Strum-conversion DTO Inventory (Plan D F-022)

This inventory enumerates every String and Option<String> field in every DTO struct (any pub struct deriving Serialize / Deserialize) across the CRAIG workspace, classifies each per the Plan D F-022 discriminator (CONVERT-EXISTING / CONVERT-NEW / KEEP), and names the target enum for each CONVERT candidate.

Inventory date: 2026-05-24
Plan: Plan D code-quality-discipline §Step 2 (F-022 inventory — NOT-AUDIT-READY blocking)
Status: Done (2026-05-24) — filed; unblocked Plan D Steps 3-4

Archive record

!433 (2026-05-24; Plan D Step 2, the inventory that scoped Steps 3-4)

Executive summary

Classification Count %

Total fields surveyed

1,568

100%

CONVERT-EXISTING (enum already in craig-reference)

195

12.4%

CONVERT-NEW (new enum design needed)

236 (~32 unique)

15.1%

KEEP (free-text / ID-shaped / runtime ref / crypto)

1,137

72.5%

Survey scope (8 source areas):

  • crates/craig-cases-contracts/src/**

  • crates/craig-intake-sdk/src/types.rs

  • crates/craig-test-lib/src/builders.rs + helper modules

  • services//src/api/* + services/*/src/store/models.rs (8 services)

  • services/craig-web/src/routes/** (BFF route models — no dedicated forms/ directory)

  • services/craig-cli/src/cmd/**

  • tools/craig-seed/src/**

  • tools/craig-mock-server/src/**

Verification of substantiated 14 NEW-enum candidates from plan body §Step 4 (2026-05-15 baseline): all 14 present and unchanged. Re-anchored at file:line:

  • services/craig-cases/src/store/models.rs:171 Investigation.status → InvestigationStatus

  • services/craig-cases/src/store/models.rs:202 Case.status → CaseStatus

  • services/craig-cases/src/store/models.rs:235 CasePlan.status → CasePlanStatus

  • services/craig-cases/src/store/models.rs:254 CasePlanTask.status → TaskStatus

  • services/craig-cases/src/store/models.rs:96 ScreeningDecision.disposition_kind → reuse craig_reference::enums::Disposition

  • services/craig-cases/src/store/models.rs:147 EffectiveDisposition.disposition_kind → reuse craig_reference::enums::Disposition

  • services/craig-exchange/src/store/models.rs:32 DataSharingAgreement.status → AgreementStatus

  • services/craig-exchange/src/store/models.rs:46 ExchangeTransaction.status → TransactionStatus

  • services/craig-exchange/src/store/models.rs:70 ExchangeSendJob.status → SendJobStatus

  • services/craig-exchange/src/store/models.rs:125 IcpcRequest.status → IcpcRequestStatus

  • services/craig-financial/src/store/models.rs:42 Payment.status → PaymentStatus

  • services/craig-financial/src/store/models.rs:66 PaymentAdjustment.status → AdjustmentStatus

  • services/craig-financial/src/store/models.rs:82 ClaimingRecord.status → ClaimingStatus

  • services/craig-placement/src/store/models.rs:68 Placement.status → PlacementStatus

  • services/craig-security/src/store/models.rs:68 SecurityReview.status → ReviewStatus

  • services/craig-security/src/store/models.rs:133 Partner.kind → PartnerKind

  • services/craig-security/src/store/models.rs:134 Partner.status → PartnerStatus

  • services/craig-security/src/store/models.rs:185 PartnerSignerKey.status → SignerKeyStatus

Section 1 — CONVERT-NEW enums

This section names every new enum required across the workspace. After deduplication of identical-shape enums repeated at multiple usage sites, the inventory identifies 32 unique new enums that must be designed and added to crates/craig-reference/src/enums.rs (or per-service models.rs for service-internal enums never crossing crate boundaries).

The 14 substantiated candidates (above) are plan-of-record and ship in Step 4 Phase 1-3 per the plan body’s batched delivery sequence. The remaining 18 candidates were newly discovered during inventory and require stakeholder review per §Step 2 verification clause before being added to Step 4 scope.

1.1 Plan-of-record (14 enums — already substantiated by §Step 4)

Enum Service / Crate Primary site Variants

InvestigationStatus

craig-cases

store/models.rs:171

open, in_progress, pending_review, closed, transferred (verify against transitions.rs)

CaseStatus

craig-cases

store/models.rs:202

open, closed, transferred

CasePlanStatus

craig-cases

store/models.rs:235

draft, approved, active, closed

TaskStatus

craig-cases

store/models.rs:254

pending, in_progress, complete, cancelled

AgreementStatus

craig-exchange

store/models.rs:32

draft, active, expired, suspended

TransactionStatus

craig-exchange

store/models.rs:46

pending, processing, completed, failed

SendJobStatus

craig-exchange

store/models.rs:70

queued, sending, completed, failed, retrying

IcpcRequestStatus

craig-exchange

store/models.rs:125

submitted, pending, approved, denied, expired

PaymentStatus

craig-financial

store/models.rs:42

pending, approved, issued, voided, paid

AdjustmentStatus

craig-financial

store/models.rs:66

pending, approved, applied, reversed

ClaimingStatus

craig-financial

store/models.rs:82

draft, submitted, under_review, approved, denied

PlacementStatus

craig-placement

store/models.rs:68

active, ended, pending, trial

ReviewStatus

craig-security

store/models.rs:68

scheduled, in_progress, completed, remediation_pending

PartnerKind

craig-security

store/models.rs:133

state_agency, court_system, federal_agency, healthcare, education

PartnerStatus

craig-security

store/models.rs:134

active, suspended, terminated

SignerKeyStatus

craig-security

store/models.rs:185

active, rotating, revoked, expired

Variants above are inferences from neighboring transitions.rs and validation arrays — Step 4 author must verify each against the canonical state-machine before shipping.

1.2 Newly discovered (~18 unique enums — require stakeholder review)

These candidates were surfaced during the inventory walk but are NOT in the substantiated 14. Each cites a state-machine-enforced or validation-constrained call site. Per §Step 2 verification clause, these require stakeholder sign-off before being added to Step 4 scope.

Enum Origin Primary site Rationale

ReportStatus

craig-intake-sdk

types.rs:345

Report processing lifecycle: pending, accepted, converted, rejected

DecisionActorRole

craig-cases-contracts

reports.rs:86

Decision-maker role for screening: screener, supervisor, ssa_intake (already partially enumified in store)

ReportDisposition

craig-cases-contracts

reports.rs:88

Screening decision outcome: accept_for_investigation, screen_out, refer_only — distinct from existing Disposition enum which is investigation-outcome

FollowUpActionKind

craig-cases-contracts

reports.rs:99 + web intake/reports.rs:109

Schedule_contact, request_records, referral, safety_planning — partially documented in handlers

ExchangeFormat

craig-exchange

store/models.rs:294

Wire format: json, xml, hl7, csv — present in ExchangePartner + builder

ExchangeType

craig-exchange

store/models.rs:317

Transaction kind: data_request, data_response, query, bulk_export

AuthType

craig-exchange

store/models.rs:292

Partner auth method: basic, oauth, mtls, api_key — distinct from JWT verification mode

LicenseStatus

craig-placement

store/models.rs:228 (FosterHome)

Foster-home license: active, inactive, suspended, expired, pending_renewal

KinshipDecision

craig-placement

store/models.rs:274 (KinshipOption)

Kinship placement decision: accepted, rejected, pending, ineligible — currently free-text rejection_reason

DetectionRuleType

craig-security

store/models.rs:511

Anomaly, threshold, pattern, policy_violation

ImplementationStatus

craig-security

store/models.rs:475 (NIST control)

not_started, in_progress, implemented, monitored, deprecated

MajorChangeKind

craig-security

store/models.rs:557

worker_assignment, org_restructure, system_upgrade, policy_change

ReviewType

craig-security

store/models.rs:460 (already exists?)

Verify if enums::ReviewType already covers: security, privacy, compliance, incident_response

SubmissionStatus

craig-reporting

models.rs (AFCARS/NCANDS)

draft, submitted, under_review, approved, rejected — distinct from existing transition enums in transitions.rs

TimelineEventKind

craig-web

routes/cases/chain.rs:108

UI-side timeline: opened, closed, assigned, escalated, reassigned, status_changed — could be UI-only enum

PartnerIntegrationKind

craig-web

routes/security/mod.rs:125

sftp, rest, icpc, soap — distinct from PartnerKind (org type vs integration mechanism)

SchoolType

tools/craig-seed (only)

model.rs:527

public, private, charter, virtual — currently SEED-only; defer until production DTO surface needs it

HealthRecordType

tools/craig-seed (only)

model.rs:540

physical_exam, immunization, dental, vision — SEED-only; defer

Notes on §1.2 candidates:

  • The IcpcHomeStudy struct in tools/craig-seed/src/model.rs:343-352 proposes 8 assessment enums (SafetyAssessment, BackgroundCheckStatus, ReferenceCheckStatus, CapacityAssessment, SupportSystemsAssessment, EducationAccessAssessment, MedicalAccessAssessment, IcpcDecision). These are SEED-only struct fields and should NOT be converted unless ICPC home-study models migrate from craig-seed into a production crate. Tracked as deferred.

  • TimelineEventKind and PartnerIntegrationKind are UI-side enums that may be defined in services/craig-web/ rather than craig-reference since they don’t cross crate boundaries.

Phase Scope Enums

Phase 1

Cases-internal (substantiated)

InvestigationStatus, CaseStatus, CasePlanStatus, TaskStatus (4)

Phase 2

Exchange + Financial (substantiated)

AgreementStatus, TransactionStatus, SendJobStatus, IcpcRequestStatus, PaymentStatus, AdjustmentStatus, ClaimingStatus (7)

Phase 3

Placement + Security (substantiated)

PlacementStatus, LicenseStatus, ReviewStatus, ImplementationStatus, PartnerKind, PartnerStatus, SignerKeyStatus (7 — shipped 2026-05-25; ImplementationStatus renamed from NistStatus during promotion)

Phase 4 (post-review)

Newly discovered (§1.2) — stakeholder sign-off required

~18 candidates pending review

Section 2 — CONVERT-EXISTING fields

195 fields can be converted using enums already defined in crates/craig-reference/src/enums.rs or crates/craig-reference/src/fips.rs. These are mechanical conversions — no enum design required — and should ship in Step 3 batches per source crate.

2.1 By source crate

Crate Field count Target enums (most-used)

crates/craig-cases-contracts/src/**

18

Gender, Race, Ethnicity, RelationshipToChild, ReporterType, AbuseType, Priority, Disposition, ClosureReason, HouseholdRole, ContactType, CourtOrderType, PermanencyGoal, TaskResponsible, SafetyDecision

crates/craig-intake-sdk/src/types.rs

10

Race, Ethnicity, Gender, RelationshipToChild, RelationshipToCaregiver, MaltreaterRelationship, ChildRelationshipToCaregiver, Language, MaritalStatus, MilitaryBranch, AbuseType

services//src/api/*

0 (reclassified)

The 2 originally-claimed sites (ScreeningDecision + EffectiveDisposition disposition_kind) turn out to be KEEP post-substantiation — validated against per-jurisdiction {jurisdiction}-screening-policy ruleset metadata at runtime, not the static Disposition enum (which is investigation-outcome: Substantiated/Unsubstantiated/Inconclusive — different domain). The disposition_kind value space is jurisdiction-config-driven runtime ref data per the KEEP discriminator.

services/craig-web/src/routes/**

66

View-model render-side; downstream of cases-contracts conversion — flows automatically once contracts convert. Direct enums: HouseholdRole, ExchangeDirection, ClosureReason, Severity, ReporterType, PermanencyGoal, PaymentType, Priority, Disposition + 20 more

services/craig-cli/src/cmd/**

Negligible

clap::Args derives — operators pass text; backend parses

crates/craig-test-lib/src/builders.rs

17

Gender, Race, Ethnicity, ReporterType, Priority, LicenseType, PartnerType, ExchangeDirection, IcpcDirection, IcpcRequestType, PlacementType, RelationshipToChild — mirrors contracts; auto-flows

tools/craig-seed/src/**

82

Same enums as contracts; sampled from canonical const arrays at datagen.rs:59-185. Implicit enum evidence — converts automatically once enums.rs absorbs the new types

Mechanical pattern: for every CONVERT-EXISTING field, replace pub <field>: String (or Option<String>) with pub <field>: <Enum> (or Option<Enum>), add use craig_reference::enums::<Enum>; to imports, and update any serialization-test fixtures that pass literal strings. Existing strum::EnumString + serde derives on the target enum already handle the wire-format.

The plan body §Step 3 specifies per-source-crate batches. Recommended order:

  1. Batch 1: crates/craig-cases-contracts/src/** (18 fields, foundational — flows to test-lib + web + seed)

  2. Batch 2: crates/craig-intake-sdk/src/types.rs (10 fields, partner wire-format — coordinate with SDK consumer tests)

  3. Batch 3: crates/craig-test-lib/src/builders.rs (17 fields, follows batch 1 + 2)

  4. Batch 4: tools/craig-seed/src/** (82 fields, follows batches 1-3 enum availability)

  5. Batch 5: services/craig-web/src/routes/** (66 fields, view-model side — final because web depends on all upstream crates)

  6. Batch 6 — deleted post-substantiation: the 2 fields originally claimed for this batch (disposition_kind on ScreeningDecision + EffectiveDisposition) reclassified as KEEP — per-jurisdiction ruleset-driven runtime ref data, not a code-enumerated taxonomy. See §2.1 row note.

Section 3 — KEEP fields (1,137 total)

KEEP fields are partner-supplied free text, ID-shaped values, runtime reference data, narrative/PII, or crypto material. No conversion. Categories surveyed:

Category Count Representative examples + rationale

Names (persons / orgs / courts)

~250

first_name, last_name, court_name, judge, partner_name, school_name. PII; free-text; no taxonomy.

Narrative / description / comments

~180

narrative, description, notes, comment, rationale, findings, additional_info. Free-text; PII-bearing for case narratives.

PII contact info

~80

phone, email, street, city, zip, address. Free-text; PII; format-validated but not enumified.

IDs / UUIDs / references

~120

partner_id, case_id, worker_id, *_by, *_by_name, created_by, recorded_by. UUID-shaped or worker-display-name; references not taxonomies.

Timestamps

~90

created_at, updated_at, occurred_at, started_at, *_date. ISO8601 / RFC3339 string formats.

Runtime reference data

~110

admin_unit (county registry), jurisdiction, ruleset_name, sending_state, receiving_state (FIPS USPS codes), state_fips, fips_code. Externally-curated reference tables, not code-defined taxonomies.

Free-form user input

~85

search, sort_by, sort_dir, contact_with, screen_out_reason, license_number. Operator-input; not enumified.

Crypto material

~25

received_ip_hash, public_key_jwk, algorithm, jti, signing_jwk, ssn (hashed), ssn_last_four (hashed). HMAC outputs; JWS components; PII hashes.

URLs / paths / object keys

~50

endpoint_url, href, object_key. URI-shaped; partner-configurable.

Numeric strings (financial)

~40

daily_rate, gross_amount, ffp_rate, net_amount, total_expenditure. Decimal numbers serialized as String (likely should be Decimal not String, but that’s a separate hygiene issue not in F-022 scope).

ICWA / cultural narrative

~30

tribal_affiliation, indian_heritage_details, csec_* free-text. ICWA/CSEC-domain free text; intentionally not enumified per AFCARS data classification.

Sentinel field names / DB schema names

~25

field_name, source_table, control_id, control_family. Internal identifiers / schema references; not taxonomies.

Misc one-offs

~52

grade_level, language (when used as free-text rather than enum), claiming_period, reporting_period. Various rationales — see per-field analyses in agent reports.

Section 4 — DRY / consolidation notes

  1. Test-builder duplication: crates/craig-test-lib/src/builders.rs mirrors the shape of cross-crate-contracts DTOs. Conversion flows automatically — once contracts convert, builder fields' types track. No separate enum design needed for builders.

  2. Seed-data const arrays: tools/craig-seed/src/datagen.rs:59-185 defines const Vec arrays (REPORTER_TYPES, ABUSE_TYPES, GENDERS, etc.) that match enums.rs variants exactly. All seed-data String assignments sample from these consts. These are implicit enum evidence: once enums.rs absorbs the matching enums, the seed module can swap Vec<&str> for Vec<Enum> and the sampling logic continues working.

  3. Mock-server adapters: tools/craig-mock-server/src/ uses serde_json::Value for partner responses (doe.rs, empi.rs). Aligns with Plan I F-037 (partner-edge retains Value). Out of scope for F-022 — no struct definitions to enumify.

  4. Cross-crate enum name collisions: ReviewType may already exist for security-review classification — verify before introducing the §1.2 candidate of the same name. Similarly Disposition (existing, investigation-outcome) vs. ReportDisposition (§1.2, screening-outcome) — distinct semantic and should NOT be merged.

  5. UI-only vs cross-crate: TimelineEventKind, PartnerIntegrationKind are candidates for services/craig-web/src/ local definition rather than craig-reference. They are UI-render-side and never cross the BFF boundary back to APIs. Step 4 should evaluate locality per enum.

Section 5 — Next actions

  1. Stakeholder review (1-2 maintainers per §Step 2 verification clause) sign off on:

    • The 14 substantiated enums (already plan-of-record — should be uncontroversial)

    • The ~18 newly discovered candidates in §1.2 — DECIDE: in-scope for Step 4, defer, or out-of-scope

    • The seed-only 8 IcpcHomeStudy candidates — explicitly defer

    • Locality of UI-side candidates (TimelineEventKind, PartnerIntegrationKind)

  2. Step 3 unblocked: 195 CONVERT-EXISTING fields ready for mechanical conversion in batches per §2.2.

  3. Step 4 unblocked (for the 14 substantiated set): 16 enums designed and shipped in 3 phases per plan body §Step 4 row.

  4. After Steps 3 + 4 ship: re-run inventory to confirm zero pub <field>: String remaining where the field name signals a closed taxonomy (status, kind, type, severity, disposition, role).

Cross-references

  • Plan: Plan D — code-quality-discipline §Step 2 (this step), §Step 3 (CONVERT-EXISTING batches), §Step 4 (CONVERT-NEW design + conversion)

  • Reference enums: crates/craig-reference/src/enums.rs (39 strum enums + AFCARS/NCANDS taxonomies)

  • Partner-edge Value carve-out: Plan L — partner-typed-schemas

  • Pre-existing transition enums (per-service): services/craig-cases/src/transitions.rs, services/craig-financial/src/transitions.rs, services/craig-exchange/src/transitions.rs, services/craig-security/src/transitions.rs, services/craig-placement/src/transitions.rs

Edit this page · latest