Plan: Frequency-Normalization Foundation (#861, epic &63)
On this page
Status
| Step | Description | Status |
|---|---|---|
1. Shared converter |
|
Done (2026-06-15) — 4 unit tests. |
2. Orchestrator normalization seam |
The eligibility orchestrator loads |
Done (2026-06-15) — 3 unit tests; zero fixture impact (all orchestrator-reachable fixtures use |
3. Retire duplicate converters |
SNAP |
Done (2026-06-15). |
4. canopy-web f64 converter |
|
Deferred (#863 — cosmetic, not a determination path) |
Design — decisions
-
Factors are policy data, not code constants. The pay-period counts (52/26/24/12) are calendar constants in
rulesets/federal/snap-budgeting-factors.jsonper ADR-006/ADR-011 (the allowlist’s own guidance says pay-period conversion factors live there).canopy_reference::moneyships the taxonomy + arithmetic only; every consumer (SNAP, the orchestrator, Medicaid) loads the factors from that JSON.audit-literalsscanning onlyservices/+crates/canopy-contracts-*(#657) is not a license to hardcode them in the othercrates/. -
Normalization at the orchestrator seam (ADR-034). ADR-034 makes the orchestrator responsible for each program’s complete typed input. The medicaid/tanf contracts drop
frequency, so the conversion must happen before deserialization — in the orchestrator, not the program. SNAP receivesfrequency="monthly"→ its (delegating)MonthlyAmountis a passthrough → byte-identical. -
Recognized-vs-passthrough is explicit. The free
to_monthlypasses an unrecognized frequency through (SNAP’s historical default); callers that must not mislabel a record (the orchestrator seam, ELE) useFrequency::parse+ match and warn on the unknown branch.
Verification
-
cargo nextest run -p canopy-reference -p canopy-eligibility -p canopy-snap -p canopy-medicaid(converter + seam + delegations; existing suites unchanged). -
cargo xtask policy audit-literalsclean (no new literals; stale ELE entry removed);quality-budgetsB3a at floor (typed round-trip, no newserde_json::Value). -
SNAP byte-identity: the SNAP
MonthlyAmountsuite + a weekly-income check yield the same monthly as before (same federal factors).