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 |
Done (2026-08-31) — the foundations MR |
A2 |
#660 — |
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 — |
Done (2026-09-01) — MR feature/661-a3-policy-audit; as designed, plus: the audit
logic lives in |
A4 |
#662 — |
Done (2026-09-01) — MR feature/662-a4-policy-drift; as designed, plus: the
classification is pure ( |
A5 |
#663 — populate citations for the remaining GEORGIA program rulesets |
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 |
B1 |
#665 — scenario-inventory schema (scenario module in |
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
( |
Done (2026-09-01) — !1549 |
B3 |
#667 — |
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 |
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 |
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:
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: newcraig-policy, manifest keyedruleset-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_duplicatehas since gone BLOCKING); the id convention ({corpus}.{stage}.{slug}); the schema proposal (first-classrows — 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-policyby 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).