Licensing Review Skill
Reusable instructions for processing structured licensing-review tasks in contractor, liquor, and alcohol-renewal domains. This skill covers environment setup, task-type recognition, data collection, domain analysis, and output formatting.
1. Environment Setup
Every task references <TASK_ENV_BASE_URL> in the prompt. Resolve this by reading the file environment_access.md at the workspace root, which contains:
base_url — the actual HTTP origin to use in place of <TASK_ENV_BASE_URL>.
credentials — a mapping of HTTP method + path pattern to required headers. The most common credential is a header X-Task-Token required on POST /api/sql calls.
allowed_endpoints — the full list of endpoints available in this environment instance. Only endpoints listed here (and in the prompt) should be called.
Making API calls
- Use the
base_url from environment_access.md to construct full URLs.
- For
GET endpoints, no special headers are typically required unless environment_access.md specifies one.
- For
POST /api/sql, include the required token header from environment_access.md credentials. The body should be a JSON object with a "query" key containing the SQL string.
SQL access
When POST /api/sql appears in the prompt or environment_access.md, you may run arbitrary SELECT queries against the environment's database. Use SQL to:
- Join records across related tables when the REST endpoints return only flat lists.
- Filter or aggregate data that would require multiple client-side passes over REST results.
- Look up records by criteria not directly exposed as REST query parameters.
Always inspect the REST endpoint responses first to understand the available table schemas and column names before writing SQL.
2. Task-Type Recognition
Read the prompt to determine which of three task families the request belongs to. The family determines the endpoints to call, the analysis framework to apply, and the shape of the output.
Type A — Contractor Batch Eligibility Review
Recognition signals:
- Mention of "State Contractors Licensing Board" or "Contractors Licensing Board".
- A list of application IDs in the format
C-TRX-NNN.
- Phrases like "eligibility batch", "escalated for a structured application decision", or "specialty endorsement questions".
- The prompt may specify a review date for financial-coverage checks.
Relevant endpoints:
GET /api/policies
GET /api/contractor/applications
GET /api/contractor/bonds
GET /api/contractor/insurance
GET /api/contractor/license-history
GET /api/contractor/violations
GET /api/contractor/correspondence
GET /api/contractor/inspections
POST /api/sql
Type B — Liquor License Staff Package
Recognition signals:
- Mention of "restricted liquor license", "liquor license transfer", "hotel-lounge", or "internal staff package".
- A single target application ID in the format
L-TR*-* plus a location ID in the format LOC-TR*.
- Phrases like "issuance posture", "same-premises basis", "first-90-day monitoring plan", "escalation triggers".
Relevant endpoints:
GET /api/policies
GET /api/liquor/applications
GET /api/liquor/settlements
GET /api/liquor/privileges
GET /api/liquor/incidents
GET /api/liquor/site-evidence
POST /api/sql (when listed in the prompt or environment_access.md)
Type C — Alcohol Renewal Review Queue
Recognition signals:
- Mention of "Alcohol Renewal Unit", "pre-release renewal screen", or "renewal queue".
- A range of license numbers in the format
AL-TR*-*.
- A "release boundary" or "boundary date" plus a "target queue size".
- Phrases like "ranked manual-review queue", "violation matching", or "match confidence".
Relevant endpoints:
GET /api/alcohol/licensees
GET /api/alcohol/violations
GET /api/renewal/rules
POST /api/sql (when listed in the prompt or environment_access.md)
3. Data Collection Strategy
General pattern
- Read
environment_access.md to get base_url and any required token.
- Read
input/payloads/answer_template.json to understand the exact output schema — every field name, every allowed value, every ordering rule.
- Call all relevant
GET endpoints for the task type. Inspect the shape of each response to understand the available fields.
- If the REST data is insufficient to resolve a decision (e.g., you need to join two datasets, or filter on a field not exposed as a query parameter), use
POST /api/sql with a targeted SELECT query.
- Cross-reference
GET /api/policies against each application — policies describe current regulatory baselines that may create or remove deficiency flags compared to prior standards.
Endpoint data shapes (general patterns)
/api/policies — Returns policy records with fields for policy identifiers, effective dates, and policy text describing current regulatory requirements. Use these to determine whether a deficiency is created by a policy change (for the policy_impacted flag in Type A tasks).
Contractor endpoints (Type A):
/api/contractor/applications — Each record has an application_id, applicant details, endorsement fields, and status flags.
/api/contractor/bonds — Each record links to an application or license and has bond amount, status (active/cancelled), and effective dates.
/api/contractor/insurance — Each record has coverage amounts, status (current/expired/pending), and effective dates.
/api/contractor/license-history — Each record has license status events including suspension start/end dates.
/api/contractor/violations — Each record has a violation ID, severity (minor/serious), and resolution status.
/api/contractor/correspondence — Each record has a correspondence ID, date, verification status, and linked application.
/api/contractor/inspections — Each record has inspection results, document gaps, and safety flags.
Liquor endpoints (Type B):
/api/liquor/applications — The target application record with premise details, license class, and status.
/api/liquor/settlements — Past settlement agreements that may cover or exclude specific risks.
/api/liquor/privileges — Operating privilege grants and conditions attached to the license or location.
/api/liquor/incidents — Reported incidents at the location (assaults, noise complaints, minor sales, etc.).
/api/liquor/site-evidence — Site documentation: floor plans, photos, camera evidence, signage records, police memos.
Alcohol endpoints (Type C):
/api/alcohol/licensees — Each record has a license_no, facility name, address, and status.
/api/alcohol/violations — Each record has a violation_id, license_no (or related identifier), violation date, and description.
/api/renewal/rules — Rule records describing renewal criteria, boundary-date handling, and risk-tier thresholds.
4. Domain Analysis Frameworks
4A. Contractor Batch Eligibility (Type A)
For each application in the batch, evaluate across these dimensions and map findings to the deficiency codes and required actions defined in the answer template:
Bond evaluation:
- If no active bond exists → deficiency:
no_active_bond / bond_cancelled → action: file_active_bond / obtain_current_bond.
- If the bond amount is below the required minimum (check policies and application class) → deficiency:
bond_shortfall → action: increase_bond_amount / increase_bond.
Insurance evaluation:
- If the insurance policy has expired based on the review date → deficiency:
insurance_expired / insurance_not_current → action: provide_current_insurance / renew_insurance.
- If coverage is below the required amount → deficiency:
insurance_shortfall → action: increase_insurance_amount / increase_insurance.
- If insurance status is pending and not yet bound → deficiency:
insurance_pending → action: verify_insurance_binding.
Endorsement evaluation:
- If a required endorsement is completely absent → deficiency:
endorsement_missing / endorsement_not_verified → action: obtain_required_endorsement / verify_endorsement.
- If an endorsement application is in progress but not yet confirmed → deficiency:
endorsement_pending → action: verify_pending_endorsement.
Experience evaluation:
- If documented experience falls below the required threshold for the license class → deficiency:
experience_shortfall → action: submit_experience_evidence / document_experience.
License history evaluation:
- If the applicant has an active (unresolved) suspension → deficiency:
active_suspension → action: board_review_suspension / clear_suspension.
Violation evaluation:
- If there are open/unresolved minor violations → deficiency:
open_minor_violation → action: resolve_minor_violation_review.
- If there are open/unresolved serious violations → deficiency:
open_serious_violation / unresolved_serious_complaint → action: resolve_serious_violation / resolve_complaint.
Inspection evaluation:
- If an inspection found document gaps not yet cleared → deficiency:
inspection_doc_gap → action: clear_document_gap.
- If an inspection flagged safety issues requiring re-inspection → deficiency:
inspection_safety_recheck → action: complete_safety_recheck.
Decision logic:
- APPROVE: No deficiencies found. All bonds, insurance, endorsements, experience, and background checks are satisfactory.
- HOLD: One or more deficiencies exist that can be resolved by the applicant (missing documents, shortfalls, pending verifications). No active suspension or unresolved serious violation.
- DENY: Active suspension, unresolved serious violations, or a combination of deficiencies that cannot be cured within the review period.
Risk tier assignment:
- low: No deficiencies (APPROVE cases).
- medium: Holdable deficiencies that are administrative or financial in nature.
- high: Active suspension, serious violations, safety recheck required, or a combination of 3+ deficiency categories.
Policy impact determination:
- Compare the application against the current policies from
GET /api/policies. A policy_impacted flag is true when one or more deficiencies would not have existed under the prior policy baseline — i.e., the current policy creates the deficiency or material review flag.
Correspondence review:
- Identify correspondence records that are stale (beyond a reasonable response window) or unverified. Include their IDs in
stale_or_unverified_correspondence_ids in the summary.
Summary construction:
- Count applications by determination (approve, hold, deny).
- Collect application IDs for high-risk and policy-impacted cases.
- Sort all ID lists in ascending lexical order.
4B. Liquor License Staff Package (Type B)
For the single target application and location, build a structured staff review package:
Same-premises basis:
- Check the application and privilege records to determine whether the license is being reviewed on the same premises as a prior license. If the premises address matches a prior license record and the license class is transferable,
same_premises_basis_applies is true.
Risk coverage assessment (covered_risk_codes):
- Review incidents, settlements, and site evidence to identify which risks are present and covered by current controls:
AFTER_HOURS — incidents or complaints about after-hours operation.
ASSAULT — reported assaults or violent incidents on premises.
FOOD_SERVICE_GAP — insufficient food service documentation or capacity.
MINOR_SALE / SALE_TO_MINOR — recorded or alleged sales to minors.
NOISE — noise complaints tied to the location.
PUBLIC_SAFETY — general public-safety incidents.
SAME_PREMISES — risks specifically tied to same-premises transfer rules.
TAX_HOLD — outstanding tax obligations blocking the license.
PATIO_BOUNDARY — risks related to patio or outdoor service boundaries.
CAMERA_COVERAGE — gaps in camera surveillance coverage.
ID_CHECK — risks from inadequate ID verification.
Verification gaps (verification_gap_codes):
- Identify what evidence or documentation is missing, conflicting, or stale:
- Signage issues:
CONTROL_SIGNAGE_CONFLICTING, CONTROL_SIGNAGE_CURRENT_MISSING, control_signage_missing.
- Floor plan issues:
FLOOR_PLAN_CONFLICTING, FLOOR_PLAN_STALE, floor_plan_conflicting.
- Evidence gaps:
SITE_PHOTO_MISSING, site_photo_missing, camera_evidence_missing, food_service_evidence_missing.
- Notice gaps:
NEIGHBOR_NOTICE_MISSING, neighbor_notice_missing.
- Memo/legal conflicts:
POLICE_MEMO_CONFLICTING, police_memo_identity_note.
- Open issues:
OPEN_INCIDENT_FOLLOW_UP, TAX_CLEARANCE_MISSING, tax_hold_unresolved, late_night_monitoring_needed.
Standard obligations vs. location-specific controls:
- Standard obligations are the ordinary license-class requirements — the obligations that apply to any license of this class regardless of location. Common codes:
CCTV, DELIVERY, FOOD_SERVICE, HOURS, ID_CHECK, NOISE, PATIO, SECURITY.
- Location-specific controls are additional controls imposed on this specific location due to its history, incidents, or conditions. Use the same code set but only include controls that are actively required at this location based on privilege conditions, settlement terms, or site-evidence documentation.
First-90-day monitoring plan:
- Build an ordered list of monitoring checkpoints, each with a
check_code and timing:
first_30_days — checks that must happen immediately after issuance (signage review, ID check observation, initial walkthrough).
days_31_60 — follow-ups that need a month of operational data (after-hours visits, police memo follow-up).
days_61_90 — later-stage checks that verify sustained compliance (noise log review, patio boundary checks, tax clearance).
- Each
check_code addresses a specific verification gap or risk. The plan should be operationally sequenced — earlier checks verify setup, later checks verify sustained operation.
Escalation triggers:
- Define conditions that would cause field staff to escalate the license back for review:
- Violation-based:
AFTER_HOURS_VIOLATION, REFERRED_MINOR_SALE_UNRESOLVED, minor_sale, after_hours_service, noise_or_patio_breach, patio_boundary_failure, id_check_failure.
- Control failures:
CONTROL_SIGNAGE_NOT_VERIFIED, SECURITY_CCTV_CONTROL_FAILURE, missing_camera_coverage, footage_not_produced, food_service_not_available.
- External events:
MAJOR_INCIDENT_REPORTED, BOARD_ORDER_CONFLICT, unreported_violent_incident.
- Administrative:
TAX_HOLD_REOPENED, open_tax_hold_uncleared.
Recommended posture:
issue_restricted — All major risks are covered, verification gaps are minor, and a monitoring plan is feasible.
request_follow_up — Significant verification gaps exist that need resolution before a final decision, but denial is premature.
deny — Unresolvable risks, missing same-premises basis when required, or active serious violations.
4C. Alcohol Renewal Review Queue (Type C)
Build a ranked manual-review queue from a set of target licenses:
Violation matching:
- For each target license, find all violations that match. Matching should consider:
- Exact match: The violation's
license_no field equals the target license number exactly.
- Close address match: The violation references the same facility/location through a related identifier (e.g., an old license number for the same premises, or an address-based match when the license number differs slightly).
- Uncertain match: The violation may relate to the license but the connection is ambiguous (e.g., same address but different entity name).
- Set
match_confidence accordingly: "exact", "close_address", or "uncertain".
Boundary date filtering:
- The prompt specifies a release boundary date. Violations with dates on or after the boundary date are post-boundary and must be excluded from the violation counts,
most_recent_violation_date, and matched_violation_ids used for ranking.
- Post-boundary violations should still be listed in
summary.post_boundary_violation_ids_excluded.
Ranking logic:
- Rank licenses from highest review priority (rank 1) to lowest (rank 10) using these factors in descending priority:
- Number of pre-boundary matched violations (more violations = higher priority).
- Recency of the most recent pre-boundary violation (more recent = higher priority).
- Match confidence (exact matches rank higher than close_address, which ranks higher than uncertain, all else equal).
- Violation severity implied by the renewal rules or violation descriptions.
- The queue must contain exactly the target size (e.g., 10 entries), with ranks 1 through N and no gaps.
Risk tier assignment:
- high: Multiple recent violations, serious violation types, or board-review triggers.
- medium: Some violations but older or less severe.
- low: Few or no violations, all minor and old.
Next-step label assignment:
board_review — Licensees with the most severe or numerous violations requiring elevated review.
manual_fine_check — Licensees where fines may need manual verification.
manual_ALERT_check — Licensees flagged in an ALERT system or similar watchlist.
additional_record_check — Licensees needing further record pulls before a decision.
Summary construction:
queue_size: The number of entries in the queue (should match the target).
boundary_date: The release boundary date from the prompt, in YYYY-MM-DD format.
post_boundary_violation_ids_excluded: All violation IDs with dates on or after the boundary date, sorted ascending.
close_or_uncertain_match_license_numbers: License numbers with non-exact match confidence, sorted ascending.
board_review_license_numbers: License numbers assigned board_review as their next step, sorted ascending.
5. Output Formatting Rules
General rules for all task types
- Return only JSON — no markdown fences, no prose, no narrative memo, no citations outside the JSON structure.
- Follow the answer template exactly — use only the keys, value types, and allowed enum values defined in
input/payloads/answer_template.json.
- Ordering — respect all ordering rules stated in the template:
- Application/queue entries ordered by their identifier (ascending lexical for IDs, ascending integer for ranks).
- Deficiency codes, required actions, and other code arrays sorted in the order specified by the template (usually alphabetical/lexical ascending).
- Violation IDs sorted by date ascending, then by ID ascending.
- Empty values — use
[] (empty array) when no codes, actions, or IDs apply. Never use null or omit a required key.
- Date format — all dates must use
YYYY-MM-DD format.
- No extra keys — do not add keys not shown in the template, even if they would be informative.
Type-specific formatting notes
Type A (Contractor Batch):
application_decisions must contain exactly the number of target applications listed in the prompt, ordered by application_id ascending.
summary.approve_count + summary.hold_count + summary.deny_count must equal the total number of applications.
policy_impacted is a boolean per application.
stale_or_unverified_correspondence_ids collects correspondence IDs that are stale or unverified across the entire batch.
Type B (Liquor Staff Package):
- All code arrays (
covered_risk_codes, verification_gap_codes, standard_obligation_codes, location_specific_control_codes, escalation_trigger_codes) must use only the allowed values from the template — the vocabulary varies between task instances.
first_90_day_plan is an array of objects, each with check_code and timing. The allowed check codes and timing values are specific to each template.
same_premises_basis_applies is a boolean.
recommended_posture is one of the three allowed enum values.
Type C (Alcohol Renewal Queue):
queue must have exactly the target queue size with ranks 1 through N and no gaps.
matched_violation_ids within each queue entry must be sorted by violation date ascending, then violation_id ascending.
summary.post_boundary_violation_ids_excluded lists violation IDs that were filtered out by the boundary date.
summary.close_or_uncertain_match_license_numbers and summary.board_review_license_numbers must be sorted ascending.
6. Step-by-Step Execution Protocol
When a licensing-review task is encountered, follow this protocol:
- Read environment: Open
environment_access.md, note base_url and any credentials.
- Read template: Open
input/payloads/answer_template.json, memorize the required output shape and all allowed enum values.
- Identify task type: Match the prompt against the three families in Section 2.
- Fetch data: Call all relevant
GET endpoints. Inspect response shapes to learn field names.
- Apply analysis framework: Use the appropriate framework from Section 4 to evaluate each application/license.
- Cross-reference policies: Always check
GET /api/policies against each application to determine policy impact.
- Fill gaps with SQL: If REST data is insufficient to resolve a specific decision (e.g., joining across datasets, filtering by criteria not exposed as query parameters), use
POST /api/sql.
- Construct output: Build the JSON strictly according to the template, following all ordering and formatting rules from Section 5.
- Validate: Verify counts are consistent, all required keys are present, all enum values are from the allowed set, and ordering rules are satisfied.
- Return only the JSON object — no surrounding text.
1---2name: fewshot-attempt-03-433description: Licensing Review Skill4---5# Licensing Review Skill67Reusable instructions for processing structured licensing-review tasks in contractor, liquor, and alcohol-renewal domains. This skill covers environment setup, task-type recognition, data collection, domain analysis, and output formatting.89---1011## 1. Environment Setup1213Every task references `<TASK_ENV_BASE_URL>` in the prompt. Resolve this by reading the file `environment_access.md` at the workspace root, which contains:1415- **`base_url`** — the actual HTTP origin to use in place of `<TASK_ENV_BASE_URL>`.16- **`credentials`** — a mapping of HTTP method + path pattern to required headers. The most common credential is a header `X-Task-Token` required on `POST /api/sql` calls.17- **`allowed_endpoints`** — the full list of endpoints available in this environment instance. Only endpoints listed here (and in the prompt) should be called.1819### Making API calls2021- Use the `base_url` from `environment_access.md` to construct full URLs.22- For `GET` endpoints, no special headers are typically required unless `environment_access.md` specifies one.23- For `POST /api/sql`, include the required token header from `environment_access.md` credentials. The body should be a JSON object with a `"query"` key containing the SQL string.2425### SQL access2627When `POST /api/sql` appears in the prompt or `environment_access.md`, you may run arbitrary `SELECT` queries against the environment's database. Use SQL to:28- Join records across related tables when the REST endpoints return only flat lists.29- Filter or aggregate data that would require multiple client-side passes over REST results.30- Look up records by criteria not directly exposed as REST query parameters.3132Always inspect the REST endpoint responses first to understand the available table schemas and column names before writing SQL.3334---3536## 2. Task-Type Recognition3738Read the prompt to determine which of three task families the request belongs to. The family determines the endpoints to call, the analysis framework to apply, and the shape of the output.3940### Type A — Contractor Batch Eligibility Review4142**Recognition signals:**43- Mention of "State Contractors Licensing Board" or "Contractors Licensing Board".44- A list of application IDs in the format `C-TRX-NNN`.45- Phrases like "eligibility batch", "escalated for a structured application decision", or "specialty endorsement questions".46- The prompt may specify a review date for financial-coverage checks.4748**Relevant endpoints:**49- `GET /api/policies`50- `GET /api/contractor/applications`51- `GET /api/contractor/bonds`52- `GET /api/contractor/insurance`53- `GET /api/contractor/license-history`54- `GET /api/contractor/violations`55- `GET /api/contractor/correspondence`56- `GET /api/contractor/inspections`57- `POST /api/sql`5859### Type B — Liquor License Staff Package6061**Recognition signals:**62- Mention of "restricted liquor license", "liquor license transfer", "hotel-lounge", or "internal staff package".63- A single target application ID in the format `L-TR*-*` plus a location ID in the format `LOC-TR*`.64- Phrases like "issuance posture", "same-premises basis", "first-90-day monitoring plan", "escalation triggers".6566**Relevant endpoints:**67- `GET /api/policies`68- `GET /api/liquor/applications`69- `GET /api/liquor/settlements`70- `GET /api/liquor/privileges`71- `GET /api/liquor/incidents`72- `GET /api/liquor/site-evidence`73- `POST /api/sql` (when listed in the prompt or `environment_access.md`)7475### Type C — Alcohol Renewal Review Queue7677**Recognition signals:**78- Mention of "Alcohol Renewal Unit", "pre-release renewal screen", or "renewal queue".79- A range of license numbers in the format `AL-TR*-*`.80- A "release boundary" or "boundary date" plus a "target queue size".81- Phrases like "ranked manual-review queue", "violation matching", or "match confidence".8283**Relevant endpoints:**84- `GET /api/alcohol/licensees`85- `GET /api/alcohol/violations`86- `GET /api/renewal/rules`87- `POST /api/sql` (when listed in the prompt or `environment_access.md`)8889---9091## 3. Data Collection Strategy9293### General pattern94951. Read `environment_access.md` to get `base_url` and any required token.962. Read `input/payloads/answer_template.json` to understand the exact output schema — every field name, every allowed value, every ordering rule.973. Call all relevant `GET` endpoints for the task type. Inspect the shape of each response to understand the available fields.984. If the REST data is insufficient to resolve a decision (e.g., you need to join two datasets, or filter on a field not exposed as a query parameter), use `POST /api/sql` with a targeted `SELECT` query.995. Cross-reference `GET /api/policies` against each application — policies describe current regulatory baselines that may create or remove deficiency flags compared to prior standards.100101### Endpoint data shapes (general patterns)102103**`/api/policies`** — Returns policy records with fields for policy identifiers, effective dates, and policy text describing current regulatory requirements. Use these to determine whether a deficiency is created by a policy change (for the `policy_impacted` flag in Type A tasks).104105**Contractor endpoints** (Type A):106- **`/api/contractor/applications`** — Each record has an `application_id`, applicant details, endorsement fields, and status flags.107- **`/api/contractor/bonds`** — Each record links to an application or license and has bond amount, status (active/cancelled), and effective dates.108- **`/api/contractor/insurance`** — Each record has coverage amounts, status (current/expired/pending), and effective dates.109- **`/api/contractor/license-history`** — Each record has license status events including suspension start/end dates.110- **`/api/contractor/violations`** — Each record has a violation ID, severity (minor/serious), and resolution status.111- **`/api/contractor/correspondence`** — Each record has a correspondence ID, date, verification status, and linked application.112- **`/api/contractor/inspections`** — Each record has inspection results, document gaps, and safety flags.113114**Liquor endpoints** (Type B):115- **`/api/liquor/applications`** — The target application record with premise details, license class, and status.116- **`/api/liquor/settlements`** — Past settlement agreements that may cover or exclude specific risks.117- **`/api/liquor/privileges`** — Operating privilege grants and conditions attached to the license or location.118- **`/api/liquor/incidents`** — Reported incidents at the location (assaults, noise complaints, minor sales, etc.).119- **`/api/liquor/site-evidence`** — Site documentation: floor plans, photos, camera evidence, signage records, police memos.120121**Alcohol endpoints** (Type C):122- **`/api/alcohol/licensees`** — Each record has a `license_no`, facility name, address, and status.123- **`/api/alcohol/violations`** — Each record has a `violation_id`, `license_no` (or related identifier), violation date, and description.124- **`/api/renewal/rules`** — Rule records describing renewal criteria, boundary-date handling, and risk-tier thresholds.125126---127128## 4. Domain Analysis Frameworks129130### 4A. Contractor Batch Eligibility (Type A)131132For each application in the batch, evaluate across these dimensions and map findings to the deficiency codes and required actions defined in the answer template:133134**Bond evaluation:**135- If no active bond exists → deficiency: `no_active_bond` / `bond_cancelled` → action: `file_active_bond` / `obtain_current_bond`.136- If the bond amount is below the required minimum (check policies and application class) → deficiency: `bond_shortfall` → action: `increase_bond_amount` / `increase_bond`.137138**Insurance evaluation:**139- If the insurance policy has expired based on the review date → deficiency: `insurance_expired` / `insurance_not_current` → action: `provide_current_insurance` / `renew_insurance`.140- If coverage is below the required amount → deficiency: `insurance_shortfall` → action: `increase_insurance_amount` / `increase_insurance`.141- If insurance status is pending and not yet bound → deficiency: `insurance_pending` → action: `verify_insurance_binding`.142143**Endorsement evaluation:**144- If a required endorsement is completely absent → deficiency: `endorsement_missing` / `endorsement_not_verified` → action: `obtain_required_endorsement` / `verify_endorsement`.145- If an endorsement application is in progress but not yet confirmed → deficiency: `endorsement_pending` → action: `verify_pending_endorsement`.146147**Experience evaluation:**148- If documented experience falls below the required threshold for the license class → deficiency: `experience_shortfall` → action: `submit_experience_evidence` / `document_experience`.149150**License history evaluation:**151- If the applicant has an active (unresolved) suspension → deficiency: `active_suspension` → action: `board_review_suspension` / `clear_suspension`.152153**Violation evaluation:**154- If there are open/unresolved minor violations → deficiency: `open_minor_violation` → action: `resolve_minor_violation_review`.155- If there are open/unresolved serious violations → deficiency: `open_serious_violation` / `unresolved_serious_complaint` → action: `resolve_serious_violation` / `resolve_complaint`.156157**Inspection evaluation:**158- If an inspection found document gaps not yet cleared → deficiency: `inspection_doc_gap` → action: `clear_document_gap`.159- If an inspection flagged safety issues requiring re-inspection → deficiency: `inspection_safety_recheck` → action: `complete_safety_recheck`.160161**Decision logic:**162- **APPROVE**: No deficiencies found. All bonds, insurance, endorsements, experience, and background checks are satisfactory.163- **HOLD**: One or more deficiencies exist that can be resolved by the applicant (missing documents, shortfalls, pending verifications). No active suspension or unresolved serious violation.164- **DENY**: Active suspension, unresolved serious violations, or a combination of deficiencies that cannot be cured within the review period.165166**Risk tier assignment:**167- **low**: No deficiencies (APPROVE cases).168- **medium**: Holdable deficiencies that are administrative or financial in nature.169- **high**: Active suspension, serious violations, safety recheck required, or a combination of 3+ deficiency categories.170171**Policy impact determination:**172- Compare the application against the current policies from `GET /api/policies`. A `policy_impacted` flag is `true` when one or more deficiencies would not have existed under the prior policy baseline — i.e., the current policy *creates* the deficiency or material review flag.173174**Correspondence review:**175- Identify correspondence records that are stale (beyond a reasonable response window) or unverified. Include their IDs in `stale_or_unverified_correspondence_ids` in the summary.176177**Summary construction:**178- Count applications by determination (approve, hold, deny).179- Collect application IDs for high-risk and policy-impacted cases.180- Sort all ID lists in ascending lexical order.181182### 4B. Liquor License Staff Package (Type B)183184For the single target application and location, build a structured staff review package:185186**Same-premises basis:**187- Check the application and privilege records to determine whether the license is being reviewed on the same premises as a prior license. If the premises address matches a prior license record and the license class is transferable, `same_premises_basis_applies` is `true`.188189**Risk coverage assessment (`covered_risk_codes`):**190- Review incidents, settlements, and site evidence to identify which risks are present and covered by current controls:191 - `AFTER_HOURS` — incidents or complaints about after-hours operation.192 - `ASSAULT` — reported assaults or violent incidents on premises.193 - `FOOD_SERVICE_GAP` — insufficient food service documentation or capacity.194 - `MINOR_SALE` / `SALE_TO_MINOR` — recorded or alleged sales to minors.195 - `NOISE` — noise complaints tied to the location.196 - `PUBLIC_SAFETY` — general public-safety incidents.197 - `SAME_PREMISES` — risks specifically tied to same-premises transfer rules.198 - `TAX_HOLD` — outstanding tax obligations blocking the license.199 - `PATIO_BOUNDARY` — risks related to patio or outdoor service boundaries.200 - `CAMERA_COVERAGE` — gaps in camera surveillance coverage.201 - `ID_CHECK` — risks from inadequate ID verification.202203**Verification gaps (`verification_gap_codes`):**204- Identify what evidence or documentation is missing, conflicting, or stale:205 - Signage issues: `CONTROL_SIGNAGE_CONFLICTING`, `CONTROL_SIGNAGE_CURRENT_MISSING`, `control_signage_missing`.206 - Floor plan issues: `FLOOR_PLAN_CONFLICTING`, `FLOOR_PLAN_STALE`, `floor_plan_conflicting`.207 - Evidence gaps: `SITE_PHOTO_MISSING`, `site_photo_missing`, `camera_evidence_missing`, `food_service_evidence_missing`.208 - Notice gaps: `NEIGHBOR_NOTICE_MISSING`, `neighbor_notice_missing`.209 - Memo/legal conflicts: `POLICE_MEMO_CONFLICTING`, `police_memo_identity_note`.210 - Open issues: `OPEN_INCIDENT_FOLLOW_UP`, `TAX_CLEARANCE_MISSING`, `tax_hold_unresolved`, `late_night_monitoring_needed`.211212**Standard obligations vs. location-specific controls:**213- **Standard obligations** are the ordinary license-class requirements — the obligations that apply to *any* license of this class regardless of location. Common codes: `CCTV`, `DELIVERY`, `FOOD_SERVICE`, `HOURS`, `ID_CHECK`, `NOISE`, `PATIO`, `SECURITY`.214- **Location-specific controls** are additional controls imposed on *this specific location* due to its history, incidents, or conditions. Use the same code set but only include controls that are actively required at this location based on privilege conditions, settlement terms, or site-evidence documentation.215216**First-90-day monitoring plan:**217- Build an ordered list of monitoring checkpoints, each with a `check_code` and `timing`:218 - `first_30_days` — checks that must happen immediately after issuance (signage review, ID check observation, initial walkthrough).219 - `days_31_60` — follow-ups that need a month of operational data (after-hours visits, police memo follow-up).220 - `days_61_90` — later-stage checks that verify sustained compliance (noise log review, patio boundary checks, tax clearance).221- Each `check_code` addresses a specific verification gap or risk. The plan should be operationally sequenced — earlier checks verify setup, later checks verify sustained operation.222223**Escalation triggers:**224- Define conditions that would cause field staff to escalate the license back for review:225 - Violation-based: `AFTER_HOURS_VIOLATION`, `REFERRED_MINOR_SALE_UNRESOLVED`, `minor_sale`, `after_hours_service`, `noise_or_patio_breach`, `patio_boundary_failure`, `id_check_failure`.226 - Control failures: `CONTROL_SIGNAGE_NOT_VERIFIED`, `SECURITY_CCTV_CONTROL_FAILURE`, `missing_camera_coverage`, `footage_not_produced`, `food_service_not_available`.227 - External events: `MAJOR_INCIDENT_REPORTED`, `BOARD_ORDER_CONFLICT`, `unreported_violent_incident`.228 - Administrative: `TAX_HOLD_REOPENED`, `open_tax_hold_uncleared`.229230**Recommended posture:**231- `issue_restricted` — All major risks are covered, verification gaps are minor, and a monitoring plan is feasible.232- `request_follow_up` — Significant verification gaps exist that need resolution before a final decision, but denial is premature.233- `deny` — Unresolvable risks, missing same-premises basis when required, or active serious violations.234235### 4C. Alcohol Renewal Review Queue (Type C)236237Build a ranked manual-review queue from a set of target licenses:238239**Violation matching:**240- For each target license, find all violations that match. Matching should consider:241 - **Exact match**: The violation's `license_no` field equals the target license number exactly.242 - **Close address match**: The violation references the same facility/location through a related identifier (e.g., an old license number for the same premises, or an address-based match when the license number differs slightly).243 - **Uncertain match**: The violation may relate to the license but the connection is ambiguous (e.g., same address but different entity name).244- Set `match_confidence` accordingly: `"exact"`, `"close_address"`, or `"uncertain"`.245246**Boundary date filtering:**247- The prompt specifies a release boundary date. Violations with dates **on or after** the boundary date are *post-boundary* and must be **excluded** from the violation counts, `most_recent_violation_date`, and `matched_violation_ids` used for ranking.248- Post-boundary violations should still be listed in `summary.post_boundary_violation_ids_excluded`.249250**Ranking logic:**251- Rank licenses from highest review priority (rank 1) to lowest (rank 10) using these factors in descending priority:252 1. **Number of pre-boundary matched violations** (more violations = higher priority).253 2. **Recency** of the most recent pre-boundary violation (more recent = higher priority).254 3. **Match confidence** (exact matches rank higher than close_address, which ranks higher than uncertain, all else equal).255 4. **Violation severity** implied by the renewal rules or violation descriptions.256- The queue must contain exactly the target size (e.g., 10 entries), with ranks 1 through N and no gaps.257258**Risk tier assignment:**259- **high**: Multiple recent violations, serious violation types, or board-review triggers.260- **medium**: Some violations but older or less severe.261- **low**: Few or no violations, all minor and old.262263**Next-step label assignment:**264- `board_review` — Licensees with the most severe or numerous violations requiring elevated review.265- `manual_fine_check` — Licensees where fines may need manual verification.266- `manual_ALERT_check` — Licensees flagged in an ALERT system or similar watchlist.267- `additional_record_check` — Licensees needing further record pulls before a decision.268269**Summary construction:**270- `queue_size`: The number of entries in the queue (should match the target).271- `boundary_date`: The release boundary date from the prompt, in YYYY-MM-DD format.272- `post_boundary_violation_ids_excluded`: All violation IDs with dates on or after the boundary date, sorted ascending.273- `close_or_uncertain_match_license_numbers`: License numbers with non-exact match confidence, sorted ascending.274- `board_review_license_numbers`: License numbers assigned `board_review` as their next step, sorted ascending.275276---277278## 5. Output Formatting Rules279280### General rules for all task types2812821. **Return only JSON** — no markdown fences, no prose, no narrative memo, no citations outside the JSON structure.2832. **Follow the answer template exactly** — use only the keys, value types, and allowed enum values defined in `input/payloads/answer_template.json`.2843. **Ordering** — respect all ordering rules stated in the template:285 - Application/queue entries ordered by their identifier (ascending lexical for IDs, ascending integer for ranks).286 - Deficiency codes, required actions, and other code arrays sorted in the order specified by the template (usually alphabetical/lexical ascending).287 - Violation IDs sorted by date ascending, then by ID ascending.2884. **Empty values** — use `[]` (empty array) when no codes, actions, or IDs apply. Never use `null` or omit a required key.2895. **Date format** — all dates must use `YYYY-MM-DD` format.2906. **No extra keys** — do not add keys not shown in the template, even if they would be informative.291292### Type-specific formatting notes293294**Type A (Contractor Batch):**295- `application_decisions` must contain exactly the number of target applications listed in the prompt, ordered by `application_id` ascending.296- `summary.approve_count + summary.hold_count + summary.deny_count` must equal the total number of applications.297- `policy_impacted` is a boolean per application.298- `stale_or_unverified_correspondence_ids` collects correspondence IDs that are stale or unverified across the entire batch.299300**Type B (Liquor Staff Package):**301- All code arrays (`covered_risk_codes`, `verification_gap_codes`, `standard_obligation_codes`, `location_specific_control_codes`, `escalation_trigger_codes`) must use only the allowed values from the template — the vocabulary varies between task instances.302- `first_90_day_plan` is an array of objects, each with `check_code` and `timing`. The allowed check codes and timing values are specific to each template.303- `same_premises_basis_applies` is a boolean.304- `recommended_posture` is one of the three allowed enum values.305306**Type C (Alcohol Renewal Queue):**307- `queue` must have exactly the target queue size with ranks 1 through N and no gaps.308- `matched_violation_ids` within each queue entry must be sorted by violation date ascending, then violation_id ascending.309- `summary.post_boundary_violation_ids_excluded` lists violation IDs that were filtered out by the boundary date.310- `summary.close_or_uncertain_match_license_numbers` and `summary.board_review_license_numbers` must be sorted ascending.311312---313314## 6. Step-by-Step Execution Protocol315316When a licensing-review task is encountered, follow this protocol:3173181. **Read environment**: Open `environment_access.md`, note `base_url` and any credentials.3192. **Read template**: Open `input/payloads/answer_template.json`, memorize the required output shape and all allowed enum values.3203. **Identify task type**: Match the prompt against the three families in Section 2.3214. **Fetch data**: Call all relevant `GET` endpoints. Inspect response shapes to learn field names.3225. **Apply analysis framework**: Use the appropriate framework from Section 4 to evaluate each application/license.3236. **Cross-reference policies**: Always check `GET /api/policies` against each application to determine policy impact.3247. **Fill gaps with SQL**: If REST data is insufficient to resolve a specific decision (e.g., joining across datasets, filtering by criteria not exposed as query parameters), use `POST /api/sql`.3258. **Construct output**: Build the JSON strictly according to the template, following all ordering and formatting rules from Section 5.3269. **Validate**: Verify counts are consistent, all required keys are present, all enum values are from the allowed set, and ordering rules are satisfied.32710. **Return only the JSON object** — no surrounding text.