ADR-054: A TANF Determination Is the Pack’s — Rust Supplies Facts, the Pack’s Decisions Decide
Status: Accepted (2026-11-22) with plan tanf-determination-is-the-packs
Issue: #2210 (this decision lands with #3507)
Ruling: the maintainer, 2026-11-21 and 2026-11-22, on the plan.
Relates to: ADR-003 (rulesets as data), ADR-006 (jurisdiction-agnostic ruleset organization), ADR-051 (configuration is a git source).
Context
Before this decision canopy-tanf decided most of a TANF case in Rust. It composed the assistance unit by one state's manual, called a member under 18 a dependent child, took a flat disregard from each earner, and read three fixed tables (a gross ceiling, a standard of need, a family maximum) and a minimum grant by key. The pack's two decisions ran the last tests on figures Rust had already computed. A second jurisdiction with a different unit rule, a percentage disregard or a different set of standards could not be expressed without changing source.
Decision
-
The pack's decisions own the unit, the counted income, the needs tests, the grant and the verdict. A pack that runs TANF carries four decisions under names canopy fixes (
canopy_reference::tanf_decisions). canopy-tanf refuses to start on a stack that lacks one. -
Rust supplies facts and does joins. It sends each member's recorded facts, derives from the parent-child relations the two facts no single-member decision can see, and assembles each person's income by kind. It applies no disregard, sums nothing, and compares nothing to a standard.
-
Members are evaluated one at a time. A relation between members is a join, and Rust does joins; a decision is asked about one member with the join's result beside them.
-
The pack names its own standards and values.
[tanf.standards.<name>]and[tanf.values]replace the fixed keys. canopy-tanf reads none of them by name for a determination: it resolves every standard for the unit's size and hands all of them to the decisions. -
The four unit statuses stay canopy's; the words are the pack's.
included,excluded,penalizedanddeemedkey the unit table's constraints. Reasons and deemer types are whatever the pack's decision writes.
The four decisions
| Decision | Asked | Reads | Returns |
|---|---|---|---|
|
once per member |
|
|
|
once per member |
the same, plus |
|
|
once |
|
|
|
once, on an eligible verdict |
|
|
unit_size is the count of members whose counts_in_size is true, and dependent_children the count the first decision called dependent children. The request's household_size prices nothing.
What Rust keeps
-
The split of pooled business costs. A household-level business expense is divided among the self-employed in proportion to their receipts, to the cent, by largest remainder. This is arithmetic on recorded facts, not policy, and a decision language has no exact way to do it.
-
The federal clock. The 60-month federal limit is enforced whatever the pack's decision answers.
-
Refusing what it cannot use. An answer outside the contract is the pack's fault, not the caller's: a status that is not one of the four, an excluded member with no reason, an eligible verdict with no
net_income, or a grant not issued with nominimum_benefiteach refuse the determination with 502, and nothing of it is stored. -
Refusing a decision that reads what it is not sent. At boot, a decision naming a standard or value the pack does not declare, or a threshold or input canopy-tanf does not send, refuses the start: the engine evaluates such a name as
null, and a test of income againstnullpasses. -
Refusing a request its members do not account for. A request with no member, or with income for a person who is not a member, is refused 422: the unit is composed from the members, so either would be decided short.
Alternatives considered
-
One decision over the whole household. It would have to join members to each other in an expression language. Rejected: the joins are graph facts, the same in every jurisdiction.
-
Rust applies the disregard from pack parameters. Keeps today's shape, and fixes the disregard's form (flat, per earner) in source. Rejected: the form is what a jurisdiction tunes.
-
Keep the three fixed standards and add more keys as needed. Each new jurisdiction's table would be a source change. Rejected.
Consequences
-
A jurisdiction changes its unit rule, its disregard, its standards or its grant formula in its pack alone.
-
A pack's decisions are now load-bearing for money.
canopy config checkreplays the fixture cases a pack carries for its decisions, and itstanf-decisionscheck reports a missing decision or an undeclared standard or value before a pin (#3510). It does not require a pack to carry fixtures. -
A decision whose inputs change cannot be pinned ahead of canopy's change: the pack and canopy move in one merge request.
-
The members-and-size gap recorded in #3086 (a member excluded from the unit still priced the grant) is now the pack's to answer through
counts_in_sizeandincome_counts.
Verification
-
A table of 24 households, written against the code before this change, holds unchanged on the reference pack after it (
services/canopy-tanf/src/determine/case_table_infra_tests.rs). -
a_pack_that_answers_differently_is_determined_differently: the second fixture pack's decisions give a different unit size, counted income and dependent-child age, and the determination follows them. -
the_decisions_are_told_the_composed_units_size: both household-level decisions receive the composed unit's size. -
a_determination_one_answer_of_which_is_unusable_stores_nothing: an unusable answer refuses the run and leaves no determination, unit row or snapshot. -
a_stack_without_a_tanf_decision_refuses_to_load_naming_it: boot refusal, naming the file. -
a_request_its_members_do_not_account_for_refuses_422. -
a_decision_reading_what_it_is_not_sent_refuses_to_load_naming_it, andeach_key_list_is_its_request_bodys_fields, which holds the checked input names to the request bodies.