Plan: Intake-Screening Evaluation at the Screening-Decision Act (#1630 criterion 2, epic &88)
- Archive record
- Status
- Context
- Scope
- Design
- A. One ruleset per jurisdiction owns the screening act (GA v1.3, TX v1.2)
- B. The request (
crates/craig-cases-contracts/src/reports.rs; replacesRecordDecisionRequest, pre-1.0 BREAKING) - C. The act (
api/reports/decisions.rs+ newapi/reports/screening_consult.rsandscreening_surface.rs) - D. Persistence (
services/craig-cases/migrations/20260906120000_screening_decision_provenance.sql, ADDITIVE) - E. Surfaces (the same MR as C / D — the wire shape moves together)
- F. Retire the
case.intake_created→ craig-rules binding (U1; the producer stays — craig-security audits it)
- Steps
- Files Touched
- Verification
- Documentation Updates
- Review log
- Errata
Status
Done (2026-09-07) — !1581
- Anchors
-
#1630 (criterion 2; criteria 1 and 3 shipped — ADR-072 §CSEC ruling), #1054 (closed: the id bug; the payload gap is this plan), epic &88, follow-on #1693, residue #1694 (Texas track tokens), #1695 (NOT NULL contract migration), #1696 (children cap at the cases create boundary), #1692 (matching-layer rules 403 → 500, open), #1690 (Texas county time zones), #661 (citation blocking flip).
Context
The intake-screening ruleset (rulesets/georgia/georgia-intake-screening.json v1.2,
rulesets/texas/texas-intake-screening.json v1.1) is tier-1 policy cited to PAMMS 3.2 / 3.32, but it is
evaluated today only from the case.intake_created domain event, whose payload is
{investigation_id, referral_id} (services/craig-cases/src/events.rs:36-43; the consumer feeds it
verbatim as the ruleset input, services/craig-rules/src/main.rs:744-798, binding :496). Under zen’s
absent-key semantics no criteria row matches, so every rule_evaluations row is a catch-all artifact with
no screening_decision, and the output has zero consumers. The human screening decision
(POST /v1/cases/reports/{id}/screening-decisions, services/craig-cases/src/api/reports/decisions.rs:98-175)
never consults the ruleset at all.
Two live defects the v1 review exposed are fixed here because the act is rewritten anyway: the route
trusts the request body’s actor_role for the allowlist and override-authority checks
(decisions.rs:111, :138; tests/api/reports.rs:179 shows a caseworker client acting as
county_supervisor), and attribution persists the outer bearer rather than the acting worker
(decisions.rs:152-156, while the intent hash at :148 already uses claims.acting_worker()).
Rulings (2026-09-05). (1) Minimal scope: criterion 2 only. (2) "The shape of what’s possible should be
generic and the actual rule should be in rules." (3) Path A: the generic shape ships correctly now;
Georgia’s admissibility row is ADVISORY — every disposition admissible, the verdict recorded and shown,
disagreement a stored fact — because the v1.2 criteria are not policy-complete (special circumstances
3.0:95-100, the alternate jurisdiction path 3.2:39-43, emancipation 3.2:30, locatable vs identified,
history states 3.2:247-251, historical incidents 3.2:52 / :281-296 — an 18+ alleged victim with other
children in the home, which the Georgia 18-or-older screen-out row contradicts today — impending danger,
alerts, legal mandates) and binding on them would reject policy-authorized cases. Binding PER-SUBJECT
prohibition rows arrive with the policy-complete criteria (#1693) and flip by ruleset promotion, no code
change; a rule that needs a report-level aggregate ("no evaluated child qualifies", or one that reads
non-victim children) needs an aggregate input or a code change, scoped to #1693 (§C "Which children"). (4) Screening is an intake-tier act: admin, state_office,
eligibility_worker, icpc_coordinator and readonly are deliberately UNMAPPED (403) — today admin
records decisions by self-declaring cicc; that goes (CHANGELOG Removed).
ADRs applied. ADR-027 (no state assumptions in code); ADR-072 (tier-1 predicates and vocabularies in
JDM; consult via POST /v1/rules/evaluate; operative pin: None; persist evaluation id + revision
version; single source of authority; the #1578 self-tier supersession rule is STRUCTURAL and stays in
Rust); ADR-006 §PII (the input document lands in rule_evaluations.input — booleans, tokens, ages in
years only); ADR-003 (binding removal is one act + §amendment); ADR-070 (every governing row cited;
value = the row _description; derivation for CRAIG-transformed values); ADR-062 (precheck before
any volatile dependency; claim_first first in the domain tx); ADR-058 / #1130 (the full evaluated
document is the rules-side single copy — cases persists attested inputs, parsed business outputs, the
evidence snapshot and the pointer, the ive_determinations shape); ADR-063 (an ADDITIVE migration never
touches schema_compat_floor — 20260802210000_schema_compat_floor.sql:8-12, ADR-063 §D3; N−1 rollback
stays open); ADR-068 (a typed 503 is for TRANSIENT conditions only); pre-1.0 breaking changes under
CHANGELOG Changed / Removed with an ordered rollout runbook.
Scope
In scope
-
The two intake-screening rulesets own the screening act:
metadata.screening(allowlists, the realm-role → policy-role mapping, the attestable-fact list), declared input and output schemas (Draft-7, carried as JSON STRINGS — zen’s wire shape), neutral input keys, anINSUFFICIENT_INFORMATIONterminal row, adisposition-admissibilitytable (advisory rows), full citation coverage of the four tables. -
The screening-decision act consults the ruleset synchronously with the real facts: a bounded attested document validated against the attestable subset, server-derived context and per-victim-child evidence, N concurrent evaluates under one budget, fail-closed parse, the admissibility conjunction, per-evaluation provenance rows.
-
Trusted actor:
deny_pure_service; the policy role derived from the ACTING worker’s realm roles through the ruleset mapping; the acting worker persisted as the actor;actor_roleoff the wire. Pre-cutover prior rows keep their legacy tokens until the CONTRACT migration #1697 rewrites them after every N−1 writer is drained (two-phase expand/contract, ruled at the U1 gate); until then U2 refuses their supersession fail-closed with the token named — no config map. -
Additive persistence + a report-only invariant (#1695 promotes it); the effective-disposition view and models carry provenance;
evaluation_idson the disposition event with a strict contract created for it. -
GET /v1/cases/screening-surfacefor clients; a Critical surface-verifier worker for the active ruleset (screening routes only;/readyzuntouched); the{j}-screening-policy.jsonfiles and their client fetch retired (folded into the intake-screening ruleset); the reportchildrenlist capped at the cases create boundary (the intake edge already caps at 10). -
The
case.intake_created→ craig-rules binding retired (producer stays), with the live broker cutover, the ruleset-promotion ordering and the rollback order. -
craig-web form and views, CLI, test-lib, e2e, generated API docs, Antora pages, ADR-072 amendment, CHANGELOG.
Out of scope (each with its issue)
-
The act on the report, retiring
screening_decisions, the special-circumstance classes, the derived response deadline, policy-complete criteria and BINDING admissibility — #1693. -
Texas track rows keyed on tokens the fleet never produces (the Texas
allegation_typeschema stays an open string until #1694 tightens it). The NOT NULL contract migration — #1695. Cappingchildrenat the cases create boundary is IN scope; a shared constant across the intake edge and the SDKs is #1696. Flippinggeorgiainto the citation audit’s blocking set — #661. Texas county time zones — #1690. The matching-layer rules 403 → 500 fold — #1692. -
response_time_expiredis DECLARED in the input schema and not derived in this program (it is derivable from the prior decision’s persistedjurisdiction_outputs+decided_at; #1693 derives it).
Design
A. One ruleset per jurisdiction owns the screening act (GA v1.3, TX v1.2)
{j}-intake-screening gains, in ONE file:
-
A
metadata.screeningblock: the allowlists that{j}-screening-policy.jsoncarries today (disposition_kinds,follow_up_action_kinds,convertible_dispositions,override_authority;rulesets/georgia/georgia-screening-policy.json:5-22), the role mappingactor_roles: [{ token, realm_roles: […], rank }], andattestable_facts: [{ key, title, description }]— the questions the UI renders, per jurisdiction, in the jurisdiction’s own words (Texas keeps "Immediate risk of death or serious harm" as the title of itspresent_danger_indicatorsslot; the neutral key is a SLOT, not a definition — recorded in the derivation). -
inputNode.content.schema(Draft-7,additionalProperties: false,required: []) andoutputNode.content.schema(Draft-7;required+ typedproperties, additional output keys allowed) — carried as JSON STRINGS holding the serialised schema: zen-types deserialisescontent.schemathroughempty_value_string_is_none_safe(zen-types-0.54.0/src/decision/mod.rs:73-83, :228-238— it wrapsempty_string_is_none, thenserde_json::from_str(..).ok()), so an inline object failsDecisionContentdeserialisation (the seed rejects the file) and a string that does not parse silently becomes NO schema. zen validates both at every evaluate (zen-engine-0.54.0/src/nodes/input/mod.rs:19-21,output/mod.rs:19-21) but COMPILES a schema only at the first evaluation (nodes/validator_cache.rs:28) — hence therules checklint parses AND compiles both (Draft-7) and the*_off_schema_key_is_an_engine_error,*_output_schema_rejects_a_missing_required_keyand*_schemas_are_parsable_stringspins guard the runtime. -
The
disposition-admissibilitydecision table (hitPolicy: first, six inputs, two outputs, one wildcard row that carries EVERY input id — zen never matches a row missing an input id,nodes/decision_table/mod.rs:113) wired by THREE edges:input →(its own inputs),screening-criteria →(it readsscreening_decision) and→ output(zen runs a node once every incoming neighbour has, on the merge of their outputs —decision_graph/walker.rs:47-54, :109-137, :154-159).
{j}-screening-policy.json and the ScreeningPolicyClient fetch of it are retired in U2 (the client is
renamed ScreeningSurfaceClient, module src/screening_surface_client.rs) (pre-1.0
Removed; the client re-points to the intake-screening ruleset — the same by-name GET, so ONE
(rule_set_name, revision) is persisted for allowlists + mapping + verdict). The by-name body already
carries revision (services/craig-rules/src/api.rs:371-378 returns store::RuleSet, store.rs:10-21);
cases' own decode (screening_policy.rs:179, fed by the by-name fetch at :239-275) reads it into the
surface struct beside content.metadata (today it reads only the metadata; it must ALSO read the
top-level revision) — no craig-authz change.
Georgia role mapping (approved at the gate; recorded with an ADR-070 derivation):
| policy token | realm roles (crates/craig-auth/src/claims.rs REALM_ROLES) |
rank | manual actor |
|---|---|---|---|
|
|
1 |
Centralized Intake Specialist (CIS) at the CICC — PAMMS 3.2:106-107 |
|
|
2 |
Centralized Intake Specialist Supervisor (CISS) — 3.2:180-181, :216-219 |
|
|
3 |
County Director (3.2:94-95) |
|
|
4 |
Regional Safety FPS / Lead FPS (3.2:97 NOTE) — the realm has no FPS role; |
The highest rank among the acting worker’s realm roles wins — claims.acting_worker() returns the
lifted actor’s Claims (claims.rs:340-342), so acting_worker().realm_access.roles is the ACTING
worker’s under BFF relay and the bearer’s otherwise; no match → 403 screening-actor-unmapped (ruling 4:
admin, state_office, eligibility_worker, icpc_coordinator, readonly are unmapped on purpose).
Reachability of the office rows — a fork for the gate: the report authz ruleset
(rulesets/georgia/georgia-authz-report.json:21-52) has no office-role inputs, so a PURE County Director
(paula.county, the #1624 two-axis probe user) is refused at the authz Update step BEFORE the mapping
runs; dana.county reaches county_director only because she also holds supervisor. This page records
option (b): the office tokens presuppose a co-held caseworker / supervisor realm role, pinned by
pure_county_director_is_403_at_report_authz. Option (a) — grant Update on Report to county_director
and regional_director in georgia-authz-report.json (a ruleset row, tier 1) — widens who may act on
reports and is the maintainer’s call.
override_authority is re-keyed to these tokens, the FULL list: county_director and regional_fps
supersede cicc_intake AND cicc_supervisor (3.2:94-95 the County Director override of a CICC
acceptance decision; :97 extends it to the Regional Safety FPS / Lead FPS — the :94 conditions become
BINDING rows only in #1693: the window needs response_time_expired, derived there; the direction inputs
and the rationale requirement are already in place here, so the binding flip is a ruleset promotion);
cicc_supervisor supersedes cicc_intake (the CICC supervisory approve / reject of an intake decision,
3.2:216 — today’s single cicc tier is split, so the edge must be declared or the self-tier rule no
longer covers it); the #1578 self-tier rule stays. Today’s county_supervisor ⊃ cicc pair
(georgia-screening-policy.json:20-22) is carried by county_director ⊃ cicc_intake; the three legacy
tokens persisted on pre-cutover rows (cicc, county_supervisor, caseworker) are NOT mapped by
config — a config map was a pre-1.0 compatibility shim; the U1 gate ruled the two-phase cutover: U2
(expand) refuses a legacy-token prior fail-closed, and the contract migration #1697 rewrites the values
once no N−1 writer remains (§C, §D, §E). Texas
mirrors Georgia STRUCTURALLY, every value marked ⁂ uncited pending #1694 in its derivation (U1 authors
it; Texas has no policy file to copy from): swi_intake ← caseworker (rank 1), swi_supervisor ←
supervisor (2), county_director ← county_director (3), regional ← regional_director (4); the same
three override edges (county_director / regional ⊃ swi_intake + swi_supervisor; swi_supervisor
⊃ swi_intake); the three value allowlists (disposition_kinds, follow_up_action_kinds, convertible_dispositions —
georgia-screening-policy.json:7-18) copied verbatim; attestable_facts titles for its seven keys
(maltreatment_alleged, child_in_state, child_identified, alleged_maltreater_is_caregiver,
present_danger_indicators titled "Immediate risk of death or serious harm", injury_non_mobile_infant,
prior_cps_safety_concerns) — the code knows only the mechanism.
Input schema keys (the "shape of what’s possible"). Attestable facts, all optional boolean (unknown =
absent): maltreatment_alleged, child_in_state, child_identified, alleged_maltreater_is_caregiver,
present_danger_indicators, visible_injuries_reported, prior_cps_history (Georgia);
injury_non_mobile_infant, prior_cps_safety_concerns (Texas — kept distinct: narrower predicates than
Georgia’s). Server-derived keys — ONE source, pub const SERVER_DERIVED_FACT_KEYS: &[&str] in
crates/craig-cases-contracts/src/reports.rs, LANDED BY U1 (the lint consumes it first; xtask gains the
craig-cases-contracts dependency in U1; U2 builds the request shape around it) and consumed by the act’s
assembly, the verifier worker and the xtask lint — declared so a future binding row can read
them (NOT attestable): allegation_type (Georgia: enum of the eight AbuseType tokens; Texas: type: string until #1694),
child_age (integer 0–130), child_is_victim, proposed_disposition (enum: the allowlist), actor_role
(enum: the mapping tokens), is_initial_decision, prior_disposition, prior_actor_role (present only
when superseding), response_time_expired (declared, not derived here). Renames (input field`s only —
rows reference input ids): Georgia `child_in_georgia → child_in_state; Texas child_in_texas →
child_in_state, alleged_perpetrator_is_caretaker → alleged_maltreater_is_caregiver,
immediate_risk_serious_harm → present_danger_indicators.
Table edits. screening-criteria: append the terminal all-wildcard row → screening_decision
"INSUFFICIENT_INFORMATION", referral_type "NONE", basis "not decidable on the attested facts — follow up with the reporter and analyse DFCS history before
deciding (Policy 3.2 Making an Intake Decision with Limited Information, 03-02.adoc:247-249); a screen-out
may be considered only after reporter follow-up and history analysis, when the child or family cannot be
identified or located and no history assists (:248-251)". response-priority and
track-assignment rules[0]: the screening cell becomes the comma-OR "SCREEN_OUT",
"INSUFFICIENT_INFORMATION" (zen unary: comma = OR, zen-expression-0.54.0/src/parser/unary.rs:39-40) AND
their _description / basis texts are rewritten to "Not screened in (screened out or insufficient
information) — no response priority / track" (the tether changes; the citation rows re-attest).
disposition-admissibility (inputs screening_decision, proposed_disposition, actor_role,
is_initial_decision, prior_actor_role, prior_disposition; outputs disposition_admissible bool,
admissibility_basis): Georgia = ONE wildcard row → true, basis "ADVISORY (2026-09) — this
ruleset’s v1.3 criteria are not policy-complete (3.0:95-100 special circumstances, 3.2:39-43 alternate
jurisdiction, 3.2:30 emancipation, 3.2:247-251 limited information, 3.2:52 / :281-296 historical
incidents), so CRAIG records the verdict beside the human disposition without binding on it; binding rows
arrive with #1693" (the manual’s criteria are
mandatory — 3.2:59, :73 — the limitation is the ruleset’s, never Georgia’s) — authority = "manual" with
a derivation.
Texas: the same advisory row, basis "no Texas admissibility policy sourced". Output schema required:
screening_decision, screening_basis, referral_type, disposition_admissible, admissibility_basis,
plus the jurisdiction’s own (response_priority; investigation_track / response_track).
Citations (rulesets/georgia/citations.toml, the ADR-070 row shape at :203-213): EVERY governing row
of the four tables — 25 rule rows (criteria 0–9, priority 0–6, track 0–6, admissibility 0; 21 new beside
the 4 that existed) plus the #description header row carrying the role-mapping derivation (the CIS /
CISS / County Director rows, regional_director as the standing proxy for the Regional Safety FPS,
option (b), the neutral-key slots, the #1697 cutover). A pamms row whose encoding NARROWS or WIDENS the
source carries a derivation naming the gap (criteria 0 — COMMUNITY_RESOURCE emitted unconditionally;
3 — the alternate-jurisdiction prong folded into one attestation; 4 — screens out before the reporter
follow-up the source requires; 6 — the LAW_ENFORCEMENT referral is CRAIG routing; 7 — emancipation and
historical incidents not read; 9 — the total-table fall-through reading); rows the manual does not state
are manual with a ⁂ derivation (priority 0 / track 0 the "not screened in" fold; priority 2–5 the
allegation / injury / age / history proxies where 3.32 reads impending danger, re-derived by #1693; track
1–6 a vocabulary matching none of 3.2’s ISA / Investigations / Special Investigations, replaced by #1676;
admissibility 0 — the limitation is the ruleset’s). Pins back-filled by policy sync-cache --pin. Georgia stays
advisory-tier in xtask/src/cmd/policy.rs BLOCKING_JURISDICTIONS (#661). Texas stays UNCITED in this
program (status quo — rulesets/texas/ has no manifest; #1694 owns Texas policy sourcing).
Rules tests (services/craig-rules/tests/georgia_ruleset_evaluation.rs, texas_ruleset_evaluation.rs):
the renamed keys everywhere (field-only renames — rule cells reference input ids); the helper split
into load_ruleset_json / try_evaluate_document / try_evaluate_ruleset (the original panicked on
error, so the schema pins could not assert on it); the Georgia enum makes two existing cases engine
errors, so they change — "none" in ga_intake_screen_out_no_maltreatment → "neglect" (same expected
row) and the "human_trafficking" negative leg of ga_intake_trafficking_waives_caregiver_and_jurisdiction
→ the pin ga_intake_off_schema_token_is_an_engine_error; the Texas cases keep their tokens
(neglectful_supervision, trafficking, none, medical_neglect) under the open-string Texas schema and
change only by the renames (#1694 owns the tightening). Pins per jurisdiction:
_absent_facts_are_insufficient_information ({} and a partial input → decision / referral / priority /
track / disposition_admissible), _off_schema_key_is_an_engine_error, _admissibility_is_advisory
(initial and superseding legs), _output_schema_rejects_a_missing_required_key (parse the JSON, DROP the
criteria table’s o_screen output DECLARATION, compile, evaluate, assert the error names
screening_decision), _schemas_are_parsable_strings (Texas asserts the open allegation_type).
Lint. cargo xtask rules check (a subcommand as of U1, on the policy pattern — the same
rules::check() that validate runs; check_in(root) is the seam the shipped_rulesets_pass_check
test drives) — validate_metadata (xtask/src/cmd/rules.rs; the #212 top-level shape check plus
seed_sources / name-similarity for EVERY ruleset) is EXTENDED with a screening branch scoped to
rulesets carrying metadata.screening, behind a typed ScreeningLintError (one variant per check,
formatted at the existing string boundary): the three allowlists non-empty string arrays; actor_roles
parsed (non-empty token; unique non-empty realm-role strings; INTEGER rank ≥ 1 — 1.0 refused);
tokens unique; ranks unique; realm roles ⊆ craig_auth::REALM_ROLES (xtask gains craig-auth) and each
in at most one token; the input node’s content.schema a JSON STRING that parses AND compiles as
Draft-7 (jsonschema::draft7::new; xtask gains jsonschema) with type: object,
additionalProperties: false and properties; tokens ⊆ the actor_role and prior_actor_role enums
(an enum of strings required); override edges string pairs naming mapping tokens; attestable_facts
{key, title, description} non-empty, unique keys, each key a boolean / enum property and never in
craig_cases_contracts::reports::SERVER_DERIVED_FACT_KEYS (xtask gains craig-cases-contracts; the
const LANDED in U1); every server-derived key declared; the output node’s schema a string that parses,
compiles, and carries a non-empty required. The mapping parser is proptested. The top-level actor_roles refusal and
the -screening-policy.json file-bucket rule in crates/craig-policy/src/audit.rs:553 (+ its fixture
test :721) move to U2 with the file deletion, so U1’s gate stays green while the file exists; U2 also
rewrites the rules.rs tests that assert the top-level shape (screening_policy_actor_roles_must_be_strings
:317, fixtures :304 / :362 / :377).
B. The request (crates/craig-cases-contracts/src/reports.rs; replaces RecordDecisionRequest, pre-1.0 BREAKING)
#[derive(Deserialize, Validate)]
#[serde(deny_unknown_fields)]
pub struct RecordDecisionRequest {
pub client_request_id: Uuid,
pub disposition_kind: String, // allowlist-validated (unchanged)
#[garde(custom(non_blank))]
pub rationale: String, // REQUIRED, trimmed, non-whitespace — see below
pub supersedes_id: Option<Uuid>,
#[garde(skip)] // parse-validated at deserialization, nothing for garde
pub attested: AttestedFacts, // newtype over BTreeMap<FactKey, FactValue> with a MANUAL
// Deserialize (a MapAccess visitor: a repeated key or a
// 33rd entry is a deserialization error → 422; serde's
// default BTreeMap visitor is last-wins)
}
pub struct FactKey(String); // ^[a-z][a-z0-9_]{0,63}$ (parse-validated newtype)
pub enum FactValue { Bool(bool), Token(String) } // Token ^[a-z0-9_]{1,64}$; JSON bool / string
pub const MAX_REPORT_CHILDREN: usize = 10; // the cases create boundary (§C); intake caps at 10 already
pub const MAX_ATTESTED_FACTS: usize = 32; // the deserializer's cap (33rd entry → 422)
pub const SERVER_DERIVED_FACT_KEYS: &[&str] = &[/* §A list */];
actor_role is REMOVED from the wire (derived, §C). The required rationale is STRUCTURAL, not a Georgia
predicate: a disposition without a stated reason is unauditable in every jurisdiction (ADR-072 tier 3 by
its own definition); PAMMS 3.2:69 / :125 ("document the justification for the intake disposition")
corroborates it — so the ruleset needs no rationale_provided input. The attested document is validated
BEFORE the consult: every key must be in metadata.screening.attestable_facts (a server-derived key such
as actor_role, child_age, proposed_disposition, prior_actor_role in attested is the same typed
400 screening-fact-not-declared, detail = the key and the attestable keys) and every value must satisfy
that property’s schema (type: boolean / enum) — checked with jsonschema as a DIRECT dependency
([workspace.dependencies] jsonschema = "0.33" + craig-cases; the lock already carries it through zen).
The document is assembled attested-first, server-derived keys written LAST (they win by construction).
zen’s own validation is the backstop (an engine error there = 500, a bug). ADR-062 intent:
ScreeningDecisionIntentV2 { schema: "v2", disposition_kind, rationale, supersedes_id, attested } (the BTreeMap is
the canonical order; the derived role is EXCLUDED — the actor is a claim column; a serialized schema:
"v2" field in the intent body is the version tag — intent_hash_v1 takes no version and the struct name
is not serialized, so a pre-cutover claim under the same client_request_id answers the fixed 409 by
field content, not by luck)
replaces ScreeningDecisionIntentV1 (api/intents/reports.rs:58-62). Proptest
attested_facts_roundtrip_never_panics_and_rejects_bad_keys + unit
attested_facts_deserialize_refuses_duplicate_keys_and_over_cap; API pins attested_server_derived_key_is_400,
attested_value_off_type_is_400, attested_over_max_entries_is_422, duplicate_attested_key_is_422.
C. The act (api/reports/decisions.rs + new api/reports/screening_consult.rs and screening_surface.rs)
Sequence: validate() → deny_pure_service(&claims) (api/persons_ssn.rs:41) → report 404 → authz
Update → request_claims::precheck FIRST after the local checks (the api/investigations/safety.rs:134-141
precedent; a replay returns the row without touching rules; there is NO act lease — see "Same-key races"
below) → surface read with the SERVICE bearer (cached 60 s; the row is public metadata, nothing
caller-specific is read; a transport failure → the typed 503 screening-surface-not-ready with reason
unreachable, not the current 500 at api/reports/mod.rs:100-111;
service_token == None → the same typed 503 screening-surface-not-ready with reason no-service-principal, never a panic) → derive actor_role
from claims.acting_worker().realm_access.roles through the mapping → allowlists → supersedes read
(prior row: report_id, disposition_kind, actor_role, decided_at); prior.report_id must equal the
path report_id, else typed 400 (kept from today, decisions.rs:132-137 — the cross-report guard
v_effective_disposition cannot supply) → override_authority on the DERIVED role inside
validate_override_authority (so refuse_concurrent_leaf’s remedy path, `decisions.rs:233-236, uses
the same check); a PRIOR row whose actor_role is not a mapping token — the pre-cutover cicc /
county_supervisor / caseworker values, until the contract migration #1697 rewrites them after every
N−1 writer is drained — is refused fail-closed: 403 screening-override-not-authorized with the token
named (pin legacy_prior_token_is_refused_with_the_token_named; the runbook states that superseding a
pre-cutover decision waits for #1697); a refused supersession is 403 screening-override-not-authorized (today a
400 bad_request_for(.., "actor_role") pointing at a field that no longer exists) → decrypt the report (api/encryption/report.rs:53 decrypt_report_pii) → derive the report-level context
and the per-child evidence → validate attested against the attestable subset → N concurrent
evaluates (try_join_all under S2S_HOP_BUDGET, the IV-E evaluate_children pattern
api/ive_children.rs:173-203) → parse each fail-closed → admissibility = the conjunction over the
evaluations (any false → 409 screening-disposition-inadmissible, detail = that evaluation’s basis
verbatim — structural fail-closed; under the advisory row it never fires) → the claimed tx as today
(execute_claimed_tx, crates/craig-api/src/lib.rs:298: claim_first → refuse_concurrent_leaf →
insert the decision + evaluation rows → event). Nothing of the cases side persists on 400 / 403 / 409 /
422 / 500 / 503 (no decision, claim or outbox row); the rules side has already committed its
rule_evaluations rows (services/craig-rules/src/engine.rs:485+ — the evaluate doc-comment: the audit rides its own one-shot transaction) — joinable by context_id, stated in
the docs.
Same-key races. Two requests with the same client_request_id that both pass the unlocked precheck
both consult rules; claim_first then admits exactly one and the other replays the committed row
(ADR-062 exactly-once EFFECTS). The loser’s evaluation set stays on the rules side as an orphan, joinable
by context_id. Round 1 added a per-key act lease to prevent that orphan; round 2 showed the lease was a
starvation lever (a process-wide permit that the default pool sizes at 2, held for the whole consult) and
a second connection per act — so it is DROPPED, the orphan accepted and documented (data-model-cases.adoc).
Pin concurrent_same_key_requests_commit_one_decision (two parked requests → one decision, one claim,
the second answers the replay).
Which children. The criteria are about the alleged VICTIM child (3.2:30). The act evaluates the
children[i] entries flagged is_victim; when a report flags none, every listed child (with
child_is_victim = false in each document, so a future binding row can hold on it); a report listing no
children → ONE subject = 'report' evaluation with no child keys. The ADR-072 amendment records that the
criteria rows are victim-scoped, that a binding row set must read child_is_victim, and the AGGREGATION
semantics fixed here: admissibility rows are per-subject prohibitions ANDed across the evaluated subjects
(a row that fires for ANY evaluated child refuses the disposition); a refusal of the form "no evaluated
child qualifies", or any rule reading non-victim children (3.2:295 "other children in the home"), needs a
report-level aggregate input such as any_child_screen_in, or a code change — scoped to #1693. N is bounded by
the cases create boundary: POST /v1/cases/reports (api/reports/crud.rs:63; children:
serde_json::Value, crates/craig-cases-contracts/src/reports.rs:112) refuses more than
MAX_REPORT_CHILDREN = 10 entries (typed 422) — the intake edge already refuses more than 10
(services/craig-intake/src/api/validation.rs:247 MAX_CHILDREN); the act evaluates at most the SAME
constant concurrently (one window = one hop — there is no second constant); a legacy row with more
entries (created before the boundary existed) answers a typed 422 screening-report-too-large before any
consult — a permanent condition, never a 503 — rendered verbatim.
Per-child evidence (server-derived, never worker-typed). child_age = whole years at the report’s
received_at converted to the jurisdiction business date (BusinessClock::for_jurisdiction(j); the
"texas" ⇒ Tz::America__Chicago arm added to crates/craig-common/src/clock.rs:55-57 with the test
for_jurisdiction_texas_is_central; the county nuance stays on #1690) from, in precedence: the linked
person’s decrypted DOB when a report_persons child link exists for that jsonb_index
(store/report_persons.rs:95; api/ive_children.rs:34-50 age_in_years / dob_fields hoisted
pub(super)) → the entry’s date_of_birth → the entry’s age (crates/craig-intake-sdk/src/types/dto.rs:206-232)
→ absent. age_source ∈ {linked_person_dob, report_dob, report_age, absent, unparseable, future,
implausible}; a derived age outside 0..=130, a future DOB or an unparseable DOB OMITS the key and records
the source (the reporter’s data, not the caller’s — no 400); a decrypt failure is a redacted 500. Age is
measured at receipt, so replays and birthdays cannot change it. allegation_type (report-level, copied
into every document): raw_submission.concern_type from the decrypted report, parsed as AbuseType
(the intake DTO’s concern_type, dto.rs:89, shares AbuseType’s tokens); absent or unparseable → the
key is omitted and `allegation_type_source = absent is recorded in screening_context — without it the
trafficking-waiver and the allegation-keyed priority / track rows cannot fire, which the recorded source
makes visible.
Budget. Surface GET (cold) + the concurrent evaluate window: const _: () = assert!(
2 * S2S_HOP_BUDGET.as_millis() + MARGIN_MS < STANDARD_REQUEST_CEILING.as_millis()) (16 + 2 = 18 < 20 s;
crates/craig-common/src/ceiling.rs:53/:94/:100; the services/craig-financial/src/subsidy/age_check.rs:36-56
shape); the report GET, decrypt and the claimed tx’s statements ride inside MARGIN_MS exactly as the
age-check comment states, and the next leg added here needs a re-partition. The new GET route has no
CEILINGS entry (api/ceilings.rs lists only non-Standard routes — Standard by default; the completeness
test stays green).
Consult. EvaluateRequest { rule_set: format!("{jurisdiction}-intake-screening"), input, context_type:
Some("screening-decision"), context_id: Some(report_id), pin: None } via
rules_client.typed().evaluate(&req, &RelayAuth::from_headers(&headers).to_relayed(), rules_client.hop_budget)
(api/ive_assembly.rs:200-212); errors through rules_upstream::map_evaluate_error (503 / 504 pass
through; the rest redacted 500; #1692 untouched). rule_set_revision must equal the surface read’s
revision; a mismatch EVICTS the cached surface entry (screening_policy.rs:55 CACHE_TTL = 1 min) and
answers 409 screening-policy-moved, so the client’s retry re-reads by name and converges.
Parse (the need() pattern, api/ive_assembly.rs:217-248): neutral keys typed — screening_decision ∈
{SCREEN_IN, SCREEN_OUT, INSUFFICIENT_INFORMATION}, referral_type ∈ {NONE, COMMUNITY_RESOURCE,
OUT_OF_STATE_REFERRAL, LAW_ENFORCEMENT, ADULT_PROTECTIVE_SERVICES} (the set both files use today),
disposition_admissible: bool, screening_basis / admissibility_basis non-empty; the jurisdiction
outputs are validated by the declared output schema on the rules side and persisted as
jurisdiction_outputs (the required output keys minus the neutral ones and minus *_basis text — the
bases stay on the single copy; tokens and booleans only). rule_set_version is the surface read’s
version for the same (name, revision) — never the evaluate response’s Option<String> field, which
would trip the all-or-none CHECK as NULL against a rules image predating #1627.
Surface verifier (the mechanism, scoped to the screening routes — NOT service readiness). Round 3
ruled the blast radius: one ruleset’s metadata shape must not pull every cases route out of rotation, so
the gate lives INSIDE the surface client (ScreeningPolicyClient, renamed ScreeningSurfaceClient,
already an Extension on the handlers and [derive(Clone)], cloned per request — so the gate is an
Arc<SurfaceGate> the clones share; no AppState, craig-api or craig-common READINESS change —
metrics.rs gains only the gauge and its non-otel stub mirror): SurfaceGate { state: AtomicU8 } over a
[repr(u8)] CLOSED enum SurfaceReason — pending (the boot value: the verifier has not run),
verified, metadata-absent, schema-missing-key, output-missing-key, no-service-principal,
unreachable — one atomic, so no torn read and no new dependency (free text, hostnames and key names go to
tracing::warn! only; the unauthenticated-surface posture of crates/craig-api/src/lib.rs:912-918). One
verify_once() on the client is what the 60 s loop and the harness both call. A Critical WorkerSpec screening-surface-verifier
(services/craig-cases/src/lib.rs:436 EXPECTED_WORKERS; a contested-surfaces.toml worker entry; the
existing s2s-client.craig-cases.screening-policy entry at contested-surfaces.toml:740-747 re-censused —
its oracle asserts today’s 500 fold and 'no 503 carve-out', both of which this act changes) runs a
60 s loop that reads the active {j}-intake-screening with the SERVICE bearer (br.service_token; rules'
RuleSet / Read gate admits the cases service identity — rulesets/georgia/georgia-authz-rule_set.json:82-83),
verifies metadata.screening present, an input schema declaring every key of SERVER_DERIVED_FACT_KEYS,
an output schema requiring the five neutral keys, and sets verified (or clears it with the reason token;
service_token == None → no-service-principal). While unverified, EVERY load_policy consumer — the act
(decisions.rs:110), conversion (conversion.rs:69) and follow-ups (follow_ups.rs:73) — and the surface
GET answer a typed 503 screening-surface-not-ready whose detail is the reason token; /readyz and every
other route are untouched; the gauge screening_surface_verified{jurisdiction} (crates/craig-common/src/metrics.rs)
is the operator alert. The task never EXITS on a failed verify (any exit reads Dead permanently,
crates/craig-common/src/supervisor.rs:485-496), so a cases booting before rules serves everything else
and converges on the screening routes when rules comes up. The in-process harness constructs the client
with an injectable token source and calls verify_once() (the wiremock legs accept any bearer). The
pin: None path is thus proven against the live revision before the first screening request is served.
Surface read for clients. GET /v1/cases/screening-surface (Standard route class; any authenticated
human — deny_pure_service; nothing report-specific; the handler carries the authz-lint annotation
// authz: skip — authenticated-only, no row data, deny_pure_service, the search_capabilities.rs:46
precedent). The fetch behind it uses the SERVICE bearer, never the caller’s (the existing
fetch(auth_header, …), screening_policy.rs:235-258, relays the caller and caches by name, which would
make a caller without rules RuleSet / Read — icpc_coordinator, eligibility_worker — see a 500 or a
200 depending on who warmed the cache); actor_role is derived locally from the acting claims; pin
screening_surface_is_200_for_icpc_coordinator_with_cold_cache. → { rule_set_name, revision, actor_role (derived for
the caller, `null when unmapped), disposition_kinds, attestable_facts: [{ key, title, description }] }`
— the BFF and CLI render and validate from it; no jurisdiction knowledge in clients.
Attribution. actor_sub / actor_name = claims.acting_worker() (sub + preferred_username of the
lifted worker) — the same identity the intent hash and the rules audit carry; pin
derived_role_reads_the_lifted_actor_roles_not_the_bearer (craig-web’s service bearer + a caseworker
actor header → cicc_intake).
D. Persistence (services/craig-cases/migrations/20260906120000_screening_decision_provenance.sql, ADDITIVE)
screening_decisions gains nullable rule_set_name TEXT, rule_set_revision BIGINT, rule_set_version TEXT,
attested_facts JSONB, screening_context JSONB, disposition_admissible BOOLEAN, admissibility_basis TEXT
under CHECK screening_decision_provenance_all_or_none. New table:
CREATE TABLE screening_decision_evaluations (
id UUID PRIMARY KEY DEFAULT uuidv7(),
decision_id UUID NOT NULL REFERENCES screening_decisions(id) ON DELETE CASCADE,
subject TEXT NOT NULL CHECK (subject IN ('child','report')), -- 'report' = a report listing no children
jsonb_index INT NULL CHECK ((subject = 'child') = (jsonb_index IS NOT NULL)),
person_id UUID NULL REFERENCES persons(id),
child_age INT NULL CHECK (child_age BETWEEN 0 AND 130),
age_source TEXT NOT NULL,
child_is_victim BOOLEAN NOT NULL,
evaluation_id UUID NOT NULL, -- rules-side pointer, no FK (cross-DB)
screening_decision TEXT NOT NULL,
referral_type TEXT NOT NULL,
disposition_admissible BOOLEAN NOT NULL,
jurisdiction_outputs JSONB NOT NULL
);
CREATE UNIQUE INDEX uq_screening_decision_evaluations_subject
ON screening_decision_evaluations (decision_id, COALESCE(jsonb_index, -1));
-- NO schema_compat_floor bump: additive (ADR-063 §D3; the floor is for destructive contracts only).
On the decision row disposition_admissible is the CONJUNCTION over its evaluations and
admissibility_basis is the first false evaluation’s basis, else the advisory basis (identical across
the set). screening_context is EXACTLY the report-level server-derived keys as sent to rules —
allegation_type, allegation_type_source, is_initial_decision, prior_disposition,
prior_actor_role, proposed_disposition, actor_role, and response_time_expired absent — tokens and
booleans only; NEVER raw_submission text, names or DOBs (an unparseable concern_type is recorded as
the source token unparseable, not the value); jurisdiction_outputs likewise; pin
screening_context_is_tokens_and_booleans_only. The ive_determination_children snapshot pattern
(20260902210000_ive_determination_children.sql:32-48), widened by subject so the zero-children case
has a persistence home. v_effective_disposition is recreated with the provenance columns
(20260423110000_reports_and_screening.sql:101-118 selects explicit columns); EffectiveDisposition and
ScreeningDecision (store/models.rs:149) use EXPLICIT column lists (no SELECT * / RETURNING *
reliance for the new fields). Legacy rows keep NULL provenance honestly (they were never evaluated); every
new insert sets it; the xtask invariant screening_decisions_evaluated_since_cutover (rows with
decided_at after the migration’s applied-at marker and NULL provenance) ships REPORT-ONLY — during the
rolling release N−1 replicas legitimately insert without provenance, so a blocking form would fire on
the very inserts the rollout requires; #1695 (the NOT NULL contract) promotes it. Rolling release: an N−1
replica’s INSERT (store/screening_decisions.rs:31-37) still succeeds against the expanded table, and
the untouched floor keeps N−1 rollback open.
Event. case.report_disposition_recorded (events.rs:384-400, already carries role + disposition
tokens) gains evaluation_ids: [uuid] (additive). No strict contract exists for this event today, so U2
CREATES it in the shared module crates/craig-cases-contracts/src/events.rs (deny_unknown_fields
payload + const + test, the pattern the other contracts there follow); craig-security’s parse_event_type
arm event_parsing.rs:347 is unaffected.
E. Surfaces (the same MR as C / D — the wire shape moves together)
-
craig-web
services/craig-web/src/routes/intake/reports.rs:321form: rendered from the surface read — one tri-state select per attestable fact (blank_as_none,routes/form.rs:53),rationalerequired, no role select (templates/intake/report_detail.html:252-253goes);ScreeningDecisionView(:146) /ReportDetailEnvelope(:181) gain the per-evaluation verdicts (age, source, decision, referral type) + the basis +evaluation_id`s; the 400 / 403 / 409 / 422 rendered VERBATIM via `rejection_detail(routes/financial/subsidy_reviews.rs:32) replacing the generic flash (:624-645). The select options come from the surface read, so craig-web adds no enum-iteration dependency. Render tests live in amod testsinroutes/intake/reports.rson thelogin.rs:66pattern. -
CLI
services/craig-cli/src/cmd/intake.rs—IntakeRecordDecisionArgs(:60) /run_record_decision(:186) AND the screen-out shortcutIntakeScreenOutReportArgs(:95) /run_screen_out_report(:219), which sendsactor_roletoday:--rationalerequired; repeatable--fact <key>=<true|false|token>validated against the surface read (unknown key → refused naming the attestable keys; duplicate key → refused; exact case);--actor-roleremoved from both;cli.adoc. -
test-lib
given::report::screen_in_attested(); everyRecordDecisionRequest {construction site (grep; todaycrates/craig-test-lib/{tests/workflows.rs, src/given/referral.rs}, casestests/api/{referrals_encryption,reports,convert_report_autolink,request_claims_reports}.rs) and the raw TypeScript sendertests/e2e/lib/given/referral.ts:31(ingivenScreenedInReferral,:21); given / e2e actors must be MAPPED roles (thecounty_supervisor_can_override_cicctest becomes acounty_directorclient,dana.county);cargo xtask coverage-matrix-mapping. -
e2e
tests/e2e/specs/intake-review.spec.ts:157-231: the fact selects + rationale. The Texas leg is an in-process cases test, not e2e.
Rollout (pre-1.0 BREAKING, one ordered release; the runbook in the deployment guide). (1) U1’s rules
image rolls FIRST and its old replicas drain (the binding consumer is gone); (2) THEN the operator promotes
georgia-intake-screening v1.3 / texas-intake-screening v1.2 (rules-promote) — promoting the strict
input schema while a pre-U1 consumer still feeds {investigation_id, referral_id} would turn every event
into an attempt failure; (3) the broker cleanup (§F); (4) U2’s cases image (the expanded table accepts
N−1 inserts; N−1 web / CLI requests still send actor_role, which deny_unknown_fields refuses as a
typed 422 — the N−1 web shows its generic flash until step 5, the CLI prints the problem body; the window
is symmetric, so step 5 waits until no N−1 cases replica remains, the condition step 6 already uses) — the
{j}-screening-policy
ruleset ROW stays live in craig-rules throughout (N−1 cases replicas still read it; deleting the FILE
retires nothing in an existing deployment); (5) web + CLI; (6) once no N−1 cases replica remains, the
operator retires the {j}-screening-policy row through the existing rules delete route
(DELETE /v1/rules/sets/{id}?reason=…, an explicit runbook step); rollback re-promotes the row from the
N−1 tag’s checkout (the file and the permissive lint live only there) BEFORE starting an N−1 cases image. The CHANGELOG Changed line names the shape, the removed
actor_role, the required rationale; Removed names the unmapped roles' loss of the act. A
compatibility window was rejected: it would keep un-attested decisions representable — the criterion-2 lie.
F. Retire the case.intake_created → craig-rules binding (U1; the producer stays — craig-security audits it)
As built (U1):
-
services/craig-rules/src/main.rs— thePublisherimport, theevents-subscriberEXPECTED_WORKERSentry, itsspawn_subscriber_workersleg,EVENTS_QUEUE,DOMAIN_EVENT_BINDINGS,spawn_domain_event_subscriber,evaluation_target,handle_domain_event, the domain-event legs of the inbox tests (the A5 truth test, the flood test, the two-path disconnect rig — the cache-invalidation legs stay in the renamedcache_consumer_tests) and the bindings pin: deleted. -
engine.rs—evaluate_in_tx(the ADR-062 A5 inbox-tx seam; its only production caller was the handler; itsfailure_row_survives_a_rolled_back_caller_txtest went with it, the own-tx property staying pinned on the direct path),rule_set_name, and the engine’s now-unreadjurisdictionfield
constructor parameter: deleted; doc references corrected (engine.rs,retention_archive.rs, ADR-006). -
Pins — the
events-subscriberrow leaves the exact worker set intests/api/health.rs(workers_exact_set_matches_devstack_defaults, run with--run-ignored all; the row removal IS the pin); craig-mq gainscraig_rules_events_queue_declare_is_refusedand re-targets its anchor pin tocraig-rules.cache.. -
contested-surfaces.toml— themq-consumer.craig-rules.main.subscribe_idempotententry and the danglingworker.craig-rules.main.watch.3stub removed by hand (the census staleness check ignoresnth). -
Broker —
devstack/rabbitmq/definitions.jsondropscraig-rules\.eventsfrom configure / write / read (a first-boot import — an existing broker follows the runbook). -
Live cutover (
deployment-guide.adoc§ Retiringcraig-rules.events): roll the U1 rules image and let the old replicas drain, THEN promote the strict rulesets (v1.3 / v1.2 — a pre-U1 consumer against the strict schema would fail every delivery), then remove the binding, then the queue, then the grant.
Full rollback order (rules image, ruleset revision, the policy row and the cases gate together): (0) if
rollout step 6 has run, re-promote {j}-screening-policy from the N−1 tag’s checkout FIRST (an N−1 cases
load_policy 500s without it, api/reports/mod.rs:100-111); (1) roll the N−1 cases image (it does not
verify the surface); (2) re-promote
{j}-intake-screening from the N−1 tag’s checkout (GA v1.2 / TX v1.1 — the strict schema would otherwise
fail every event the restored consumer feeds); (3) restore grant → queue → binding; (4) roll the N−1
rules image. Rehearsed once on the devstack broker end to end (Verification).
ADR-003 :54 / :391 §amendment; ADR-061 :92; the rulesets.adoc and implementation-guide.adoc
sentences describing the binding move to U1 with the retirement.
Steps
U1 — rulesets own the act + binding retirement (#1670, weight 8)
§A on both rulesets (metadata block incl. attestable_facts, schemas as strings, admissibility,
terminal row, cell + basis fixes, renames), citations for every governing row, the rules tests, the
rules check screening branch, §F with its topology / broker / ADR-003 / ADR-061 / deployment-guide /
rulesets.adoc / implementation-guide.adoc edits and the promotion-ordering runbook; CHANGELOG
Changed (input keys, output shape) + Removed (the binding). Safe alone: nothing consumes the new
outputs until U2; georgia-screening-policy.json is NOT deleted here (cases still reads it) and the lint
does not yet refuse its top-level shape.
U2 — the act (#1672, weight 8; Closes #1630)
§B–§E: contracts (incl. MAX_REPORT_CHILDREN and the create-boundary cap), the act + verifier worker
surface read, the migration + report-only invariant, the ScreeningPolicyClient → ScreeningSurfaceClient re-point and the
{j}-screening-policy.json deletion with the lint’s top-level refusal + the audit bucket change, web
CLI + test-lib + e2e, the regenerated api/craig-cases.adoc (the blocking drift gate,
xtask/src/cmd/validate.rs:1043), data-model-cases.adoc, services.adoc, cli.adoc, the ADR-072
amendment, CHANGELOG Added / Changed / Removed, .claude/CLAUDE.md. One MR: the wire shape, its
clients and the generated API docs cannot pass the pre-push gate apart.
Files Touched
| Files | Unit |
|---|---|
|
U1 |
|
U2 |
Verification
-
U1 (rules-side). The §A pins;
cargo xtask rules check+ the xtask unit testsrules_check_refuses_{attestable_fact_outside_schema, attestable_fact_that_is_server_derived, undeclared_server_derived_key, duplicate_rank, unknown_realm_role, realm_role_in_two_tokens, realm_role_repeated_within_one_entry, mapping_token_outside_enum, token_enum_without_strings, duplicate_mapping_token, override_edge_naming_a_non_mapping_token, missing_override_authority, override_edge_that_is_not_a_string_pair, inline_object_schema, malformed_schema_string, invalid_draft7_schema, open_input_schema, empty_allowlist, non_object_screening_block, attestable_fact_with_empty_title, duplicate_attestable_key, missing_output_node, output_schema_without_required_keys},screening_metadata_with_well_formed_shape_passes,rulesets_without_screening_block_skip_the_branch,shipped_rulesets_pass_check, the proptestsactor_role_parse_is_total_and_exactandduplicate_tokens_or_ranks_are_always_refused, andserver_derived_fact_keys_are_unique_and_sorted(craig-cases-contracts);cargo xtask policy audit; craig-rulesworkers_exact_set_matches_devstack_defaults(tests/api/health.rs,--run-ignored all— theevents-subscriberrow removed); craig-mqcraig_rules_events_queue_declare_is_refused. -
U2 (cases API) — new
services/craig-cases/tests/api/report_decisions_screening.rs, registered intests/api.rs, on the in-process keyed harness with an injectable rules URL AND jurisdiction (tests/api/keyed_harness.rs:450-477hard-codesgeorgiatoday); fault legs mock BOTH the by-name GET and the evaluate POST on wiremock; happy legs hit the live devstack rules:decision_persists_provenance_per_evaluation_and_the_attested_facts_as_sent,unknown_facts_record_insufficient_information,zero_children_persists_one_report_subject_evaluation,victims_only_are_evaluated_when_any_is_flagged,all_children_evaluated_when_none_flagged,allegation_type_comes_from_raw_submission_concern_type_and_its_source_is_recorded,off_schema_key_is_typed_400_naming_the_attestable_keys,attested_server_derived_key_is_400,duplicate_attested_key_is_422,unknown_json_field_is_422,blank_rationale_is_422,pure_service_caller_is_403,unmapped_realm_role_is_403,admin_is_unmapped_403,derived_role_reads_the_lifted_actor_roles_not_the_bearer,lifted_worker_is_the_persisted_actor,override_authority_uses_the_derived_role(caseworkercannot supersedecicc_supervisor;county_directorcan supersedecicc_intakeandcicc_supervisor),regional_fps_can_supersede_cicc_supervisor,cicc_supervisor_can_supersede_cicc_intake,legacy_cicc_prior_can_be_superseded_by_cicc_supervisor,legacy_county_supervisor_prior_needs_county_director,refused_supersession_is_typed_403,age_measured_at_receipt_not_today,age_sources_are_recorded,texas_jurisdiction_end_to_end,policy_revision_moved_evicts_the_cache_and_is_409,rules_503_passes_through_and_no_cases_row_persists,surface_read_transport_failure_is_503_and_no_cases_row_persists(reasonunreachable),output_missing_required_key_is_500_and_no_cases_row_persists,inadmissible_evaluation_is_409_with_that_basis_and_no_cases_row_persists(a WIREMOCK pair — the by-name GET answers the real v1.3 body, the evaluate POST answersdisposition_admissible: falsewith a basis under the samerule_set_revision; NEVER a promotion on the shared devstack rules, which the 60 s cache and the verifier would leak across tests; in-crate wiremock precedent:screening_policy.rsandapi/investigations/safety.rsunit tests),replay_returns_the_row_without_reconsulting(hit count = N, not 2N),concurrent_same_key_requests_commit_one_decision,supersedes_id_on_another_report_is_400_and_no_cases_row_persists,pure_county_director_is_403_at_report_authz,screening_surface_is_200_for_icpc_coordinator_with_cold_cache,legacy_prior_token_is_refused_with_the_token_named,changed_attested_facts_under_the_same_client_request_id_is_409,post_consult_db_failure_persists_nothing_cases_side,effective_disposition_carries_provenance,event_carries_the_evaluation_ids,n_minus_one_insert_without_provenance_still_succeeds,create_report_refuses_more_than_max_children,over_cap_legacy_report_is_typed_422_before_any_consult,act_and_surface_get_are_503_not_ready_until_verified_then_recover(unverified → typed 503 with the reason token → one verifier pass against live rules → 200;/readyzunaffected throughout),verifier_refuses_input_schema_missing_a_server_derived_key(a wiremock by-name body minus one key → unverified, reasonschema-missing-key, the key name only in the log),act_without_service_token_is_503_and_no_cases_row_persists(reasonno-service-principal),surface_reason_is_a_closed_token_never_free_text(incl. the boot valuepending),follow_up_and_convert_are_503_until_verified,surface_gauge_flips_zero_to_one_on_verify,worker_registry_has_screening_surface_verifier(tests/api/health.rs),one_false_evaluation_of_two_victims_is_409_with_that_basis,rule_set_version_is_the_surface_version_when_evaluate_omits_it(wiremock evaluate body without the field),screening_context_is_tokens_and_booleans_only,unknown_prior_token_is_403,attested_value_off_type_is_400,attested_over_max_entries_is_422,n_minus_one_actor_role_field_is_422,screening_surface_returns_derived_role_and_attestable_facts; the 400 / 403 / 422 legs assert no cases-side row too. craig-common:for_jurisdiction_texas_is_central. xtask:invariant_screening_decisions_evaluated_since_cutover_is_report_only. craig-web (mod testsinroutes/intake/reports.rs):screening_form_renders_the_surface_facts,screening_rejection_renders_the_detail_verbatim. Contracts: the proptest of §B, the unitattested_facts_deserialize_refuses_duplicate_keys_and_over_cap, and the newreport_disposition_recordedstrict-contract test. -
End to end (devstack). Record a decision through craig-web on a seeded report with two flagged victims; the decision row and two evaluation rows carry provenance; each
evaluation_idresolves incraig_rules.rule_evaluationswithcontext_type = 'screening-decision'and an input of booleans / tokens / ages only; acicc_intakedisposition disagreeing with the verdict is recorded withdisposition_admissible = trueand the advisory basis visible;rabbitmqctl list_queuesshows nocraig-rules.events; the FULL rollback order of §F (policy row, cases image, ruleset re-promotion, broker, rules image) rehearsed once on the devstack. One pre-push battery per unit MR.
Documentation Updates
data-model-cases.adoc (the seven columns + the evaluations table + the same-key orphan / context_id
join note), the regenerated api/craig-cases.adoc,
services.adoc (pointer), implementation-guide.adoc (events catalog: the retired binding in U1, the
evaluation_ids field in U2), rulesets.adoc (the intake-screening ruleset owns the act; the #1054 note
resolved — U1), deployment-guide.adoc (worker count, queue row, grant, the ordered rollout incl. the
promotion step and the policy-row retirement, the full rollback order, the screening_surface_verified
gauge as the operator alert), cli.adoc; ADR-003 §amendment; ADR-061
count; the ADR-072 amendment — "admissibility of a human disposition against the criteria is a tier-1
table; advisory / binding / role-gated is rows; the criteria rows are victim-scoped and a binding row set
must read child_is_victim; admissibility rows are per-subject prohibitions ANDed across the evaluated
subjects — a report-level aggregate rule needs an aggregate input or a code change (#1693); the code
enforces the boolean fail-closed over every evaluation and persists
name + revision + version + per-evaluation ids; the required rationale is structural (tier 3);
INSUFFICIENT_INFORMATION + screened_in stays convertible under the advisory row — the derived
response time is #1693’s"; CHANGELOG (Changed: RecordDecisionRequest shape, actor_role removed,
rationale required, the case.report_disposition_recorded actor_role value now a mapping token (the
strict-contract test pins the vocabulary), the two rulesets' input keys and output shape, the ordered
rollout; Added: the
consult, the columns + evaluations table, the seven slugs — screening-fact-not-declared 400,
screening-actor-unmapped 403, screening-override-not-authorized 403,
screening-disposition-inadmissible 409, screening-policy-moved 409, screening-report-too-large 422,
screening-surface-not-ready 503 — the surface read, the verifier worker + gauge, the children cap, CLI flags;
Removed: the case.intake_created binding + craig-rules.events queue / grant / worker, the
{j}-screening-policy rulesets (their client is re-pointed to {j}-intake-screening), the unmapped
roles' ability to record a screening decision); .claude/CLAUDE.md status (U2, the final MR).
Review log
| Round | Vendor | Resolved model | Verdict |
|---|---|---|---|
page 1 (v2 → v2.1) |
Anthropic — four contextless lenses (engineering / security / implementability / policy), two refuters per major |
Claude Fable 5.1 |
no-ship (2 critical + 15 major confirmed, 5 refuted, 22 minors) → folded |
page 2 (v2.1 → v2.2) |
Anthropic — the same four lenses |
Claude Fable 5.1 |
no-ship (10 major, 0 refuted, 15 minors) → folded |
page 3 (v2.2 → v2.3) |
Anthropic — the same four lenses |
Claude Fable 5.1 |
gate-ready after the fold (8 major, 0 refuted, 16 minors) → folded |
U2 execution plan 1 |
Anthropic — one fresh contextless subagent, the four plan-lifecycle questions |
Claude Fable 5.1 |
no-ship (7 blockers) → folded |
U2 execution plan 2 |
the maintainer (human gate review) |
— |
no-ship (12 findings) → folded → approved 2026-09-06 |
The v1 gate rejection (42 findings, 2026-09-05) and the U1 as-built deltas are recorded in the #1670 / #1672 MR notes and the ADR-072 amendment.
Errata
Deviations from the frozen Design found at implementation (U2, #1672), each as built:
-
Erratum (2026-09-07): no "office proof" mechanism exists (#1102 is the lifted-actor JWT) — the acting worker is
claims.acting_worker(). -
Erratum (2026-09-07): the raw by-name GET stays the surface read (the typed rules client drops
revision); it gainsrevision+version. -
Erratum (2026-09-07): the cases service token is threaded into the surface client as
ServiceBearer(Oidc/Static/Absent); bearer acquisition runs INSIDE the one hop-budget timeout. -
Erratum (2026-09-07): the
BusinessClockproptest’s unmapped fixture is"atlantis"(Texas gained an arm). -
Erratum (2026-09-07): the evidence derivation lives in a third module,
api/reports/screening_evidence.rs; children are extracted PER FIELD (a malformedagenever drops a flagged victim —unparseable). -
Erratum (2026-09-07):
linked_ambiguousis the eighthage_source— two distinct persons on one child slot recordperson_id NULL, no age, no fallback;person_id … ON DELETE SET NULL. -
Erratum (2026-09-07):
jurisdiction_outputsareOutputValue(Bool|Token ^[A-Za-z0-9_]{1,64}$) — only the ruleset’s REQUIRED non-neutral, non-basis output keys persist; numbers and free text are a 500. -
Erratum (2026-09-07): the surface reason vocabulary is NINE closed tokens (
metadata-invalid,schema-invalidadded); EVERY surface failure — structural or transient, verifier or request path — is the typed 503screening-surface-not-readycarrying the token (ADR-068 reserves 503 for transient; the token + gauge distinguish). -
Erratum (2026-09-07):
SERVER_DERIVED_FACT_KEYSare refused at the request boundary regardless of what the fetched metadata lists; decode refuses metadata listing one, and requires the input schema’srequiredto be EMPTY. -
Erratum (2026-09-07): the surface exposes each fact’s
kind(boolean|enum {options}); web renders and the CLI validates by kind. -
Erratum (2026-09-07):
GET /v1/cases/reports/{id}/screening-decisions/{decision_id}/evaluations(Read on the parent, cross-report 404) reads a superseded decision’s evidence;ReportDetail.evaluationscarries the effective decision’s; both return the contracts DTO (the store-model baseline is unchanged). -
Erratum (2026-09-07): the
{j}-screening-policyROW is retired only after the release is final (the rules delete is a soft delete with no restore — the N−1 rollback’s dependency); rollback step (0) is gone; the FILE is deleted here. -
Erratum (2026-09-07): the two
legacy_*test names are ONE parameterisedlegacy_prior_token_is_refused_with_the_token_named;pure_county_director_is_403_at_report_authzis a devstack black-box test mintingpaula.county; the gauge is unobservable in-process (gate().reason()is the pin); the/readyzhalf is structural; the invariant lives in the test-lib SQL catalog. -
Erratum (2026-09-07): the e2e
caseworkersession is jane.doe and derivescicc_supervisor; the CLI devstack tests mint bob.smith (admin is unmapped). -
Erratum (2026-09-07): the mixed-version window (an N−1 cases replica writing AFTER the migration) is not rehearsable on the devstack —
cargo xtask dev startwipes and reseeds the volumes when a checked-out tree lacks an applied migration — so that leg is pinned by the store testn_minus_one_insert_without_provenance_still_succeedsand the invariant test; the devstack rehearsal covered the N−1 stack (legacy wire, convert) and the roll-forward against its rows (the legacy-token 403, a fresh provenance-bearing decision). -
Erratum (2026-09-07): the contested-surfaces anchor moved with the module rename (
screening_surface_client.rs/fetch, workercraig-cases.lib.watch.5); the data-model section is new; two pushes so Status carries the MR reference.