Determination quarantine, resolution and the typed status vocabulary (epic &86)
- Context
- Scope
- Design
- Units — U-A → U-L, one MR
- U-A (w2) —
refactor(reference): prune determination status to written verdicts (#628) - U-B (w3) —
feat(signing): classify signature checks by exact kid (#2061) - U-C (w3) —
feat(snap): store and serve a determination’s signed bytes (#1984) - U-D (w8) —
fix(eligibility): split quarantined envelopes from determinations of record (#2061) - U-E (w3) —
fix(eligibility): verify a D-2c successor against SNAP’s signed bytes (#1984) - U-F (w3) —
refactor(medicaid,web): delete the determination requeue (#2061) - U-G (w8) —
refactor: type determination status at every boundary (#628) - U-H (w5) —
feat(eligibility): list, reverify and dismiss quarantined envelopes (#2061) - U-I (w5) —
feat(web): an operator worklist for quarantined envelopes (#2061) - U-J (w5) —
feat(xtask): refuse untyped determination verdict fields (#628) - U-K (w3) —
test(e2e): resolve a seeded quarantined envelope (#2061) - U-L (w3) —
docs: document determination quarantine and typed status (&86)
- U-A (w2) —
- Verification
- Documentation Updates
- Review log
Status: Done (2026-09-25) — !1515
Issues: #2061, #628, #1984 (epic &86)
Branches: fix/86-determination-quarantine (carries this page)
This is a Design + Scope plan. GitLab owns tracking, and the issues carry the briefs. The plan freezes when U-A starts. It ships as one MR, with one battery: the page and nav, U-A to U-L, and the Done flip. The three issues are one design: the vocabulary must exist before quarantine rows can be typed, and the lint guards both.
Erratum (2026-09-25): a chip dispatch is served by canopy-medicaid, which signs as medicaid (services/canopy-medicaid/src/main.rs:1138-1142), so D2’s verification and D3’s binding use the dispatch registry’s signing program (chip → medicaid, otherwise the program itself) while the trusted program column stays chip (the served-program gap is #2319). D3’s projection pin runs on the row as the INSERT returns it, inside the uncommitted transaction, so every database coercion is caught; a same-request duplicate in one response is EnvelopeConflict (duplicate_in_response); a signature holding a NUL is ContractViolation with no row.
Erratum (2026-09-25): D7’s adoption refusals follow the direct path’s codes: a signature check that fails (key_unknown, key_unavailable, signature_invalid, a malformed JWS) is SignatureQuarantined (retryable), while bytes that are not canonical or not an envelope (signature_malformed) and every provenance_rejected are ContractViolation (terminal). A successor carrying this case’s own signed operation_id is never skipped as foreign: a pin mismatch on it is provenance_rejected.
Erratum (2026-09-25): D6’s refusals grew as built: 409 anchor_unavailable (a signed effective-date basis whose claim anchor cannot be read), not_pending (the combined result holds no pending entry for the program), envelope_conflict / duplicate_in_response / unrepresentable_envelope (D3’s persist outcomes), 422 invalid_limit / partial_cursor / unknown_program (list-query validation); a recorded resolution answers 201 and a replay 200, and a replay refuses 409 superseded once something newer exists; the worker portal records a promotion back only on the 201.
Context
A program service signs its determination (ADR-002) and publishes its own completion event (enrollment, notices and renewals consume it). canopy-eligibility then verifies the envelope for its copy and the application record.
-
Quarantine is encoded twice. The interactive path overwrites the verdict with
status = 'signature_quarantined'(services/canopy-eligibility/src/orchestrator.rs:2467). The bulk path keeps it withsignature_verified = false, but overwrites the signedbasis(bulk/arm.rs:431,:823) and the claimed program, application, household and person with case values (:755-761). -
The stored row is not what was received. Columns coerce (
NUMERIC(10,2), microsecond timestamps:migrations/20260326000000_create_eligibility_tables.sql:25,:32). A quarantined row takes the claimed id’s primary key, so a tampered first landing blocks the genuine one (store/mod.rs:167-211). -
The verifier’s answer is lost. Both callers flatten the key-outage
Errand the mismatchOk(false)(orchestrator.rs:2427-2434,bulk/arm.rs:511-515), and the in-memory keys ignore the JWS kid (crates/canopy-signing/src/verifier.rs:89,:134). -
Success ignores what was persisted. On a conflict the interactive path discards the existing row (
orchestrator.rs:2602), and bulk writes a definitive result from the incoming envelope (bulk/arm.rs:726). The interactive path never compares the claimed application or household with the request. -
Reads disagree. Alerts and the portal drop unverified rows (
store/mod.rs:438-502,services/canopy-portal/src/home.rs:571-591).latest_per_programand case-status do not (store/mod.rs:284-312,:386-427). canopy-web prints "JWS verified" for any non-empty signature (services/canopy-web/src/determination_view.rs:1318). -
No resolution exists. The worker action posts to canopy-medicaid’s requeue, which rewrites a signed field on ANY row under a service token (
services/canopy-medicaid/src/api/cmd_handlers.rs:259-319, #2061). -
#1984. A D-2c adopted successor stays unverified forever (
bulk/arm.rs:642-651,:803-856). -
#628. Status is
Stringeverywhere, under several names (baseline_status,dry_run_status,preview_*_status,case_status,eligibility_status).DeterminationStatushas ten variants, and producers write three. No status column has a CHECK, and SNAP persists whatever status its ruleset emits (services/canopy-snap/src/determine.rs:1999-2003).
Rulings in force (maintainer, 2026-09-25):
-
The vocabulary is approved, denied and sanctioned. The other seven variants are real concepts that canopy already models elsewhere: denial reasons, the ABAWD clock, IPV cases, and the application, enrollment, appeal and verification lifecycles.
-
Resolution is reverify or dismiss. An order re-dispatch evaluates facts at legal-today (
crates/canopy-contracts-eligibility/src/orders.rs:24-45), so it would answer a different question. -
Every boundary is typed. T-MSIS keeps filing canopy-medicaid’s own
approvedrows (ADR-001: the program service’s row is the determination of record). -
Also in force: pre-1.0 with no compatibility shims; delete until wired; ADR-001 §B4; ADR-034 §3; verified attribution.
Scope
In scope: D1–D12. Out of scope (GitLab follow-ups, linked from the closing comment): the 42 CFR 435.952(a) review of discrepant information; a case-page quarantine banner; seed determinations with placeholder signatures; program services publishing before eligibility verifies (ADR-002 ordering); an order retry after a quarantine minting a new determination per attempt; application record-back with no ordering guard; SNAP overpayment replay rebuilding verdicts as approved.
Design
Decisions
Invariants
-
A determination’s status is the producing program’s signed verdict: approved, denied or sanctioned. No other token can be written (CHECK) or parsed (typed).
-
A determination of record stores the exact bytes that verified, and its columns re-canonicalize to them. Success is decided from the persisted row.
-
A quarantined envelope never shares a table or key with a determination of record.
-
Every resolution is serialized by the row’s revision and ledgered with a verified actor. A promotion re-evaluates no facts.
Units — U-A → U-L, one MR
Commit 1 is docs(plans): plan the determination quarantine and status vocabulary (&86). The last is docs(plans): close the determination quarantine plan (&86).
U-A (w2) — refactor(reference): prune determination status to written verdicts (#628)
Files: crates/canopy-reference/src/enums.rs, status_bucket, web record_back_outcome (services/canopy-web/src/api/applications.rs:2555-2600) and its dead arms, crates/canopy-contracts-applications/src/applications.rs:392-400.
Tests: a proptest that serde, Display, as_str and TryFrom agree, and that unknown tokens are refused.
U-B (w3) — feat(signing): classify signature checks by exact kid (#2061)
Files: crates/canopy-signing/src/{verifier,lib}.rs, plus both callers mapping SignatureCheck.
Tests: each D2 outcome with and without a provider; a known kid that fails verification is Mismatch in both cases.
U-C (w3) — feat(snap): store and serve a determination’s signed bytes (#1984)
Files: the snap D12 migration, determine.rs, store/{models,mod}.rs, the handler, services/canopy-snap/src/api/mod.rs (path pin +1), crates/canopy-contracts-snap/src/paths.rs.
Tests:
-
The served bytes equal the signed bytes and verify with SNAP’s key.
-
404 and 403.
U-D (w8) — fix(eligibility): split quarantined envelopes from determinations of record (#2061)
Files: the eligibility D12 migration and the quarantine table (open keyset index on (received_at, id)); quarantine.rs, orchestrator.rs, bulk/{arm,store}.rs, store/{mod,models}.rs, metrics.rs; contracts-eligibility determinations.rs and QuarantineReason; portal home.rs; seed model.rs, datagen.rs, sql.rs; orchestrator_dispatch_test.rs, alert_scoping_test.rs, bulk_ac6_test.rs.
Tests:
-
Each reason is persisted with its metric.
-
A tampered household or amount is quarantined, and its bytes do not verify. A binding mismatch →
provenance_rejected. -
A conflicting re-land →
EnvelopeConflict, with no definitive response and no cohort result. A same-bytes re-land succeeds. An unrepresentable envelope is refused. -
No quarantined envelope reaches a household read, alert or the portal.
U-E (w3) — fix(eligibility): verify a D-2c successor against SNAP’s signed bytes (#1984)
Files: bulk/arm.rs, orchestrator.rs (the envelope fetch).
Tests: a verified successor becomes of record and is ledgered adopted; a tampered one is quarantined and fails; a foreign one is skipped.
U-F (w3) — refactor(medicaid,web): delete the determination requeue (#2061)
Files:
-
D8’s files.
-
compliance/action-catalogue/medicaid.toml:act-on-change-redeterminerebinds to/cmd/ingest(ingest_cmd_update,services/canopy-medicaid/tests/cmd_reeval_e2e_test.rs).requeue-flagged-determinationis restated as the 435.952(a) review, and becomes a GAP incompliance/action-coverage-allowlist.tomlciting the follow-up filed here. -
The scenario
medicaid.verification.flagged-determination-requeuegainsblocked_byon that follow-up.
Tests: reporting tmsis_files_approved_determinations_and_filters_the_rest over DeterminationStatus::iter(); the web action sets.
U-G (w8) — refactor: type determination status at every boundary (#628)
Files: D10’s files and the CHECK migrations (D12).
Tests:
-
Per column, every variant round-trips and a raw
pendinginsert is refused. -
The KAT passes unchanged.
-
An unknown response status →
ContractViolation. -
SNAP refuses a missing
eligible, an unknown status, approved with ¬eligible, and denied with eligible. -
The web renders
sanctioned.
U-H (w5) — feat(eligibility): list, reverify and dismiss quarantined envelopes (#2061)
Files: claims.rs; the ledger migration; contracts-eligibility {paths,quarantine,events}.rs; eligibility api/quarantine.rs, store/quarantine.rs, services/canopy-eligibility/src/api/mod.rs; the test-lib client.
Tests:
-
The list is scoped, bounded and keyset-ordered. It excludes order, bulk, superseded and dismissed rows.
-
A
key_unavailablerow reverifies once the key resolves: it becomes of record,combined_resultsmoves the program, the event is staged, and a repeat returns the same result. -
Refusals: superseded, in flight,
provenance_rejected, blank note, service bearer, caseworker. -
services/canopy-eligibility/tests/quarantine_concurrency_test.rs: dismiss against dismiss, reverify against dismiss, and a failed reverify against dismiss each yield exactly one success and one ledger row per revision.
U-I (w5) — feat(web): an operator worklist for quarantined envelopes (#2061)
Files: ops_quarantine.rs, its template, services/canopy-web/src/api/mod.rs, actions.rs, session.rs, determination_view.rs, _det_meta.html, xtask/src/cmd/route_authz.rs.
Tests:
-
A non-operator → 403; out of scope → 403; a failed exchange → a fragment.
-
Dismiss → 303 with its notice. A promotion records back.
-
is_determination_operator⇔DETERMINATION_OPERATOR_ROLES. -
The chip’s three states.
U-J (w5) — feat(xtask): refuse untyped determination verdict fields (#628)
Files: D11, docs/modules/ROOT/pages/testing.adoc, docs/modules/ROOT/pages/tooling/xtask-catalog.adoc.
U-K (w3) — test(e2e): resolve a seeded quarantined envelope (#2061)
Files: the seed (one interactive quarantined Medicaid envelope, reason signature_malformed), tests/e2e/lib/seed.ts, the new tests/e2e/specs/worker-portal-quarantined-determinations.spec.ts, and worker-portal-medicaid-actions.spec.ts.
Tests: a supervisor reverifies (it stays quarantined), then dismisses (303, the notice, the row is gone); a caseworker gets 403.
Verification
-
cargo nextest runover the crates listed in the units. -
cargo xtask dev refresh, thencargo xtask test --integration --host --no-refresh --skip-static --run-ignoredfor canopy-eligibility, canopy-snap, canopy-medicaid, canopy-renewals, canopy-web and canopy-reporting. -
cargo xtask e2e(it reseeds): the new spec and the Medicaid actions spec. -
determination-status-lint,route-authz,policy action-coverage,scenarios audit,neutrality-lintandapi-docs --update, thengit push. The battery is the gate.
Documentation Updates
-
ADR-002 Amendment 5: two tables, exact bytes, trusted routing, the verifier’s classes, the ledger, D-2c.
-
api/canopy-{eligibility,snap,medicaid,web}.adoc;data-models/canopy-{eligibility,snap,renewals}.adocand the CHECKs on the other data-model pages. -
authorization-inventory.adoc,rbac-matrix.adoc,guide/caseworker.adoc:205-210,guide/supervisor.adoc. -
CHANGELOG.adoc:-
Changed: the tables split; status is typed and pruned; the requeue is deleted; SNAP verdicts are strict; delete cutovers.
-
Added: the endpoints, SNAP’s envelope read, the worklist, the metric.
-
Fixed: the TANF time-limit claim at
CHANGELOG.adoc:2170.
-
-
GitLab: file the out-of-scope follow-ups.
Review log
| round | vendor | resolved model | verdict |
|---|---|---|---|
1 (2026-09-25) |
Anthropic |
claude-opus-5-5 |
no-ship — seven blockers fixed in revision 2 (the wipe remedy, cohort re-arm, re-land equality, dismiss compare-and-set, |
2 (2026-09-25) |
OpenAI |
gpt-6-astra |
no-ship — 13 findings fixed in revision 3: revision-serialized resolutions; trusted routing apart from claimed bytes; exact signed bytes instead of coercing columns; success from the persisted row ( |