Plan: SHINES Mandated-Reporter Portal Parity for the Standalone Intake Form

Archive record

Merge requests: Aravinth Manivannan’s !1748 (plan), !1757 (U1), !1813 (U2), !1884 (U3), !1885 (U4), !1886 (U5), !1887 (U6), !1888 (U7), !1889 (U8) and !1891 (U9), approved as-is on 2026-10-21 and re-landed with integration fixes: !1971 (slice 1: the plan and U1–U4, Closes #2097–#2100); the close-out !1972 (slice 2: U5–U9, Closes #2101–#2105)

2026-10-22 — after a contextless round 1 (no-ship, folded 2026-09-29). What landed: the DFCS pick-list CSV as typed ShinesCodeTable tables in craig-reference (U1); the reporter’s Reporter Type (mandated only), Gender, State and County pick-lists (U2); the reporter’s household flag, the Principal / Collateral switch and reporter_rel_to_victim (U3); the intake date-time, alternate contact and first-hand contact on Step 1 (U4); per-person shines_* demographics, single-select race, the retired crosswalks (U5); per-person household membership and relationship, is_other_member removed (U6); a non-household child’s required address, a 422 required-field-missing (U7); foster care as one Yes / No on the Children step, foster_care_address removed (U8); PDF / image-only signed attachments checked by magic signature, a 400 attachment-content-unaccepted (U9). Every SHINES pick-list value, top-level and per-person, is matched as sent (#2545). Follow-ups stay open: #691, #692, #1714.

Status

Done (2026-10-22) — !1972

Erratum (2026-09-29): U1 ships gender_to_shines_code(value: &str) → Option<&'static str> (looks the value up in the Gender table; None outside it) instead of D1’s (&CodeEntry) → &'static str — total over its input without a panic path.

Erratum (2026-10-05): U2 creates entry_rules.rs with validate_shines_extra only; validate_shines_adult / validate_shines_child and the BackendProfile threading into the array validators land with the first of U5 / U6 (an empty per-entry validator would be a no-op stub). D2’s options render as {% for %} loops over a typed ShinesPickLists in ui.rs, not an Askama macro file (no template in the repo uses macros); the SHINES state select is #shines_reporter_state (the default-profile block’s #reporter_state input stays in the DOM).

Erratum (2026-10-12): U5 removes fidelity.rs’s `LossyMapping / LOSSY_MAPPINGS and its boot check outright rather than leaving an empty table — race was its only entry, and nothing is lossy once race is single-select. U5 refuses the CRAIG-typed keys per entry where a shines_* replacement exists: all five on an adult, sex and race on a child (a child’s ethnicity / language have no SHINES field and stay capture-only, as before).

Anchors

Epic &100; issues #2097–#2105 (one per unit below); ADR-042 (amended by U1); #692 (authoritative SHINES RefVals — numeric ids stay placeholders); #691 (proposed SHINES wire keys — go-live dependency); #1714 (Principal/Collateral value lists — U1 supplies them for this form).

Context

DFCS compared the GA DHS portal’s "CPS - Mandated Reporter Form" with CRAIG’s mandated form — craig-intake /report under the standalone-SHINES backend profile (boot_standalone_shines, services/craig-intake/src/main.rs) — and listed 27 gaps (source: Craig_CPS_Form_Diff.pdf, received 2026-09-28; its 27 items are transcribed on epic &100 — the item numbers below are its numbering), with the portal’s pick-lists as a CSV (Craig_Field_Dropdowns(Sheet1).csv, 11 columns), committed verbatim with this plan at crates/craig-reference/data/shines/field-dropdowns.csv.

Standalone SHINES is phase 1 of a phased rollout in which CRAIG ultimately replaces SHINES, so the SHINES variant is SHINES-compliant: the portal’s value sets, single-select race, gender with Unknown. The default (cases) profile keeps its AFCARS-bound CRAIG enums (Sex, RaceResponses, Language, MaritalStatus) and its form stays unchanged.

What exists on main today (verified 2026-09-29):

  • The SHINES blocks of services/craig-intake/templates/report.html render most SHINES fields as free text (reporter_relation, reporter_county, adult state / rel_to_primary_caretaker), race as a multi-select checkbox group folded lossily to one raceId, and marital status / language over the CRAIG enums.

  • The reporter address, household-member checkbox and relationship dropdowns are default-profile only (report.html Step 1, x-show="… !== 'shines'"); adult sex and ethnicity have no SHINES field.

  • Adult and child SSN inputs exist (items 20 / 24 are labelling and input-hint gaps); foster care exists as a Step-5 checkbox with name + address (items 19 / 26 are placement); signed attachments exist for SHINES + mandated (item 27 lacks an accept filter, a per-file list with remove, the warning copy and a server MIME check).

  • SHINES intakeDate / dateReported are both the submit time (mapper.rs build_incident); mandated_reporter_category is validated, then dropped on the SHINES path.

CSV facts the design rests on: list sizes 110 / 99 / 75 / 99 / 3 / 55 / 161 / 5 / 34 / 8 / 5 (column order as in the header); the three relationship lists carry a 2-letter code prefix (PK Primary Caretaker), the rest are label-only; codes are unique within a list but six (DC, FM, GS, N2, PB, RN) carry different labels in different lists; the 99 Reporter Type labels equal the 99 Collateral labels one-to-one.

Scope

In scope: the 27 items, mapped to units below; the SHINES code tables; the wire, SDK, mapper and validation changes they need; the ADR-042 amendment; the proposed-SHINES-API rows for every new wire key.

Out of scope: the default-profile form; the craig-web staff report-entry form; the P28 call-taker form (epic &89, unmerged feature/p28-partner-intake — it rebases onto this work); the authoritative numeric RefVals (#692); the portal’s "Incident Date Time" and submit-once notice (not among the 27; R8).

Design

D1 — SHINES code tables (craig-reference::shines_codes)

New module crates/craig-reference/src/shines_codes.rs, beside shines.rs. Not craig-state-ga: that crate is an optional craig-intake feature (state-ga), while the SHINES backend compiles in every build, and the Rust SDK depends on craig-reference only. SHINES code tables are a system’s reference data, not Georgia policy vocabulary.

  • The CSV is already committed (with this plan) at crates/craig-reference/data/shines/field-dropdowns.csv; U1 adds provenance (DFCS, received 2026-09-28) to the module doc.

  • pub struct CodeEntry { pub code: &'static str, pub label: &'static str, pub display: &'static str } — display is the verbatim CSV cell; for label-only lists code == label == display.

  • pub enum ShinesCodeTable { AllegedMaltreatorRelationship, RelationshipPrincipal, RelationshipCollateral, ReporterType, Gender, State, County, MaritalStatus, Language, Race, Ethnicity } (strum::EnumIter) with entries(self) → &'static [CodeEntry], get(self, value: &str) → Option<&'static CodeEntry>, csv_header(self) → &'static str.

  • Tables are hand-authored const slices (the counties.rs model): no build.rs, no runtime parse, panic-free.

  • Wire value: coded lists send the 2-letter code; label-only lists send the exact CSV label — on CRAIG’s ingress wire. The SHINES outbound form is the mapper’s job: Gender maps Female / Male / Unknown → F / M / U via gender_to_shines_code(&CodeEntry) → &'static str in shines.rs (replacing sex_to_shines_code).

  • shines.rs gains code_table_placeholder_id(table, value) → Option<u16> (1-based table position), marked PLACEHOLDER REFVAL (#692), pinned like the other placeholders and kept out of sdks/test-vectors/refval.json. When #692 delivers ids, only this function changes.

  • Tests: per-table order + content parity against its CSV column (the CSV read via include_str! under #[cfg(test)], csv as a dev-dependency; the verbatim file keeps DFCS’s UTF-8 BOM, which the test strips); codes match ^[A-Z0-9]{2}$ and are unique per table; County minus {Out of State, SVU} equals the GEORGIA_COUNTIES names; State minus {Out of State} is a subset of fips::State full names; proptest — the test’s code/label splitter round-trips any [A-Z0-9]{2} <label> and never panics.

D2 — rendering

ReportTemplate (services/craig-intake/src/ui.rs) gains shines_codes: bool, true only under the Shines profile. A new Askama macro file templates/shines_options.html ({% macro options(table) %}) renders <option value="{{ e.code }}">{{ e.display }}</option> from entries() (auto-escaped). No hand-copied option lists. Code-table labels are SHINES reference text, untranslated in en and es, on <select lang="en">; field labels and help text are Fluent keys in crates/craig-i18n/catalog/{en,es}/public.ftl (gated by tests/i18n_coverage.rs).

D3 — wire rule

  • Reuse a key that is an untyped free string or bool with no CRAIG vocabulary, adding Shines-profile table validation: top-level reporter_state, reporter_county, reporter_is_household_member; AdultEntry state, county, rel_to_primary_caretaker, street / city / zip, ssn; ChildEntry ssn.

  • New ChildEntry fields (services/craig-intake/src/api/validation.rs, plus the Rust SDK Child dto): rel_to_primary_caretaker, street, city, state, zip, county — optional strings, garde-capped like their AdultEntry twins, table-validated under Shines only; tolerated and unmapped under the default profile (as ssn is today).

  • Add a flat shines_-prefixed key where the core key is CRAIG/AFCARS-typed (the shines_household_role convention): shines_gender, shines_race (single value), shines_ethnicity, shines_marital_status, shines_language, shines_household_member: bool. No nested per-person object; no per-profile parse of one key.

  • New top-level ExtraFields keys (backend/shines/extra.rs, SHINES_EXTRA_KEYS 16 → 22): intake_datetime, reporter_alt_contact_info, rep_type, reporter_gender, reporter_rel_to_primary_caretaker, reporter_rel_to_victim. rep_type is new because mandated_reporter_category is ENUM_STRING_MAX (32)-capped over a CRAIG allowlist and Reporter Type labels run to 39 characters.

  • Caps count characters, not bytes, and match the HTML maxlength: reporter_alt_contact_info 100, first_hand_info 50, foster_care_name 50.

  • Per-profile validation lives in a new strippable module backend/shines/entry_rules.rs: validate_shines_adult(&AdultEntry, usize), validate_shines_child(&ChildEntry, usize), validate_shines_extra(&SubmitReportRequest, &ExtraFields). validate_adults_array / validate_children_array take the BackendProfile and call them only under Shines. Under Shines the CRAIG-typed per-entry keys (sex, race, ethnicity, language, marital_status) are a 400 naming the shines_* replacement — never silently dropped. The same 400 applies to top-level reporter_relation (replaced by reporter_rel_to_victim) and mandated_reporter_category (replaced by rep_type; its select is hidden under Shines). Under the default profile nothing changes.

  • require_mandated_category keeps its signature; its call in backend/shines/signed_submit.rs is deleted (that handler runs only under Shines), the public.rs call stays.

  • Pre-1.0, no scaffolding: is_other_member and foster_care_address (+ fosterCareAddress, per R5’s default) are removed (the mapper derives isOtherMember from shines_household_member); race_to_shines_id, RACE_ID_OTHER_OR_UNKNOWN, marital_status_to_shines_id, language_to_shines_id, sex_to_shines_code and the race entry of fidelity.rs LOSSY_MAPPINGS retire.

  • Every wire change updates the Rust SDK (crates/craig-intake-sdk/src/types/ — reporter_relation, today Option<RelationshipToChild> in dto.rs, is removed from the Shines builder path), the TS SHINES_EXTRA_KEYS and Python _SHINES_EXTRA_KEYS (the sdks/python/tests/test_extra_fields.py length pin 16 → 22), sdks/test-vectors/extra-fields.json, the SDK changelogs and CHANGELOG.adoc == Unreleased (Changed / Removed).

D4 — SHINES CpsRequest mapping

# Source SHINES wire (mapper.rs) Key

1

intake_datetime (fallback submitted_at)

intakeDate as RFC 3339 datetime; dateReported stays server time

format change

2

reporter_alt_contact_info

reporterInfo.altContactInfo

new

3

first_hand_info (moved to Step 1)

firstHandInfo

existing

4

rep_type

reporterInfo.repType (the reporter-type crosswalk remains the fallback for non-mandated)

existing

5

reporter_gender

reporterInfo.sex (M / F / U)

new

6

reporter_state

reporterInfo.state

new

7

reporter_county (moved to Step 1)

county

existing

8

reporter_is_household_member + reporter_rel_to_primary_caretaker

reporterInfo.isHouseholdMember, .relToPrimaryCaretaker

new ×2

9

reporter_rel_to_victim (replaces free-text reporter_relation)

reporterRelationship

existing

10, 21

shines_household_member

otherHouseholdInfo[].isOtherMember; motherInfo / fatherInfo / chindInfo[].isHouseholdMember

new on parents / children

11, 22

rel_to_primary_caretaker

otherHouseholdInfo[].relToPrimaryCaretaker; same key on parents / children

new on parents / children

12, 13

state, county

state into the composed address; county

new county

14, 25

shines_gender

parents / others sex (new); chindInfo[].sex gains U

mixed

15–17

shines_marital_status / _language / _race

maritalStatusId / langId / raceId via code_table_placeholder_id

existing

18

shines_ethnicity

ethnicityId (placeholder)

new

20, 24

ssn

ssn (digits via map_ssn)

existing

23

child street / city / state / zip / county

chindInfo[].address (composed) + county

new

19, 26

is_in_foster_care, foster_care_name

isInfosterCare, fosterCareName

existing

27

supporting_documents

supportingDocuments

existing

Every new key — and the intakeDate date → date-time format change — is added to a "Portal-parity extensions" table in the proposed SHINES API as a go-live dependency (#691); the new placeholder ids (ethnicityId, sex U) join #692. Each unit updates mapper::TOP_LEVEL_KEYS where needed, the mapped_request_hash pin, the full_body() / full_extra() fixtures, and adds a wire-key lock test.

D5 — conditional logic

  • Household member → relationship list. Client: two <template x-if> blocks (Principal / Collateral) bound to one x-model; toggling the checkbox clears the value (codes overlap across lists, e.g. AF; PK / SC / SL are Principal-only). Server (entry_rules.rs): the value must be in Principal when the household flag is true, in Collateral otherwise — else 400 INVALID_ENUM_VALUE naming the table. This is a value-set constraint, not a relevance rule: relevance governs presence, validation governs the value set (recorded in the ADR amendment).

  • Child address. When shines_household_member is false, street, city, state, zip, county are required: 422 REQUIRED_FIELD_MISSING at children[i].<field>. Client: x-show + :required + a Step-4 check in report-form.js validateStep (stepErrorField = 'child_address'). Per-entry rules live in entry_rules.rs because the relevance grammar (FieldId) is top-level only.

  • Reporter type. New relevance row (Shines profile): FieldId::RepType relevant when reporter_type = mandated, required_when_relevant: true; require_mandated_category becomes a no-op under Shines.

  • Intake date-time. intake_datetime is optional (absent → submitted_at); a value later than server now
    INTAKE_DATETIME_MAX_SKEW (a new 5-minute const in entry_rules.rs, absorbing reporter clock drift) is a 422; backdating is allowed (R2).

  • Foster care. Keep the FosterCareName rule; remove the FosterCareAddress rule, FieldId::FosterCareAddress and the key (the portal has no address field; R5). The checkbox becomes a Yes / No radio (SHINES_TRIGGER_BOOLS → SHINES_TRISTATE_BOOLS).

D6 — foster care placement (items 19, 26)

The wire has one report-level isInfosterCare / fosterCareName, so the question renders once, on Step 4 (Children): "Children are in Foster Care — Yes / No; If Yes: Foster Parent / Placing Agency Name" (max 50), removed from Step 5. A per-adult copy (item 19 read literally) would produce conflicting answers — R5.

D7 — upload parity (item 27)

Scope stays SHINES + mandated (the files are covered by the report’s JWS).

  • Client (report-form.js): Alpine signAttachments: File[]; the input’s @change appends and clears; per-file Delete; View via URL.createObjectURL (revoked on remove / reset); MAX_ATTACHMENTS enforced, de-duplicated; accept=".pdf,.jpg,.jpeg,.png,.gif,.tif,.tiff,.webp".

  • Server (backend/shines/attachments.rs, after verify_manifest): craig_store::validate_upload over a new SHINES_ATTACHMENT_MIME_TYPES subset (pdf, jpeg, png, gif, tiff, webp), magic-byte sniff included; a failure is a generic 400 naming no file (the existing no-oracle discipline).

  • Warning copy: a neutral product-default key intake-attach-prohibited-content-warning (en / es); the GA overlay crates/craig-state-ga/terminology/{en,es}/ overrides it with the portal text: "Please refrain from attaching and sending sexually explicit, nude or obscene photographs of a child; lewd exhibition of the genitals or pubic area of any person; of which the image focuses solely or principally on a child’s genitals or anal region, or portrays any grossly offensive acts. If you have such photos, please provide the photos/videos to Law Enforcement, Medical Personnel or any professional authorized to manage such pictures or videos. CICC cannot accept such documents but will verbally obtain full details for our CPS report. Please keep copies of the pictures or video. The assigned CPS Case Manager will request to view the documents as part of the CPS assessment process." (es: a translation reviewed in the MR). Styled from theme tokens (the CSS test forbids raw hex).

D8 — ADR-042 amendment (U1)

Records: D1’s placement; the D3 wire rule; value-set validation vs relevance (D5); the i18n posture (D2); the retired crosswalks.

Units

One issue per unit under the epic; each lands on its own feat/… branch and MR. Weights are implementation complexity.

Unit Deliverable Items Weight After

U1 (#2097)

D1 code tables + CSV parity tests; code_table_placeholder_id; D8 ADR amendment

—

3

—

U2 (#2098)

entry_rules.rs with all three validators + BackendProfile threaded into the array validators; D2 rendering; reporter dropdowns rep_type, reporter_gender, reporter_state, reporter_county; RepType relevance row

4–7

5

U1

U3 (#2099)

Reporter household member + Principal / Collateral switch; reporter_rel_to_victim

8, 9

3

U2

U4 (#2100)

Intake date-time (defaults to now), alt contact (100), first-hand contact (50), both moved to Step 1

1–3

3

U2

U5 (#2101)

Per-person shines_* demographics, state / county validation, single-select race, crosswalk retirement, SSN input hints (inputmode="numeric", maxlength=11); SHINES e2e locators move to data-field attributes

12–18, 20, 24, 25

8

U2

U6 (#2102)

Adult / child household member + relationship; is_other_member removed

10, 11, 21, 22

5

U2

U7 (#2103)

Child address required iff not a household member

23

3

U5, U6

U8 (#2104)

Foster care relocated to Step 4, Yes / No, name cap 50, address rule dropped

19, 26

2

U2

U9 (#2105)

Upload parity (D7)

27

3

U2

Tests per unit (each issue lists its own):

  • U1 — the D1 parity, invariant and proptest suite.

  • U2–U9 — unit tests in api/validation.rs, entry_rules.rs, mapper.rs (hash pin + wire-key lock), relevance; a ui.rs render test that the code-table options appear only under Shines; API tests in services/craig-intake/tests/api/ (signed_submit.rs, intake_schema.rs) covering accept + reject per profile; tests/e2e/specs/intake-embedded-ui-shines.spec.ts for every new widget and conditional. The default-profile specs (intake-embedded-ui.spec.ts) pass unchanged — that is the "default form unchanged" proof.

  • U3 / U6 — both branches of the Principal / Collateral switch, and the toggle clearing the value.

  • U4 — multibyte character-count caps; an intake date-time in the future (beyond 5 min skew) is a 422; the mapper’s intakeDate format.

  • U7 — a 422 per missing address part; household member → no address required.

  • U8 — "Yes" without a name is a 422; "Yes" with a name and no address is accepted.

  • U9 — a PE header declared as application/pdf is rejected; hash-mismatch behaviour unchanged; e2e add two files, remove one, submit — the manifest carries one entry; the warning is visible.

Every unit: en / es catalog keys, proposed-API rows for its new keys, SDK + vector updates, CHANGELOG.adoc.

Verification

  1. cargo nextest run -p craig-reference -p craig-intake -p craig-intake-sdk — unit + API tests.

  2. cargo xtask dev reload, then the SHINES devstack form at craig-intake-standalone-shines (host port 8011): walk a mandated report through every item; the forwarded CpsRequest at the mock SHINES carries the D4 keys.

  3. cargo xtask e2e — the SHINES and default-profile intake specs green.

  4. The TS / Python SDK suites against the updated extra-fields.json vector.

  5. cargo xtask check-docs, cargo xtask plan-lint.

DFCS rulings needed

Open questions, recorded on the epic; the design takes the stated default until ruled.

  • R1 — Is repType the Collateral 2-letter code (the labels match one-to-one) or the label? Default: the label. Does the Reporter Type list apply to non-mandated SHINES reporters? Default: no.

  • R2 — Intake date: editable / backdatable by the reporter? Date or date-time, which time zone? Default: editable, not in the future, date-time in UTC on the wire.

  • R3 — Is SHINES isOtherMember the portal’s "Household Member"? Default: yes.

  • R4 — Child address: all five parts required? What is county "SVU", and should reporters see it? Should a non-Georgia state force county "Out of State"? Default: all five required; SVU shown; no forcing.

  • R5 — Foster care per report or per adult / child? Is fosterCareAddress still wanted? Default: per report; no.

  • R6 — "Your Relationship to Victim Child" uses the Alleged Maltreator list (it includes AN / SM / UK). Default: as the diff states.

  • R7 — Canonical labels for the six codes that differ between lists; is the 34-language list final; are American Samoa and the Northern Mariana Islands intentionally absent? Default: per-list labels verbatim.

  • R8 — Is the portal’s submit-once / cpsintake@dhs.ga.gov notice wanted? Default: out of scope.

The numeric ids for race, marital status, language, ethnicity and sex U remain #692.

Review log

Round Vendor Resolved model Verdict

1

Anthropic

claude-opus-5-5

no-ship — Q2: source files unreachable; child keys mislabelled as reuses; plus reporter_relation / mandated_reporter_category under Shines, gender code mapping, the intake-date rule, the entry_rules.rs owner, the Python key pin; Q3: foster_care_address. All folded (2026-09-29).

Edit this page · latest