Plan: Policy Traceability & Scenario-Journey Corpus (epic &56)

Status

v3, 2026-08-31 — the earlier units U0/A1/B1 (!1534) and A2 (!1535) were implemented BEFORE this plan passed external review — a process violation, corrected by this gate; findings against that as-built are FILED as fix issues (#FIX-1…#FIX-7 in the review package; issue numbers assigned at filing), never folded silently. v3 reworks the UNIMPLEMENTED units A3–A5 and B2–B5 per the 2026-08-31 external review (completeness universe, drift operations, contextless unit specs, the coverage/ratchet redesign). External review PASSED (round 2, 2026-08-31) — A3+ implementation unblocked in the recorded sequence.

Unit Description Status

U0

This plan, nav-linked Active

Done (2026-08-31) — the foundations MR (#659 + #665)

A1

#659 — the craig-policy tooling crate (citation module), ADR-070, and rulesets/georgia/citations.toml populated for the proof-of-shape ruleset (georgia-safety-assessment.json — the one file #1604 verified correct with content evidence). Typed Authority enum, RulesetRef (file#json-path) key addressing with a real resolver against the JDM files, the content-tether rule (value REQUIRED on every rule-indexed key, compared at resolution — see Design), the derivation honesty field, shape validation + proptests. No PAMMS clone, no pins, no xtask surface yet

Done (2026-08-31) — the foundations MR

A2

#660 — PolicySource trait + PammsGitSource (anonymous public shallow clone of gadhs/pamms-sources/dfcs-cws into gitignored rulesets/georgia/.policy-cache/), ManualSource fallback, sync-manifest, cargo xtask policy sync-cache [--pin] (format-preserving toml_edit back-fill of source_sha256; fails loud on a cited file absent from the cache). Ports Canopy’s three cache_sync guards verbatim (dash-proofing --, clone-nesting cwd, non-git-dir guard — in-crate as-built). Config home (as-built): committed rulesets/<j>/policy-source.toml. Hardened by #1619: --pin = initial pins only (differing pin errors naming --repin); --repin <who> = reviewed overwrite + attestation stamp; validate-all-then-ONE- atomic-write; cache reads canonicalize under the root, rejecting traversal/symlinks

Done (2026-08-31) — proven live: the proof-of-shape rows are pinned against the real manual; #1619 hardening landed 2026-08-31

A3

#661 — cargo xtask policy audit. UNIVERSE (finding 18 — one-citation-per-file is vacuous): two granularities, both machine-enumerated. (a) RULE-ROW granularity for every non-authz PROGRAM JDM in every rulesets/<j>/ dir — georgia’s EIGHT (its nine minus screening-policy, which lives in bucket (b); hard-checks U2 added georgia-subsidy-eligibility.json after the v3 count) and texas’s six: every nodes[id=…].content.rules[<idx>] key (enumerated via the ADR-070 resolver) plus the #description header, each covered by a citations.toml row or an exception. (b) FILE granularity for authz rulesets, *-screening-policy.json, and the config TOMLs (case_detail/dashboard): ≥1 citation row or a reasoned per-file exception (their content is jurisdiction policy per ADR-072, but row-granularity over 54 authz tables is noise — a recorded, revisitable choice; NOTE for A5: the citation key grammar is .json-only, so the two config TOMLs can only ever be EXCEPTED — the A5 flip must either carry their expiring exceptions or extend the grammar first). Exceptions: rulesets/<j>/citation-exceptions.toml, { key, reason, owner, review_by } — unknown-key orphans ERROR, expired review_by ERRORS; every entry EXPIRES, which is the ratchet (growth is a reviewed diff and nothing lives forever). VERDICTS ARE PER-JURISDICTION (internal-pass catch: a global blocking flip would hard-fail texas on expiring hand-enumerated rows): the audit carries a blocking_jurisdictions list — georgia enters at A5; texas stays ADVISORY-reported until its population follow-up (filed at approval) lands, and in ADVISORY jurisdictions FILE-level exceptions are permitted for non-authz rulesets too (day-one texas = 6 file entries, not hundreds of row entries; the no-wildcard row rule binds BLOCKING jurisdictions). Checks (v1 where sound): key-resolution
content tether, schema, staleness warning (>365 d), orphan citations, pin-presence (pamms rows unpinned = warning until A5, then error in blocking jurisdictions)

Done (2026-09-01) — MR feature/661-a3-policy-audit; as designed, plus: the audit logic lives in craig_policy::audit (pure, today-injected) with xtask as the CLI
a report-only validate step; the committed-corpus finding-free battery pin is count-free (#1617 doctrine); georgia’s row-JDM count corrected to EIGHT (U2 added subsidy-eligibility); ADR-070 gained the as-built amendment superseding its per-file-floor bullet

A4

#662 — cargo xtask policy drift + OPERATIONS (finding 28). The command: re-sync, recompute per-cited-file hashes, compare pins; classes CHANGED / MISSING-UPSTREAM / UNPINNED / ACKED. Acknowledgments make known-drift finite: committed rulesets/<j>/drift-acks.toml entries { source_ref, acknowledged_hash, reason, owner, expires ≤ 90 d } — a CHANGED whose current hash equals an unexpired ack reports ACKED (exit 0); expiry or a further hash change re-raises CHANGED (exit 1). CI: a schedule-discriminated job per the repo doctrine (the CLUSTER_TESTS precedent, .gitlab-ci.yml:666–675 + :719): variable POLICY_DRIFT="true" on the weekly schedule, rule $CI_PIPELINE_SOURCE == "schedule" && $POLICY_DRIFT == "true", allow_failure: true, the drift report as a CI artifact, the maintainer named as alert owner in the job comment; remediation = re-read → update value/verified_date → --repin, or an expiring ack. SLA: every finding is acked-or-fixed by the NEXT scheduled run — an unacked finding keeps the job red (pipeline yellow) at the named owner, and ack expiry (≤90 d) re-raises it. Drift stays advisory FOREVER (live-upstream doctrine) — the ack ledger is what stops "known drift ships forever"

Done (2026-09-01) — MR feature/662-a4-policy-drift; as designed, plus: the classification is pure (craig_policy::drift, today-injected, per cited FILE — rows sharing a manual page classify once; inconsistent pins across rows = a finding; a moot ack = a warning naming its removal); the CI rules are pinned by a textual xtask test (exactly ONE - if:); the report file is gitignored locally and a 90-day artifact in CI; live-proven against the real pamms cache (both pinned georgia pages: ok). One-time operator step recorded: POLICY_DRIFT=true on the existing Monday schedule

A5

#663 — populate citations for the remaining GEORGIA program rulesets
case-routing’s chapter cite; every row verified against the live manual (verification-human); sparse Chapter 9 — cite what exists, never interpolate; the not-policy exclusion list (timeliness warn/crit thresholds, person-match tunables) stays OUT via reasoned exceptions. Pins back-filled via --repin (post-#FIX-5 the initial-pin/repin split exists); A3 flips blocking for the GA universe. A5 NEVER carries the hard-checks/backpay <j>-subsidy-eligibility citations — those ride the units that create the rules (finding 28). Texas population is the filed follow-up, not A5 scope

Done (2026-09-03) — MR feature/663-1622-citations; as designed, plus: the population covered the FULL row-key universe (georgia: 113 new citation rows
38 row-level exceptions over the uncovered keys (five retired when #1670 cited their rows), every pamms row pinned by --pin; the not-policy list — person-match tunables, timeliness status rows, routing mechanics — entered the expiring ledger as operational/plumbing rows, and rows no source was found for as source-not-located with the shortest review_by), the 56 file-bucket members carry file-level exceptions (authz ×54, the two config TOMLs; the screening-policy entry retired with the file in #1672 — the .json-only key grammar was NOT extended), georgia flipped BLOCKING; two wrong header chapter cites corrected (case-routing "Chapter 4", placement-matching "Chapter 11"; text-only, version bumps). Texas (#1622, the filed follow-up) landed in the SAME MR at rule-row granularity (152 rows + 27 row-level exceptions over 139 keys; policy-source.toml = manual, no pins by design) and flipped BLOCKING too. Verification-human per the 2026-09-03 ruling: agent-populated + adversarially re-verified, every row listed on the MR, maintainer spot-check before merge

B1

#665 — scenario-inventory schema (scenario module in craig-policy), ADR-071, the initial 22-row corpus transcribed from the #664 findings comment (the canonical taxonomy source) into compliance/scenario-inventory/{stage}.toml (core; B1 creates the new top-level compliance/ dir) + rulesets/georgia/scenarios/{stage}.toml, and cargo xtask scenarios audit. Findings = exit 1; uncovered = report. The committed corpus is ALSO audited by a battery test (the blocking surface for inventory lies while the validate step stays advisory — see Design)

Done (2026-08-31) — the foundations MR; opening report 1 covered / 4 partial / 17 uncovered, 7 journey-critical

B2

#666 — the journey "given" library, contextless spec (finding 29). TS side (tests/e2e/lib/given/): a GivenContext constructed per test from the actor’s identity (a SEED.users principal — the storage-state actor; builders replay the SERVICE APIs with a bearer minted for that actor through the craig-api ROPC client, because case + investigation creation have NO BFF path (#333): the cookie session stays the JOURNEY’s vehicle, the bearer is the GIVEN’s) + a runId (sha1 of run epoch · worker index · test title path — worker-salted, test-salted, retry-stable) that prefixes every created-entity name; builders return TYPED (branded) ids and are sequential-composable: givenReport, givenScreenedInReferral, givenInvestigation (added: journeys 2/4’s precondition), givenCase (+household children + primary caregiver), givenActivePlacement (home/license/capacity options; givenHome exposed), givenApprovedPlan, givenErrAgreement, givenReviewCompleted (the SUBSIDY renewal review — the corpus registry’s subsidy_review entity; security reviews are out of scope) — the closure of the eight B4 journeys' preconditions, built by REPLAYING REAL ENDPOINTS (the honest-constructor doctrine; no SQL fabrication). Partial-build retry: builders are get-or-create through ADR-062’s request-claim identity — every create’s client_request_id is DERIVED from (runId, builder, canonical body), so a same-actor re-entered builder replays to the ORIGINAL entity and a changed body derives a different id (never a 409 — the effective actor is part of the claimed intent, so a different principal re-entering an actor-less body in the same run IS a 409 by design); server-idempotent legs (convert, review completion) read-then-act. cargo xtask e2e stamps a CRAIG_E2E_RUN_EPOCH per invocation so a new battery never replays a consumed build; cleanup: none — run-scoped names + the reseed between batteries own isolation; concurrency: runId disjointness IS the ownership rule. Container wiring: CRAIG_E2E_{CASES,PLACEMENT,FINANCIAL}_URL join the exchange precedent. Rust side: craig_test_lib::given wrapping the existing typed clients with the same contract (uuid-v5 derived ids, newtype ids, typed GivenError) for integration tests. Verification spec given-builders.spec.ts (caseworker project) + tests/given_roundtrip.rs

Done (2026-09-01) — !1549

B3

#667 — --scenario seed variants, propagation defined end-to-end (finding 29): variant families live in tools/craig-seed behind --scenario <slug> (repeatable; a closed ScenarioSlug registry, so a typo is a CLI error), additive over the base families, deterministic under the same --seed — every variant pins ALL of its ids (the fixture-G posture: zero RNG / uuid-stream draws), so the base’s six renders stay byte-identical with variants off (the existing byte-identity vector IS the acceptance) and a second pinned vector guards the variant bytes; the active set is canonical (sorted, deduplicated) for generation, identity and manifest alike, and joins the _seed_marker identity recipe explicitly (MARKER_PROTOCOL_VERSION 2→3). The generated tests/e2e/lib/seed.ts gains a SEED.scenarios section listing EVERY known slug — { active: false, slug } or { active: true, slug, …pinned ids } — so a spec narrows on .active against any manifest (the committed manifest stays BASE; a variant regen is a deliberate working-tree diff). cargo xtask e2e --scenario <slug> and cargo xtask dev reseed --scenario <slug> thread the slugs to the seed container (compose CRAIG_SCENARIOS, split by seed.sh into --scenario flags) and to the manifest regeneration; Playwright specs SKIP with the regen command in the reason when their slug is inactive (visible in list/junit/html). Variants provide named BACKGROUND states (the F-B7 fork: builders construct what journeys mutate; seed provides the caseload around them): B3 ships subsidy-generator-backlog (an ACTIVE ERR with no payment rows — journey 7’s generator target; the backlog stands until the devstack’s HOURLY generator tick or a craig-financial restart mints it, so the journey triggers inside that window or reseeds) and foster-home-at-capacity (a home at max_capacity 2 — journeys 1/4’s occupancy background). A slug change needs a volume-wiping verb: the .devstack/ guard does not track --scenario (it hashes sources plus the active-bundle selector and the field-key KCV), and the seed’s identity guard refuses a non-wiping up naming dev reseed. Verification: seed-scenarios.spec.ts + the craig-seed integration/byte-identity tests

Done (2026-09-01) — !1550

B4

#668 — the first EIGHT journeys, named, each with actors/knobs/oracles and a Done criterion (finding 29 — asserted oracle keys are the CORPUS rows' keys, verbatim). Delivered as two MRs (an XL unit): B4-A infrastructure (!1551) and B4-B the journeys (!1552). (1) core.placement.end-voids-perdiem — jane.doe ends a given-built placement from the list; asserts placement_end_voids_live_perdiem (the API-observable half: zero live per-diem rows), occupancy_mismatch, placement_ended_missing_ended_at; out_of_order_end_leaves_tombstone is not UI-drivable (recorded). (2) core.investigation.pending-review-close — jane.doe via the API (the BFF CREATE is #333-blocked, the transitions are not); asserts investigation_closed_at_stamped, investigation_no_backward_edges, safety_assessment_freezes_ruleset; investigation_close_event_iff_disposition is outbox-only (recorded). (3) core.case.close-refuses-mutation — jane.doe; asserts case_close_terminal, closure_leaves_assignments_unchanged, and — since the #1631 fix landed the store’s closed-case gate (the row was blocked_by it at B4) — closed_case_refuses_subentity_mutation (a contact and a plan against the closed case refuse 409 case-closed); case_closed_event_same_tx is outbox-only (recorded). (4) core.case.full-spine — jane.doe; asserts cross_service_refs_resolve, perdiem_placement_duplicate, day_count_gross_consistent, occupancy_mismatch, and — since the #1632 fix (financial’s own case_assignments projection + the activation payload’s triple; the row was blocked_by it at B4) — both halves of assignment_projection_born_at_revision_zero (the placement triple AND the per-diem pair are the case’s revision-0 pair, polled). (5) core.plan.approval-supersession — jane.doe; asserts one_active_plan_per_case, active_plan_review_due_required, plan_approval_authz_gated; plan_superseded_same_tx is the sweep’s (the new craig-cases invariant). (6) core.case.assignment-propagation — bob.smith owns the case, admin reassigns; asserts assignment_revision_strictly_increases, denorm_triples_lockstep (placement + payment — the families in its footprint), assignment_scope_flips_visibility; stale_revision_replay_no_op needs a republished event (recorded — the Rust real-broker legs own it). (7) georgia.subsidy.generator-month-emission — admin triggers the run against the B3 subsidy-generator-backlog variant’s pinned ERR (the devstack’s generator ticks HOURLY — trigger inside the window the variant leaves open, or reseed); asserts per_agreement_month_unique, multiple_subsidy_payments_same_child_month; subsidy_payment_uas_consistent / subsidy_perdiem_same_month_overlap / subsidy_cutover_iff_imported are the sweep’s; on the base seed the leg SKIPS visibly. (8) core.financial.perdiem-provenance-lifecycle — jane.doe walks approve → issue → clear, bob.smith refused; asserts payment_provenance_matches_placement, ffp_amount_stale, payment_lifecycle_forward_only; payment_events_staged_in_order is outbox-only (recorded). Done per journey = journey-<slug>.spec.ts exists, its binding’s asserts cover the row’s PROVABLE oracles, and the audit grades the row Covered (blocked rows sit outside the denominator in B5’s ledger). Infrastructure deliverables (finding 19 + 31, B4-A): the journey Playwright project (testMatch: /specs\/journey-.*\.spec\.ts/, dependencies: ['setup']) + config-guard/authCookiesDependencies updates; the crates/craig-test-lib/sql/invariants/craig-cases/ bucket born with the cases-side oracles (plan_superseded_same_tx, active_plan_review_due_required — DDL-backed, BLOCKING — and cohort_bump_same_tx_as_event; these are the corpus KEYS — the earlier row text’s review_due_at_required / cohort_bump_same_tx were typos); the post-journey sweep in craig-test-lib (journey_sweep: PER-INVARIANT selectors scoped to the journey’s entity ids, LIMIT stripped, scenario-id attribution in the failure — scoping IS the pre/post baseline for the journeys that BUILD their entities, which did not exist before the run; journey 7 sweeps the SEEDED backlog rows it consumes, so its footprint is the variant’s pinned ids) fed by JourneyLedger records and run by cargo xtask e2e after every run; and the knob-evidence registry tests/e2e/knob-projects.toml — entries { project, test_match_glob, knobs } where the glob DECLARATIVELY mirrors the project’s testMatch: the pure-fs audit joins binding file → glob → project → knobs, and the config-coverage e2e spec asserts every registry glob selects the SAME spec files as its real project’s testMatch. Knob-gated rows can be Covered only via a registry project carrying their knobs; until then they cap at Partial (knob-capped)

Done (2026-09-02) — !1551 + !1552

B5

#669 — the coverage ratchet + promotion, redesigned (findings 30/32; replaces the hardcoded corpus battery via #FIX-3; PRECONDITION: #FIX-7’s synthetic second-jurisdiction policy fixture exists, so GA-leak detection is mechanical before coverage is promoted): a committed per-ID ledger compliance/scenario-coverage.lock — one entry per scenario { id, level, oracle_fingerprint = sha256(sorted oracle keys+enforcement), status }. Rules: an id may not vanish without a TOMBSTONE { id, reason, replaced_by? }; level may not lower and the oracle fingerprint may not shrink without a tombstone-reasoned replacement; status is MONOTONE (Covered may never regress). Coverage formula: per-corpus covered_count is a monotone floor; Partial = 0; knob-capped rows sit in a separately-reported bucket outside the denominator until knob evidence exists; BLOCKED rows (blocked_by non-empty) sit outside the denominator in their own reported bucket too. --bless moves the ledger only FORWARD (statuses up, counts up), is a reviewed diff, and its owner is the MAINTAINER (CODEOWNERS approval on the lock file). Audit statuses tighten with it (finding 30): oracle keys UNIQUE per row and ≥1 oracle required on t1/t2 rows; EVERY binding’s asserts ⊆ row oracles; Covered additionally requires the UNION of resolving bindings' asserts to cover ALL the row’s oracles (altitude alone stops being enough — statuses recompute, expect demotions, that is the point); journey_critical redefines to ANY-weak (≥1 store-only/none/report-only oracle flags the row, weak count reported — the ALL-weak rule missed mixed rows). Promotion: the validate step flips blocking at zero standing findings + the ledger in place. As built: the union rule and the every-binding asserts requirement forced the corpus edits that seed the first lock (the intake workflow test extended to earn its two asserts; the two flash-only placement.spec.ts bindings and the redirect-only intake-review.spec.ts binding removed; the full-spine integration bindings bind the one oracle they assert; the testonia fixture binding names its oracle; the plan and subsidy journey bindings gain the sweep stems their specs track — the two Covered rows behind the covered_floor = 1 seeds); an ABSENT lock is a finding; the sweep-stem rule (a journey may claim a sweep-run stem only if it tracks that entity kind) was added for the B4 sweep

Done (2026-09-02) — !1553 (ledger seeded at landing with the recomputed statuses; the demotions the union rule causes are the point)

B6

#670 — constraint-driven generative seeding + seed-sweep. Deferred by design (Canopy ADR-033; gated on B1–B4 maturing). The precondition schema ships in B1 as an OPTIONAL, shape-checked-only field so inventory rows can record constraints early without the resolver existing

Deferred (gated on B1–B4; tracked as #670)

Anchors: #659 #665 #660 (closed — as-built), #661 #662 #663 #666 #667 #668 #669 #670
As-built record: U0/A1/B1 = !1534; A2 = !1535 — pre-review implementation, see Status
Scale: A3 M, A4 S, A5 L, B2 XL, B3 M, B4 XL, B5 M

Decided forks (engineering-class; recorded, overridable at review)

The #664 spike named seven genuine forks for this plan and #658 left three more; with the review’s additions the full census is below. All are engineering (test-infrastructure / schema shape), none change money behavior or product policy, so they are decided here per the surface-product-forks/decide-engineering-forks doctrine:

Fork Decision

Crate homing (both schemas)

ONE new tooling crate crates/craig-policy holding BOTH the citation and scenario modules — Canopy’s proven shape (its canopy-policy homes citation.rs AND scenario.rs). Rationale: scenario policy_refs and citation keys share the same RulesetRef (file#json-path) addressing code; xtask gains ONE dep; neither schema belongs in craig-test-lib (heavy: sqlx/reqwest/lapin) nor in a service. Leaf deps only: serde, toml, thiserror, chrono, serde_json (see the JDM note in Design). Tooling-only — never a runtime dep of any service (the ADR-023/024 posture: rulesets are the verified snapshot)

authority vocabulary (#659’s issue text lists ocga)

A REAL enum (Canopy’s free-string authority let operational/federal/unlisted values leak — recorded port gotcha): pamms | federal_statute | federal_register | acf_program_instruction | state_statute | manual. ocga is dropped as redundant — the schema is jurisdiction-agnostic, OCGA refs ride state_citation under state_statute. federal_statute is added because the rulesets' densest citation family is 42 USC / 8 USC statute text, which is neither Federal Register nor program instruction

Derived values (the #658 drift-surface finding: 455-day TPR, 84-day ICPC, $1,850 AFDC proxy are CRAIG approximations)

A derivation: Option<String> field; the authority stays the underlying source family (no derived authority — "where from" and "did we transform it" are independent axes). Honesty about enforcement (review catch): whether a value IS a transformation is human judgment, so derivation is mandatory by AUTHORING DOCTRINE (ADR-070), not by machine validation — the machine checks only non-empty-when-present. ADR-070 enumerates the known derived rows (TPR 455 d, ICPC 84 d, AFDC $1,850, and — until the hard-checks U-FMAP unit retires it — the FMAP placeholder) as the seed list, and A5’s verification includes confirming each enumerated row carries it

Citation keying + the content tether

<ruleset-file>#<json-path> with node-id addressing: georgia-safety-assessment.json# nodes[id=child-vulnerability].content.rules[0] (+ optional trailing .i_age column-id for cell-level cites; <file>#description for header cites). Node id`s are stable slugs; rules are anonymous so the array index is the handle. Because an insertion above `rules[0] would otherwise RE-POINT the citation with every gate green (review stop-class), every rules[<idx>]-keyed citation MUST carry value, and resolution COMPARES it: column-tailed key ⇒ value equals the resolved cell content; rule-level key ⇒ value equals the rule’s _description. The compare runs in A1’s committed-manifest battery test from day one and is A3 check (2) thereafter. Keys are manifest-dir-relative; scenario policy_refs are workspace-relative (ruleset:rulesets/georgia/<file>#<path>)

Scenario-corpus bundle strategy (Canopy’s "never use a real jurisdiction as the engine corpus" vs CRAIG’s single real bundle)

core rows run against the GA devstack, jurisdiction-parameterized, until a second StateBundle exists. NO synthetic test-min/test-max bundle pair now (a full StateBundle is a product surface, not a test fixture — the tx-stub reference bundle is not deployable). The GA-ism-leak risk is mitigated at authoring time by the corpus split discipline (anything StateBundle-policy-dependent MUST be a georgia.* row — enforced by review, recorded in ADR-071) and revisited when bundle #2 arrives. Follow-up filed at implementation

Oracle homing + the bidirectional enforcement join

Inline rows on each scenario (self-contained; the duplication across rows is real but small). NO separate oracle-registry file — for the machine-checkable enforcement classes the invariant catalog IS the registry. The join is BIDIRECTIONAL (review stop-ship): (a) a row declaring blocking-invariant / report-only-invariant must name a real catalog stem with matching blocking-ness; (b) a row whose key matches a catalog stem MUST declare an invariant class — so an oracle cannot understate enforcement (store-only on a cataloged key) or dodge the check by relabeling. Keys under genuinely non-invariant classes are scenario-local identifiers; their only machine check is non-collision with catalog stems, recorded honestly

Post-journey invariant sweep + the missing craig-cases invariants bucket

B4’s scope, recorded now: journey specs run the report-only SQL invariant catalog as a post-journey sweep (making journeys the enforcement vehicle for the report-only oracles), and B4 creates the absent sql/invariants/craig-cases/ bucket for the cases-side oracles. Neither blocks B1 — B1’s oracle rows for catalog-less enforcement classes carry store-only/db/none honestly

The #333 UI blocker (investigation/case UI journeys dead behind epic &24)

API-level given-builders + relational asserts are the PRIMARY journey vehicle (B2/B4); UI walkthroughs are deferred per-row via blocked_by = ["#333"]. Fixing #333 is not a prerequisite of this program

Fixture construction (F-B7 — the #664 fork’s second half: owned seed fixtures vs endpoint builders, given fixtures E/G are consumed irreversibly by existing specs)

B2’s given-builders become the PRIMARY constructor for journey preconditions (endpoint-replay — the Canopy "only honest constructor" rationale: S2S-witnessed rows and event chains cannot be fabricated in SQL); craig-seed stays the BACKGROUND-caseload layer, and B3’s --scenario variants provide named background states, not per-scenario mutation targets. The single-owner-fixture rule stays for the legacy specs; new journey specs own what they build

Time control (month-granular scenarios)

Backdate-only: seed as-of + fixture anchoring covers the B4 slate; rows needing a moving clock carry blocked_by naming a follow-up issue (filed at implementation if B4 hits the wall). No fleet-wide devstack clock in this program

Knob policy

The schema’s knobs field is format-checked (CRAIG_[A-Z0-9_]+) and knob-gated rows are reported distinctly by the audit; whether the e2e devstack runs all knobs on is B4’s call. The audit itself never reads the environment (pure fs, CI-safe)

Exchange inbound / ICPC lifecycle / foster-home training-expiry machines (uncatalogued by the spike)

Excluded from corpus v1; a named follow-up reader pass is filed at implementation. (The taxonomy’s core.placement.license-capacity-gates row stands — it exercises the license gate, not the uncatalogued training-expiry machine)

Context

Epic &56 captured two coupled gaps: the 6 hand-authored Georgia program rulesets cite policy only as _description prose (no machine provenance, no currency, no drift detection), and the test estate has no narrative layer (no scenario inventory, no journey specs, no coverage gate). Discovery closed both unknowns:

  • #658 (Stream A spike): the PAMMS-CWS manual is a PUBLIC git repo in CRAIG’s own GitLab group (gadhs/pamms-sources/dfcs-cws, Antora, Policy N.M ⇒ modules/cws/pages/NN-MM.adoc, richer per-page metadata than the OFI side). GO on a git-backed PolicySource. The citation audit it ran found most hand-authored citations wrong under the current manual numbering — fixed by #1604 BEFORE this plan, so the manifest never enshrines wrong numbers. Crate recommendation: new craig-policy, manifest keyed ruleset-file#json-path (CRAIG’s citable values live in JDM JSON, not a jurisdiction.toml — the one deliberate divergence from Canopy).

  • #664 (Stream B spike): a 22-scenario taxonomy grounded in the actual transition tables, each row with 2–5 relational oracles and their at-spike-time enforcement class (the audit resolves CURRENT truth — e.g. perdiem_placement_duplicate has since gone BLOCKING); the id convention ({corpus}.{stage}.{slug}); the schema proposal (first-class rows — the CRAIG addition over Canopy ADR-032); the ranked #668 priority slices. The findings comment on #664 is the canonical transcription source for the initial corpus.

Prior art is ported, never consumed: Canopy ADR-011 (citations, PolicySource, audit/drift) and ADR-032/033 (two-tier corpus, relational oracles). The port maps — including Canopy’s verbatim type shapes, its resolve_binding code, its three cache_sync regression guards, and its staged advisory→blocking rollout history — were captured by dedicated readers at plan time.

Design

Stream A — the citation manifest (A1 scope; A2–A5 consume it)

crates/craig-policy/src/citation.rs, ported from Canopy with five deliberate changes (typed Authority, derivation, RulesetRef keys + resolver, the rule-key value content tether, dates validated as real dates):

CitationManifest { meta: CitationMeta, citations: BTreeMap<String, Citation> }
CitationMeta    { jurisdiction, schema_version: u32, last_full_audit, audited_by }
Citation {
    value: Option<toml::Value>,        // REQUIRED on rules[<idx>] keys (content tether);
                                       // mirror of the governed cell / rule _description
    authority: Authority,              // the six-variant enum (serde snake_case)
    source_ref: String,                // pamms: cache-relative "<repo-slug>/<path>.adoc",
                                       // e.g. "dfcs-cws/modules/cws/pages/19-11.adoc"
                                       // (the Canopy live shape; A2's pin recompute joins
                                       // .policy-cache/<source_ref>); statutes: citation string
    section: Option<String>,           // in-page anchor ("#requirements") or section name
    manual_transmittal: Option<String>,// the :mt: xref target verbatim (CWS caveat from #658)
    effective_date: String,            // validated YYYY-MM-DD (string for TOML-date-vs-string neutrality)
    federal_citation: Option<String>,
    state_citation: Option<String>,
    verified_date: String,             // validated YYYY-MM-DD
    verified_by: Option<String>,
    derivation: Option<String>,        // authoring-doctrine-mandatory on transformed values
    notes: Option<String>,
    source_sha256: Option<String>,     // 64-lowercase-hex; back-filled by A2's --pin
}

Shape validation (pure fns, all issues collected then reported — never first-error-wins): every key parses as a RulesetRef; value present on every rule-indexed key; authority-conditional requirements (pamms ⇒ source_ref is a relative .adoc path; federal_statute/federal_register/acf_program_instruction ⇒ federal_citation present; state_statute ⇒ state_citation present); dates parse (chrono::NaiveDate); sha256 well-formed when present; derivation non-empty when present; verified_date not in the future (today injected by the caller) and verified_by required when source_sha256 is present (#1620).

RulesetRef grammar: <file>#<path> where path is description (header) or nodes[id=<slug>].content.rules[<idx>] with an optional .<column-id> tail. The resolver walks the ruleset’s JSON and answers Resolved/NodeMissing/RuleIndexOut/ ColumnMissing — and on Resolved, when the citation carries value, compares it against the resolved content (cell for column-tailed keys, _description for rule-level keys; mismatch is its own outcome). JDM files are a third-party schemaless format (zen-engine), so the walker navigates serde_json::Value behind the quality-budget exemption marker (// STRUCTURAL-VALUE: <reason> on the line above each literal use — the B3a budget counts un-marked serde_json::Value in src/). A full typed JDM mirror would be a fragile parallel schema; rejected. The crate’s tests resolve-and-compare EVERY key of the committed Georgia manifest against the live ruleset files, so a renumbering OR a rule inserted above a cited index fails the battery even before A3 exists.

Evidence honesty: value mirrors what the RULESET says, not what the manual says — manifest↔manual consistency is A3+A4’s job (hash-pin + human re-read); manifest↔ruleset consistency is mechanical from day one (the tether above). Rows whose cited page states no value (the AFDC flat proxy; historically the FMAP placeholder, retired by the hard-checks U-FMAP unit in favor of effective-dated bundle reference data) carry derivation + notes saying exactly that, per the #1604 wording.

Proof-of-shape population: georgia-safety-assessment.json — the 4 explicit Policy-19.11 cites (header + present-danger rule + the 5-criterion impending-danger row + the age-0-5 vulnerability row) plus the age-band and safety-decision threshold rows, keyed per the convention, source_ref = "dfcs-cws/modules/cws/pages/19-11.adoc", verified_date = 2026-08-29 / verified_by citing the #1604 content-evidence audit. No source_sha256 yet (pinning is A2’s --pin; hand-pinning without the sync machinery would create pins nothing can recompute) — the A3 pin-presence check is warning-tier until A5 exactly so this window is visible, not silent.

ADR-070 records: the provenance model, the authority vocabulary decision (incl. dropping ocga), the derivation doctrine + the enumerated derived-row seed list, the keying convention + the content-tether rule and its index-stability argument, the verified_date-is-attestation honesty note, the tooling-only rule, what A2–A5 add (incl. the A3 universe floor + pin-presence check and the A4 UNPINNED class + scheduled advisory CI job), and the drift-is-advisory-forever inheritance.

Stream B — the scenario inventory (B1 scope)

crates/craig-policy/src/scenario.rs. Corpus files: compliance/scenario-inventory/ {stage}.toml (the core corpus — bundle-independent truths; B1 creates the top-level compliance/ dir) and rulesets/georgia/scenarios/{stage}.toml (the jurisdiction pack). BOTH corpus directories are mandatory once created: the audit FAILS if either is absent or parses to zero rows (a deleted corpus must never green the gate). Schema per the #664 decision:

ScenarioEntry {
    id,               // {corpus}.{stage}.{kebab-slug}; corpus ∈ {core, <jurisdiction>};
                      // stage ∈ {intake, screening, investigation, case, plan, placement,
                      //          financial, subsidy, claiming, permanency, reporting,
                      //          identity, exchange}  (closed); globally unique
    title,
    tier: Tier,       // t1-core | t2-variant | t3-edge   (implementation priority)
    level: Level,     // unit | flow | journey  (ORDERED — required test altitude)
    slice,            // entity arrow-path (grammar below)
    journey,          // prose actor summary
    policy_refs: [],  // "ruleset:<ws-relative-file>#<json-path>" | "adr:ADR-0NN"
    knobs: [],        // CRAIG_… env knobs the scenario requires ON (format-checked)
    blocked_by: [],   // "#NNN" issue refs
    bindings: [],     // [[scenario.binding]] (B5 extends: asserts on EVERY binding)
    oracles: [],      // [[scenario.oracle]]  — the CRAIG addition
    preconditions: [],// [[scenario.precondition]] — OPTIONAL, shape-checked only (#670)
}
ScenarioBinding { kind: e2e-spec | integration-test | ruleset-fixture,
                  file/describe/test_ref/fixture,
                  asserts: [] }  // oracle keys this binding asserts; REQUIRED (non-empty,
                                 // keys ∈ the row's oracles) when the binding serves
                                 // Journey — the #664 "journeys stay honest" rule
ScenarioOracle  { key, relation, enforcement: blocking-invariant | report-only-invariant
                                              | db | store-only | reconcile | none }

slice grammar (normalized at authoring — the taxonomy’s prose slices are reshaped to fit): segments joined by →; each segment entity or entity(detail) where entity must be in the closed registry and detail is free-form (states, transitions, disambiguators). The registry (a const in the crate, carried in ADR-071): person, report, screening_decision, referral, investigation, case, case_household, case_assignment, case_plan, contact, court_order, placement, foster_home, foster_home_license, kinship_option, payment, payment_adjustment, claim, ive_determination, subsidy_agreement, subsidy_review, subsidy_import_record, afcars_submission. Unparseable slice or unknown entity = audit finding.

Coverage derivation (as-built today; B5 TIGHTENS it): no bindings → Uncovered; all bindings dangling → Uncovered + findings; best-RESOLVING binding’s served level ≥ the row’s level → Covered; else Partial. FROM B5: Covered additionally requires the UNION of resolving bindings' asserts to cover ALL the row’s oracles, asserts becomes required (⊆ row oracles) on EVERY binding, and journey_critical flags ANY-weak rows (≥1 store-only/none/report-only oracle) instead of ALL-weak — the per-ID coverage ledger enforces the transition (see B5). Served levels are path-derived, never declared: e2e-spec serves Journey iff the spec file is journey-.spec.ts, else Flow; integration-test serves Flow iff the file lives under crates/craig-test-lib/tests/ (the cross-service harness home), else Unit; ruleset-fixture serves Unit. Two path-derivation residues recorded in ADR-071 (the gate defends against drift and honest mistakes, not adversarial inventory authors — corpus edits are reviewed code): renaming a spec journey- mints Journey service, and a trivial test under the harness dir serves Flow.

Binding resolution is declaration-anchored, not substring (review major — a describe title in a comment, or a test.describe.skip, must NOT resolve): e2e-spec resolves iff the file contains a test.describe( (incl. .serial/.parallel variants) whose FIRST string argument equals the bound title, and that declaration is not .skip/.fixme; integration-test (test_ref = path::fn_name) resolves iff the file declares fn <name>( carrying a [test]/[tokio::test] attribute in its attribute block — [ignore] deliberately does NOT dangle (implementation catch, recorded: in this repo [ignore = "requires devstack"] is the devstack GATE and the battery runs --run-ignored=all, so ignored tests execute on every pre-push — treating them as parked would have falsely dangled every cross-service workflow binding); ruleset-fixture (fixture = workspace-relative JSON path) resolves iff the file exists, parses as JSON, and — when it is a JDM document — has non-empty nodes (the Canopy SHELL-fixture rule generalized: binding a parseable-but-empty fixture is a dangling-class finding, "a gap laundered into covered"). Anchoring is regex-over-source, declaration-shaped; its residual coarseness is recorded in the lint’s doc comment.

Audit checks (cargo xtask scenarios audit, pure fs, CI-safe; heavy logic in craig-policy, xtask owns only corpus discovery, the invariant-catalog join, and reporting): (1) per-row schema + id grammar + closed vocabularies (stage list, entity registry) + the journey-binding asserts rule; (2) global id uniqueness across ALL corpus files; (3) corpus↔file consistency (a georgia. id in the core corpus dir or vice versa = finding); (4) binding resolution per the declaration-anchored rules above; (5) policy_refs resolution — ruleset: refs resolve via the A1 RulesetRef resolver, adr: refs match an existing adrs/adr-0nn-.adoc; (6) the BIDIRECTIONAL oracle-enforcement join (fork table above) — including the stem↔header-name equality assertion across the invariant catalog (the xtask gate keys blocking-ness off the header name; the audit joins on filename stem; the audit asserts they agree catalog-wide so it can never attest a blocking-ness the real gate doesn’t enforce); (7) knob + blocked_by format; (8) reverse audit — every on-disk tests/e2e/specs/journey-.spec.ts must appear as some binding (vacuously green today; activates at B4). Report additions: per-corpus row counts (with the absent-dir/zero-row failure), knob-gated rows, and the *journey-critical tally — rows where every oracle’s enforcement ∈ {store-only, none, report-only-invariant} (journey coverage is the ONLY enforcement — the #664 mechanical priority signal for B4).

Exit semantics and the blocking surface: any finding → exit 1; uncovered rows → counted report (the burn-down metric; Canopy doctrine: "uncovered scenarios never fail; lies in the inventory always do"). The validate wiring is an ADVISORY report_* step (end of phase_doc_lints) that prints the coverage summary + a hard FINDINGS: N count — but the committed corpus is ALSO audited by a #[test] in the battery (xtask fixture-test tier), so an inventory lie fails every pre-push from day one even while the validate step stays advisory; B5 promotes the step itself per its stated criteria. The standalone command is the operator surface meanwhile.

Initial corpus: the 22 taxonomy rows from the #664 findings comment, transcribed with their oracles re-resolved against the CURRENT invariant catalog (the spike’s enforcement snapshot has already drifted once), bound to the coverage that exists today (exact describe titles and test fn names captured at plan time — e.g. workflow_public_report_to_referral, Intake Report Review, the subsidy specs). Expect the honest opening report: most rows Partial or Uncovered.

Precondition rows (B6 forward-compat): is accepted and shape-checked only (relation/subject/param/count fields; the §8 no-literal rule enforced syntactically — a param naming policy dollar values may not be a bare number); the resolver against policy params is #670’s. Rows in the initial corpus carry none.

ADR-071 records: the two-corpus split + the GA-devstack decision, the id convention (and why stage replaces Canopy’s program segment), first-class oracles + the bidirectional enforcement join, the journey-binding asserts rule, path-derived served levels + their recorded residues, declaration-anchored resolution, the entity registry, the shell-fixture rule, uncovered-as-report, and the B5 promotion criteria.

Verification

Per-unit, for the UNIMPLEMENTED units (finding 33 — the old section mostly re-verified as-built A1/B1):

  • A3: fixture jurisdictions exercising every finding class — uncited rule row, header-only file (must NOT green the rows), authz file with/without exception, orphaned exception, expired review_by, texas-shaped dir (non-authz rulesets
    exceptions-only manifest), pin-absent pamms row pre/post the A5 flip; the universe count printed per jurisdiction and file-granularity bucket.

  • A4: CHANGED/MISSING/UNPINNED/ACKED classification fixtures; ack expiry re-raises; ack hash-mismatch re-raises; the CI job fires ONLY under POLICY_DRIFT == "true" (rules audited in the .gitlab-ci lint fixture); artifact presence.

  • A5: the committed GA manifest resolves + tethers clean at full universe (the A3 gate flipping blocking IS the acceptance test); spot content-verification recorded per row in the MR (verification-human).

  • B2: each builder round-trips against devstack (create → typed id → readable); re-run-after-partial-build converges without duplicates; two workers' runIds never collide (name-collision probe).

  • B3: same --seed + same slugs ⇒ byte-identical seed.ts; absent slug ⇒ visible spec skip; reseed threads slugs.

  • B4: per journey — the named oracle assertions execute (a deliberately broken oracle fails the spec, pinned once via a mutation fixture); the post-journey sweep catches a seeded violation scoped to the journey’s ids; the knob registry’s buckets are pinned on the audit’s fixture row (journey 7 itself carries no knobs — the generator is not knob-gated).

  • B5: ledger mutation matrix — id deletion without tombstone, level lowering, fingerprint shrink, status regression, denominator gaming via easy-row addition (floor is COUNT-monotone per corpus so additions never lower it, and Covered requires oracle-union) — each a named failing fixture; promotion flips only at zero findings.

  • Every unit: full battery + contextless J-review.

Out of scope (recorded)

  • Automated statute/manual → rules transpilation (the epic’s explicit non-goal).

  • Runtime use of craig-policy by any service (tooling-only; rulesets stay the verified snapshot).

  • Rule-content enrichment, non-Georgia jurisdictions (schema is jurisdiction-agnostic; only GA populates here).

  • The generative seed harness + precondition resolver (#670, gated on B1–B4).

  • A synthetic StateBundle test pair (revisit at bundle #2; follow-up filed).

  • Retro-fitting sql/invariants/craig-cases/ before B4 (B4 creates it with the first cases-side journey oracles).

Edit this page · latest