Plan: AFCARS Readiness — the Encrypted Artifact, Readiness and ready_for_transmission (#2127, P-D4 of #1965)

Archive record

Merge requests: !1800 (U0 plan page + the program errata + the unit and follow-up issues, Relates #2127) + !1801 (the fence fix, Closes #2172) + !1802 (U1, Closes #2176) + !1803 (U2, Closes #2177) + !1804 (the immutable retained policy, Closes #2174) + !1805 (U3, Closes #2178) + !1806 (U4, Closes #2179) + !1807 (U5, Closes #2180); the close-out (U6, Closes #2181 and #2127)

2026-10-05 — approved in plan mode 2026-10-04 (rulings R-D25–R-D34 as recommended) after a contextless round 1 (no-ship, 3 blockers fixed, 9 findings folded), the maintainer’s round 2 (no-ship, 7 findings folded) and a three-pass fold check. What landed: the fence fix (#2172: the export fence compares the submission’s own (export_generated_at, current_export_attempt_id) and never supersedes its own winner, so a re-export after the 31-day prune moves the pointer); artifact sealing (U1: FieldEncryptor::seal_artifact / open_artifact, AES-256-GCM-SIV under the reporting column key, the nonce HKDF-derived from the key and the (kind, submission, attempt, generated_on) context, the CGAF envelope, typed refusals); the encrypted export (U2: a keyed deployment seals every AFCARS export before upload and only a keyless optional one stores plaintext; export_sha256 names the delivered file; a keyed export establishes the key lineage before it claims; the download opens the object and fails closed with a redacted 500; the migration supersedes pre-U2 unfinished attempts and bumps schema_compat_floor, a drained deploy); the immutable retained policy (#2174: UPDATE, DELETE and TRUNCATE refused on the binding and the documents); the readiness record (U3: append-only afcars_export_readiness, one row per winning flip, unique per submission and export generation, written in the finalizer’s transaction from the retained policy; a missing or damaged policy rolls the finalize back and the attempt is never reaped); the act (U4: ready_for_transmission on a Program-keyed graph; PUT …/ready-for-transmission authorizes, verifies outside a transaction (the surface 503, the readiness record 409 afcars-export-missing, the stored object’s digest chain a redacted 500), then re-checks under the submission’s row lock (the pointer 409 conflict, approved, records without errors, the head, the identities 409 afcars-artifact-stale) and stages one audited event; a ready artifact is frozen in the export route and the finalizer’s fence; four problem types; invariant leg 7; a floor bump, a drained deploy); transmit retired (U5: AFCARS approved → transmitted, the route, the event’s producer and the test-lib client removed; the four transmit legs re-homed onto the act; the CLI ready-afcars; the web Mark ready for transmission, whose refusal names the surface’s reason; the e2e finale is that refusal). Until P-D5 no generated submission is validated, and until #1987 no surface verifies, so outside the hermetic tests the act answers 503. Follow-ups: #2173 (craig-cases' fence sibling), #2175 (the ADR-058 AFCARS retention class), #2182 (the financial evaluator timeout seen once in a battery); P-D5’s inputs are on #1965, the delivery program’s on #1967.

Status

Done (2026-10-05) — !1807

Anchor What binds here

#2127; AFCARS 2020 Program (#949)

A9 (readiness is a derivation over the winning export attempt, recorded in the finalizer, re-verified by the act; stale only cleared by a regenerate), A4 (a replay never changes readiness), R11 (the artifact is client-side encrypted), R12 (no delivery: the transmit stub is retired)

P-D1 (#1965) D1 and R-D7

the fixed scope (weight ≈ 19); NCANDS’s twin route is #2130’s

P-D2 (#2125) D1, D3, U8, R-D9

the column key also seals the artifact; the retained policy and read_policy; replay vs regenerate; artifact re-encryption is #2149’s

P-D3 (#2126) as built

validated only with records and zero failing rows; the status ↔ results invariant; no generated submission is validated until P-D5

ADR-020, ADR-048 (§ Amendment #949 each), ADR-040, ADR-063 D3

the store holds ciphertext and the download decrypts; the column key envelope-encrypts the file; transmitted is the delivery program’s (#1967); the compatibility floor

Context (census 2026-10-04, on main after P-D3)

  • The export renders a plaintext TSV and gates nothing. export_afcars (services/craig-reporting/src/api/afcars.rs:701-748) authorizes Update, reads the retained policy (409 afcars-policy-missing, a tampered document 500, :665-679) and runs run_export_attempt with build_afcars_tsv (:615-649), whose cell 4 is the submission’s status at export time (:635). Drafts and validated_with_errors rows export (no status gate; tests/api/afcars_export.rs:15-24). The download streams the stored object as text/plain with no hash re-check (:764-798).

  • The attempt machine wants identical bytes. run_export_attempt mints the attempt id and pins generated_on (a %Y%m%d date, from the prior attempt’s intent or the clock) before calling the Fn(&str) build closure (api/export_attempts.rs:101-169, :119-128); a same-actor replay answers 409 EXPORT_SOURCE_CHANGED on digest drift (:130-143), and concurrent same-attempt puts must converge (crates/craig-store/src/attempts.rs:696-732). The reconciler promotes any pending / stored attempt whose blob verifies against its declared digest (attempts.rs:970-975).

  • The finalizer. ExportFinalizer::finalize (src/upload_finalizers.rs:137-208) serves AFCARS and NCANDS: it locks the submission FOR UPDATE (:146-156), flips five pointer columns, incrementing export_generation (:158-182), behind a fence that joins the incumbent’s upload_attempts row (:166-172), and emits the generated event. It runs in craig-store’s promote transaction (attempts.rs:816-838) from the request path and from the in-process reconciler, which has no AppState (src/main.rs:399-411). It lives in the crate’s lib target, which holds nothing else (src/lib.rs); read_policy and PolicyReadError are pub(crate) in the bin (afcars/records/store.rs:279, :311).

  • Two pre-existing defects, each its own fix: issue: #2172 and #2174. The prune deletes the winning attempt after 31 days (attempts.rs:328-333, :864); the fence then fails and a re-export never moves the pointer. The fix compares the submission’s own (export_generated_at, current_export_attempt_id) with the candidate and skips superseding an incumbent that is the candidate itself (craig-cases' fence, services/craig-cases/src/store/court_orders.rs:100-106, is #2173). The retained policy binding is mutable: afcars_submission_policy has no immutability trigger (migrations/20261002120000_afcars_submission_chain.sql:29-38).

  • The only encryption primitive is the cell encryptor: FieldEncryptor::encrypt seals AES-256-GCM-SIV with a random nonce into base64 (crates/craig-crypto/src/lib.rs:565-605). Sealing the TSV with it would make every replay a 409. The key (CRAIG_REPORTING_FIELD_ENCRYPTION_KEY) is booted into the jobs runtime only (src/main.rs:127, :177). Lineage is verify-only at boot (src/key_lineage.rs:38-55), written by the generate alone (afcars/job/commit.rs:130); the seed writes no reporting lineage row (tools/craig-seed/src/sql.rs:164).

  • No readiness exists (rg 'artifact-stale|ready_for_transmission' is empty). SubmissionStatus is shared with NCANDS, its graph program-blind (src/transitions.rs:7-9, :51-94); invariant leg 6 names the four clean post-validated states (crates/craig-test-lib/sql/invariants/craig-reporting/validated_with_errors.sql:59-64).

  • Promotion. The layout and record-number pins live in the dictionary (afcars_dictionary/mod.rs:1257-1292); the surface identity {dictionary, crosswalk} is re-verified every 60 s per replica (src/afcars_surface/mod.rs:152-157, verify.rs:376-378). Production never verifies before #1987; hermetic tests promote with serve_dictionary / promote_crosswalk (tests/support/afcars_surface.rs:188-214).

  • Transmit. transmit_afcars (api/afcars.rs:485-587, the stub text at :490) authorizes Approve, runs refuse_untransmittable (shared with NCANDS, api/mod.rs:78-101), stamps transmitted_at and publishes reporting.afcars_transmitted. Consumers: the CLI (services/craig-cli/src/cmd/reporting.rs:47, :456-467); the web form and route (services/craig-web/templates/reporting/afcars.html:114-117, src/routes/reporting/afcars.rs:239-256, main.rs:1248); the test-lib client and route map; four devstack legs (tests/api/afcars.rs:208, :242, :270; tests/api/replay_guards.rs:122); the e2e finale (tests/e2e/specs/reporting-actions.spec.ts:192-200). Seed row 2024B is transmitted (tools/craig-seed/src/datagen.rs:3096-3111).

Scope

In: D1–D5. Prerequisites (own fix: issues): the fence #2172 (before U2), the immutable policy #2174 (before U3). Out: the XML, record number and bulletins (P-D5 #2129); delivery (#1967); NCANDS transmit (#2130); re-encryption (#2149); #2175.

Design

D1 — Artifact sealing (U1)

  • craig-crypto gains FieldEncryptor::seal_artifact(&[u8], &ArtifactContext) → Result<Vec<u8>, CryptoError> and open_artifact (the same Result, fault-injectable at the AEAD boundary like encrypt), over raw bytes, with ArtifactContext { kind: ArtifactKind, submission_id, attempt_id, generated_on } (R-D25). The AAD is the envelope’s magic and version followed by each context field length-prefixed, the cell format’s header binding. The cipher is the encryptor’s AES-256-GCM-SIV (no new dependency); the nonce is derived inside the crate from the key and the context (HKDF-SHA256, a dedicated info label), never caller-supplied: one attempt seals byte-identically, and an attempt id re-claimed after the 31-day prune carries a later generated_on, so no two claims share a nonce.

  • The output is a binary envelope CGAF || version || nonce || ciphertext (a magic distinct from the cell format’s CGEF). open_artifact refuses a wrong key, a wrong context, a tampered byte or header and a non-envelope input with a typed error, never a pass-through.

D2 — The encrypted export and download (U2, after #2172)

  • The encryptor and the mode become a router extension. Inside run_export_attempt, after build returns the TSV, an AFCARS-only step computes the intent’s file_sha256 from the plaintext and seals it under the attempt’s context; the stored bytes, their digest and the replay gate are the sealed ones. NCANDS is unchanged.

  • export_sha256 (wire and event) stays the digest of the DELIVERED file: the finalizer writes the intent’s file_sha256; the stored-object digest goes to the readiness record (R-D26). Every AFCARS intent carries file_sha256, keyless included (where it equals the stored digest); the finalizer self-supersedes, and never promotes, an AFCARS attempt whose intent lacks it. A keyed deployment (either mode) always seals; only a keyless optional one (the dev mode; required is the default) stores and serves plaintext, its object_sha256 equal to file_sha256. The in-crate rig becomes keyed (its artifact() opens the envelope), plus one keyless export / download leg.

  • Before claiming, a keyed export establishes or verifies the reporting crypto_key_lineage row (establish_lineage; an erratum to P-D2 D1’s "the generate is the sole writer").

  • The download fetches, opens and serves the plaintext; a keyed deployment fails closed on a non-envelope or tampered object (ADR-020 §D1: a redacted 500, the detail logged). It buffers instead of streaming (a departure from #1946, accepted while the file is one half’s TSV; P-D5 re-measures with the XML) and keeps the head streamed_afcars_download_carries_the_attachment_head_and_the_exact_bytes pins (tests/api/afcars_export.rs:86): attachment disposition, no-store, a Content-Length of the plaintext.

  • Upgrade barrier (R-D32, R-D33). U2’s migration bumps schema_compat_floor to its own version (ADR-063 D3; the ADR-040 precedent), so no pre-U2 binary boots against it and rollback below U2 is refused; and it marks every pending / stored afcars_export attempt superseded (a replay is refused, nothing written: 409 keyed, 422 keyless). The deployment guide’s U2 note requires a drained deploy (stop every craig-reporting replica, whose reconciler is in-process; run the migration gate; start U2) and an operator re-export of each pre-U2 plaintext artifact, which the fence fix makes possible after a prune.

D3 — The readiness record (U3, after #2174)

  • The prerequisite fix makes afcars_submission_policy and afcars_policy_documents immutable (the records' UPDATE / DELETE / TRUNCATE trigger), so a policy re-read always equals what was rendered (R-D34). It rewrites the replay suite’s tamper leg (src/api/afcars_replay_tests.rs:398-402, an UPDATE): the UPDATE is now refused, and damage is planted by inserting a document whose content does not hash to its key.

  • U3 moves the retained-policy read (read_policy, PolicyReadError and the identity pair it returns) into a lib module, src/retained_policy.rs, pub in lib.rs and used by the bin through the lib.

  • Migration …_afcars_export_readiness.sql: afcars_export_readiness(id UUID v7 PK, submission_id FK ON DELETE RESTRICT, export_generation, attempt_id, object_sha256, file_sha256, dictionary_id, dictionary_revision, dictionary_sha256, crosswalk_id, crosswalk_revision, crosswalk_sha256, recorded_at; UNIQUE (submission_id, export_generation)), append-only (the records' trigger shape), no FK to upload_attempts, so a reused attempt id never collides (R-D27).

  • ExportKind gains a readiness flag. The AFCARS arm of ExportFinalizer::finalize inserts the row for the WINNING flip only, inside the FOR UPDATE transaction, from the attempt’s intent and the retained-policy read on the same transaction. A damaged document rolls the whole finalize back (tested through a planted stored attempt and the reconciler, since the export route’s own policy read refuses first). A losing or superseded attempt records nothing.

  • The layout and record-number revisions A9 names are carried by the recorded dictionary identity (a program erratum at U0); P-D5 adds explicit pin columns if its XML needs them. data-model-reporting gains the table in U3.

D4 — The ready_for_transmission act (U4)

  • SubmissionStatus gains ReadyForTransmission; the graph is keyed by a Program enum (AFCARS, NCANDS) and AFCARS gains approved → ready_for_transmission (U4 keeps AFCARS approved → transmitted; U5 removes it). afcars_submissions gains ready_by, ready_at and ready_export_generation (the certified generation). U4’s migration bumps schema_compat_floor (a pre-U4 binary cannot decode the status and ignores the freeze) under a drained deploy (R-D32).

  • PUT /v1/reporting/afcars/{id}/ready-for-transmission (authz Approve; the Georgia rows are action-generic), in a new api/afcars_readiness.rs, with its client method, route-map row and regenerated API page (R-D29). It verifies, in order (R-D28):

    1. outside the transaction (a verify step the tests can call alone): authorize first (403, the transmit route’s deny-before-fetch order), then fetch (404); the surface is verified (else 503 afcars-surface-not-ready); the readiness row for the submission’s current export_generation is read (none, or its attempt_id ≠ current_export_attempt_id: 409 afcars-export-missing); the stored object is fetched (missing: 409 afcars-export-missing), its digest must equal object_sha256, it is opened, and sha256(plaintext), readiness.file_sha256 and submission.export_sha256 must all agree; a disagreement or a failed open is an integrity failure (ADR-020 §D1: a redacted 500, the detail logged);

    2. inside (a commit step taking the verified result), after SELECT … FOR UPDATE on the submission only: the pointer and generation still equal those read (else 409 CONFLICT, retry); status approved (else 400 INVALID_STATE_TRANSITION); record_count > 0 and validation_errors = 0 (else 400 VALIDATION_FAILED: this predicate REPLACES refuse_untransmittable for AFCARS, A9); the row is the head (else 409 afcars-superseded); the recorded identities equal the surface’s current ones (else 409 afcars-artifact-stale, R-D30); then the CAS, ready_by / ready_at / ready_export_generation, and one reporting.afcars_ready_for_transmission event. In a keyless deployment the open step is the identity.

  • Lock order: the submission row alone, never an attempt row, so no deadlock with the finalizer. After readiness the artifact is frozen: every export of a ready row, new or a replay, is refused before build with 409 afcars-artifact-frozen (its TSV embeds the status, so a rebuild would differ), and the finalizer self-supersedes any in-flight attempt landing on a ready row. A regenerate over a ready head stays allowed (the old row stops being the head; #1967 delivers heads only).

  • New problem types, all 409: afcars-artifact-stale, afcars-export-missing, afcars-superseded, afcars-artifact-frozen. Invariant leg 6 gains ready_for_transmission; a new leg requires a ready submission’s export_generation to equal its ready_export_generation, with a readiness row for it. craig-security gains the event’s audit arm (unit-tested like event_parsing.rs:2101); ADR-003’s catalog, state-machines, data-model-reporting and the deployment guide’s U4 note follow.

D5 — The transmit route retired (U5)

  • AFCARS loses approved → transmitted. transmit_afcars, its utoipa block, its router line, publish_afcars_transmitted and their dead imports go; refuse_untransmittable keeps its NCANDS caller; craig-security keeps its afcars_transmitted parse arm for #1967.

  • The four transmit legs re-home onto the act with their assertions kept, named in the commit. Devstack never verifies a surface before #1987, so the #762 zero-record, #952 errors and #1268 one-event-and-replay legs move to the in-crate rig, which drives the handler with a verified hermetic surface (the src/api/afcars_replay_tests.rs pattern); the caseworker 403 stays a devstack leg (authorization precedes the surface check), beside one devstack 503 leg.

  • The CLI transmit-afcars becomes ready-afcars; the web approved arm shows "Mark ready for transmission", a ready_for_transmission badge and its Download arm, with en locale keys; the e2e finale becomes the surface-not-ready refusal. Seed row 2024B stays transmitted (a pre-#1967 history fixture).

  • Docs: state-machines (the removed edge), cli, the supervisor guide. #1965 AC3: rg -n 'Marks the submission as transmitted' services/craig-reporting/src/api/afcars.rs is EMPTY.

Erratum (2026-10-05): the #762 leg re-homes on an approved zero-record row, since a draft stops at the act’s status check before the record gate (#2180).

Units

Each MR Relates to #2127, #1965 and #949 and closes its own unit issue; U6 closes #2127.

MR Scope W

U0

this page (Active nav); the unit issues under &99 (U1 #2176 … U6 #2181); program errata (A9’s anchors upload_finalizers.rs:137-208 and afcars.rs:485-587; the pins carried by the dictionary identity; the close-out transmit grep scoped to api/afcars.rs until #2130; the P-D row weight); the prerequisite fixes #2172, #2174 and the craig-cases sibling #2173; the ADR-058 follow-up #2175

1

U1

ARTIFACT SEALING in craig-crypto (D1)

2

U2

THE ENCRYPTED EXPORT AND DOWNLOAD, the wire digest, lineage at export, the upgrade barrier (D2); after the fence fix

5

U3

THE READINESS RECORD: the lib seam, the table, the finalizer arm (D3); after the policy fix

3

U4

THE ACT: the status, the new edge, the route with its client, map and API page, the predicate, the problem types, the event, the invariant legs, the floor bump, its docs (D4)

5

U5

TRANSMIT RETIRED: the old edge with the route, CLI, web, e2e, docs, AC3 (D5)

3

U6

CLOSE-OUT: plan-lint --done, the archive row, #1967’s inputs, P-D5’s inputs on #1965

1

Weight 20, linear: U0, #2172, U1, U2, #2174, U3, U4, U5, U6. U4 keeps the old edge (its transmit legs stay green); U5 removes it with the route and consumers. Every MR is green alone with its CHANGELOG entry; every new test carries // @axis:. Until P-D5 no generated submission is validated, so act legs plant an approved row with records and a policy row the hermetic surface serves; devstack and e2e legs assert the honest 503.

Test matrix (by risk)

Test Axis Unit Asserts

a_re_export_after_the_incumbent_attempt_was_pruned_replaces_the_pointer

fault

#2172

after a prune, and with the same id reused: the pointer moves and the winner ends promoted

a_valid_policy_substitution_is_refused_by_the_binding

evil

#2174

UPDATE / DELETE / TRUNCATE refused on both tables; the tamper leg rewritten to plant by INSERT

sealing_is_deterministic_per_attempt

replay

U1

proptest: same bytes and context → same envelope; another attempt id or generated_on → another

an_artifact_seals_and_opens_round_trip

happy

U1

proptest: any bytes, any context

an_artifact_opened_under_another_context_or_key_is_refused; a_flipped_byte_or_a_plaintext_input_is_refused

evil

U1

wrong submission, attempt, date or key; proptest: any one-byte tamper, header included; a non-envelope → typed error

the_stored_afcars_artifact_is_an_envelope_not_the_tsv

evil

U2

the raw object holds neither the header nor the id; opening yields the TSV

re_export_renders_under_the_retained_policy_content_not_the_current_name (P-D2’s #1965 AC2, re-pointed)

replay

U2

as today, read through open_artifact; a same-id replay is byte-identical ciphertext

afcars_export_flips_pointer_with_attempt_and_event_oracles (kept); ncands_export_bytes_are_unchanged

happy

U2

sha256(download) == export_sha256; the attempt’s declared digest is the sealed bytes'; NCANDS bytes and filename as before

streamed_afcars_download_carries_the_attachment_head_and_the_exact_bytes (kept)

happy

U2

the plaintext; attachment disposition, no-store, the plaintext Content-Length

a_keyed_download_of_a_plaintext_or_tampered_artifact_fails_closed

fault

U2

redacted 500, no plaintext fallback

a_pre_encryption_attempt_is_superseded_not_promoted

fault

U2

the migration supersedes pending / stored AFCARS attempts; a replay is refused, nothing written (409 keyed, 422 keyless); the finalizer supersedes one without file_sha256; a fresh id promotes

a_keyless_export_stores_and_serves_plaintext

sad

U2

the dev mode: object_sha256 = file_sha256; the download serves the bytes

an_export_establishes_the_reporting_lineage_row

fault

U2

the row after the first keyed export; a mismatched key is refused before any claim

the_winning_export_records_its_readiness_in_the_finalize_transaction

happy

U3

one row: generation, attempt, both digests, both identities equal the policy row

a_losing_export_attempt_records_no_readiness

conc

U3

concurrent fresh exports → one row per winning flip

the_reconciler_promoted_export_records_readiness_without_a_request

fault

U3

the production finalizer through a test-built reconciler

a_damaged_policy_document_rolls_the_finalize_back

evil

U3

a planted stored attempt through the reconciler: no flip, no row, no event; the attempt stays stored

a_reused_attempt_id_after_the_prune_records_a_new_readiness_row

fault

U3

the same id on another submission, and on the same one after a prune → new rows, no collision

an_approved_exported_submission_becomes_ready_for_transmission

happy

U4

200; status, ready_by, ready_at; one event; transmitted* null

a_layout_promotion_after_export_makes_transmit_refuse_artifact_stale (#1965 AC2; the program’s name, "transmit" being A9’s word for the act)

sad

U4

serve_dictionary with a changed layout pin → 409 afcars-artifact-stale; still approved, no event

a_crosswalk_promotion_after_export_makes_the_act_refuse_artifact_stale

sad

U4

promote_crosswalk → 409

a_fresh_export_after_a_promotion_stays_stale

replay

U4

the re-export renders the RETAINED pair; still 409 (A4); a regenerate supersedes the row

a_digest_that_disagrees_with_the_readiness_record_refuses_readiness

evil

U4

export_sha256 ≠ file_sha256, or stored bytes ≠ object_sha256 → redacted 500, nothing readied

an_unexported_or_superseded_submission_is_not_readied

sad

U4

no readiness row → 409; a successor → 409

an_unverified_surface_refuses_with_surface_not_ready; a_keyless_deployment_readies_on_matching_digests

fault / sad

U4

in-crate unverified surface → 503; keyless: the digest chain holds without opening

a_swapped_or_missing_stored_artifact_refuses_readiness

evil

U4

another attempt’s ciphertext → redacted 500; a deleted object → 409 afcars-export-missing

a_pointer_moved_between_verify_and_commit_is_a_conflict

conc

U4

verify, a finalize, then commit → 409 CONFLICT, nothing readied

an_export_of_a_ready_submission_is_frozen

sad

U4

a new attempt and a same-id replay → 409 afcars-artifact-frozen, nothing written

an_export_racing_the_act_never_moves_a_readied_pointer

conc

U4

a late finalize self-supersedes; pointer and record unchanged

two_concurrent_acts_ready_once

conc

U4

one 200, one refusal, one event

readiness_survives_the_attempt_prune

fault

U4

the winner’s attempt row deleted → the act still passes

the_invariant_flags_a_ready_row_whose_pointer_moved

evil

U4

a ready row whose generation moved fires; seed rows (2024B included) pass

the_ready_event_is_audited

happy

U4

craig-security parses reporting.afcars_ready_for_transmission

re-homed in-crate: a_zero_record_submission_is_not_readied, a_submission_with_validation_errors_is_not_readied, ready_for_transmission_stages_one_event_and_a_replay_refuses

sad / replay

U5

the #762, #952 and #1268 assertions on a verified hermetic surface

re-homed devstack: a_caseworker_cannot_ready_a_submission; the_act_on_devstack_answers_surface_not_ready

evil / fault

U5

403 before the surface check; 503 with the row untouched

ncands_keeps_its_transmit_edge_and_afcars_loses_it; the_afcars_transmit_route_is_gone

evil / sad

U5

the program-aware graph; POST …/transmit → 404 / 405

e2e: review → approve → export + download → ready refused while the surface is unverified

sad

U5

the decrypted download is non-empty; the flash names the surface; the row stays approved

Verification

  • Per MR: fmt, clippy, the budgets, validate-authz-coverage, validate-migration-constraints (the floor bumps), api-docs --check, coverage-matrix-mapping --check, check-docs, plan-lint; the scratch-DB legs locally; the battery.

  • Close-out: cargo xtask plan-lint --done docs/modules/ROOT/pages/plans/archive/afcars-readiness.adoc --allow-open 949,1965,1967,1987,2127,2129,2130,2149 plus the issues U0 files.

Rollout and risks

  • U2 (Changed): ciphertext at rest, a drained deploy and a floor bump (rollback below U2 refused, recovery a forward fix), pre-U2 attempts superseded, each pre-U2 plaintext artifact re-exported. U3: one migration. U4: a migration with another floor bump and drained deploy. U5 (Removed): the AFCARS transmit route and transmit-afcars.

  • Risks: a repeating nonce (U1’s proptest over ids and dates); the finalizer’s new write in a shared transaction (kind isolation tested); the ≤ 60 s surface lag (accepted, R-D30; #1967 re-runs the predicate at delivery).

# Recommendation Alternative

R-D25

AES-256-GCM-SIV under the ruled column key, nonce derived from key and context (incl. generated_on)

a nonce pinned in the intent; a two-digest attempt; a new key

R-D26

export_sha256 names the delivered file; lineage at export; keyless optional is plaintext

a ciphertext digest

R-D27

An append-only readiness row per winning flip, keyed per submission and generation

columns on the submission

R-D28

The act checks surface, readiness, the digest chain, status, counts, head, identities; frozen after readiness

row columns only; a post-ready export demotes

R-D29

PUT …/ready-for-transmission, ready-afcars, a web button, one audited event

POST …/ready; no event

R-D30

Pull at the act, full identities, ≤ 60 s lag accepted

content hash only; a verify in the act; a listener

R-D31

The ADR-058 AFCARS retention class is a follow-up (#2175)

fold it in (≈ +3)

R-D32

Drained deploys for U2 and U4, each with a floor bump

compatibility gates until a cleanup

R-D33

Pre-U2 unfinished attempts superseded; the finalizer supersedes any without file_sha256

seal blobs in place

R-D34

The retained policy becomes immutable (a prerequisite fix, #2174)

bind rendered identities into the intent

Review log

Round Vendor Resolved model Verdict

1

Anthropic — one fresh contextless reviewer (the page, the rules, the four questions; 37 citations checked)

Claude Opus 5.5

no-ship — 3 blockers fixed (re-homed legs in-crate; the lib seam; a fallible seal); 9 findings folded

2

OpenAI — maintainer-run (2026-10-04)

GPT Astra

no-ship — 7 findings folded: the fence fix before U2; a drained deploy and the floor bump; pre-U2 attempts superseded; the full digest chain at the act; the immutable retained policy before U3; readiness keyed per submission and generation, the seal context dated; U4 keeps the old edge. Fold check (three contextless Anthropic passes, Claude Opus 5.5): an auditor (6 addressed, 1 partial; 4 new gaps), a gap hunt (3 blockers, 10 minor) and a residue verifier (6 residues) — all fixed

Edit this page · latest