Plan: Below-Floor Backpay via the Import Path (#1115)

Archive record

Merge requests: !1533 (the plan page, v2, Relates #1115) + !1536 (v3 approved with ADR-072, Relates #1115) + !1561 (U-LE, Relates #1115; it also carried #1644’s unrelated plan archive) + !1831 (the resumption: the as-built corrections and the 2026-10-07 rulings, Relates #1115) + !1838 (U1, Closes #2223) + !1839 (U2, Closes #2224) + !1840 (the run-time floor re-check, Closes #2228) + !1841 (U-AUTHZ, Closes #2225) + !1842 (U3, Closes #2226); the close-out !1843 (U4, Closes #2227 and #1115)

2026-10-08 — v3 approved in plan mode 2026-08-31 after an internal round 1 (no-ship, 42 findings over this plan and its hard-checks pair, folded into v2), the maintainer’s round 2 (no-ship on v2, 44 findings folded into v3; ship on v3) and the G-A gate (F0 / F1, ADR-072); frozen at U-LE (2026-09-02), resumed 2026-10-07 with the maintainer rulings on #1115 as errata (rulings 1–3, F-1–F-3, F1, F-A, F-B, G-B). What landed: late enrollment ruleset-decided (U-LE: the late_enrollment decision of the subsidy-eligibility consult, Georgia accepting; the store waives its floor only for a re-checked LateEnrollmentWitness; ADR-055 § Amendment (2026-09-02, #1115 U-LE)); the seam and the ledger (U1: the generator’s child-month decision extracted into the judgment-only child_month_judgment, which generation calls too; backpay_batches with the reconcile floor frozen as floor_month, backpay_records with staged_by, the judged row frozen as canonical_payload + canonical_hash, typed blockers and one ADR-074 provenance pair per act; stage refuses any live subsidy row on the child-month, naming it; supersede refuses while a payment references the record, naming the void for an undisbursed one and a payment adjustment for a disbursed one); the finalize engine (U2: the gate refuses a finalizer who staged a staged or materialized record of the batch, then checks the count, the key checksum and the reviewed content checksum; one transaction per record re-judges the month under the seam’s locks and pays through the generator’s persist_backpay_payment with financial.payment_created in that transaction, or flips the record diverged; settle answers finalized only when every manifest key materialized; the BLOCKING invariant subsidy_backpay_bounds); the run-time floor re-check (#2228: the reconcile drain retires a queued month below its run’s floor, and a generation job whose month fell below it fails with nothing written); the routes (U-AUTHZ: seven routes under /v1/financial/backpay/; the unit-bearing subsidy_backpay (stage, supersede) and the unit-less subsidy_backpay_batch (create_batch, read, finalize, abort), admin-only as shipped; the knob first on every write; the backpay_finalize consent job; both late-enrollment floor refusals name POST /v1/financial/backpay/batches, meeting #1115’s AC-2); the operator surface (U3: cargo xtask backpay stage / show / finalize / supersede / abort, finalize confirming the printed content checksum; two read-only craig-web pages; a Playwright spec that stages and finalizes as two operators); the record (U4: ADR-057 § Amendment (2026-10-08, #2227), backpay as the second import-class act). G-B (2026-10-08): the default-OFF CRAIG_FINANCIALSUBSIDY_BACKPAYENABLED is a standing capability, and each finalize is the per-batch consent. The authority floors are ⁂ readings on #1073. One close-out erratum: a superseded month re-stages in its own batch while that batch is staging. Follow-ups outside the epic: #2229 (an operator remedy for a wedged finalizing batch) and #1942 (cross-replica pickup for consent jobs).

Status

Done (2026-10-08) — !1843

Units

Unit Description

F0

RULED (2026-08-31, ADR-072): enrollment refusals RELAX — create/activate ACCEPT late enrollments and record TRUE coverage; pre-floor months stay generator-unreachable and payable only via the explicit backpay act. The accept-or-refuse posture is a RULES-ENGINE arm (U-LE), never a source edit; the reconcile floor itself stays source (tier-3 safety invariant — automation never mints months older than current − 12 in ANY jurisdiction). Carries an ADR-055 amendment + consent text + a pre-1.0 Changed CHANGELOG entry

F1

RULED (2026-08-31, ADR-072): BOTH the stage and finalize authority floors are JURISDICTION-CONFIGURED, fail-closed when unconfigured — no part of CRAIG presupposes an administrative-unit design (finding 20 killed the "county-shaped staging" residue). The seam is the authority program’s; no new hardcoded floor is ever added

G-A

Gate: F0 + F1 + the month-judgment design. Fork rulings recorded; the v3 rework passed the round-2 external review (Review log)

U-LE

NEW (findings 7/17): the late-enrollment policy arm. The <j>-subsidy-eligibility ruleset (shared with hard-checks U2) gains decision late_enrollment: inputs { program, months_before_floor: int }, output { accept: bool } — served by the SAME single per-request evaluation as the age decision (hard-checks §U2: one graph, two decision tables, one budget slot; the late table’s first arm is the universal on-time row months_before_floor == 0 → accept, so an absent late arm can never refuse on-time enrollment, finding 17). WHO consults: the HANDLER, pre-tx (no HTTP ever runs inside an open domain tx), computing months_before_floor via ONE shared floor fn exported from the store (the same derivation validate_create_active (store.rs:1964, its floor at :1990) and check_activation_date_window (store.rs:3104, its floor at :3123) use today — single source, no duplicated arithmetic). The STORE keeps its floor checks as defense-in-depth: a below-floor coverage start refuses with the EXISTING typed errors UNLESS the tx params carry a LateEnrollmentWitness — a struct with a pub(crate)-in-the-api- module constructor carrying evaluation_id + rule_set_revision
months_before_floor
, persisted on the act (honest claim: crate-visibility discipline plus persisted provenance, not cryptographic unforgeability). Arm absent OR accept=false → the existing refusals, byte-identical (fail-closed default = today’s behavior). GA arm: accept (⁂ #1073); citations rows ride this unit. Landed 2026-09-02; the as-built deviations are in Errata

U1

The judgment-only seam, the substrate, stage. Seam (ruling 1, 2026-10-07): the generator’s child-month DECISION — lock_child_payment_exclusion → perdiem_overlap_exists → child_overlapping_agreements (FOR UPDATE) → per-agreement expected_month_row → arbitrate_month, inline today in process_child_tx (generator.rs:776–831) — is extracted into ONE fn child_month_judgment that locks and reads but writes nothing, returning the arbitrated per-agreement decisions plus the child-month’s live (non-voided) subsidy rows. The writers (reconcile_foreign_rows :1314, apply_month_decision :1037 and all beneath them) stay in the generator, which calls the seam, then its writers; process_child_tx and its drain caller (drain_one_pair) keep their behaviour, every existing generator test unedited (the foreign-row reconcile after the judgment is order-neutral: it touches only agreements the overlap scan did not return, and expected_month_row reads no payment row). U2 reuses the seam. Substrate: backpay_batches + backpay_records mirroring the PROVEN #1071 shapes (20260725090000_subsidy_import_ledger.sql; finding 16 fixes folded): batches carry status IN ('staging','finalizing','finalized','aborted'), expected_count (1..50000 CHECK), manifest_checksum (sha256-hex CHECK; framing = the sorted record_key \n lines, record_key = agreement_id:payment_month — completeness only: a client cannot compute the stage-computed canonical_hash at create, so the price binding rides the finalize request, U2; ruling F1), floor_month DATE NOT NULL — the reconcile floor FROZEN at batch creation from store::reconcile_floor on the jurisdiction business date (finding 15); records carry agreement_id, payment_month, staged_by TEXT NOT NULL (the staging actor — the stager≠finalizer data source), canonical_payload JSONB (the STAGE-COMPUTED priced row — the REQUEST carries only the two keys; the LEDGER freezes what the judgment computed), canonical_hash, status IN ('staged','rejected','materialized','diverged','superseded') — rejected = stage-time validation refusal (typed blockers persisted); diverged = FINALIZE-time judgment mismatch (the diff persisted in blockers; no payment exists) — plus a materialized-shape CHECK, and ONE ADR-074 provenance pair PER AUTHORIZED ACT (each authority_rule_set_id UUID + authority_revision BIGINT, all-or-none CHECK, the 20260912140000 shape): stage stamps the unprefixed pair, supersede a superseded_ twin, finalize (U2) a finalized_ twin — U1 creates all three. The stage and supersede store fns take the resolved ApprovedAction (BackpayStage / BackpaySupersede, resolved-only, approvals.rs:131–142) and re-check covers under the row lock. The payment↔record link is ONE-directional: payments.backpay_record_id (FK, UNIQUE); records carry no payment_id (no dual write to diverge). Identity: PARTIAL UNIQUE on (agreement_id, payment_month) WHERE status IN ('staged','materialized','diverged') — a diverged record HOLDS the pair until explicitly superseded. Correction (Design § Corrections): SUPERSEDE is STORE-GATED — the typed 409 while any non-voided payment references the record (an undisbursed one is voided first through the existing void; a disbursed one never is — the manual void refuses it, typed 400 disbursed-payment-void — so the 409 names the payment-adjustment path) — and its own authority action; diverged records (no payment) supersede freely; then re-stage in a NEW batch (the chain is the evidence). Stage validation = the seam’s judgment (a Full/Partial row for THIS agreement)
payment_month < floor_month + the cutover guard + NO live subsidy row on the child-month (ruling F-1: any live subsidy row refuses stage typed, the refusal NAMING that payment — the seam never voids). Replay is checked first, so a record’s own materialized payment is the replay case, never the F-1 refusal: replay answers from the live record by hash compare (staged → AlreadyStaged; materialized+match → AlreadyImported-from-record with ORIGINAL facts; mismatch → typed conflict). The G-B knob’s settings land here (see G-B)

U2

FINALIZE, reusing U1’s child_month_judgment unchanged (the extraction moved into U1, ruling 1). The engine mirrors #1071’s (import_batch/finalize.rs): manifest-gate (the manifest_gate shape: zero rejected, staged+materialized == expected, recomputed key checksum equal, and the finalize request’s content_checksum — sorted (record_key \0 canonical_hash \n) pairs over the live records the finalizer reviewed — recomputed from the records and equal, so a record superseded and re-staged after the review is never paid at an unreviewed price; ruling F1) inside enter_finalizing; then one tx per record under the seam’s child lock — re-checks the BackpayFinalize proof by key (the import’s per-record re-check), re-runs the FULL judgment, byte-compares the judged row against the frozen canonical_payload (a divergence, or a live subsidy row on the child-month → the record flips diverged with the diff persisted; the batch continues), enforces payment_month < floor_month again, and inserts through a GENERATOR-OWNED writer (generator.rs owns every subsidy-origin payments write, :6–11): the insert_subsidy_payment shape plus payments.backpay_record_id (FK, UNIQUE — one payment per record; batch derivable via the record), staging financial.payment_created in the SAME tx (generator parity, finding 25) and stamping the finalize provenance twin on the record. A per-batch session lease (the subsidy-import-finalize:<batch_id> shape, finalize.rs:103) and the per-record JobBoundary check mirror finalize.rs. Settle (mirrors #1071’s): staged remain → batch stays finalizing (the next pass resumes); diverged > 0 && staged == 0 → batch returns to staging (operator supersedes/re-stages, then re-finalizes; the manifest re-verifies over the new live set); zero staged, zero diverged and every manifest key materialized → finalized + the counts-only summary event, else (a key superseded off while finalizing) back to staging, no summary (ruling F-B). BLOCKING invariant subsidy_backpay_bounds (a catalog file under crates/craig-test-lib/sql/invariants/craig-financial/, listed in BLOCKING_INVARIANTS, xtask/src/cmd/invariants.rs): a backpay-provenance payment’s month is < its batch’s floor_month AND (cutover absent OR month ≥ cutover) AND agreement-armed

U-AUTHZ

NEW (finding 26): the operational contract. Authz (rulings 3 and F-2): operation-discriminated, on TWO new resource types (the variant pin, craig-authz types.rs:707, 58 → 60), each with GA + TX {j}-authz-<type>.json in the subsidy_import shape — a leading service-principal DENY, ONE admin allow naming the type’s operations, default deny; admin-only is the SHIPPED DEFAULT and source names no jurisdiction (ADR-072). RECORD acts authorize the unit-bearing ResourceType::SubsidyBackpay (subsidy_backpay: stage, supersede): its ref carries the agreement’s attrs.admin_unit through ONE builder fetched before the check (ADR-077 D5; SubsidyBackpay joins UNIT_BEARING_TYPES, validate_authz_coverage.rs:178, 10 → 11; a NULL unit = key absent), so each jurisdiction’s rows decide whether a role consults it. BATCH-WIDE acts authorize the separate ResourceType::SubsidyBackpayBatch (subsidy_backpay_batch: create_batch, finalize, abort, read — the batch read and the list): admin-only with no unit attribute, recorded here as an exception to unit scoping (a batch spans agreements). It stays OUTSIDE UNIT_BEARING_TYPES, so the coverage gate’s unit rule never inspects its refs (validate_authz_coverage.rs:706–714) and no nil-id marker or census entry is involved: finalize, abort and the batch read carry the real batch id, create and the list Uuid::nil() (the import_resource_ref create precedent, subsidy_imports.rs:247–266; imports have no batch list, and SubsidyImport is outside the set too). A nil-id marker cannot serve these refs: over a real id the gate fails it (MarkerOnRealId, validate_authz_coverage.rs:670). STAGER ≠ FINALIZER is enforced by U2’s gate from the records' staged_by (ruling F-A); U-AUTHZ maps its typed refusal FinalizerStagedRecords (409-class). Authority floors: each authorized act mints its proof pre-tx through subsidy_shared::resolved_proof (BackpayStage / BackpaySupersede / BackpayFinalize; GA county / county / state, ⁂ #1073), the ADR-074 503 / 403 / 500 / 400 / 409 map unchanged. Handler order (the import precedent): knob FIRST → garde → authz → require_subsidy_writes (#2207, subsidy_shared.rs:151) → proof (stage, supersede, finalize) → tx. Routes + DTOs (craig_financial_contracts::subsidy_backpay): POST /v1/financial/backpay/batches (create: {client_request_id, expected_count, manifest_checksum} → batch view incl. the frozen floor_month); POST /batches/{id}/records (stage: {agreement_id, payment_month} → disposition + the frozen priced-row view); POST /records/{id}/supersede (store-gated, see U1); POST /batches/{id}/finalize — a 202 ENQUEUE of the backpay_finalize CONSENT job on craig_api::jobs (the import_finalize precedent, #1938): body \{client_request_id, content_checksum} (ADR-062, both required; the checksum rides the job input to U2’s gate) → Location + JobView; the proof rides the ProofStash, never the row; enter_finalizing runs inside the claim tx; one active job per batch (a second → 409 job-already-active); the attempt re-checks the knob (failed(refused_at_start)); result = the last pass’s settle report; crash / lost_proof leave the batch finalizing and a fresh-id re-POST resumes per record (cross-replica pickup is #1942); three barren passes → failed(no_progress); POST /batches/{id}/abort (the #1071 shape: refused once finalizing); GET /batches, GET /batches/{id} (ledger views). Progress telemetry (per-chunk counts); the deployment guide’s background-jobs table + a stuck-finalizing runbook entry. Late-enrollment refusal (ruling F-3): this unit, the one that makes finalize live, makes both floor refusals name the backpay route POST /v1/financial/backpay/batches: the create refusal (validate_create_active, store.rs:1998–2001), which names no path today, gains it, and the activate refusal (TransferBeforeReconcileFloor, error.rs:208–211), which already names the #1115 backpay path, gains the route. That meets #1115’s AC-2. The live leg’s stage replay answers AlreadyImported after finalize (AlreadyStaged before it, a separate leg). G-B is ruled (2026-10-08) and no longer gates this unit’s merge

G-B

Money-consent ruling — RULED 2026-10-08 (maintainer, on #1115): Option B, a standing capability; it no longer gates U-AUTHZ’s merge. CRAIG_FINANCIALSUBSIDY_BACKPAYENABLED, default OFF, gating EVERY write incl. stage, lands in U1 as a typed settings group beside SubsidyImportSettings (craig-common settings.rs:1328) with its consent text in the configuration reference and a tests/e2e/knob-projects.toml entry; every backpay write route calls it FIRST and the finalize attempt re-checks it (U-AUTHZ; the require_import_enabled + IMPORT_KNOB precedent), so no writer is ever reachable un-gated. The ruled text: the configuration reference and the deployment guide

U3

Surfaces: cargo xtask backpay (stage / finalize; device-code OAuth; finalize reads the batch’s live records, shows the operator their priced rows, computes content_checksum over what it showed, then is ONE POST and a poll of the job through the shared job_poll — the import-subsidy-history precedent since #1938), read-only ledger views in craig-web’s subsidy surfaces (job state through the _job_status.html partial), runbook section

U4

Close-out: ADR-057 §Amendment (backpay as the second import-class act); CHANGELOG; cargo xtask plan-lint --done; plan → Done

Anchor: #1115 · Epic: &102
Branches: feat/1115-<unit>-<slug>
Sequencing: U-LE (landed 2026-09-02); U1 (seam + substrate + stage + the G-B knob settings) → U2 (the finalize engine) → U-AUTHZ (routes, authz, the finalize job, the reworded floor refusals; G-B ruled 2026-10-08) → U3 → U4
Scale: U-LE M, U1 L, U2 M, U-AUTHZ M, U3 S, U4 S

Errata

  • Erratum (2026-09-02, U-LE as built; moved from its status cell on 2026-10-07): as designed, plus: the witness is a pub type with PRIVATE fields (the store’s pub params must name it; external callers can only pass None) constructed at ONE site from the verdict; the store re-checks the witness’s month count against its own recomputation (stale = absent); the activation leg is pinned at the store/unit level because the API derives transfer_on from the placement’s end date, which the placement API stamps as "now" (no API fixture can produce a below-floor transfer); ADR-055 § Amendment (2026-09-02) carries the record; ruleset v1.1.

  • Erratum (2026-09-18): the Batch class is gone (#1571, retired at #1940) — finalize lands as a background job on craig_api::jobs (202 + poll; the import_finalize consent-kind precedent, #1938), never a ceiling class. (Moved from the U-AUTHZ row on 2026-10-07; that row now states the job contract.)

  • Erratum (2026-10-07, ruling 1 on #1115): a judgment-only seam (child_month_judgment) is extracted INSIDE U1 and writes nothing; reconcile_foreign_rows and apply_month_decision stay in the generator; U2 reuses the seam. Corrected: U1, U2, Design § One judgment, Sequencing, Scale (this also resolves U1’s stage check naming "U2’s seam" while U1 ran first).

  • Erratum (2026-10-07, ruling F-1 on #1115): staging refuses a child-month that already has a live subsidy row, and the typed refusal names that payment (the seam never voids); consequently a record whose child-month gains a live subsidy row after staging diverges at finalize. Corrected: U1, U2, Design, Verification.

  • Erratum (2026-10-07, ruling 2 on #1115): a disbursed backpay month is corrected through the payment-adjustment ledger and supersede serves undisbursed months only — the manual void refuses a disbursed payment (typed 400 disbursed-payment-void) and the kept #2185 trigger backstops a raw UPDATE. Corrected: U1, Design § Corrections, Verification.

  • Erratum (2026-10-07, ruling 3 on #1115): the record-level subsidy_backpay ref carries the agreement’s admin_unit (ADR-077); admin-only is the shipped default; source names no jurisdiction (ADR-072). Corrected: U-AUTHZ.

  • Erratum (2026-10-07, ruling F-2 on #1115; mechanism corrected the same day): batch-wide acts (create, list, the batch read, finalize, abort) are admin-only with no unit attribute, an exception to unit scoping, and authorize the separate non-unit-bearing subsidy_backpay_batch type carrying the real batch id where one exists — the drafted nil-id marker cannot work on refs that carry a real batch id (MarkerOnRealId). Corrected: U-AUTHZ, Verification.

  • Erratum (2026-10-07, ruling F-3 on #1115): the late-enrollment floor refusals name the backpay path in U-AUTHZ, the unit that makes finalize live; until then their text stays byte-identical (U-LE’s contract). Corrected: U-AUTHZ, U4, Sequencing, Verification.

  • Erratum (2026-10-08, G-B ruling on #1115; it closes ruling 4’s open gate of 2026-10-07): G-B is Option B, a standing capability. Enabling the knob is the jurisdiction’s recorded decision that months the reconcile floor makes unreachable are paid only through the staged-and-finalized backpay act, flipped through change-controlled configuration authorized by the office holding the finalize floor; OFF is the kill switch. Each finalize is the per-batch consent (the BackpayFinalize floor, a finalizer who staged none of the batch’s staged or materialized records, the reviewed content_checksum); no consent reference and no migration (Option C rejected). G-B no longer gates U-AUTHZ’s merge. Corrected: G-B, U-AUTHZ, Sequencing.

  • Erratum (2026-10-07): finalize is the backpay_finalize consent job — body {client_request_id}, 202 + JobView, not "no body → settle report"; lease, crash and stall semantics are the jobs runtime’s. Corrected: U-AUTHZ, Verification.

  • Erratum (2026-10-07): every backpay write passes require_subsidy_writes (#2207) after authz. Corrected: U-AUTHZ, Verification.

  • Erratum (2026-10-07): each authorized act — stage, supersede, finalize — mints its proof through resolved_proof, the store re-checks it by key in-tx, and the record carries one ADR-074 provenance pair per act. Corrected: U1, U2, U-AUTHZ.

  • Erratum (2026-10-07): the knob is a handler gate plus the attempt re-check (the import precedent), not a store guard: U1 lands the settings and consent text; U-AUTHZ’s routes call it. Corrected: G-B.

  • Erratum (2026-10-07): eligibility.evaluated never touches a subsidy row; the stage-to-finalize race is an agreement status or terms change. Corrected: Verification.

  • Erratum (2026-10-07): the F0 refusal-path record landed with U-LE (ADR-055 § Amendment 2026-09-02), so U4 no longer carries it. Corrected: U4.

  • Erratum (2026-10-07): code references re-pointed to the as-built lines; branches take the feat commit-type prefix. Corrected: Context, Branches.

  • Erratum (2026-10-07, U1 as built): the seam reads the child-month’s live subsidy rows with one extra SELECT after arbitration, and the generator ignores the result (reconcile_foreign_rows keeps its own read). The only observable generator delta is log order: arbitration’s anomaly WARN now precedes the foreign-row WARNs within a child pass.

  • Erratum (2026-10-07, U1 as built): rejected records carry no canonical payload or hash. A rejected record is never finalized, so nothing is frozen; its typed blockers are the evidence. The payload pair is all-or-none and required on staged, materialized and diverged. Replay of a staged or materialized record compares the fresh judgment’s hash: equal answers AlreadyStaged or AlreadyImported, unequal or no-longer-payable answers the typed JudgmentMoved. A pair staged by another batch answers BatchConflict, and a diverged record answers RecordDiverged.

  • Erratum (2026-10-07, ruling F1 on #1115): the batch’s manifest_checksum frames the sorted record keys only (completeness), since a client cannot compute the stage-computed canonical_hash at create; the finalize request carries a content_checksum over the live records' (record_key, canonical_hash) pairs the finalizer reviewed, and U2’s gate refuses on a mismatch. Corrected: U1, U2, U-AUTHZ, U3, Verification.

  • Erratum (2026-10-07, U1 as built): the supersede act also records superseded_by and superseded_at beside its provenance twin. A staged record whose batch left staging refuses supersede. The finalize pair is required on materialized records and allowed on diverged ones (U2 decides).

  • Erratum (2026-10-08, ruling F-A on #1115): stager ≠ finalizer is enforced in U2’s gate, not U-AUTHZ: under the batch row lock, after the proof re-check, both the staging arm (before the manifest legs) and the finalizing resume arm refuse a finalizer who staged a staged or materialized record of the batch with the typed FinalizerStagedRecords (the record ids); nothing flips, nothing resumes, and U-AUTHZ maps the refusal (409-class). Corrected: U-AUTHZ.

  • Erratum (2026-10-08, ruling F-B on #1115): finalized means every manifest key was materialized: settle sends a batch with nothing staged or diverged but fewer materialized records than expected_count (a key superseded off while finalizing) back to staging with no summary. As built at the close-out, a superseded record’s agreement-month therefore stages again in its own batch while that batch is staging (where a diverged record’s batch returns), else in a new batch, and the RecordDiverged refusal says "stage the month again"; U1’s and Design § Corrections' "re-stage in a NEW batch" read as this sentence. Corrected: U2.

  • Erratum (2026-10-08, U2 as built): the finalize pair is stamped on both outcomes, materialized and diverged (the diverged flip is a write under the BackpayFinalize proof); the finalize diff adds judged_row_changed (one per changed field) and canonical_hash_mismatch (a frozen payload that no longer hashes to its canonical_hash diverges its record: the Verification "malformed canonical payload" refusal) to the stage tokens; each record’s transaction locks the batch row first, then the seam’s locks, then the record, and writes a divergence in that same transaction.

  • Erratum (2026-10-08, U2 as built): the gate’s manifest legs run only when a batch leaves staging (while it is finalizing, stage refuses and no staged record can be superseded), and both checksums cover the batch’s staged and materialized records; the summary event is financial.subsidy_backpay_batch_finalized {batch_id, expected_count, materialized, superseded} (counts only); subsidy_backpay_bounds reads "agreement-armed" as: the live payment’s agreement and month equal its record’s, and the record is materialized (ruling F-D).

  • Erratum (2026-10-08, flag F-C on #1115, fixed by #2228): the floor held at enqueue only; the reconcile drain now retires a queued month below its run’s floor (counted, never generated, nothing voided) and a subsidy_generate job whose month is below the floor of its attempt’s business date fails engine_failed (below_reconcile_floor) with nothing written. Corrected: Design.

  • Erratum (2026-10-08, U-AUTHZ as built): the ApiDoc derive moved to src/api/openapi.rs, keeping api/mod.rs under B1 (U-4); import_finalize and backpay_finalize share one pass loop, jobs::passes (U-5); abort, only while staging, flips staged and rejected records to superseded (superseded_by NULL) and never unpays (U-7, U-14); GET /batches/{id} carries a keyset page of records (after, limit), the read U3 checksums (U-8); the finalize intent is \{batch_id, content_checksum}, so a changed checksum under one id is 409 idempotency-conflict (U-9); the live stage replay after finalize answers AlreadyImported (U-1); the devstack separation legs restamp staged_by by SQL, a documented constructed state (U-2); five new problem types (backpay-judgment-moved, backpay-record-diverged, backpay-supersede-void-first, backpay-month-disbursed, backpay-finalizer-staged) beside the reused manifest-mismatch, batch-state and batch-conflict (U-6).

  • Erratum (2026-10-08, U3 as built; the rulings on the U3 contract’s flags, #2226): the tool covers every backpay act, so the subcommand set is stage (create-or-resume), show (the full review and the content checksum, no POST), finalize, supersede and abort; finalize confirms by the operator typing the checksum’s first 12 hex characters or by --expect-checksum (no --yes), refuses locally (unverified, refusal-only) when the session staged a reviewed row, and prints the ?job=<id> deep link to the web batch page; craig-web’s two read-only pages add no BFF role layer (the backend ruleset decides; the nav link sits under is_admin()) and depend on craig-financial-contracts; the e2e spec creates a per-attempt Keycloak stager and finalizes as a second operator. Corrected: none (the U3 row’s "stage / finalize" reads as this line).

Context

The M1 reconcile floor (ADR-055 F2) makes months below current − 12 unreachable by every generation path — deliberately: background machinery must never conjure old money. The floor lives ONLY at queue-enqueue (enqueue_reconcile_months store.rs:3516) and the two creation validators (store.rs:1990, :3123), which read it through store::reconcile_floor (store.rs:293) — the fn backpay freezes from, single-sourced by the hard-checks program’s U2 (store.rs:1987); expected_month_row (generator.rs:876) itself knows nothing of it — which is exactly why backpay must enforce the frozen floor itself (finding 15). The 2026-08-21 steer fixed the mechanism (import-path reuse); the 2026-08-31 rulings fixed which months exist (F0: late enrollment records true coverage) and who consents (F1: configured authority).

The program resumed 2026-10-07; the maintainer rulings of that day on #1115 are recorded in Errata. The authority seam the remaining units consume is operational (ADR-074, epic &86, 2026-09-12): per environment, the administrative-authority family is bootstrapped (cargo xtask rules-bootstrap) before any backpay act can mint a proof.

Design

One judgment, three moments — now with the RIGHT judgment. Stage validation, the finalize re-check, and the materialized row are all products of the SAME extracted seam (child_month_judgment, U1): child lock → per-diem overlap → overlapping agreements under row locks → per-agreement expected_month_row → arbitration. It judges and writes nothing; the foreign-row reconcile and every writer stay in the generator (ruling 1). Reusing the whole composition is what absorbs sibling agreements, multi-program demotion, per-diem exclusivity, cutover bounds, proration, and coverage windows — bare expected_month_row absorbs only the last four (finding 14). A month stages only if the seam judges a Full/Partial row for THIS agreement and the child-month carries no live subsidy row (any live subsidy row refuses, naming that payment — ruling F-1; the seam never voids); the computed row freezes as the record’s canonical payload; finalize re-judges in the record’s tx and fails the RECORD on any divergence, never the batch.

The floor is data on the batch. floor_month freezes at batch creation; stage and finalize both enforce payment_month < floor_month. Months at-or-above the frozen floor belong to the generator/reconcile — typed refusal. Because the live floor only advances and every generation run re-reads it at start (the drain retires a queued month below it; a job whose month fell below it while queued is refused, #2228), a frozen below-floor month never enters a run that starts after the floor passed it; a finalize that crosses a month boundary keeps its frozen floor (finding 15).

Wire-supplied amounts stay unrepresentable: the staging request carries (agreement_id, payment_month) only; the LEDGER’s canonical payload is what the judgment computed at stage time (finding 16’s wording fix — the payload is frozen EVIDENCE, not wire input).

Corrections (ruling 2): an UNDISBURSED backpay payment (pending / approved) is voided through the existing lifecycle → the record flips superseded (evidence chain intact) → re-stage in a NEW batch under the live-pair partial unique. A DISBURSED one (issued / cleared) is never voided or rewound: the manual void refuses it with the typed 400 disbursed-payment-void (services/craig-financial/src/api/payments_void.rs:47–48, reached through the status filter in void_payment_manual, which voids only pending / approved, store/payments.rs:300), and the #2185 trigger (20261006120000_payment_history_guards.sql) only backstops a raw UPDATE. It is corrected through the payment-adjustment ledger (POST /v1/financial/payments/{id}/adjustments, then approve), the path every disbursed payment uses; its record stays materialized and the adjustment on the payment is the evidence. Reconcile cannot regenerate below the floor, so these are the only correction paths; recorded.

Verification

Findings-27 matrix, all as named tests: per-refusal typed pins (at/above frozen floor, below-cutover, per-diem-covered month, sibling-agreement month, multi-program demotion, outside-coverage, a live subsidy row on the child-month — this agreement’s or another’s, the refusal naming that payment, replay identity per disposition); floor edge — batch created in month M, finalized in M+1 (frozen floor holds); every existing payment status against a colliding month; cross-batch same-pair race (partial-unique loser typed); the seam extraction (every existing generator and drain test green, unedited); correction chains — undisbursed (void → supersede → re-stage → finalize) and disbursed (supersede refused with the typed 409 naming the adjustment path; an approved adjustment corrects the net; a direct API void refused with the typed 400 disbursed-payment-void by payments_void.rs, via the status filter in void_payment_manual — the #2185 trigger only backstops a raw UPDATE); manifest mismatch (each gate leg, the finalize content_checksum included); knob-off on EVERY writer incl. stage, plus the finalize attempt’s failed(refused_at_start); require_subsidy_writes closed → its typed 400 on every writer; authority unconfigured → fail-closed refusal; the provenance pair persisted per act; authz on both types (admin allowed per named operation; non-admin, service principal and an unnamed operation denied; the record refs carry the agreement unit, an unstamped agreement leaves the key absent; the batch refs carry none and validate-authz-coverage stays green with the census unchanged); stager==finalizer refused; malformed canonical payload (hash mismatch) refused; financial.payment_created exactly-once per record (incl. crash-resume replay); same-record double-finalize race; competing agreement created between stage and finalize (divergence fails the record); finalizer contention (a second enqueue while one is queued or running → 409 job-already-active; a peer holding the lease → waiting_for_lease; after crash / lost_proof a fresh-id re-POST resumes per record); a boundary cut or a per-record infra error leaves the row staged, three barren passes → failed(no_progress); supersede-refused-while-payment-live (the typed 409; then void → supersede succeeds); an agreement status or terms change committed between stage and finalize (the judged row diverges → diverged, never a silently different payment — the event-before-issuance race class; eligibility.evaluated cannot cause it: subsidy rows are never IV-E, store/payments.rs:413); the U-LE legs (on-time evaluates the combined consult but can never be late-refused; arm-absent refuses late byte-identically until U-AUTHZ; accept persists the witness; replay-after-accept); U-AUTHZ’s reworded create and activate floor refusals name the backpay path. Plus the BLOCKING invariant probes and the e2e ledger views. Every unit: full battery + contextless J-review.

Out of scope (recorded)

  • Any generator-floor change; the floor stays source (ADR-072 tier 3).

  • Backpay web FORMS (xtask + API first; read-only views only).

  • Hard-checks' units (its own plan; U-LE’s ruleset file is shared infrastructure).

  • Retro-rate re-pricing of past months (the adjustments domain).

  • The authority program itself (its own epic + plan-mode plan).

Review log

Both rounds ran on 2026-08-31: round 1 over v1 produced v2; round 2 over v2 produced v3, which it passed together with the G-A maintainer gate (F0 / F1, ADR-072). The 2026-10-07 rulings are design rulings after the freeze, not review rounds (Errata).

Round Vendor Resolved model Verdict

1

Anthropic — the internal three-lens pass (money semantics / false success / contextless implementability)

not recorded (authoring session: Claude Fable 5)

no-ship — 42 findings over this plan and its hard-checks pair, 9 stop-ship-class, all folded into v2

2

OpenAI — the maintainer’s review

GPT Astra (ruling F-4, 2026-10-07)

no-ship on v2 (44 findings; stop-ship classes: the wrong judgment unit, the unfrozen floor, the self-contradicting ledger identity, the unassigned late-enrollment unit, missing authz/ops contracts, mis-sequenced money consent), folded into v3 → ship on v3 (plan-mode approved, G-A passed)

Edit this page · latest