WIC lifecycle substrate: pinned federal text, routable events, program notice identity (epic &106, Plan B1)
Status: Done (2026-09-28) — !1526
Issues: #2389 (epic &106; split from #2360)
Branches: feat/2389-wic-lifecycle-substrate (carries this page)
This is a Design + Scope plan. GitLab owns tracking. It freezes when the first unit starts. One MR, one battery. It binds no catalogue row.
Erratum (2026-09-28): as built, D3’s floor check runs inside NoticeConfig::load, and a CHECK (notices_letterhead_complete) keeps the three letterhead columns all or none. The letterhead is read by a query in store.rs, off the wire Notice, and prepare's printing half moved into assemble_notice so the printed and stored halves are testable together. D2’s infra test is a child module of services/canopy-wic/src/api/persist.rs (the B1 line budget), and completed_at is the determination’s created_at.
Erratum (2026-09-28): the MR also fixes four related defects found while implementing, each as its own issue and commit: #2397 (the WIC denial route’s bare regulatory basis), #2398 (a re-render dropped its continued-benefits block), #2399 ([notices] ignored unknown keys) and #2401 (three texts called the appeals decision clock 90 days). The portal helpline’s program identity is follow-up #2400.
It lays the ground for four plans:
-
B2 (#2390): expiration;
-
B3 (#2391): termination;
-
B4 (#2392): breastfeeding cessation and mid-certification assessment;
-
B5 (#2393): temporary certification.
Context
-
Every WIC letter prints the SNAP identity.
-
canopy-notices holds one identity per jurisdiction:
[notices]inrulesets/<pack>/jurisdiction.toml, whichNoticeConfigloads (services/canopy-notices/src/config.rs~181-188). Georgia’s values are SNAP-cited: a 90-day hearing window (7 CFR 273.15(g)), DHS letterhead and the OSAH hearing office. -
Both paths that render WIC letters use it:
-
the
application.denied.wicroute (rulesets/georgia/notices/manifest.toml~765-771); -
the worker notices behind the bound rows
wic.certification.written-decision-notificationand…ineligibility-reasons-hearing-rights(compliance/action-catalogue/wic.toml~306-330,POST /notices).
-
-
DPH says 60 days (CT-860.04 V) with DPH contacts (Notice of Termination, Rev Feb 2023).
-
The fields are read in
services/canopy-notices/src/generator.rs, atprepare(~269-290), atpersist(the stored hearing deadline and contacts, ~434-446) and aton_demand_context(~529-559). They are also read inservices/canopy-notices/src/worker.rssms_body(~266, ~338).
-
-
canopy-wic’s events cannot be routed.
-
wic.determination_completedcarries neitherhousehold_idnorperson_id, andwic.certification_createdlackshousehold_id(services/canopy-wic/src/events.rs). -
canopy-notices skips an event without both (
services/canopy-notices/src/main.rs~409-433). canopy-web’s case audit feed filters onhousehold_id, and its SSE hub bindswic.determination_completedand readshousehold_id. -
The payloads are untyped service structs, with raw
Uuidids.
-
-
The federal lifecycle text is not pinned.
-
docs/modules/ROOT/pages/federal-requirements.adochas no rows for 246.7(g)(3), (h), (j)(6) or (j)(8). -
It restates (j)(5) and 246.9(e) only as a paraphrase, inside the combined row at ~644-649.
-
The lifecycle rows cite a bare "7 CFR 246.7(j)".
-
-
#2360 is still cited by five allowlist entries, eight scenario fences, two
CHANGELOG.adocentries (~40, ~336) and about twenty doc and code comments. -
Precedents:
-
RenewalSnapCertificationConvertedV1, a typed, notices-consumed event with a wire pin (crates/canopy-contracts-renewals/src/certifications.rs~742, ~777), stamped with.with_programs(services/canopy-renewals/src/events.rs~102-109); -
DeterminationCompletedV1, whose version is the envelope’s (crates/canopy-contracts-eligibility/src/events.rs~96); -
[medicaid].chip_program_namepulled intoNoticeConfig(config.rs~218-230); -
Plan A1’s split of the dual-participation row.
-
Rulings in force:
-
pre-1.0, no shims;
-
every jurisdiction without code changes;
-
ADR-004 (ids, codes and dates only on the bus) and ADR-011 (every pack key cited);
-
neutrality (no DPH or Georgia in the default or fixture packs, or in Rust);
-
the maintainer’s 2026-09-28 ruling that related defects found in a workstream are fixed there, each with its own issue and commit.
Scope
In scope: D1–D4.
Out of scope:
-
the
[wic.lifecycle]table and federal floors file, which B2 (#2390) adds with its first key; -
the temporary certification’s federal basis and trigger (B5, #2393);
-
routing
wic.determination_completedto a WIC notice; -
enforcing a WIC hearing-request window in canopy-appeals. Only enrollment-bound appeals are windowed (
services/canopy-appeals/src/api/mod.rs~411-430), and B3 decides the question for terminations. -
[notices].advance_notice_daysstays jurisdiction-wide. WIC’s 15-day notice under (j)(6) belongs to B3.
Related defects fixed here. Each has its own fix: issue, its own commit, and a Closes line in the MR:
-
2395:
compute_hearing_deadline(generator.rs~1270) is dead code under[allow(dead_code)]. It is deleted. -
#2396:
canopy_typst::context::flatten_context(crates/canopy-typst/src/context.rs~99-113) lets aprogram_datakey override a configured identity field.-
For the six identity keys (
agency_name,agency_address,agency_phone,hearing_phone,hearing_address,appeal_deadline_days) andnotice_date, the context’s value wins and a collision is logged at WARN. The hearing window printed "from the date of this notice" is therefore always the notice datepersistcomputes the stored deadline from (~434). -
Every other key,
effective_dateincluded (generator.rs~584), keeps today’sprogram_data-wins overlay.
-
Design
| # | Decision | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
D1 |
Pinned federal text.
Triggers become these exact strings. Rows outside the lifecycle keep theirs; for example
|
||||||||||||||
D2 |
Routable, typed WIC events.
|
||||||||||||||
D3 |
Notice identity per program.
|
||||||||||||||
D4 |
Retire #2360 from the tracking.
|
Invariants
-
A new notice for a program with a
[notices.program.<p>]table prints and stores that identity alone, and any other notice uses[notices]. The printed and the stored hearing deadline match, and no program’s window falls below its federal floor. -
A regenerated notice reproduces its stored letterhead and appeal rights, never the current configuration.
-
Both
wic.*events are typed V1 payloads with newtype ids, carryinghousehold_idandperson_id. -
No reference to #2360 remains outside the archived plans, and no lifecycle row claims issuance or priority capability.
Units — U-A ∥ U-B ∥ U-C, one MR
Commit 1: docs(plans): plan the WIC lifecycle substrate (#2389). Last: docs(plans): close the WIC lifecycle substrate plan (#2389).
U-A (w5) — feat(notices): give each program its own notice identity (#2389)
Files:
-
services/canopy-notices/src/{config.rs,generator.rs,worker.rs,store.rs,domain.rs,test_support.rs}; -
services/canopy-notices/src/api/applicant_reads.rs, if the fallback needs the rights row passed through; -
a new
services/canopy-notices/migrations/<next>_notice_letterhead.sql; -
crates/canopy-typst/src/context.rs; -
rulesets/federal/{hearing-request-windows.json,citations.toml,indexing.toml,README.adoc}; -
rulesets/{georgia,default,test-max}/{jurisdiction.toml,citations.toml}; -
docs/modules/ROOT/pages/api/canopy-notices.adoc(a new notice-identity section) anddocs/modules/ROOT/pages/data-models/canopy-notices.adoc(the letterhead columns); -
docs/modules/ROOT/pages/rulesets.adoc(the[notices]sample and the floor).
Tests. They compare against the loaded pack’s values, not literals, to satisfy neutrality-lint:
-
program_identity_parses_and_refuses_partial_or_unknown: the Georgia table, a missing required field and an unknown slug; all four packs load. -
a_window_below_the_federal_floor_refuses_boot: a WIC overlay of 30 days, and a[notices]fallback of 30 days with no overlay. -
a_wic_notice_prints_and_stores_the_wic_identity: the render context, the appeal-rights row and the stored letterhead carry the pack’s WIC values, withnotice_dateplus the window. -
a_snap_notice_keeps_the_jurisdiction_identity. -
on_demand_render_reproduces_the_stored_notice:-
a WIC notice persisted before the overlay (NULL letterhead, a 90-day deadline, jurisdiction contacts) regenerates with exactly those after the overlay exists;
-
a notice persisted with a letterhead regenerates with it after the config changes.
-
-
sms_body_uses_the_program_agency_phone. -
configured_identity_wins_over_program_data. -
a_program_data_notice_date_moves_neither_the_printed_nor_the_stored_deadline: through both rendering and persistence.
The two related fixes are separate commits.
U-B (w2) — feat(wic): publish typed, routable WIC events (#2389)
Files:
-
crates/canopy-contracts-wic/{src/events.rs,src/lib.rs,tests/roundtrip.rs}; -
crates/canopy-reference/src/cross_program.rs; -
services/canopy-wic/src/events.rsandservices/canopy-wic/src/api/persist.rs; -
xtask/mq-topology-allow.toml; -
docs/modules/ROOT/pages/api/canopy-wic.adoc(Events published, ~221-227).
Tests:
-
a pinned wire form and a proptest round trip for each V1 struct;
-
event_type_constants_are_dot_delimitedextended to the new constant; -
persisted_events_carry_the_household_and_person, an infra test inservices/canopy-wic/src/api/persist.rsthat reads both outbox rows.
U-C (w2) — chore(compliance): pin the WIC lifecycle text and retire #2360 (&106)
Files:
-
docs/modules/ROOT/pages/federal-requirements.adoc; -
compliance/{action-catalogue/wic.toml,action-coverage-allowlist.toml,scenario-inventory/wic.toml}; -
rulesets/georgia/scenarios/wic.toml; -
rulesets/federal/{wic-certification-periods.json,citations.toml}; -
rulesets/georgia/citations.toml; -
docs/modules/ROOT/pages/rulesets.adoc(~255); -
crates/canopy-contracts-wic/src/participants.rs(docs) anddocs/modules/ROOT/openapi/wic.json; -
docs/modules/ROOT/pages/api/canopy-wic.adoc(~86, ~161-163); -
docs/modules/ROOT/pages/data-models/canopy-wic.adoc; -
services/canopy-wic/tests/wic_test.rs(a comment).
The CHANGELOG.adoc retargets land with this unit’s commit.
Checks: action-coverage, scenarios audit (offline and --online), policy audit, and git grep -n '#2360' — . ':!docs/modules/ROOT/pages/plans/' returning nothing. Plan pages, active and archived, record history.
CHANGELOG entries, one per unit:
-
Fixed: WIC letters print the DPH identity and a 60-day window, and a regenerated notice reproduces what was stored;
-
Added: the program identity overlay, the letterhead columns and the federal hearing-request floor;
-
Changed: the WIC event payloads, and the audit
resource_id.
Verification
-
Per unit, in isolated worktrees:
-
fmt, workspace clippy with the portal features, and
cargo docwith broken intra-doc links denied; -
the non-live lanes, and the ephemeral-schema tests filtered by name;
-
quality-budgets, neutrality-lint, the policy gates, scenarios audit, test-lanes-lint and machete.
-
-
On the branch:
CANOPY_CARGO_FEATURES=canopy-api/test-clock cargo xtask dev reload, thencargo xtask api-docs, thengit push. The battery runs the notices tests, including the SNAP envelope snapshot, and the WIC tests.
Documentation Updates
-
The pages in the units.
-
GitLab:
-
file the two related
fix:issues (#2395, #2396); -
after merge, close #2360 (split; every reference retired) and repoint #2389’s plan link.
-
Review log
| round | vendor | resolved model | verdict |
|---|---|---|---|
1 (2026-09-28) |
Anthropic |
claude-opus-5-5 |
no-ship — five blockers fixed:
* D1 names each restated paragraph’s owner and the exact new triggers, drops (j)(7) (a claims notice) and (g)(2), and splits the combined 246.9 row;
* the two new catalogue rows are fully specified;
* the two CHANGELOG cites are retargeted;
* event ids are newtypes;
* paths are unambiguous.
Observations folded in: the SSE claim, the protected identity keys, the fixture values, the multi-owner fences, and the out-of-scope |
2 (2026-09-28) |
OpenAI |
gpt-6-astra |
no-ship — all eight findings fixed:
* a regenerated notice reproduces its stored letterhead (new columns) and appeal rights, never the current overlay;
* |