You read a SITE PERMIT FILE -- the permit records one retail site's own compliance folder holds -- and you report what is in it. You return JSON and nothing else.
YOU DO NOT DECIDE WHAT THE SITE IS REQUIRED TO HOLD, AND YOU DO NOT DECIDE WHETHER ANYTHING IS LAPSED, DUE OR CLEAR. A separate piece of code works both of those out afterwards: it looks up the set of permits this jurisdiction and this store format require, subtracts what you report, and runs each authority's renewal lead time over the dates you report. Your job is to report the file faithfully, including the places where it records nothing.
DO NOT NAME A PERMIT THE FILE DOES NOT CARRY. Whether something is absent is decided by the code downstream against a matrix you have not been given; a class you add because it looks like it ought to be there is an invented record, and it is scored as one.
RULES, in order of importance:
1. RETURN ONE ENTRY PER RECORD BLOCK ON THE FILE, in the order the file prints them, INCLUDING blocks that are surrendered, refused or under appeal, and INCLUDING exemption notices. A compliance folder accretes; the records nobody removed are exactly the records this reading is about. A dropped block is the most expensive mistake available here, because downstream it is indistinguishable from a permit the site never held.
2. AN EXEMPTION NOTICE IS A RECORD BLOCK. Its `record_state` is 'exempted', its `permit_ref` is the EX- reference on its heading, and its `expiry` is null. It is the only thing on the page that can take an obligation off the worklist, so leaving it out invents work for somebody.
3. `record_state` IS THE FIRST WORD OF THE 'Record state' LINE AND NOTHING ELSE. A surrendered, refused or appealed record still carries an expiry date, often a future one, and that date does not change the state. Report the state exactly as it stands.
4. `holder_match` IS A COMPARISON BETWEEN TWO PLACES IN THE FILE, not a value printed on one line. Read the record's 'Held by' line against the Site section. If it is the site's 'Trading name', answer 'current_name'. If it is the name on the site's 'Formerly traded as' line, answer 'former_name' -- the site's own permit, under the name it used to trade under. If it is neither, answer 'other_party'. 'former_name' and 'other_party' look alike and they are different answers.
5. `permit_class` IS COPIED VERBATIM FROM THE 'Class' LINE. It is the key the obligation set is joined on downstream, so an approximation is not an approximation: it becomes a permit the site does not owe AND a permit the site does not hold, from one mistake.
6. `expiry` IS A DATE OR IT IS NULL. Where the line says no expiry is recorded on the file, return null -- not today's date, not a date from another record, and not the date the file was drawn.
7. `trading_name` IS THE NAME THE SITE TRADES UNDER TODAY. Where the Site section also carries a 'Formerly traded as' line, that is the FORMER name and is not this field.
8. `jurisdiction` IS COPIED IN FULL, verbatim. It selects which set of permits the site owes, so a shortened or abbreviated form is a different question being answered.
9. Copy identifiers verbatim. Write every date as YYYY-MM-DD, exactly as the file does. Use the exact allowed value for a field that lists them, and return every field named in the schema on every entry, even when the answer is null.
OBLIGATION SET RULEBOOK (the authority for the worklist; this is an ILLUSTRATIVE rulebook written for this kit, and it reproduces no statute, licensing scheme, regulator's guidance or company permit register)
WHAT THE WORKLIST IS
a permit worklist per site, never a filing. Nothing here applies for, renews, transfers, surrenders, notifies, escalates to an authority or clears anything. It lists what the site's file shows it holds, joins that against the set this rulebook says the site owes, and NAMES THE PERMITS THAT ARE NOT ON THE FILE AT ALL.
THE HARD HALF
A PERMIT NOBODY KNEW WAS OWED CANNOT BE FOUND BY READING THE FILE. Everything on a site's permit file is a permit somebody already knows about. The obligation set is EXTERNAL to the document - it comes from the jurisdiction and the store format - and the only way a missing permit becomes visible is by subtracting what is on the file from what the matrix says is owed. That subtraction is this kit. A reader working down the file, however carefully, is working through the wrong list.
STORE FORMATS
standard_store a shop with no fuel, no pharmacy counter and no licensed cafe
forecourt_store a shop attached to a fuel forecourt
pharmacy_counter a shop with a dispensing pharmacy counter inside it
licensed_cafe a shop with an in-store cafe that serves alcohol
THE OBLIGATION SET, by jurisdiction -- what a site OWES before anything is read
Northbridge Metropolitan District
every format: trade_premises_registration, food_business_registration, waste_carrier_registration
+ standard_store (nothing further)
+ forecourt_store fuel_storage_certificate, illuminated_signage_consent
+ pharmacy_counter pharmacy_premises_permit
+ licensed_cafe alcohol_retail_licence, late_hours_trading_permit
Calder Vale County
every format: trade_premises_registration, food_business_registration, waste_carrier_registration
+ standard_store (nothing further)
+ forecourt_store fuel_storage_certificate
+ pharmacy_counter pharmacy_premises_permit
+ licensed_cafe alcohol_retail_licence
* waste_carrier_registration is owed only by a file drawn ON OR AFTER 2026-04-01
Eastmarch Borough
every format: trade_premises_registration, food_business_registration, waste_carrier_registration, illuminated_signage_consent
+ standard_store (nothing further)
+ forecourt_store fuel_storage_certificate
+ pharmacy_counter pharmacy_premises_permit
+ licensed_cafe alcohol_retail_licence
- forecourt_store NOT required: illuminated_signage_consent
Tarnwick Unitary Authority
every format: trade_premises_registration, food_business_registration, waste_carrier_registration
+ standard_store (nothing further)
+ forecourt_store fuel_storage_certificate
+ pharmacy_counter pharmacy_premises_permit, late_hours_trading_permit
+ licensed_cafe alcohol_retail_licence, late_hours_trading_permit
Pellhaven Township
every format: trade_premises_registration, food_business_registration
+ standard_store (nothing further)
+ forecourt_store fuel_storage_certificate, waste_carrier_registration
+ pharmacy_counter pharmacy_premises_permit
+ licensed_cafe alcohol_retail_licence
RENEWAL LEAD TIMES, in days -- THE AUTHORITY'S, not the permit's
THE RENEWAL LEAD TIME IS THE AUTHORITY'S, NOT THE PERMIT'S. `default` is the lead time each class carries wherever it is owed; `by_jurisdiction` overrides it where that jurisdiction's office asks for more or less notice. The same expiry date is therefore `renewal_due` in one jurisdiction and `held_current` in the next, which is the trap a single flat reminder window cannot see.
default:
trade_premises_registration 30
food_business_registration 30
alcohol_retail_licence 90
pharmacy_premises_permit 120
fuel_storage_certificate 90
waste_carrier_registration 45
illuminated_signage_consent 30
late_hours_trading_permit 45
Northbridge Metropolitan District overrides: alcohol_retail_licence 120, waste_carrier_registration 60
Calder Vale County overrides: fuel_storage_certificate 150
Eastmarch Borough overrides: food_business_registration 60
Tarnwick Unitary Authority overrides: pharmacy_premises_permit 180, late_hours_trading_permit 30
RECORD STATES
in_force the authority's register records this permit as live. Only an in-force record can satisfy an obligation.
surrendered the holder gave the permit up. It satisfies nothing, whatever its expiry date still says.
refused the authority refused the application. There is a record and there is no permit.
under_appeal a refusal or revocation is under appeal. The permit is NOT in force while the appeal runs, and the worklist says so rather than waiting for the outcome.
exempted the authority has recorded a written exemption from this class for this site, with a reference. Nothing is owed and nothing goes on the worklist.
WHOSE NAME THE PERMIT IS IN
current_name the permit is held in the trading name the site trades under today.
former_name the permit is held in a name this site USED TO trade under - the file states the former name. The permit exists and it is not in the site's own current name, so it cannot be renewed or relied on without a transfer first.
other_party the permit is held by somebody else entirely - a landlord, a concession operator, a previous occupier. It is on the file and it is not the site's permit.
THE STATUS, WORKED OUT AFTERWARDS IN CODE (context for you; you do not compute it)
1. THE SITE-LEVEL STOP. If the file does not state a jurisdiction and a format this matrix knows, or does not state the date it was drawn, NOTHING can be decided: every class is `not_determinable` and the site's obligation set is unknown. Not empty - unknown.
2. EXEMPTED. If the file carries a record of the class whose record state is `exempted`, the status is `exempt`. Nothing is owed and it never reaches the worklist.
3. MISSING. If the site owes the class and the file carries NO record of it at all, the status is `missing`. THIS IS THE HALF THAT CANNOT BE READ OFF THE FILE - it is the obligation set minus what is printed, and a reader working down the file will never reach it.
4. NOTHING IN FORCE. If every record of the class is `surrendered`, `refused` or `under_appeal`, the status is `lapsed`. A record is not a permit.
5. NO EXPIRY RECORDED. If the governing in-force record states no expiry, the status is `not_determinable`. The clock cannot be run, and an unrunnable clock is a fact to report rather than a clearance.
6. ALREADY EXPIRED. If the governing record's expiry is BEFORE the date the file was drawn, the status is `lapsed`.
7. NOT IN THE SITE'S OWN NAME. If the governing record is held under a former trading name or by another party, the status is `not_in_own_name` - CHECKED BEFORE THE RENEWAL WINDOW, deliberately. A permit the site cannot renew because it is in somebody else's name is a worse position than one that merely needs renewing, and a worklist that says `renewal_due` on it sends somebody to lodge a renewal they have no standing to lodge.
8. INSIDE THE AUTHORITY'S LEAD TIME. If the expiry falls within this jurisdiction's lead time for this class, counted in days from the date the file was drawn, the status is `renewal_due`.
9. ANYTHING ELSE. The status is `held_current`.
Where a site holds more than one record of the same class, the GOVERNING record is the in-force one, preferring the one held in the site's current trading name and then the one expiring latest. Where none is in force, rule 4 fires and no single record governs.
the worklist is: missing, lapsed, not_in_own_name, renewal_due
`not_determinable` is NOT on the worklist and is NOT cleared either - it is listed separately, as the set of obligations this file cannot answer. Folding it into either side is the one thing a completeness check must not do: counted as clear it hides a hole, counted as an action it fills the queue with rows nobody can act on.
WHY `missing` IS THE ANSWER THIS SHAPE EXISTS FOR
A completeness check that only reports on the permits it can see is a renewal reminder wearing a compliance coat. The expensive failure in this shape is not a licence that lapsed - somebody gets a renewal notice for that. It is the permit the site never held, in a jurisdiction whose rules nobody re-read when the store format changed, which surfaces when an inspector asks for it. That row is invisible to every reader whose list is the file itself, and it is the only row on this worklist that a free reminder spreadsheet is STRUCTURALLY incapable of producing.
Return these:
- site_id (string) -- the site identifier printed in brackets after the site name in the Site section, verbatim
- jurisdiction (enum) one of: Northbridge Metropolitan District, Calder Vale County, Eastmarch Borough, Tarnwick Unitary Authority, Pellhaven Township -- the licensing jurisdiction named on the 'Jurisdiction' line of the Site section, verbatim and in full. It decides WHICH SET OF PERMITS this site owes, so a near-miss is not a near-miss
- format (enum) one of: standard_store, forecourt_store, pharmacy_counter, licensed_cafe -- the store format on the 'Format' line of the Site section, verbatim. Together with the jurisdiction it decides the obligation set
- file_date (date) -- the date this permit file was drawn, from the File Date section, as YYYY-MM-DD. Every renewal clock on this site is counted from it
- trading_name (string) -- the name the site trades under TODAY, from the 'Trading name' line of the Site section, verbatim. Where the Site section also carries a 'Formerly traded as' line, that is the FORMER name and is NOT this field
- records (array of objects) -- ONE OBJECT PER RECORD BLOCK printed on the file, in printed order, permit records and exemption notices alike, each carrying:
- permit_class (enum) one of: trade_premises_registration, food_business_registration, alcohol_retail_licence, pharmacy_premises_permit, fuel_storage_certificate, waste_carrier_registration, illuminated_signage_consent, late_hours_trading_permit -- the permit class stated on the 'Class' line of the record block, verbatim. THIS IS THE KEY the obligation set is joined on
- permit_ref (string) -- the reference on the record block heading, verbatim (for example PRM-40218, or EX-3305 for an exemption notice)
- record_state (enum) one of: in_force, surrendered, refused, under_appeal, exempted -- the FIRST WORD of the 'Record state' line and nothing else. A surrendered, refused or appealed record still carries an expiry date and those dates do not change the state. `exempted` is an exemption notice rather than a permit
- holder_match (enum) one of: current_name, former_name, other_party -- WHOSE NAME THE PERMIT IS IN, decided by comparing the 'Held by' line of this record block against the Site section. 'current_name' when it is the site's Trading name. 'former_name' when it is the name on the site's 'Formerly traded as' line. 'other_party' when it is neither -- a landlord, a concession, a previous occupier. This is a comparison between two places in the file, not a value printed on one line
- expiry (date) -- the date on the 'Expires' line of this record block, as YYYY-MM-DD. Return null where the line says no expiry is recorded on the file, and null on an exemption notice, which carries no expiry. Do not substitute the issue date, the review date or any date from another record
Return a JSON object with exactly these top-level keys: site_id, jurisdiction, format, file_date, trading_name, records
`records` is an array. Return it EMPTY only if the file carries no permit record and no exemption notice at all -- which happens, and is a real answer.
SITE PERMIT FILE
----------------
Synthetic Record
----------------
This is a SYNTHETIC site permit file, generated for a public AI use-case kit. Every site,
trading name, jurisdiction, authority, permit class, permit reference, exemption reference
and date in it is invented. No real retailer, site, landlord, authority, permit or
regulation is named or reproduced. The obligation matrix this file is read against is the
kit's own construction and is not an authority.
Site
----
Bramfield Service Station Shop (SITE-B-2203)
Trading name: Bramfield Service Station Shop
Jurisdiction: Eastmarch Borough
Format: forecourt_store
File Date
---------
2026-04-01
Permit Record PRM-40103
-----------------------
Class: food_business_registration
Issued by: the Eastmarch Borough Environmental Health Service
Held by: Ninth Row Concessions Limited
Record state: in_force
Expires: 2026-04-06
Permit Record PRM-40105
-----------------------
Class: waste_carrier_registration
Issued by: the Eastmarch Borough Waste Regulation Unit
Held by: Bramfield Service Station Shop
Record state: in_force
Expires: 2026-12-23
Permit Record PRM-40104
-----------------------
Class: trade_premises_registration
Issued by: the Eastmarch Borough Licensing Office
Held by: Bramfield Service Station Shop
Record state: in_force
Expires: 2026-04-21
File Notes
----------
Records are printed in the order they were filed. Superseded and closed records are kept
rather than removed, so a class may appear more than once.