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).
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 |
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
|
U1 |
The judgment-only seam, the substrate, stage. Seam (ruling 1, 2026-10-07): the generator’s child-month
DECISION — |
U2 |
FINALIZE, reusing U1’s |
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
|
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. |
U3 |
Surfaces: |
U4 |
Close-out: ADR-057 §Amendment (backpay as the second import-class act); CHANGELOG;
|
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
pubtype with PRIVATE fields (the store’spubparams must name it; external callers can only passNone) 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 derivestransfer_onfrom 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; theimport_finalizeconsent-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_rowsandapply_month_decisionstay 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_backpayref carries the agreement’sadmin_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_batchtype 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
BackpayFinalizefloor, a finalizer who staged none of the batch’s staged or materialized records, the reviewedcontent_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_finalizeconsent 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.evaluatednever 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
featcommit-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_rowskeeps 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_checksumframes the sorted record keys only (completeness), since a client cannot compute the stage-computedcanonical_hashat create; the finalize request carries acontent_checksumover 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_byandsuperseded_atbeside its provenance twin. A staged record whose batch leftstagingrefuses 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
stagingarm (before the manifest legs) and thefinalizingresume arm refuse a finalizer who staged astagedormaterializedrecord of the batch with the typedFinalizerStagedRecords(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):
finalizedmeans every manifest key was materialized: settle sends a batch with nothing staged or diverged but fewer materialized records thanexpected_count(a key superseded off while finalizing) back tostagingwith no summary. As built at the close-out, a superseded record’s agreement-month therefore stages again in its own batch while that batch isstaging(where a diverged record’s batch returns), else in a new batch, and theRecordDivergedrefusal 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,
materializedanddiverged(the diverged flip is a write under theBackpayFinalizeproof); the finalize diff addsjudged_row_changed(one per changed field) andcanonical_hash_mismatch(a frozen payload that no longer hashes to itscanonical_hashdiverges 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 isfinalizing, stage refuses and no staged record can be superseded), and both checksums cover the batch’sstagedandmaterializedrecords; the summary event isfinancial.subsidy_backpay_batch_finalized{batch_id, expected_count, materialized, superseded}(counts only);subsidy_backpay_boundsreads "agreement-armed" as: the live payment’s agreement and month equal its record’s, and the record ismaterialized(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_generatejob whose month is below the floor of its attempt’s business date failsengine_failed(below_reconcile_floor) with nothing written. Corrected: Design. -
Erratum (2026-10-08, U-AUTHZ as built): the
ApiDocderive moved tosrc/api/openapi.rs, keepingapi/mod.rsunder B1 (U-4);import_finalizeandbackpay_finalizeshare one pass loop,jobs::passes(U-5); abort, only whilestaging, flipsstagedandrejectedrecords tosuperseded(superseded_byNULL) 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 409idempotency-conflict(U-9); the live stage replay after finalize answersAlreadyImported(U-1); the devstack separation legs restampstaged_byby 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 reusedmanifest-mismatch,batch-stateandbatch-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,supersedeandabort; 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 underis_admin()) and depend oncraig-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) |