Plan: One SHINES CpsRequest for the Portal Form and the P28 Call-Intake Form
Archive record
Merge requests: Aravinth Manivannan’s !1901 (#2333 with the JSON Schema, and #2351), approved as-is on 2026-10-21 and re-landed with integration fixes as the close-out !1974 (Closes #2333, #2351)
2026-10-22 — after a contextless round 1 (no-ship, folded 2026-10-13). What landed:
four craig-reference enums with placeholder SHINES codes, under the boot fidelity gate (D1, D7);
the reporter_demographics / triage / notification / screening blocks and
safety_concern_description, each block refused on every channel with a 403 field-permission-denied until staff
authorization (#2617) (D2);
per-person designation / employer / is_dfcs_staff / military_stationed_at and a child’s apt /
is_in_foster_care / foster_care_provider_name, the foster-care 422 required-field-missing (D3, D4);
the narrative "Additional information" answers (D5); every new value matched as sent (#2545);
the reporterInfo / triageInfo / notificationInfo / additionalInfo / screeningInfo wire and one adultInfo[]
list (D6, #2351), with a JSON Schema the mapper tests hold to its keys.
Follow-ups stay open: #692, #693, #1714, #1770 (the P28 form rebase); #2617 (staff authorization for the staff-only
blocks).
Status
Done (2026-10-22) — !1974
Erratum (2026-10-13): the adults ride one adultInfo[] list (#2351) — where this plan names motherInfo, fatherInfo
or otherHouseholdInfo[], read adultInfo[]; shines_household_role is removed.
Erratum (2026-10-13): ChildEntry.is_in_foster_care ships as Option<bool> (wire Y / N / empty), not D3’s
plain bool — a fourth plain bool on the child entry would need a struct_excessive_bools lint override, and "not
asked" (the portal form) is distinct from "no". D5’s caps on the new narrative fields are declared on NarrativeView
but, like every existing narrative cap, not enforced at the edge (nothing validates the view); the five answers are
bounded by their token check. The four D2 blocks are accepted only on the signed channel (a 422 naming the block
elsewhere): they are staff-recorded, and screening.entering_into_shines steers a downstream bot, so an
unauthenticated caller must not be able to set them.
Erratum (2026-10-22): re-landed as !1974 with integration fixes — on every channel a block is a 403
field-permission-denied until staff authorization (#2617), not a 422; the foster-care refusal is a 422 required-field-missing;
reporter_demographics.ssn is an SsnIdentifier; every new list value and token is matched as sent (#2545).
- Anchors
-
Issue #2333 (epic &89); builds on SHINES Mandated-Reporter Portal Parity (epic &100, units U1–U9); ADR-042; #692 / #693 (authoritative SHINES RefVals and wire keys — everything new here is a placeholder until they land); #1714 (Principal / Collateral lists — already `ShinesCodeTable`s); #1770 (P28 over the S3 delivery).
Context
Two branches grew the SHINES CpsRequest (services/craig-intake/src/backend/shines/mapper.rs) apart:
-
The portal-parity stack (the base of this branch) matches the DHS public "CPS - Mandated Reporter Form": SHINES pick-list values for demographics and relationships, a timed
intakeDate, a child address, attachment rules. -
feature/p28-partner-intake(epic &89, unmerged, predates the stack) adds the fields of the DHS call-intake form that agents fill while on the phone: reporter demographics, triage, county notification, screening gates, "Additional information", and per-person employer / designation / foster care. It reads keys the stack has since removed (reporter_relation,is_other_member,foster_care_address) and CRAIG-enum crosswalks the stack deleted.
DFCS’s Craig_P28_Form_Differences.docx lists 26 call-intake items missing from CRAIG; the stack covers the 7 that
overlap with the public portal. This plan closes the other 19 in the contract — the request body, its validation, the
mapper and the SDKs. After it merges, the P28 branch is rebased onto it and keeps only its form, route and specs.
Scope
- In
-
ExtraFields, the per-entry child / adult views, the SHINES narrative view, SHINES-profile validation, relevance, theCpsRequestmapper, the boot fidelity gate,craig-referenceenums and crosswalks, the three SDKs, the cross-language fixture,CHANGELOG.adocandinterfaces/shines-cps-intake-proposed-api.adoc. - Out
-
Any form UI. The mandated-reporter form (
report.html) mirrors the public portal, which has none of these fields; the call-taker UI isp28.htmlon the P28 branch. The default (cases) profile is unchanged: it tolerates the new per-entry keys and maps nothing. Server-side enforcement of the screening gates (they end the call in the form; D2).
Design
All new keys follow the stack’s rules (portal-parity D3): accepted only under BackendProfile::Shines, pick-list fields
hold SHINES list values checked in backend/shines/entry_rules.rs, blank counts as absent, errors never echo input.
D1 — reference enums (craig-reference)
Four new enums in enums.rs, each with a validate_* function in validation.rs; two existing enums are reused. All
six get a placeholder SHINES crosswalk in shines.rs (fn x_to_shines_code(X) → &'static str, #692):
| Enum | Wire tokens | Placeholder SHINES code |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The first three are ported from the P28 branch. P28’s TriStateAnswer duplicates YesNoUnknown and its
SafetyConcernAnswer has no consumer (safety_concerns is a free core string that already maps to emergencyInfo);
neither is ported. YesNoUnknown / YesNo need no new validator: callers use the generic validate_enum.
D2 — ExtraFields (backend/shines/extra.rs)
Five new top-level keys (21 → 26), added to SHINES_EXTRA_KEYS and sdks/test-vectors/extra-fields.json. The four
blocks are structs with #[serde(default, deny_unknown_fields)], so a misspelled nested key is a 400, not lost data.
| Key | Shape (every leaf optional; a string unless marked) |
|---|---|
|
|
|
|
|
|
|
|
|
Free text, |
Block bools are Option<bool> (unanswered is distinct from "no"). No new cap constant. The Rust SDK mirror carries the
same caps. sanitize_extra_fields sanitizes every string leaf of the blocks except ssn (the mapper digit-extracts it;
a raw SSN is never normalized).
The screening answers are captured, not enforced: the form ends the call on a disqualifying answer, and an API caller
that sends victim_is_minor: false is recorded as having said so.
D3 — per-entry keys (api/validation.rs)
| Entry | New keys |
|---|---|
|
|
|
|
is_dfcs_staff is a plain #[serde(default)] bool, as shines_household_member: absent is false, and the wire
value is always Y or N. is_in_foster_care is Option<bool> (see the erratum).
Household membership stays shines_household_member (portal-parity U6); P28’s is_household_member entry key is not
added. Report-level is_in_foster_care / foster_care_name (portal-parity U8) stay as they are: the portal asks once
per report, the call form once per child, and SHINES receives whichever was answered.
D4 — SHINES-profile rules (entry_rules.rs)
-
validate_shines_extraadditionally checks: the fourshines_*demographics andcounty_notifiedagainst theirShinesCodeTable;triage_response_time,notification_method,mandated_reporter_disclosureagainst their enums;reporter_demographics.date_of_birthas an ISO date. Field paths are dotted (triage.triage_response_time). -
validate_shines_adult/validate_shines_childcheckdesignationagainstPersonDesignation. -
Relationship list.
rel_to_primary_caretakeris drawn from the Principal list when the entry’sdesignationisprincipal, the Collateral list when it iscollateral, and — when no designation is given — byshines_household_memberas today. The call form has both a Household Member checkbox and a Principal / Collateral radio, and the radio picks the list. -
Foster care. A child with
is_in_foster_careand a blankfoster_care_provider_nameis a 422 atchildren[i].foster_care_provider_name(the twin of the child-address rule). -
Narrative. A new
validate_shines_narrative, called fromprepare_submissionunder Shines, parses the body’snarrativeobject asNarrativeViewand checks the D5 answers:previous_truancy,digital_payment_platforms,has_recent_photosareYesNoUnknown;can_email_photos,child_fatality_or_serious_injuryareYesNo. A narrative that does not parse is a 400 here (today it is a 500 in the sink). -
Relevance. One new SHINES row:
triage_response_timeis relevant whentriage_neededis true, and required then.FieldId::TriageNeeded/TriageResponseTimeresolve from the nested block; their schema names stay flat (triage_needed,triage_response_time), and theFieldIddoc comment says so.
D5 — narrative (backend/shines/narrative.rs)
NarrativeView gains previous_truancy, previous_truancy_description, digital_payment_platforms,
digital_payment_details, has_recent_photos, can_email_photos, child_fatality_or_serious_injury — all optional
strings: the five answers ENUM_STRING_MAX, the two free-text ones NARRATIVE_MAX. The narrative object is already
forwarded and sanitized as a whole; only the typed view grows.
D6 — CpsRequest mapping (mapper.rs)
Convention (as the stack): a string key is always present and empty when unanswered; a numeric *Id key is omitted when
unanswered; a bool maps to Y / N / empty; an enum maps to its D1 code.
| Where | Keys added |
|---|---|
|
|
top level |
|
|
|
|
|
notificationDateTime is RFC 3339 UTC to the second, as intakeDate. TOP_LEVEL_KEYS gains the five top-level keys;
the pinned mapped_request_hash is re-blessed. screeningInfo exists because the "entering this into SHINES" answer
decides whether a downstream bot enters the intake — P28 captured it and never forwarded it.
D7 — fidelity gate (fidelity.rs)
verify_crosswalk_totality adds one ensure_nonsentinel call per D1 enum, so an empty placeholder code refuses boot.
D8 — SDK parity
-
Rust (
crates/craig-intake-sdk/src/types/): the four block structs and the new key inextra.rs; the D3 keys onChild/Adultand the D5 keys onNarrativeindto.rs(previous_truancyis already there — only its doc changes); re-exports inmod.rs; the pinned key count. -
Python (
sdks/python/src/craig_intake/builder.py) and TypeScript (sdks/typescript/src/builder.ts): the five keys in each SHINES key list; their tests' key counts; both SDK changelogs. -
sdks/test-vectors/extra-fields.json: 26 keys, with a populated value for each new one.
Verification
-
Unit: each D4 rule (accept, refuse, blank-is-absent), nested unknown key refused, sanitization incl. the
ssncarve-out, the relevance row, the D6 keys and blocks (populated and empty), the re-blessed hash,TOP_LEVEL_KEYS, the fidelity gate, enum round-trips, the fixture parity tests. The mapper proptest’sarb_adult/arb_childgenerators gain the D3 keys. -
Devstack API: in
tests/api/signed_submit.rs, a signed submission carrying every new block stores aCpsRequestwith the D6 keys, and each D4 rule refuses a signed submission; intests/api/intake_schema.rs, the public channel refuses a call-intake block. -
cargo xtask validate --skip-devstack --skip-docker,cargo xtask sdk-test,cargo xtask plan-lint.
Follow-through — the P28 rebase
After the MR for #2333 is open, feature/p28-partner-intake is rebased onto this branch. Its contract commits
(reference enums, ExtraFields, mapper, relevance, SDK keys, sanitization) are dropped in favour of this one; its form
(p28.html, p28-form.js), route, CSS and Playwright specs are kept and adapted to send the D2 / D3 keys and to expect
the D6 wire.
Review log
| Round | Vendor | Resolved model | Verdict |
|---|---|---|---|
1 |
Anthropic |
claude-opus-5-5 |
no-ship — Q1: nav entry under Planned while In progress; Q2: D1 added two enums
that already exist ( |