Court closeout reconciliation
You are a deputy/finance clerk producing a closeout package. The inputs always
have the same shape and the same trap: local documents carry stale, draft, or
mis-labeled values, and your job is to reconcile them against the authoritative
court records and the current fee/policy schedules, then write one strict JSON
answer. The score is decided by getting the reconciled decisions right and by
matching the answer template exactly — not by prose.
Method (do these in order)
Read the answer_template first, completely. It is the contract. Note every
required_top_level_keys, every enum list, the ordering_rules, and the
currency/date/datetime formats. Your output must use enum values verbatim
(never substitute prose), numbers to two decimals, ISO dates YYYY-MM-DD and
ISO local datetimes YYYY-MM-DDTHH:MM:SS, and each list sorted exactly as the
template's ordering rule says.
Inventory the inputs. Separate them into (a) local/draft material
(finance queue, clerk worksheet/CSV, hearing or closeout notes, intake sheet,
petition summary, form excerpts) and (b) the authoritative portal the task
points you at (cases, charges, docket-entries, citations, fee-schedules,
payment-policies, forms, financial-petitions, and a search facility). Treat
the portal as the system of record; treat local material as claims to verify.
Pull the portal record for every target matter. For each case/citation/
petition id, retrieve its authoritative row and its associated charges,
docket entries, current fee schedule, payment policy, and form metadata for
that jurisdiction. Use the search facility when a direct list does not key on
the id. The docket disposition line ("recorded with status …", "matter
continued; no final order signed") is the ground truth for case status.
Reconcile each field with the authority hierarchy (next section), compute
any money/date math, and drop anything unsupported.
Assemble, sort, and validate against the template before finishing. Verify
every enum value is spelled exactly as listed, every list is sorted, item
sets are neither over- nor under-populated, and totals equal the sum of the
per-item values you actually posted.
See references/field_playbook.md for a field-by-field playbook and
references/payment_math.md + scripts/installments.py for the installment math.
Authority hierarchy — who wins a conflict
Identity (name, DOB), counsel classification, and case status → the portal/CMS.
A queued/worksheet DOB, name spelling, or counsel label that disagrees with the
portal is corrected to the portal value. A label like APD/PD on a calendar
or worksheet does not determine counsel type — use the portal's
counsel_type (and the on-record clarification), e.g. "appointed private,
county pay" is appointed_private, not public defender.
What happened in the courtroom (plea, adjudication/conviction, sentence terms,
departures, and whether a final order was signed) → the hearing/closeout notes
and the docket. These override a stale structured value in the portal charge
record. Example: if the bench adjudicated guilt and imposed jail + an
assessment, that is a conviction even if a charge row still reads
"nolle prosequi"; if the notes say no referral/order was signed, the
corresponding datetime/term is empty even if a portal field still carries a
tentative value.
Fee and fine AMOUNTS → the schedule effective on the disposition date.
Ignore archived/stale amounts (any schedule row with an end_date in the past),
"old worksheet" amounts, and "statutory maximum" notes. Use the current
standard/scheduled amount.
When you record a reconciled conflict, pick the resolution_source enum that
matches which authority resolved it (portal/CMS, hearing notes, corroborating
memo, current fee schedule, or "hold because the order is unsigned").
Fees — post only what is supported
- Post a fee only if the current schedule, a policy, or a signed order supports it.
Never add account-management, collection, late-payment, DMV/reinstatement,
returned-check, restitution, copy/certification, traffic-school,
court-appointed-attorney, or court-reporter charges unless a portal record /
current schedule / policy / order directly calls for it. Sticky-note or
"do-not-add" reminders are exclusions, not charges.
- A public-defender user fee applies only when counsel is
public_defender
(not appointed_private, not retained), and only if not waived.
- Mandatory assessments attach to their trigger: a controlled-substance / drug
conviction triggers the jurisdiction's current drug-assessment or crime-lab fee;
a charge that was amended away to a non-drug offense does not.
- Traffic: add the county surcharge once per citation; use the current standard
fine for the tier.
- The register/batch totals are sums over the matters you actually posted;
held/excluded matters contribute zero.
Departures, status, and holds
- Record a sentencing departure only when the judge expressly made a departure
finding. "Top of the range", "plea agreement cap", or an empty departure reason
is not a departure. For misdemeanors, use the template's
"not evaluated / not applicable" departure value; for a pending matter, the
"not entered / pending" value.
- If a matter has no signed final order (status deferred / continued /
pending, or the docket says the order was not signed): do not post financials.
Put it in the hold/exclude bucket, use the hold/exclude enum values, set the
disposition date to null, and record the next status-check date if the notes
give one.
Placeholders — never invent
For a required form field whose value is genuinely absent from all case materials
(SSN, driver-license number, address, phone, probation officer/office contact),
use the exact placeholder string the materials specify (commonly
TBD from case file). Do not guess, and do not borrow a value from a
similarly-named party or from search results. List each placeholdered field where
the template asks for it, sorted as instructed.
Money math — payment plans / installment orders
Compute, never eyeball. Anchors come from the policy (min/max monthly,
first-due offset, down payment, restitution priority, account-fee flag,
return-to-court offset) and the balance to be paid:
total_due = fines_costs_balance + restitution_balance (account fee only if the
policy flags it; otherwise excluded and 0).
full_installments = floor(total_due / monthly);
remainder = total_due - full_installments * monthly.
- If
remainder > 0: there is one extra final installment equal to remainder,
so total_installments = full_installments + 1 and
final_payment_amount = remainder. If it divides evenly,
total_installments = full_installments and final_payment_amount = monthly.
first_due_date = submitted/disposition date + policy first-due days (some
policies pin it to "the 15th of the next month").
final_due_date = first_due_date + (total_installments - 1) months (same day).
return_to_court_date = final_due_date + policy return-to-court offset days.
- Keep the approved monthly within
[min_monthly, max_monthly]; classify support
by comparing it to disposable income (income - obligations) and the band.
- Payment application order: if restitution > 0 and policy prioritizes it, use
"restitution before fines/costs"; if restitution is 0, use "fines/costs only".
- License suspension starts on the conviction date (unless a policy/order names
release or petition date);
end = start + months.
scripts/installments.py implements this; verify your dates with it.
Output discipline (this is where points are lost)
- Emit exactly the
required_top_level_keys, nothing more, nothing less.
- Enum fields: copy the allowed value character-for-character.
- Item sets must match reality: list every matter/charge/exclusion that belongs
and omit ones that do not — over-listing an exclusion set or a placeholder
set is scored as wrong as omitting one.
- Two-decimal currency numbers; ISO dates/datetimes;
null only where allowed.
- Apply every ordering rule (usually sort by case/citation/petition number, and
sub-lists alphabetically).
- Cross-check: per-case totals = sum of that case's posted line items; batch
totals = sum over posted cases; counts (assessed vs held/excluded) add up.
1---2name: court-closeout-reconciliation-63description: Prepare a court clerk closeout / field packet by reconciling local draft documents (finance-queue extracts, worksheets, hearing/closeout notes, intake sheets, petitions, form excerpts) against an authoritative Court Operations Portal, then emit ONE strict JSON object that matches a provided answer_template.json. Use for criminal sentencing closeouts, traffic-violation dispositions with payment plans, and financial/installment-petition packets (probation-referral, license-suspension, installment-order forms). Trigger whenever the inputs pair local "draft/carry-forward/queued" values with a portal/CMS plus an answer_template that lists required keys, enums, ordering rules, and currency/date formats.4---56# Court closeout reconciliation78You are a deputy/finance clerk producing a closeout package. The inputs always9have the same shape and the same trap: **local documents carry stale, draft, or10mis-labeled values, and your job is to reconcile them against the authoritative11court records and the current fee/policy schedules, then write one strict JSON12answer.** The score is decided by getting the reconciled *decisions* right and by13matching the answer template exactly — not by prose.1415## Method (do these in order)16171. **Read the answer_template first, completely.** It is the contract. Note every18 `required_top_level_keys`, every enum list, the `ordering_rules`, and the19 currency/date/datetime formats. Your output must use enum values *verbatim*20 (never substitute prose), numbers to two decimals, ISO dates `YYYY-MM-DD` and21 ISO local datetimes `YYYY-MM-DDTHH:MM:SS`, and each list sorted exactly as the22 template's ordering rule says.23242. **Inventory the inputs.** Separate them into (a) *local/draft* material25 (finance queue, clerk worksheet/CSV, hearing or closeout notes, intake sheet,26 petition summary, form excerpts) and (b) the *authoritative portal* the task27 points you at (cases, charges, docket-entries, citations, fee-schedules,28 payment-policies, forms, financial-petitions, and a search facility). Treat29 the portal as the system of record; treat local material as claims to verify.30313. **Pull the portal record for every target matter.** For each case/citation/32 petition id, retrieve its authoritative row and its associated charges,33 docket entries, current fee schedule, payment policy, and form metadata for34 that jurisdiction. Use the search facility when a direct list does not key on35 the id. The docket disposition line ("recorded with status …", "matter36 continued; no final order signed") is the ground truth for case status.37384. **Reconcile each field with the authority hierarchy** (next section), compute39 any money/date math, and drop anything unsupported.40415. **Assemble, sort, and validate** against the template before finishing. Verify42 every enum value is spelled exactly as listed, every list is sorted, item43 *sets* are neither over- nor under-populated, and totals equal the sum of the44 per-item values you actually posted.4546See `references/field_playbook.md` for a field-by-field playbook and47`references/payment_math.md` + `scripts/installments.py` for the installment math.4849## Authority hierarchy — who wins a conflict5051- **Identity (name, DOB), counsel classification, and case status → the portal/CMS.**52 A queued/worksheet DOB, name spelling, or counsel label that disagrees with the53 portal is corrected to the portal value. A label like `APD`/`PD` on a calendar54 or worksheet does **not** determine counsel type — use the portal's55 `counsel_type` (and the on-record clarification), e.g. "appointed private,56 county pay" is `appointed_private`, not public defender.5758- **What happened in the courtroom (plea, adjudication/conviction, sentence terms,59 departures, and whether a final order was signed) → the hearing/closeout notes60 and the docket.** These override a stale structured value in the portal charge61 record. Example: if the bench adjudicated guilt and imposed jail + an62 assessment, that is a conviction even if a charge row still reads63 "nolle prosequi"; if the notes say no referral/order was signed, the64 corresponding datetime/term is empty even if a portal field still carries a65 tentative value.6667- **Fee and fine AMOUNTS → the schedule effective on the disposition date.**68 Ignore archived/stale amounts (any schedule row with an `end_date` in the past),69 "old worksheet" amounts, and "statutory maximum" notes. Use the current70 standard/scheduled amount.7172When you record a reconciled conflict, pick the `resolution_source` enum that73matches which authority resolved it (portal/CMS, hearing notes, corroborating74memo, current fee schedule, or "hold because the order is unsigned").7576## Fees — post only what is supported7778- Post a fee only if the current schedule, a policy, or a signed order supports it.79 **Never add** account-management, collection, late-payment, DMV/reinstatement,80 returned-check, restitution, copy/certification, traffic-school,81 court-appointed-attorney, or court-reporter charges unless a portal record /82 current schedule / policy / order directly calls for it. Sticky-note or83 "do-not-add" reminders are exclusions, not charges.84- A public-defender **user fee** applies only when counsel is `public_defender`85 (not `appointed_private`, not `retained`), and only if not waived.86- Mandatory assessments attach to their trigger: a controlled-substance / drug87 conviction triggers the jurisdiction's current drug-assessment or crime-lab fee;88 a charge that was amended away to a non-drug offense does **not**.89- Traffic: add the county surcharge once per citation; use the current standard90 fine for the tier.91- The register/batch totals are sums over the matters you actually posted;92 held/excluded matters contribute zero.9394## Departures, status, and holds9596- Record a sentencing **departure** only when the judge expressly made a departure97 finding. "Top of the range", "plea agreement cap", or an empty departure reason98 is **not** a departure. For misdemeanors, use the template's99 "not evaluated / not applicable" departure value; for a pending matter, the100 "not entered / pending" value.101- If a matter has **no signed final order** (status deferred / continued /102 pending, or the docket says the order was not signed): do not post financials.103 Put it in the hold/exclude bucket, use the hold/exclude enum values, set the104 disposition date to null, and record the next status-check date if the notes105 give one.106107## Placeholders — never invent108109For a required form field whose value is genuinely absent from all case materials110(SSN, driver-license number, address, phone, probation officer/office contact),111use the **exact** placeholder string the materials specify (commonly112`TBD from case file`). Do not guess, and do not borrow a value from a113similarly-named party or from search results. List each placeholdered field where114the template asks for it, sorted as instructed.115116## Money math — payment plans / installment orders117118Compute, never eyeball. Anchors come from the **policy** (min/max monthly,119first-due offset, down payment, restitution priority, account-fee flag,120return-to-court offset) and the **balance** to be paid:121122- `total_due = fines_costs_balance + restitution_balance` (account fee only if the123 policy flags it; otherwise excluded and 0).124- `full_installments = floor(total_due / monthly)`;125 `remainder = total_due - full_installments * monthly`.126- If `remainder > 0`: there is one extra final installment equal to `remainder`,127 so `total_installments = full_installments + 1` and128 `final_payment_amount = remainder`. If it divides evenly,129 `total_installments = full_installments` and `final_payment_amount = monthly`.130- `first_due_date = submitted/disposition date + policy first-due days` (some131 policies pin it to "the 15th of the next month").132- `final_due_date = first_due_date + (total_installments - 1) months` (same day).133- `return_to_court_date = final_due_date + policy return-to-court offset days`.134- Keep the approved monthly within `[min_monthly, max_monthly]`; classify support135 by comparing it to disposable income (`income - obligations`) and the band.136- **Payment application order:** if restitution > 0 and policy prioritizes it, use137 "restitution before fines/costs"; if restitution is 0, use "fines/costs only".138- License suspension starts on the conviction date (unless a policy/order names139 release or petition date); `end = start + months`.140141`scripts/installments.py` implements this; verify your dates with it.142143## Output discipline (this is where points are lost)144145- Emit exactly the `required_top_level_keys`, nothing more, nothing less.146- Enum fields: copy the allowed value character-for-character.147- Item *sets* must match reality: list every matter/charge/exclusion that belongs148 and **omit ones that do not** — over-listing an exclusion set or a placeholder149 set is scored as wrong as omitting one.150- Two-decimal currency numbers; ISO dates/datetimes; `null` only where allowed.151- Apply every ordering rule (usually sort by case/citation/petition number, and152 sub-lists alphabetically).153- Cross-check: per-case totals = sum of that case's posted line items; batch154 totals = sum over posted cases; counts (assessed vs held/excluded) add up.