Plan: the TANF determination is the pack’s (#2210, plan 1 of 2)
Status: Done (2026-11-22) — six units; the neutrality allowlist holds nothing under #2210
Epic: &128
Issues: #2210 (parent) · U1 #3505 · U2 #3506 · U3 #3507 · U4 #3508 · U5 #3509 · U6 #3510 · follow-ups #3511, #3512
Closes: #2210 (by U6)
Branches: refactor/tanf-vocabulary-rows, refactor/tanf-sanction-steps, refactor/tanf-pack-decisions, refactor/tanf-supplemental-payments, refactor/tanf-deprivation-from-pack, refactor/tanf-neutrality-close
This is a Design + Scope plan: GitLab owns tracking, the child issues carry the implementer brief, and the plan freezes when U1 starts.
Context
compliance/neutrality-gate.toml holds 14 entries and 82 findings under #2210. Georgia’s TANF state plan is compiled into shared code:
-
services/canopy-tanf/src/au_composition.rsdecides each member’s place in the unit with Georgia’s rules and reason strings;au_composition/inputs.rsfixes the dependent-child age at 18. -
services/canopy-tanf/src/determine.rscomputes counted income with one flat disregard per earner (compute_tanf_earned_income) and feeds the pack’s two decisions three fixed standards (gic,son,fm) thatservices/canopy-tanf/src/params.rsrequires of every pack. -
services/canopy-tanf/src/api/grg_handlers.rshard-codes two payment types of one State’s kinship subsidy;params.rsrefuses a pack without[tanf.grg]; the table, routes and contract (crates/canopy-contracts-tanf/src/grg.rs) are named for it. -
services/canopy-tanf/src/api/personal_responsibility_handlers.rslists five requirement types in a literal. -
TanfDenialReasonCode(crates/canopy-reference/src/denial_labels.rs) is a closed enum; canopy-notices prints its labels (services/canopy-notices/src/generator.rs). -
The sanctions rollup (
services/canopy-tanf/src/api/work_requirement_handlers.rs,services/canopy-web/src/dashboard/panels/sanctions_rollup.rs) has three fixed level columns. No production code imposes or lifts a sanction, and nothing reads the pack’s[tanf.sanctions]keys. -
services/canopy-eligibility/src/orchestrator.rsinfers a deprivation basis with a fixed age and Georgia’s token.
A second State cannot write TANF on this: Texas has two needs tests, grant tables by household structure, a different disregard sequence and no kinship subsidy (notes on #2210).
Rulings this plan implements
-
Slate A, 2026-11-16 (#3415): the pack’s decisions own unit composition, whose income counts, the needs tests, the grant and the sanction; payment types are pack rows; Rust keeps the federal clock and work participation.
-
2026-11-22 (question tool): two plans. This one makes the determination and its vocabularies the pack’s, with Georgia’s results unchanged. Plan 2 carries named month counters, review cadence without a certification period, and rules that span cases.
-
2026-11-22: Rust assembles neutral per-person facts, including self-employment net of business expenses; the pack applies disregards and deeming.
-
2026-11-22: the sanction ladder is pack rows that the decision and the rollup read; imposing and lifting a sanction is its own issue.
Design
The decisions a TANF pack carries (U3)
Names are fixed by canopy in a new canopy_reference::tanf_decisions module, as medicaid_decisions does. A pack that enables TANF carries all four.
| Decision | Evaluated | Returns |
|---|---|---|
|
once per member |
|
|
once per member |
|
|
once |
|
|
once, on an eligible verdict |
as today |
Per-member evaluation is deliberate: relations between members are joins, and Rust does joins. The order is fixed:
-
Rust sends each member’s facts (age, relationship, disability status, the member flags the request carries) to
tanf-dependent-child. -
Rust derives, from the parent-child edges and those answers, each member’s structural relations:
parent_of_dependent_child,only_step_relations_to_dependent_children. These are graph facts, not policy. -
tanf-unit-memberplaces each member. The four statuses stay canopy’s: the unit table’s constraints key on them. Reason codes and deemer types are the pack’s strings. -
Rust counts the members with
counts_in_size, resolves the pack’s named standards for that size, and sendstanf-eligibilitythe unit, each member’s income facts and the context.
Income facts. compute_tanf_earned_income is replaced by a function that returns, per person: wages, self_employment_net (gross less business expenses, with the pooled-expense apportionment kept exactly as it is, and its tests), and unearned by income type. No disregard is applied in Rust. The pack’s decision sums what counts for members whose income_counts is true.
Context. Two pack tables replace the fixed keys:
[tanf.standards.need] # any name; shapes as Medicaid class limits
by_household_size = [235, 356, 424]
each_additional = 24
[tanf.values] # any name -> integer, passed through
earned_income_disregard_cents = 25000
minimum_benefit_cents = 1000
A decision reads context.standards.<name> (dollars for the unit’s size) and context.values.<name>. The shapes and their resolution reuse ClassLimit (crates/canopy-reference/src/medicaid_classes.rs), moved to a neutral module; Medicaid keeps using it. A TANF standard may be by_household_size or amount only: canopy-tanf loads no poverty guideline, so it refuses pct_fpl and individual/couple at boot, naming the standard. Removed from params.rs and every pack: [tanf.financial_standards], [tanf.earned_income].disregard_amount_cents, [tanf].minimum_benefit_cents. certification_months and time_limit_months stay until plan 2.
An ADR (the next free number) records the split: the pack decides, Rust assembles facts and enforces the federal limit.
U1 — denial reasons and personal-responsibility types
-
[[tanf.denial_reasons]]rows ofcode,display_text, the two keys the parser behindDenialReasonTable(crates/canopy-reference/src/medicaid_denial_reasons.rs) already reads; the parser is generalised over the table’s key only.TanfDenialReasonCodeis deleted. canopy-tanf refuses a decision’s code that has no row (502, as today for an unknown code). The code canopy emits itself,time_limit, must have a row. -
canopy-notices holds no reason table. As Medicaid does, canopy-tanf puts each reason’s sentence on its determined event beside the code (
denial_reason_texts), frozen when the decision is made, and canopy-notices prints what the event carries. The implementer follows Medicaid’s seam end to end: the event payload, its wire pin, and the notice’s entry in the pack’snotices/manifest.toml. -
[[tanf.personal_responsibilities]]rows ofcode,label. The create route refuses an undeclared type with 422.
U2 — sanction steps
-
[[tanf.sanction_steps]]rows:level(integer from 1, unique),code,label, and any further keys, which Rust passes totanf-eligibilityascontext.sanction_stepfor the person’s active level (in U2, to today’s decision; U3 keeps it). A stored level with no row refuses the determination (502). -
The rollup returns
by_level: [{ level, label, count }]for the declared steps; the web panel renders the list.[tanf.sanctions]leaves every pack.
U4 — supplemental payments
-
Optional
[[tanf.supplemental_payments]]rows:code,label,amountas{ cents = N }or{ standard = "<name>", multiplier = N }, the name being one of U3’s[tanf.standards]. -
The GRG routes, contract and table are renamed (
/v1/supplemental-payments,SupplementalPayment,tanf_supplemental_paymentswithpayee_person_id,on_behalf_of_person_id,unit_size) by a forward-only migration. The handler computes the amount from the row and refuses an undeclared code with 422.[tanf.grg]is no longer read; a pack without the table boots and the create route answers 422 for every code.
U5 — deprivation
infer_tanf_deprivation is deleted from canopy-eligibility, which sends a deprivation basis only when one was captured (none is today; #669). tanf-eligibility returns deprivation_basis and deprivation_provisional. canopy-tanf writes both to the determination’s signed program_extension, where deprivation_provisional is written today, and keeps a captured basis in program_input. A pack whose rule infers a basis from the unit (Georgia’s does today, in canopy’s code) states that rule in its own decision.
U6 — the close
-
canopy config checkgains a TANF check: the four decisions exist in the stack; every denial code a decision can answer, andtime_limit, has a row; every standard and value a decision names is declared. -
The fixture decisions under
fixtures/config/test-maxlose their Georgia text.test-maxdiffers fromdefaultin a denial reason, a payment type and a sanction step. -
The allowlist has no entry under #2210.
Config repositories
As for the intake plan: announce each table and decision on canopy/rules; Georgia’s agent writes its decisions and rows; verify from a git archive; pin in the unit’s MR. U3 needs Georgia’s four decisions and its fixtures in the same MR; U5 needs its inferred-basis rule. Texas is not pinned.
Scope
Out, each to an issue:
-
named month counters, review cadence, cross-case rules, the state time limit: plan 2 (#3511);
-
imposing, curing and lifting a sanction: #3512;
-
the TANF intake items on #3501, which stay there;
-
capturing a deprivation basis at intake: #669.
No compatibility: no alias for a removed key, route or enum; no default table.
Units
| Unit | Change | Status |
|---|---|---|
U1 |
Denial reasons and personal-responsibility types as pack rows |
Done (2026-11-22) |
U2 |
Sanction steps as pack rows; per-step rollup |
Done (2026-11-22) |
U3 |
The four decisions, income facts, named standards and values; the ADR |
Done (2026-11-22) |
U4 |
Supplemental payments replace GRG |
Done (2026-11-22) |
U5 |
Deprivation basis from the pack’s decision |
Done (2026-11-22) |
U6 |
Pack check, fixture cleanup, allowlist closed |
Done (2026-11-22) |
One MR per unit, in order, stacked. U1 to U5 relate to #2210; U6 closes it.
Risks
| Risk | Mode | Mitigation |
|---|---|---|
A household approved today through the inferred deprivation basis is denied after U5 |
silent |
An orchestrator-level case: a one-adult household with a child, sent through canopy-eligibility to canopy-tanf, is approved before U5 and after it, on a pack whose decision infers the basis. Georgia’s pin with that rule is in U5’s MR. |
Georgia’s verdicts or amounts change in U3 |
silent |
U3’s first commit adds a table of cases (inputs to status, code and benefit) run on the code as it is; the same table must pass unchanged after the swap. Georgia’s pack carries fixtures for its decisions, replayed by |
A pack without a required decision or table |
fail-closed |
canopy-tanf refuses to boot, naming it; the pack check reports it before a pin. |
A decision answers a code, standard or status canopy cannot place |
fail-closed |
The determination is refused 502 naming it; nothing is stored. |
A member evaluated by a decision that errors |
fail-closed |
The whole determination is refused; no partial unit is stored. |
The expression engine cannot express a pack’s disregard |
fail-closed |
The pack cannot be written and the gap is raised before a pin; per-person sums use |
Renamed routes and table break a caller |
fail-closed |
Only canopy-tanf and its contract use them (searched); OpenAPI snapshots and the contract round-trip change in U4. |
A sanction level stored with no declared step |
fail-closed |
Determination refused 502; the seed is updated in U2. |
Tests
-
Regression: U3’s case table and U5’s orchestrator-level case, as above; the pooled-expense apportionment tests, unchanged.
-
Contract (wire): round-trips for the renamed payment shapes and the rollup; OpenAPI snapshots.
-
Refusal (unit): each loader refuses a missing required table, a repeated code, a blank field; canopy-tanf refuses boot without a decision; each write route refuses an undeclared code with 422; an unplaceable decision answer is 502; a
pct_fplstandard refuses boot. -
Atomicity (integration): when the second member’s
tanf-unit-memberevaluation fails, the determination is refused and no unit row, determination row or event exists for it. -
Divergence: on
test-max, a denial reason, a payment type and a sanction step thatdefaultlacks are accepted and labelled. -
Migration: existing payment rows survive the rename with their values.
-
Pack check: a fixture pack missing a decision, a reason row or a named standard yields each finding; the shipped fixtures yield none.
-
Gate:
cargo xtask neutrality-lintpasses with the entries removed per unit. -
Every "refuses" above is pinned by the refusal tests.
Delivery
-
Docs with each unit:
rulesets.adoc,jurisdiction-onboarding.adoc,api/canopy-tanf.adoc,data-models/canopy-tanf.adoc,services.adoc,shared-crates.adoc, the ADR andarchitecture.adoc. -
CHANGELOG.adoc== Unreleased: oneChangedentry per unit, each naming what a pack must now carry. -
At approval: file U1 to U6 and the follow-ups; commit this plan under
plans/; note the narrowed scope on #2210. -
Close: U6’s MR closes #2210; Status becomes
Done (date).
Review log
| round | vendor | resolved model | verdict |
|---|---|---|---|
1 |
anthropic |
claude-fable-5-2 |
FLAGS (P1, P2): no risk row or test for verdicts changing when the orchestrator stops inferring a deprivation basis; the denial-reason rows were specified with a |
2 |
gemini-4-carbon |
FLAGS (P2): the same key; the plan did not say how canopy-notices receives a reason’s sentence; supplemental payments named a standard two units before standards existed; nothing said how canopy-tanf treats a poverty-guideline standard; the deprivation outputs had no stated home; no test pinned "no partial unit is stored". P1, P3, P4 pass. |
The plan presented for approval carried these resolutions: a silent-mode risk row and an orchestrator-level regression case for the deprivation unit; display_text, with the parser generalised over the table’s key only; the reason sentence carried on the determined event as Medicaid does; the units reordered so supplemental payments follow the unit that adds standards; pct_fpl and individual/couple standards refused at boot; both deprivation outputs written to the signed program_extension; an atomicity test added. The maintainer approved it on 2026-11-22.
Errata
-
Erratum (2026-11-22): supplemental payments (U4) are built before the four decisions (U3), and bring
[tanf.standards]with them. The payment handler priced one type from the family maximum in[tanf.financial_standards], which U3 removes, so it had to read a named standard first. U3 then moves the determination onto the same standards. -
Erratum (2026-11-22): the
tanf-denial-reasonspack check is built in U1, not U6: deleting the enum deleted the test that held a decision's codes to their sentences. -
Erratum (2026-11-22): canopy-notices refuses a TANF denial letter whose event carries no sentence (U1), as it does a Medicaid one.
-
Erratum (2026-11-22): a decision that names a standard or value its pack does not declare is refused when canopy-tanf boots, not with a 502 at the determination: the engine evaluates an unsent name as null without an error, so only the decision's text can show it (U3).
-
Erratum (2026-11-22):
POST /v1/determinerequires a non-emptymemberslist and refuses income for a person who is not a member, anddependent_childrenleaves the request (U3): the unit is composed from the members alone. -
Erratum (2026-11-22):
[tanf.values]hold whole numbers in the unit a decision uses them in (dollars, not cents): a decision expression may carry no numeric literal, so it cannot convert (U3). -
Erratum (2026-11-22): Georgia's results do change in U5, by the maintainer's ruling on Georgia's side: its decision gives a provisional basis to a unit with fewer than two parents in the home, which approves some households the orchestrator's inference denied.
-
Erratum (2026-11-22): U6's pack check holds a decision to the standards and values its pack declares, and not to the inputs a build sends, which canopy-tanf's own boot check holds.
test-maxalso differs fromdefaultin its unit and deprivation rules, so a test on both proves the pack's answer is followed.