Court Operations closeout / financial packet
You are acting as a court clerk. Each task gives you (a) target identifiers
(cases, citations, and/or petitions), (b) local payloads that often contain
drafts, stale carry-forwards, and conflicts, (c) a Court Operations Portal
REST API that is the authoritative CMS and current rule tables, and (d) an
answer_template.json that defines the exact output contract. Produce one JSON
object matching that template, with every value reconciled and audited.
The portal is authoritative for structured facts and current rules; the local
payloads tell you what the clerk saw and what happened in court. Your job is to
resolve conflicts correctly, apply the money/date math, exclude unsupported
items, hold un-signed matters, and emit strictly schema-conformant JSON.
Files in this skill
references/portal_api.md — every portal endpoint, its fields, how to filter,
and which field is authoritative for what.
references/reconciliation_rules.md — the full decision rules (authority
hierarchy, fees, installments, holds, placeholders, license/probation). Read
this before deciding any contested value.
scripts/installments.py — computes the installment breakdown and schedule
dates (first/final due, return-to-court). Use it instead of hand arithmetic.
Workflow
Read the prompt. Extract: the portal base URL (from <TASK_ENV_BASE_URL>;
the real value is in the environment's environment_access.md as
GDPEVO_ENV_BASE_URL), the target identifiers, the listed portal endpoints,
and the path to answer_template.json.
Treat answer_template.json as the contract. Extract and write down:
the required top-level keys, each item's required keys, every enum and its
allowed values, the ordering rules, currency precision, date/datetime/time
formats, and the exact placeholder string. The output must contain only
the keys the template lists, use enum values verbatim (never substitute
prose for an enum), and follow the formats exactly.
Read every local payload in input/payloads/ (hearing/closeout notes,
audit/finance memos, worksheets/CSVs, petition & budget summaries, form
excerpts). Note draft/stale/carry-forward flags and any explicit conflicts or
instructions ("do not add …", "verify current schedule", "order not signed",
"use placeholder for missing …").
Query the portal for the authoritative record of each target and the
reference tables. Use exact filters (?case_number=, ?citation_number=,
?petition_id=, ?jurisdiction_code=) and /api/search?q=<name> for
identity confirmation. At minimum resolve: the jurisdiction; the authoritative
case/citation/petition record; charges; docket entries (to confirm a signed
disposition vs. a hold); the current fee schedule; the payment policy; and the
form metadata — whichever the task needs. See references/portal_api.md.
Reconcile using the source-of-authority hierarchy in
references/reconciliation_rules.md §1. In short: CMS wins for identity and
structured sentence data; the current fee-schedule/policy/form tables win for
money rules and form metadata; hearing notes win for what happened in open
court (accepted plea/finding, count amendments, a departure pronounced or
expressly rejected, whether a final order was signed); a corroborating memo
settles counsel classification; draft/stale/carry-forward values are never
authoritative. Record each audit finding's resolution source accordingly.
Apply the domain computations (reconciliation_rules.md §§3–8):
- Fees: start from current-window fee-schedule rows; include mandatory
fees and only-when-triggered conditional fees (PD user fee only for public
defenders; charge-specific assessments only on the qualifying conviction
count); include a fine only if actually imposed; exclude every
unsupported/stale/discretionary fee and itemize exclusions with the schema's
reason codes.
- Installments: validate the monthly amount against the policy band and
the budget (income − obligations), then run
scripts/installments.py for
the breakdown and dates; apply the policy's restitution priority and
account-fee treatment.
- Traffic fine tiers: map the citation's
violation_code to the current
standard_fine row; add the county surcharge once.
- License suspension / probation referral: start dates, months, end dates,
and whether a referral was actually ordered.
- Holds: any matter without a signed final order is held/excluded with
zeroed financials and null dates, counted separately.
- Placeholders: use the exact placeholder string for form-required fields
absent from all sources; never invent identifiers or contacts.
Assemble the output strictly to schema. Include only allowed keys; use
enum values verbatim; apply every ordering rule (sort the arrays as directed,
e.g. by case_number/citation_number/petition_id, and any secondary key);
format all money to two decimals and all dates/datetimes/times per the
template; use null exactly where the schema allows it (e.g. no disposition
date for a held matter).
Self-check before returning (see checklist below). Then output the JSON
object only — no markdown, no commentary — unless the template says otherwise.
Output discipline
- Exactly one JSON object, matching the template's structure and key names.
- Only the keys the template defines; every enum value drawn verbatim from the
template's allowed list.
- Money: numbers to two decimals. Dates:
YYYY-MM-DD. Datetimes:
YYYY-MM-DDTHH:MM:SS. Times: HH:MM. Use null only where permitted.
- Arrays sorted exactly per the template's ordering rules.
Self-check
1---2name: court-ops-closeout3description: Prepare a court clerk closeout / financial packet (criminal sentencing register, traffic-violation payment plan, or post-sentencing installment & supervision order) by reconciling local case payloads against the Court Operations Portal REST API and emitting one JSON object that exactly matches a provided answer_template.json. Use when a task gives target case / citation / petition identifiers, local payloads (hearing notes, memos, worksheets, budgets, form excerpts), an answer_template.json, and a Court Operations Portal base URL (`<TASK_ENV_BASE_URL>` / `GDPEVO_ENV_BASE_URL`).4---56# Court Operations closeout / financial packet78You are acting as a court clerk. Each task gives you (a) target identifiers9(cases, citations, and/or petitions), (b) local payloads that often contain10drafts, stale carry-forwards, and conflicts, (c) a **Court Operations Portal**11REST API that is the authoritative CMS and current rule tables, and (d) an12`answer_template.json` that defines the exact output contract. Produce **one JSON13object** matching that template, with every value reconciled and audited.1415The portal is authoritative for structured facts and current rules; the local16payloads tell you what the clerk saw and what happened in court. Your job is to17resolve conflicts correctly, apply the money/date math, exclude unsupported18items, hold un-signed matters, and emit strictly schema-conformant JSON.1920## Files in this skill2122- `references/portal_api.md` — every portal endpoint, its fields, how to filter,23 and which field is authoritative for what.24- `references/reconciliation_rules.md` — the full decision rules (authority25 hierarchy, fees, installments, holds, placeholders, license/probation). Read26 this before deciding any contested value.27- `scripts/installments.py` — computes the installment breakdown and schedule28 dates (first/final due, return-to-court). Use it instead of hand arithmetic.2930## Workflow31321. **Read the prompt.** Extract: the portal base URL (from `<TASK_ENV_BASE_URL>`;33 the real value is in the environment's `environment_access.md` as34 `GDPEVO_ENV_BASE_URL`), the target identifiers, the listed portal endpoints,35 and the path to `answer_template.json`.36372. **Treat `answer_template.json` as the contract.** Extract and write down:38 the required top-level keys, each item's required keys, every enum and its39 allowed values, the ordering rules, currency precision, date/datetime/time40 formats, and the exact placeholder string. The output must contain **only**41 the keys the template lists, use enum values **verbatim** (never substitute42 prose for an enum), and follow the formats exactly.43443. **Read every local payload** in `input/payloads/` (hearing/closeout notes,45 audit/finance memos, worksheets/CSVs, petition & budget summaries, form46 excerpts). Note draft/stale/carry-forward flags and any explicit conflicts or47 instructions ("do not add …", "verify current schedule", "order not signed",48 "use placeholder for missing …").49504. **Query the portal for the authoritative record** of each target and the51 reference tables. Use exact filters (`?case_number=`, `?citation_number=`,52 `?petition_id=`, `?jurisdiction_code=`) and `/api/search?q=<name>` for53 identity confirmation. At minimum resolve: the jurisdiction; the authoritative54 case/citation/petition record; charges; docket entries (to confirm a signed55 disposition vs. a hold); the current fee schedule; the payment policy; and the56 form metadata — whichever the task needs. See `references/portal_api.md`.57585. **Reconcile using the source-of-authority hierarchy** in59 `references/reconciliation_rules.md` §1. In short: CMS wins for identity and60 structured sentence data; the current fee-schedule/policy/form tables win for61 money rules and form metadata; **hearing notes win for what happened in open62 court** (accepted plea/finding, count amendments, a departure pronounced or63 expressly rejected, whether a final order was signed); a corroborating memo64 settles counsel classification; draft/stale/carry-forward values are never65 authoritative. Record each audit finding's resolution source accordingly.66676. **Apply the domain computations** (reconciliation_rules.md §§3–8):68 - **Fees**: start from current-window fee-schedule rows; include mandatory69 fees and only-when-triggered conditional fees (PD user fee only for public70 defenders; charge-specific assessments only on the qualifying conviction71 count); include a fine only if actually imposed; **exclude** every72 unsupported/stale/discretionary fee and itemize exclusions with the schema's73 reason codes.74 - **Installments**: validate the monthly amount against the policy band and75 the budget (income − obligations), then run `scripts/installments.py` for76 the breakdown and dates; apply the policy's restitution priority and77 account-fee treatment.78 - **Traffic fine tiers**: map the citation's `violation_code` to the current79 `standard_fine` row; add the county surcharge once.80 - **License suspension / probation referral**: start dates, months, end dates,81 and whether a referral was actually ordered.82 - **Holds**: any matter without a signed final order is held/excluded with83 zeroed financials and null dates, counted separately.84 - **Placeholders**: use the exact placeholder string for form-required fields85 absent from all sources; never invent identifiers or contacts.86877. **Assemble the output strictly to schema.** Include only allowed keys; use88 enum values verbatim; apply every ordering rule (sort the arrays as directed,89 e.g. by case_number/citation_number/petition_id, and any secondary key);90 format all money to two decimals and all dates/datetimes/times per the91 template; use `null` exactly where the schema allows it (e.g. no disposition92 date for a held matter).93948. **Self-check before returning** (see checklist below). Then output the JSON95 object only — no markdown, no commentary — unless the template says otherwise.9697## Output discipline9899- Exactly one JSON object, matching the template's structure and key names.100- Only the keys the template defines; every enum value drawn verbatim from the101 template's allowed list.102- Money: numbers to two decimals. Dates: `YYYY-MM-DD`. Datetimes:103 `YYYY-MM-DDTHH:MM:SS`. Times: `HH:MM`. Use `null` only where permitted.104- Arrays sorted exactly per the template's ordering rules.105106## Self-check107108- [ ] Every required top-level key and every required item key is present.109- [ ] Every enum field uses an allowed value verbatim (no prose substitutes).110- [ ] Arrays are sorted per the ordering rules (primary and any secondary key).111- [ ] Currency has two decimals; dates/times use the required formats; `null`112 used only where allowed.113- [ ] Identity/counsel/charge/departure/status values reflect the correct114 authoritative source, not a draft/stale worksheet value.115- [ ] No stale/archived amount used; no unsupported fee posted; every excluded116 item has the right reason code.117- [ ] Any un-signed / deferred / continued matter is held (zeroed financials,118 null dates) and counted as held/excluded, not disposed.119- [ ] Installment breakdown and all schedule dates match120 `scripts/installments.py`; monthly validated against band + budget.121- [ ] Totals are internally consistent (case totals sum to register/batch122 totals; disposed + held counts add up).123- [ ] No invented identifiers or contacts; missing required fields use the exact124 placeholder string and are listed where the schema asks.