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
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 dedicatedforms/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:171Investigation.status→InvestigationStatus -
services/craig-cases/src/store/models.rs:202Case.status→CaseStatus -
services/craig-cases/src/store/models.rs:235CasePlan.status→CasePlanStatus -
services/craig-cases/src/store/models.rs:254CasePlanTask.status→TaskStatus -
services/craig-cases/src/store/models.rs:96ScreeningDecision.disposition_kind→ reusecraig_reference::enums::Disposition -
services/craig-cases/src/store/models.rs:147EffectiveDisposition.disposition_kind→ reusecraig_reference::enums::Disposition -
services/craig-exchange/src/store/models.rs:32DataSharingAgreement.status→AgreementStatus -
services/craig-exchange/src/store/models.rs:46ExchangeTransaction.status→TransactionStatus -
services/craig-exchange/src/store/models.rs:70ExchangeSendJob.status→SendJobStatus -
services/craig-exchange/src/store/models.rs:125IcpcRequest.status→IcpcRequestStatus -
services/craig-financial/src/store/models.rs:42Payment.status→PaymentStatus -
services/craig-financial/src/store/models.rs:66PaymentAdjustment.status→AdjustmentStatus -
services/craig-financial/src/store/models.rs:82ClaimingRecord.status→ClaimingStatus -
services/craig-placement/src/store/models.rs:68Placement.status→PlacementStatus -
services/craig-security/src/store/models.rs:68SecurityReview.status→ReviewStatus -
services/craig-security/src/store/models.rs:133Partner.kind→PartnerKind -
services/craig-security/src/store/models.rs:134Partner.status→PartnerStatus -
services/craig-security/src/store/models.rs:185PartnerSignerKey.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 |
|---|---|---|---|
|
craig-cases |
|
open, in_progress, pending_review, closed, transferred (verify against |
|
craig-cases |
|
open, closed, transferred |
|
craig-cases |
|
draft, approved, active, closed |
|
craig-cases |
|
pending, in_progress, complete, cancelled |
|
craig-exchange |
|
draft, active, expired, suspended |
|
craig-exchange |
|
pending, processing, completed, failed |
|
craig-exchange |
|
queued, sending, completed, failed, retrying |
|
craig-exchange |
|
submitted, pending, approved, denied, expired |
|
craig-financial |
|
pending, approved, issued, voided, paid |
|
craig-financial |
|
pending, approved, applied, reversed |
|
craig-financial |
|
draft, submitted, under_review, approved, denied |
|
craig-placement |
|
active, ended, pending, trial |
|
craig-security |
|
scheduled, in_progress, completed, remediation_pending |
|
craig-security |
|
state_agency, court_system, federal_agency, healthcare, education |
|
craig-security |
|
active, suspended, terminated |
|
craig-security |
|
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 |
|---|---|---|---|
|
craig-intake-sdk |
|
Report processing lifecycle: pending, accepted, converted, rejected |
|
craig-cases-contracts |
|
Decision-maker role for screening: screener, supervisor, ssa_intake (already partially enumified in store) |
|
craig-cases-contracts |
|
Screening decision outcome: accept_for_investigation, screen_out, refer_only — distinct from existing |
|
craig-cases-contracts |
|
Schedule_contact, request_records, referral, safety_planning — partially documented in handlers |
|
craig-exchange |
|
Wire format: json, xml, hl7, csv — present in |
|
craig-exchange |
|
Transaction kind: data_request, data_response, query, bulk_export |
|
craig-exchange |
|
Partner auth method: basic, oauth, mtls, api_key — distinct from JWT verification mode |
|
craig-placement |
|
Foster-home license: active, inactive, suspended, expired, pending_renewal |
|
craig-placement |
|
Kinship placement decision: accepted, rejected, pending, ineligible — currently free-text rejection_reason |
|
craig-security |
|
Anomaly, threshold, pattern, policy_violation |
|
craig-security |
|
not_started, in_progress, implemented, monitored, deprecated |
|
craig-security |
|
worker_assignment, org_restructure, system_upgrade, policy_change |
|
craig-security |
|
Verify if |
|
craig-reporting |
|
draft, submitted, under_review, approved, rejected — distinct from existing transition enums in |
|
craig-web |
|
UI-side timeline: opened, closed, assigned, escalated, reassigned, status_changed — could be UI-only enum |
|
craig-web |
|
sftp, rest, icpc, soap — distinct from PartnerKind (org type vs integration mechanism) |
|
tools/craig-seed (only) |
|
public, private, charter, virtual — currently SEED-only; defer until production DTO surface needs it |
|
tools/craig-seed (only) |
|
physical_exam, immunization, dental, vision — SEED-only; defer |
Notes on §1.2 candidates:
-
The IcpcHomeStudy struct in
tools/craig-seed/src/model.rs:343-352proposes 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. -
TimelineEventKindandPartnerIntegrationKindare UI-side enums that may be defined inservices/craig-web/rather thancraig-referencesince they don’t cross crate boundaries.
1.3 Recommended phasing for Step 4
| 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) |
|---|---|---|
|
18 |
Gender, Race, Ethnicity, RelationshipToChild, ReporterType, AbuseType, Priority, Disposition, ClosureReason, HouseholdRole, ContactType, CourtOrderType, PermanencyGoal, TaskResponsible, SafetyDecision |
|
10 |
Race, Ethnicity, Gender, RelationshipToChild, RelationshipToCaregiver, MaltreaterRelationship, ChildRelationshipToCaregiver, Language, MaritalStatus, MilitaryBranch, AbuseType |
|
0 (reclassified) |
The 2 originally-claimed sites (ScreeningDecision + EffectiveDisposition |
|
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 |
|
Negligible |
clap::Args derives — operators pass text; backend parses |
|
17 |
Gender, Race, Ethnicity, ReporterType, Priority, LicenseType, PartnerType, ExchangeDirection, IcpcDirection, IcpcRequestType, PlacementType, RelationshipToChild — mirrors contracts; auto-flows |
|
82 |
Same enums as contracts; sampled from canonical const arrays at |
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.
2.2 Step 3 batch sequencing (recommended)
The plan body §Step 3 specifies per-source-crate batches. Recommended order:
-
Batch 1:
crates/craig-cases-contracts/src/**(18 fields, foundational — flows to test-lib + web + seed) -
Batch 2:
crates/craig-intake-sdk/src/types.rs(10 fields, partner wire-format — coordinate with SDK consumer tests) -
Batch 3:
crates/craig-test-lib/src/builders.rs(17 fields, follows batch 1 + 2) -
Batch 4:
tools/craig-seed/src/**(82 fields, follows batches 1-3 enum availability) -
Batch 5:
services/craig-web/src/routes/**(66 fields, view-model side — final because web depends on all upstream crates) -
Batch 6 — deleted post-substantiation: the 2 fields originally claimed for this batch (
disposition_kindon 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 |
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
-
Test-builder duplication:
crates/craig-test-lib/src/builders.rsmirrors the shape of cross-crate-contracts DTOs. Conversion flows automatically — once contracts convert, builder fields' types track. No separate enum design needed for builders. -
Seed-data const arrays:
tools/craig-seed/src/datagen.rs:59-185defines 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. -
Mock-server adapters:
tools/craig-mock-server/src/usesserde_json::Valuefor 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. -
Cross-crate enum name collisions:
ReviewTypemay already exist for security-review classification — verify before introducing the §1.2 candidate of the same name. SimilarlyDisposition(existing, investigation-outcome) vs.ReportDisposition(§1.2, screening-outcome) — distinct semantic and should NOT be merged. -
UI-only vs cross-crate:
TimelineEventKind,PartnerIntegrationKindare candidates forservices/craig-web/src/local definition rather thancraig-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
-
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)
-
-
Step 3 unblocked: 195 CONVERT-EXISTING fields ready for mechanical conversion in batches per §2.2.
-
Step 4 unblocked (for the 14 substantiated set): 16 enums designed and shipped in 3 phases per plan body §Step 4 row.
-
After Steps 3 + 4 ship: re-run inventory to confirm zero
pub <field>: Stringremaining 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