Licensing review batch → structured JSON
You are acting as a state licensing examiner. Each task gives you a small set of
target records (application ids, a location, or a license batch), points you at a
shared licensing data service, and requires JSON only that conforms to the
task's input/payloads/answer_template.json. There is no free-text memo.
The data service is the same across tasks; only the target ids, the review
parameters, and the exact output vocabulary change. Do not guess values — read the
real records and apply the rules below.
0. Orient before you compute
- Read the prompt and extract: the target ids (and any location id), the
review/as-of/boundary date, the target count (e.g. "eight applications",
"queue size 10"), and the list of allowed endpoints.
- Read
input/payloads/answer_template.json completely. It is the contract:
it fixes the exact top-level keys, the item shape, every enum's allowed_values,
the required ordering, list lengths, and "empty list when nothing applies" rules.
The code vocabularies differ from task to task even within the same family — always
map your findings onto this template's allowed_values, never a memorized list.
- Get network access from
environment_access.md (base URL, the X-Task-Token
header value for POST /api/sql, and the allowed endpoints). Reach the service
only over the network described there.
1. Data access — read references/environment.md first
Key facts (details and gotchas in references/environment.md):
- Every
GET /api/... endpoint returns JSON. POST /api/sql accepts
{"query":"SELECT ..."} with header X-Task-Token: <token from environment_access.md>
and returns {columns,rows,row_count,truncated,...}.
- The GET endpoints are a filtered subset; the SQL tables are the complete source.
Target records are frequently absent from the GET feeds but present in SQL. Pull
the authoritative data with
POST /api/sql, filtering by your target ids
(WHERE ... LIKE '<PREFIX>-%'). GET is fine for small reference tables
(/api/policies, /api/liquor/privileges, /api/renewal/rules).
- SQL is row-limited (~200 rows) and truncates, and blocks schema introspection
(
sqlite_master, PRAGMA). Always filter by your target ids; never rely on bare
SELECT *. Table names equal the GET path with /→_ (e.g.
/api/contractor/bonds → contractor_bonds, /api/liquor/site-evidence →
liquor_site_evidence).
- Distractors are everywhere. Records for other batches share your addresses and
id shapes (
*-DIS-*, *-TE2-*, *-TE5-*, *-OLD-*, and *-LATE rows). Only
attach a record to a target when the join key says so (see each family's rules).
references/environment.md also documents scripts/env_query.sh, a helper for
GET and SQL calls.
2. Pick the task family and apply its rules
Route by the target ids / endpoints, then follow the matching reference file
exactly. Each reference gives the record joins, the condition→code logic, the
determination/ranking logic, and how to build the summary.
| Signal in prompt |
Family |
Reference |
Contractor application ids (C-...), /api/contractor/*, batch of APPROVE/HOLD/DENY |
Contractor batch eligibility |
references/contractor_batch.md |
One liquor application + location (L-... / LOC-...), /api/liquor/*, "restricted"/"staff package" |
Liquor restricted-license package |
references/liquor_package.md |
Alcohol license batch (AL-...), /api/alcohol/* + /api/renewal/rules, "queue"/"release boundary" |
Renewal manual-review queue |
references/renewal_queue.md |
All families share the same shape of reasoning:
- Select each target's own records via the correct join key (ignore distractors).
- Detect conditions from thresholds in
/api/policies (or /api/renewal/rules,
/api/liquor/privileges) and record fields — comparing against the review/boundary
date the prompt supplies.
- Map each detected condition to the closest code in this template's
allowed_values; pair deficiencies with their required action where the template
asks for actions.
- Aggregate into the required summary/queue.
3. Output discipline (all families)
- Emit only the JSON object, no prose/markdown/comments/citations, and only the
keys the template shows.
- Honor every ordering rule (usually ascending lexical for code lists and ids;
renewal
matched_violation_ids sort by date then id; queue by rank). De-duplicate
code lists. Use [] when nothing applies.
- Return exactly the required number of items (e.g. all N targets, queue length N),
ordered as specified (application decisions by id; queue by rank 1..N with no gaps).
- Make the summary internally consistent with the item-level decisions
(counts equal the decisions; id-lists are exactly the items that qualify).
- Every enum value you emit must be a member of that field's
allowed_values.
4. Self-check before returning
- JSON parses; top-level keys == template keys exactly.
- Counts/derived lists recomputed from your own items match.
- No distractor ids leaked in; no
*-LATE/post-boundary or other-batch rows counted.
- Dates in the required format; lists ordered and de-duplicated.
1---2name: licensing-review-batch3description: Produce structured JSON decisions for state licensing review tasks backed by the shared licensing data service (contractor application batches, restricted liquor license staff packages, and alcohol renewal manual-review queues). Use when a prompt asks you to review licensing records over a network environment and return JSON that must conform to an answer_template.json, especially when the prompt names contractor applications (C-*), liquor applications/locations (L-*/LOC-*), or alcohol licenses (AL-*), and lists /api/... endpoints plus POST /api/sql.4---56# Licensing review batch → structured JSON78You are acting as a state licensing examiner. Each task gives you a small set of9target records (application ids, a location, or a license batch), points you at a10shared licensing data service, and requires **JSON only** that conforms to the11task's `input/payloads/answer_template.json`. There is no free-text memo.1213The data service is the same across tasks; only the target ids, the review14parameters, and the exact output vocabulary change. Do not guess values — read the15real records and apply the rules below.1617## 0. Orient before you compute18191. Read the prompt and extract: the **target ids** (and any location id), the20 **review/as-of/boundary date**, the **target count** (e.g. "eight applications",21 "queue size 10"), and the list of allowed endpoints.222. Read `input/payloads/answer_template.json` **completely**. It is the contract:23 it fixes the exact top-level keys, the item shape, every enum's `allowed_values`,24 the required ordering, list lengths, and "empty list when nothing applies" rules.25 The code vocabularies differ from task to task even within the same family — always26 map your findings onto *this* template's `allowed_values`, never a memorized list.273. Get network access from `environment_access.md` (base URL, the `X-Task-Token`28 header value for `POST /api/sql`, and the allowed endpoints). Reach the service29 only over the network described there.3031## 1. Data access — read `references/environment.md` first3233Key facts (details and gotchas in `references/environment.md`):3435- Every `GET /api/...` endpoint returns JSON. `POST /api/sql` accepts36 `{"query":"SELECT ..."}` with header `X-Task-Token: <token from environment_access.md>`37 and returns `{columns,rows,row_count,truncated,...}`.38- **The GET endpoints are a filtered subset; the SQL tables are the complete source.**39 Target records are frequently *absent* from the GET feeds but present in SQL. Pull40 the authoritative data with `POST /api/sql`, filtering by your target ids41 (`WHERE ... LIKE '<PREFIX>-%'`). GET is fine for small reference tables42 (`/api/policies`, `/api/liquor/privileges`, `/api/renewal/rules`).43- SQL is **row-limited (~200 rows) and truncates**, and blocks schema introspection44 (`sqlite_master`, `PRAGMA`). Always filter by your target ids; never rely on bare45 `SELECT *`. Table names equal the GET path with `/`→`_` (e.g.46 `/api/contractor/bonds` → `contractor_bonds`, `/api/liquor/site-evidence` →47 `liquor_site_evidence`).48- **Distractors are everywhere.** Records for other batches share your addresses and49 id shapes (`*-DIS-*`, `*-TE2-*`, `*-TE5-*`, `*-OLD-*`, and `*-LATE` rows). Only50 attach a record to a target when the join key says so (see each family's rules).5152`references/environment.md` also documents `scripts/env_query.sh`, a helper for53GET and SQL calls.5455## 2. Pick the task family and apply its rules5657Route by the target ids / endpoints, then follow the matching reference file58exactly. Each reference gives the record joins, the condition→code logic, the59determination/ranking logic, and how to build the summary.6061| Signal in prompt | Family | Reference |62|---|---|---|63| Contractor application ids (`C-...`), `/api/contractor/*`, batch of APPROVE/HOLD/DENY | Contractor batch eligibility | `references/contractor_batch.md` |64| One liquor application + location (`L-...` / `LOC-...`), `/api/liquor/*`, "restricted"/"staff package" | Liquor restricted-license package | `references/liquor_package.md` |65| Alcohol license batch (`AL-...`), `/api/alcohol/*` + `/api/renewal/rules`, "queue"/"release boundary" | Renewal manual-review queue | `references/renewal_queue.md` |6667All families share the same shape of reasoning:6869- **Select** each target's own records via the correct join key (ignore distractors).70- **Detect conditions** from thresholds in `/api/policies` (or `/api/renewal/rules`,71 `/api/liquor/privileges`) and record fields — comparing against the review/boundary72 date the prompt supplies.73- **Map** each detected condition to the closest code in *this template's*74 `allowed_values`; pair deficiencies with their required action where the template75 asks for actions.76- **Aggregate** into the required summary/queue.7778## 3. Output discipline (all families)7980- Emit **only** the JSON object, no prose/markdown/comments/citations, and only the81 keys the template shows.82- Honor every ordering rule (usually ascending lexical for code lists and ids;83 renewal `matched_violation_ids` sort by date then id; queue by rank). De-duplicate84 code lists. Use `[]` when nothing applies.85- Return exactly the required number of items (e.g. all N targets, queue length N),86 ordered as specified (application decisions by id; queue by rank 1..N with no gaps).87- Make the summary **internally consistent** with the item-level decisions88 (counts equal the decisions; id-lists are exactly the items that qualify).89- Every enum value you emit must be a member of that field's `allowed_values`.9091## 4. Self-check before returning9293- JSON parses; top-level keys == template keys exactly.94- Counts/derived lists recomputed from your own items match.95- No distractor ids leaked in; no `*-LATE`/post-boundary or other-batch rows counted.96- Dates in the required format; lists ordered and de-duplicated.