Writing service routing and fallback map
Use this map to check, for each draft, summary, plain rewrite, translation and checklist in this site pack, which path runs first, what happens when that path fails, which timeout is stated, and what degraded response is shown without a guessed value. Cost-aware routing tiers by task complexity, input size and latency need are stated in the next section.
How this map was checked
Every file in pack app-permitdesk.site.1 was checked for a draft, summary, plain rewrite, translation or checklist call: public pages, public guides, public site.js, public site.css and public app index.html. The result below is the audit result for this pack only.
- Public pages and site.js contain no draft, summary or check call. The only outbound request stated there is the demo form post to /api/public/request, which sends form fields only and is not a draft path.
- The app shell in this pack contains no draft, summary or check call. It handles boot, restore and service worker registration only.
- The only runtime path for a draft, summary, plain rewrite, translation or checklist stated in the pack is the signed-in app draft helper, with the plan review letter rewrite that calls it. That helper file is not in supplied site pack.
- Unknown: primary writing service name not in supplied site pack. Unknown: fallback writing service name not in supplied site pack. Do not add a service name, a timeout value or a retry count for a draft path from memory, from an example or from another record.
- Every draft, summary, plain rewrite, translation and checklist in this map must pass structured-output validation before it is shown for editing. Malformed or empty output is never shown as a complete draft and is never saved, published or sent as-is. The section below states the validation checks, the one bounded repair retry and the deterministic template fallback that run in order on the same record.
- Where a service name or a timeout is Unknown on this page, the town office must supply it in the town agreement and in setup notes before anyone relies on it, in the same way the security page asks a town to confirm each control before go-live.
Cost-aware routing tiers for every draft task
Use the tier table in order before the routing map below. A tier is a cost and latency choice only. Every tier uses the same supplied fields from the record opened in the same workspace, the same bracket citation rule and the same Unknown rule. A tier never widens the field list, never adds a fee, date, code or person fact, and never changes a supplied value.
| Tier | What the tier is for | Service name in this pack |
|---|---|---|
| Tier 1, fast check | Classification and extraction from fields already on the record, with no new sentence needed. Short input, inline latency need, lowest cost per call. | Unknown: Tier 1 service name not in supplied site pack |
| Tier 2, standard draft | Rewording or translation that preserves supplied wording and values exactly. Medium input, inline editing latency need, middle cost per call. | Unknown: Tier 2 service name not in supplied site pack |
| Tier 3, strong draft | Synthesis across several field groups, with a bracket citation for every factual sentence. Long input, review step latency need where a person edits the result, highest cost per call. | Unknown: Tier 3 service name not in supplied site pack |
- Input size band means the size of the supplied context for that task on that record. Short means one field group or a short field list. Medium means several field groups or supplied text from one section. Long means several field groups together with supplied text or a comment list. No token count is stated in this pack, so no token count is added here.
- Latency need means where the result is used. Inline means a person is waiting on the screen while they edit. Review page means the check must finish before a submit control is used. Review step means staff edit the result before they send it, so quality matters more than speed.
- Routing adds no token cap, no throttle and no new limit to Majic writing service use. It is a selection of tier by task only, and it changes no timeout stated in this pack.
- A routing note may record only the task name, the tier, the input size band, the latency need and the outcome kind. It must never record a field value, a name, a fee, a date, a code or supplied text as a routing key.
Routing table by task, complexity, input size and latency
Work down the table in order. Route first is the tier to use for that task. The cheaper fallback is the safe lower cost path for that task when the first tier fails. Where the fallback is a manual path, the person writes from supplied fields on the record and lists Unknown for each missing item.
| Task | Complexity and input size band | Latency need | Route first | Cheaper fallback that is safe |
|---|---|---|---|---|
| Checklist | Low. Classification and extraction of required, received and missing from the type list and the record. Short input. | Review page, before submit. Must be fast and exact. | Tier 1, fast check | Deterministic list built from the type list and the record fields, with no writing service call. Where that list cannot be built, show the missing item list with Unknown markers. |
| Missing-sheet and completeness suggestions | Low. Classification of required documents, fields and contacts against the current version. Short input. | Inline review, staff confirm or dismiss. | Tier 1, fast check | Show the required list as required, received or missing from the record, with no suggestion text. Staff decide. |
| Plain-language rewrite | Medium. Rewording that preserves amounts, dates, record numbers, names, contacts, statuses and rule wording exactly. Medium input. | Inline editing. | Tier 2, standard draft | Keep the supplied wording on the record, with no rewording. List Unknown for any item with no supplied field. |
| Translation | Medium. Translation that preserves supplied wording, values and every Unknown marker exactly. Medium input. | Inline editing. | Tier 2, standard draft | Keep the supplied wording untranslated. List Unknown for any item with no supplied field. |
| Summary | Medium to high. Restating only supplied items, with a bracket citation for every factual sentence. Medium to long input. | Inline or review step. | Tier 3, strong draft | Extractive list that restates supplied fields in record order, with field names and no new sentence. List Unknown for any missing item. |
| Write a first draft | High. Synthesis across several field groups, with citations and Unknown markers. Long input. | Review step, person edits before saving. | Tier 3, strong draft | Manual draft written from supplied fields on the record, with bracket citations and Unknown markers. No weaker draft is used to fill a gap. |
| One consolidated correction letter per cycle | High. One letter from open discipline comments, sheet, location and due date where shown. Long input. | Review step, staff edit before sending. Quality matters more than speed. | Tier 3, strong draft | Comment list in letter order from the record, staff write the letter by hand. One letter per cycle. |
| Public demo form, not a draft path | None. Form fields only, no record fields. Short input. | Form post, 20 seconds stated in site.js. | No writing service route | Inline error box with a support code and a Try again control. Never send form fields to a writing service. |
| Health liveness check, not a draft path | None. No record fields. Short input. | Health probe, 10 seconds stated in health.html. | No writing service route | Home page fallback, stated as fallback in the result. Never send a health check to a writing service. |
How to choose a tier in order
Choose by task first
Read the task name in the table above. A checklist and a completeness suggestion stay on Tier 1 even where the input grows, because the task stays extraction. A first draft and a correction letter stay on Tier 3 even where the input is short, because the task stays synthesis with citations.
Check the input size band second
Where a Tier 2 task arrives with long input, keep Tier 2 and list Unknown for any part with no supplied field. Do not move a checklist to Tier 3 because the record has many fields, and do not move a first draft to Tier 1 because the record has few fields.
Check the latency need third
Inline and review page tasks use Tier 1 or Tier 2 first. Review step tasks may use Tier 3, because a person edits the result before it is saved or sent. No task waits for Tier 3 where Tier 1 can answer it exactly.
Use the cheaper fallback on failure, on the same fields
On a failure, use the fallback in the table above on the same supplied fields, with one retry where the screen offers it. The fallback never uses a weaker draft that could change a value, and it never adds a field from another record, another workspace, an example or a document title.
Routing map for every path in this pack
Work down the table in order. A path is listed only where this pack states it. The fallback column is the same for every draft task, because a second guessed draft is not a safe fallback.
| Task | Primary path in this pack | Fallback path when the primary fails | Timeout stated in this pack | Degraded response |
|---|---|---|---|---|
| Write a first draft | Signed-in app draft helper, not in supplied site pack. Uses only supplied fields from the record opened in the same workspace. Route Tier 3 in the table above. | No second draft. Show a plain message, keep entries, offer one retry, then return the missing item list with Unknown markers. | Unknown: draft timeout not in supplied site pack. | Empty, unreadable or timed out result returns no partial draft with a guessed value. Fully covered parts may be shown for editing, each factual sentence with its bracket citation. |
| Summary | Same signed-in app draft helper, not in supplied site pack. A summary may only restate supplied items. Route Tier 3 in the table above. | No second summary. Same plain message, one retry, then the missing item list. | Unknown: draft timeout not in supplied site pack. | Conflicting supplied fields return Unknown, both field names and the conflict, with no silently picked value. |
| Plain-language rewrite | Same signed-in app draft helper, not in supplied site pack. Supplied amounts, dates, record numbers, names, contacts, statuses and rule wording are preserved exactly. Route Tier 2 in the table above. | No second rewrite. Same plain message, one retry, then the missing item list. Translation and rewrite preserve every Unknown marker. | Unknown: draft timeout not in supplied site pack. | Rewording must not change a supplied value. A claim with no supplied field is blocked and written as Unknown. |
| Translation | Same signed-in app draft helper, not in supplied site pack. Supplied wording and values are preserved exactly. Route Tier 2 in the table above. | No second translation. Same plain message, one retry, then the missing item list. | Unknown: draft timeout not in supplied site pack. | No fee, date, code, applicant fact or status is added that is not supplied. |
| Checklist | Same signed-in app draft helper, not in supplied site pack. Required, received and missing are stated in words on the list. Route Tier 1 in the table above. | No second checklist. Same plain message, one retry, then the missing item list. A missing required item is listed as missing. | Unknown: draft timeout not in supplied site pack. | No item is listed where supplied context does not support it. |
| One consolidated correction letter per cycle | Plan review letter rewrite that calls the signed-in app draft helper, not in supplied site pack. One letter per cycle, not separate department letters. Route Tier 3 in the table above. | No second letter. Same plain message, one retry, then the missing item list for the part that needs the missing fact. | Unknown: draft timeout not in supplied site pack. | Staff edit the letter before it is sent. A draft is never saved, published or sent on its own. |
| Missing-sheet and completeness suggestions | Suggestions for staff to confirm or dismiss, stated on the permits page. No draft helper call is stated for this task in the site pack. Route Tier 1 in the table above where a check is built. | Show the required list as required, received or missing from the record. Staff decide. | Unknown: timeout for this check not in supplied site pack. | No filing block that the type does not state, and no decision. |
| Public demo form, not a draft path | Form post in site.js to /api/public/request with kind demo, question or pilot and page path. Fields only, no record fields. No writing service route. | Inline error box with a support code and a Try again control. Entries are kept on the page. | 20 seconds, stated in site.js as a 20000 millisecond abort timer. | Offline, timeout, network and server failures each show a plain reason and the next step. No form field value is used as a measurement property. |
| Health liveness check, not a draft path | Inline script on health.html, first a dedicated /healthz probe, then a home page fallback where /healthz is not confirmed. No writing service route. | Home page fallback, stated as fallback in the result. No database, file or sign-in readiness is probed from the public page. | 10 seconds, stated in health.html as a 10000 millisecond abort timer. | Result shows only result, checked-at time in UTC, probe mode and next step. No town data, header, version, token or secret is shown. |
Primary and fallback comparison
Read this comparison before you set up a template or a reminder in Setup. It states what this pack states and what it does not state, with no added service name and no added timeout.
| Item | Primary path | Fallback path | Difference that matters |
|---|---|---|---|
| Service name | Unknown: primary writing service name not in supplied site pack. | Unknown: fallback writing service name not in supplied site pack. | Do not treat an unnamed fallback as a second service that can fill a gap. The fallback in this pack is the missing item list, not a second draft. |
| Routing tier | Tier 1, Tier 2 or Tier 3 by task, as in the routing table above. Demo form and health check use no tier. | Same tier on one retry, then the cheaper fallback for that task on the same supplied fields. | Tier never widens the field list, and a cheaper tier never changes a supplied value to fill a gap. |
| Supplied fields | Only labelled fields from the record opened in the same workspace, listed by exact field name. | Same supplied fields only. No field is added from another record, another workspace, an example, a template, a document title or general practice. | Primary and fallback use the same field list, so a failure does not widen what may be stated. |
| Timeout | Unknown: draft timeout not in supplied site pack. | Same Unknown timeout for a retry. Do not copy the 20 second demo form timeout or the 10 second health timeout to a draft path. | Record one draft timeout in setup notes with the town office before live use, and use that one value for every draft task. |
| Retry | One attempt per task per record. | One retry where the screen offers it, then the missing item list. No loop and no repeated send. | A repeated error stops and asks the town office that issued the record, with the record number and field names noted. |
| Output handling | Shown for editing, labelled by result, never saved, published or sent on its own. | Same handling for any part that was fully covered before the error, with bracket citations. The missing part is listed separately. | Degraded output is never shown as a complete draft. |
Structured-output validation in order
Run these checks on every draft, summary, plain rewrite, translation, checklist and correction letter before it is shown for editing. A result that fails any check is treated as a degraded case in the table below. It is not shown as a complete draft, and the person entries stay on the page.
| Check in order | What is checked | Pass result | Fail result |
|---|---|---|---|
| 1. Structure | The result parses as the one output shape for that task, with the fixed keys for that task and no extra keys added by the writing service. | Keys match the shape recorded in setup notes for that task. | Fail. Do not show the text. Go to one bounded repair retry, then to the deterministic template fallback. |
| 2. Empty check | The main text field is not empty, not whitespace only, and not a placeholder such as a dash or a repeated supplied value with no sentence. | Text has at least one sentence or, for a checklist, at least one item row. | Fail. Treat as empty. Go to one bounded repair retry, then to the deterministic template fallback. |
| 3. Required shape per task | Write a first draft: draft text plus a citation list and an Unknown list. Summary: summary text plus a citation list and an Unknown list. Plain rewrite: rewritten text plus a preserved values list. Translation: translated text plus the Unknown markers carried from the source. Checklist: item rows with status required, received or missing in words. Correction letter: letter text plus one row per open comment with discipline, sheet or page and sign-off status. | Every required key for that task is present with the right type. | Fail. Go to one bounded repair retry, then to the deterministic template fallback. |
| 4. Citation check | Every factual sentence about a permit, fee, date, deadline, code, applicant, contact, inspection, license, hearing or payment carries a bracket citation to an exact supplied field on the same record, in the form [field_name]. | Every factual sentence has a citation from the supplied list for that record. | Fail for that sentence. Remove or block that sentence. Go to one bounded repair retry, then to the deterministic template fallback for the part that needs the missing fact. |
| 5. Unknown preservation | Every Unknown marker in the source is present in the output with the same field name, and every missing item is written as Unknown: field not in supplied context, naming the source field or document needed. | Unknown markers are preserved exactly and missing items are listed. | Fail. Restore the markers from the supplied list. Go to one bounded repair retry, then to the deterministic template fallback. |
| 6. No invented values | No fee amount, date, code section, record number, parcel fact, status, name, contact detail, license status, inspection result or balance appears that is not in a supplied field on the same record. Supplied amounts, dates, record numbers, names, contacts, statuses and rule wording are unchanged. | No invented value is present and supplied values are unchanged. | Fail. Block the invented value and list it as Unknown with the field needed. Go to one bounded repair retry, then to the deterministic template fallback. |
- Validation runs on the same record and the same supplied fields that the task used. It does not add a field from another record, another workspace, an example, a template, a document title or general practice.
- A result that passes validation is still shown for editing, labelled by result, and is never saved, published or sent on its own.
- Record the shape version and the validation result kind for each attempt in setup notes with the town office, with no supplied field value copied into the note.
One bounded repair retry
Use this retry only where validation fails. It is one retry, for the same task, on the same record, with the same supplied text and fields. It is not a second draft path and it does not widen what may be stated.
| Item | Bound |
|---|---|
| Trigger | Only a validation failure in the order above: structure, empty, required shape, citation, Unknown preservation or invented value. A timeout, no reply or unreadable result goes straight to the deterministic template fallback after the one user retry where the screen offers it, with no repair send. |
| What is sent again | The same supplied text and the same supplied fields, listed by exact field name, with the validation failure kinds named in plain words. The instruction may only ask the writing service to correct the named structure, citation or Unknown errors. It may not add a fee, date, code, requirement, person fact or legal conclusion, and it may not change a supplied value. |
| Count | One repair send per task per record. No loop. No second repair send where the repaired result still fails validation. |
| Timeout | Unknown: draft timeout not in supplied site pack. Use the one draft timeout recorded in setup notes for the repair send, the same value as the first send. Do not copy the 20 second demo form timeout or the 10 second health timeout. |
| Result handling | Validate the repaired result with the same six checks in order. Where it passes, show it for editing with its citations and Unknown list. Where it fails, do not show it as a complete draft. Go to the deterministic template fallback below and show the plain message with the missing item list. |
| Stop condition | Stop after the one repair send, after a timeout on the repair send, or after the repaired result fails validation. Keep person entries on the page and ask the town office that issued the record where the error repeats, with the record number and field names noted. |
See When a draft or summary cannot be made from the record for the plain message, the Unknown list and the issuing authority steps that follow a failed repair.
Deterministic template fallback
Use this fallback where validation fails after the one repair retry, where the writing service does not reply, times out, or returns empty or unreadable text, or where no supplied field covers the task. The fallback makes no writing service call. It builds the result only from supplied fields on the same record, in the fixed shape recorded in setup notes, so the same supplied fields always give the same template result.
| Task | Template fields, in order | Citation and Unknown rule |
|---|---|---|
| Write a first draft | Draft heading with the task name, then one line per supplied field in the order listed for that draft, then the missing item list. | Each factual line carries its bracket citation. A missing field is written as Unknown: field not in supplied context, naming the source field or document needed. |
| Summary | Summary heading, then one restated line per supplied item, then the missing item list. No new claim is added. | Each restated line carries its bracket citation. A claim with no supplied field is not listed and appears only in the missing item list as Unknown. |
| Plain-language rewrite | Rewritten heading, then the supplied wording with amounts, dates, record numbers, names, contacts, statuses and rule wording preserved exactly, then the missing item list. | Rewording changes no value. A value with no supplied field is written as Unknown and is not rewritten. |
| Translation | Translated heading, then the supplied wording in the target language with every Unknown marker preserved exactly, then the missing item list. | No fee, date, code, applicant fact or status is added that is not supplied. Unknown markers stay in place. |
| Checklist | Checklist heading, then one row per item the supplied context supports, with status required, received or missing in words, then the missing item list. | An item with no supplied support is not listed as an item. It appears only in the missing item list as Unknown, naming the field needed. |
| One consolidated correction letter per cycle | Letter heading with the record number where supplied, then one row per open comment with discipline, sheet or page and required change as supplied, then the missing item list. One letter per cycle, not separate department letters. | Each comment row carries its supplied fields only. A comment with no supplied field is listed as Unknown with the field needed, and staff edit the letter before it is sent. |
- The template fallback is labelled by result, shown for editing, and never saved, published or sent on its own, in the same way as a validated draft.
- Where no supplied context is available for a task, the fallback returns a plain message that names the supplied workspace fields that are needed, and makes no template draft for that task.
- Where supplied fields conflict or a value is ambiguous, the fallback writes Unknown, names both field names and the conflict, and drafts only the parts fully covered by supplied fields, each factual sentence with its bracket citation.
- Record the template shape version in setup notes with the town office. A change to a template shape is made in setup notes and in the screen that owns it in the same change, and is tested on a test record before publish.
Degraded responses and the fallback for each
Each row states what the screen shows and what it never shows. Use this table on a test record before you publish a type or a template.
| Degraded case | What the screen shows | What the screen never shows |
|---|---|---|
| No reply or timeout | A plain message that the draft could not be made, entries kept, one retry where safe, then Unknown: field not in supplied context for each missing item. | A guessed fee, date, code, applicant name, contact detail, license status, inspection result or balance. |
| Empty or unreadable result | Same plain message and missing item list. No partial draft hides a missing item. | A plausible letter, summary, checklist or translation that omits the Unknown marker. |
| Validation failure after the one repair retry | The deterministic template fallback for that task, built only from supplied fields, shown for editing with bracket citations and the missing item list, plus a plain message that the first result did not pass validation. | The malformed or empty result as a complete draft, a second repair send, or a value added to fill the gap. |
| No supplied field found | A plain message that names the supplied workspace fields that are needed, and the source field or document needed for each item. | A draft made from outside knowledge. |
| Supplied fields conflict or a value is unclear | Unknown for that item, both field names and the conflict in plain words. Other fully covered parts may be shown with bracket citations. | One value silently picked from the two. |
Ready to ship fallback plan with an incomplete result state
Use this plan for every path in the comparison table below. The plan keeps user entries on the page, shows that the work is incomplete in plain words, and never fills a missing permit fact with draft text. A second draft is not a fallback. The fallback is the incomplete result, the missing item list and the manual path from the record fields.
| Path | Timeout stated in pack | User input preserved | Incomplete result state shown | Never shown | Retry or manual path |
|---|---|---|---|---|---|
| Draft, summary, plain rewrite, translation, checklist and consolidated letter | Unknown: draft timeout not in supplied site pack. Do not borrow the 20 second form timer or the 10 second health timer. | Entries stay on the page. Supplied fields stay on the record opened in the same workspace. No entry is cleared on failure. | A plain message that the draft could not be made, the missing item list with Unknown markers by exact field name, and only fully covered parts with bracket citations. | A guessed fee, date, code, applicant fact, license status, inspection result, balance or legal conclusion. A partial draft shown as complete. | One retry where the screen offers it, then manual writing from the supplied fields on the record, with the town office named for each missing field. |
| Public demo form in site.js to /api/public/request | 20 seconds, 20000 milliseconds, abort timer in site.js. Offline is checked before send. | Form entries stay on the page. The form is hidden only on success. | Inline error box with reason, next step, support code starting with PD-REQ and a Try again control, with focus moved to the box. | A success state, a sent confirmation, or a form field value used as a measurement property. | Try again from the error box. Entries are kept, so no retyping is needed. |
| Health liveness check in health.html | 10 seconds, 10000 milliseconds, per probe. Dedicated /healthz first, home page fallback second. | No user input and no town data are sent. No credentials are sent. | Public site did not serve a page, with checked-at time in UTC and probe mode stated as home page fallback with dedicated /healthz not confirmed. | Response headers, build version, server detail, internal address, timing in milliseconds, token, secret or town data. A readiness claim for signed-in work. | Try the home page, check the connection on the device, then report the page address and time as a liveness result only. |
| App boot in public app index.html | 15 seconds boot timeout, 600 milliseconds script fail wait, 500 milliseconds watcher step, 30000 milliseconds restore window. | Intended destination is kept in tab session storage only where it is a safe /app/ destination, and the destination text is shown on the failure panel. | PermitDesk did not finish loading, with Try again and Open workspace home, and a note that signing in again in the same tab returns to the same workspace. | A blank page, a new account, a new workspace, or a workspace switch made by a stored value. | Try again to the same destination. Sign in again in the same tab and check the workspace name again. |
| Offline page in offline.html | No abort timer stated. Retry wait is 800 milliseconds after the online event, then reload to the same address. | Work that has not synced stays on the device. No new application or workspace is started. | Still offline at checked-at time in UTC, or This page did not load where the connection is on, with focus on Try again. | A loss claim for unsynced work, or a new application started as a workaround. | Try again, with auto retry after the connection returns. |
| Service worker registration in site.js and the app shell | No timer stated in pack. | No user input is sent or stored by this path. | Document marks the service worker as unavailable, with a PD-SW support code in the console warning only. | A page failure. Pages keep working without the service worker. | No user action stated. Registration is tried again on a later load. |
| Public status lookup in status.html | No abort timer stated in pack. Network failure is read as a TypeError, other failures as code not matched. | The code is cleared from the address and from the entry box after a check by design, and is not saved in browser storage on that page. A record number alone does not show a status. | That link code did not match a public status, or a connection message, with no record list. | Whether a record number exists, contacts, fees, documents, internal notes or the status link code. | Check the full code and try again. Contact the town office for the public status link for the record. |
Incomplete panel in fixed order
Build every incomplete panel in this order, with the same order on every path above. Status stays in words, not by colour alone, and the panel is reachable by keyboard in reading order.
Title
State that the work is incomplete in plain words, for example Draft could not be made, Request could not be sent, Public site did not serve a page, PermitDesk did not finish loading, or Still offline.
What happened
State the plain reason from the path, such as no reply, timeout, empty result, offline, network or server failure, with no internal detail and no secret.
What was kept
State what stayed on the page or on the record, such as entries kept on the page, destination kept in this tab, or work unsynced on this device, where that path states it.
What was not completed
State that no draft, send, check or load was completed, and that no partial result is shown as complete.
Missing items
For a draft task, list each missing field by exact field name as Unknown: field not in supplied context, with the source field or document needed. For a form, health, boot, offline or lookup path, list the next check from the comparison table above.
Next step and retry
Offer one Try again control where a retry is safe, then the manual path from the record fields or the town office. Do not loop a retry.
Support code and time where stated
Show a support code only where the path states one, such as PD-REQ for the form, with checked-at time in UTC where the path states it. Keep the code off the record and out of measurement properties.
Input preservation checklist
- Do not clear a form, a draft editor or a checklist on failure. Hide a form only on a confirmed success.
- Do not call the draft helper where no supplied context is available. Return the plain message that names the supplied workspace fields that are needed.
- Do not save, publish or send a partial draft. Show fully covered parts for editing only, each factual sentence with its bracket citation, and list the missing part separately.
- Keep supplied wording, amounts, dates, record numbers, names, contacts, statuses and rule wording exactly as supplied in any part that is shown.
- Do not infer a missing value from another record, another workspace, earlier conversation, an example, a template, a document title, a file name or general practice.
- Keep one attempt per task per record, one retry where the screen offers it, then stop and ask the town office that issued the record with the record number and field names noted.
- Record one draft timeout and one retry rule in setup notes with the town office before live use, and use that one value for every draft task. Unknown stays Unknown until that value is supplied.
Gate before save, publish or send
- Every factual sentence in shown draft text carries a bracket citation from the supplied list, or the sentence is not shown as a fact.
- No fee, date, code, applicant fact, license status, inspection result, balance, requirement or legal conclusion appears without a supplied field that proves it.
- Where two supplied fields conflict, the panel shows Unknown, both field names and the conflict, with no silently picked value.
- Translation and plain rewrite preserve supplied wording, values and every Unknown marker, and add no fee, date, code, applicant fact or status that is not supplied.
- A person edits the shown text before save. Draft text is never saved, published or sent on its own.
Test each path before publish
Test a missing fee and a missing applicant fact
On a test record with fee_items.amount_cents and an applicant contact fact left out, run a draft, a summary and a checklist. You should see Unknown for both fields, only the supplied fields listed, and no guessed amount, date, code, name, contact detail, license status or inspection result.
Test a forced empty result, a conflict and an embedded instruction
Force an empty or unreadable result, set two supplied fields to different values for the same item, and put text in a supplied field that tells the writing service to invent a value. You should see a plain retry message with entries kept, Unknown with both field names and the conflict, and the embedded instruction ignored as data only.
Test the form, health, boot, offline and lookup paths
Block the form post, run the health check with no dedicated health result, load the app shell with no app content, open the offline page with the connection down, and check a status code that does not match. You should see the incomplete panel in the fixed order above for each path, with entries or destination kept where that path states it, and no success state.
Publish only after every test passes
Run the safe defaults health check in the setup guide, then publish only after the tests pass. Drafts and the test record stay private and do not appear in public search. See When a draft cannot be made and Drafts, summaries and checks.
Configuration to record before live use
Work through these steps in order. Each step ends with what you should see when it worked.
Record the primary and fallback service names in setup notes
Write the primary writing service name and the fallback behaviour for each task in the table above, with the town office, in the town agreement and in setup notes. You should see Unknown replaced by a named source or a written decision that the fallback is the missing item list only.
Record the routing tier for each task
Write the tier for each task in the routing table above, with the complexity, input size band and latency need for that task, in setup notes with the town office. You should see Tier 1 for checklist and completeness, Tier 2 for rewrite and translation, Tier 3 for summary, first draft and correction letter, and no tier for the demo form and the health check, with no service name added where the pack does not state one.
Record one draft timeout and one retry rule
Write the one timeout value and the one retry rule for every draft task, so a timeout on a summary and a timeout on a checklist behave the same. You should see the timeout and retry rule copied into setup notes, with no value copied from the 20 second demo form timeout or the 10 second health timeout.
Record the output shape and validation checks per task
Write the fixed keys for each task, the six validation checks in order on this page, and the shape version. Test each check on a test record with a missing fee and a missing applicant fact. You should see Unknown for both missing fields, only the supplied fields listed, and no guessed amount, deadline, code, name, contact detail, license status or inspection result.
Record the one repair retry bound and the template fallback
Write the one repair retry bound, the same supplied text and fields rule, the stop condition, and the fixed template fields per task from the sections above. Force a validation failure on the test record. You should see one repair send, validation of the repaired result, and the deterministic template fallback where the repair still fails, with no second repair send and no malformed result shown as a complete draft.
Test a missing fee and a missing applicant fact
On a test record with fee_items.amount_cents and an applicant contact fact left out of the supplied fields, run a draft, a summary and a checklist. You should see Unknown for both missing fields, only the supplied fields listed, no guessed amount, deadline, code, name, contact detail, license status or inspection result, and no value inferred from an example or another record.
Test each tier and its cheaper fallback
Run a checklist on Tier 1 and confirm the list matches the record fields. Run a rewrite on Tier 2 and confirm every supplied value is preserved. Run a summary and a first draft on Tier 3 and confirm every factual sentence carries a bracket citation. Force a failure on each tier and confirm the cheaper fallback in the routing table above shows, with entries kept and no guessed value.
Test a forced error and a conflict
Force an empty or unreadable result, and set two supplied fields to different values for the same item, on the test record. You should see a plain retry message with entries kept, and Unknown with both field names and the conflict, with no silently picked value.
Publish only after the test passes
Run the safe defaults health check in the setup guide, then publish only after the test passes. Drafts and the test record stay private and do not appear in public search. See Set up a permit type and fees and Search a public record.
Bring your task list to the demo
Tell us which draft, summary or check you need first, and we will set the routing and fallback with your types and fees.