ADR-055: A Counted TANF Month Is a Ledger Row a Job Writes
Status: Accepted (2026-11-22) with plan tanf-months-are-counted
Issue: #3511 (this decision lands with #3518)
Ruling: the maintainer, 2026-11-22, on the plan: accrual is in scope, and a month is counted from a ledger a job writes from the approved determination in force.
Relates to: ADR-054 (a TANF determination is the pack's), ADR-016 (forward-only migrations).
Context
A time limit is a count of months. Before this decision nothing counted: tanf_time_limits.months_used was written once, when a clock was created, and no job, event or route moved it. The federal 60-month limit (42 USC 608(a)(7); 45 CFR 264.1) therefore never advanced past a seeded value.
canopy keeps no record that a TANF benefit was paid. What it has is the signed determination: who is in the unit, whether a grant was approved, for which days, and for how much.
Decision
-
A counted month is a row.
tanf_counted_months (person_id, counter, month, determination_id, recorded_at), keyed by person, counter and month. Rows are only ever inserted. A person's count is the months on record before the ledger began (tanf_time_limits.opening_months) plus their rows, computed on every read, so no stored total has to be kept in step. -
A job writes it. Once a legal day, across every replica, canopy-tanf counts each calendar month that has ended in the jurisdiction's legal timezone and is after the last month counted, oldest first, each month in its own transaction.
POST /v1/tanf/scheduler/runruns the same pass on demand. A run missed for weeks catches up; the ledger's key makes a replayed or concurrent pass unable to count a month twice. -
A month is judged by the determination in force at its end. Per household: the newest determination made before the month's end whose verdict canopy-eligibility has recorded. The month counts when that determination is approved, in effect on the month's last day (a grant that expires earlier in the month is not), and issued a benefit. The cut-off at the month's end means a late run judges an old month by the determination then in force, not by a later one.
-
The federal counter is canopy's own rule. 45 CFR 264.1 is the same in every State, so it is code, under the reserved counter name
federal. A month counts for each member the unit includes who is the head of household or the head's spouse, and for no one else (264.1(a), (b)(1)(i)); only when the pack's grant decision answered that federal funds pay the grant (264.1(b)(2)); not for a person whose clock is exempt; not for a month an exclusion covers. A supplemental payment is not a determination and counts nothing (45 CFR 260.31(b)(1)). -
Which funds pay a grant is the pack's answer.
tanf-benefit-calculationreturnsfederally_funded, a boolean, on every evaluation. canopy-tanf refuses a determination without it (502, nothing stored) and keeps the answer on the determination. -
An exclusion is recorded by a worker.
POST /v1/time-limits/{person_id}/exclusionsrecords months that do not count for a person, with a reason the pack declares in[[tanf.count_exclusions]]. The job reads exclusions when it counts. -
The 60-month bar covers the head and the spouse. 264.1(a)(1) bars a family that includes a head of household or spouse who has had 60 months, so a determination reads the applicant's clock and each
spousemember's, and deniestime_limitwhen any that is not exempt has reached the limit, whatever the pack's decision answered.
Consequences
-
The ledger counts authorized months, not paid ones. A benefit that was returned, purged or never drawn is counted, because canopy has no TANF issuance record to say so. When one exists the job can read it; until then a worker records an exclusion.
-
Recording an exclusion is the agency's duty. A month federal law does not count (264.1(b)(1)(ii), a month lived in Indian country with high unemployment) is counted unless a worker records it. An exclusion recorded after its month was counted does not remove the row: correcting a counted month is #818's.
-
No month before the ledger began is counted. The migration starts the ledger at the month before it runs. Earlier months are whatever
opening_monthsholds. -
A pack cannot yet identify a State-funded unit. The grant decision is sent no fact that tells one from another (#3525), so a pack answers
federally_fundedfor all its grants alike. -
The counter name is general. The ledger's
countercolumn also takes a pack's own counters ([[tanf.counters]], #3519): the pack's unit decision says whose months count toward each, and the federal counter's tests do not apply to them.
Amendment 1 (2026-11-22, #3520): a clock keeps no State limit
A clock used to copy the pack's [tanf].time_limit_months when it was created, and the eligibility decision was sent that copy. canopy-tanf now stores and sends no State limit: the pack names its limit among its values and its decision compares the count with it. The consequence is deliberate: a decision reads the pack's current value, so a State that changes its limit changes it for everyone at their next determination. A State whose law lets a recipient keep an earlier limit would need a rule of its own for that; none of the pinned packs has one.
Alternatives considered
-
Count at determination time. A determination covers many months and may be superseded before most of them arrive; counting ahead would need un-counting.
-
A stored total incremented each month. A replay or a race double-counts, and the total says nothing of which months it holds. The keyed ledger makes both impossible and keeps the evidence.
-
Wait for a TANF issuance record. It would count paid months exactly, and it does not exist; the limit would stay unenforced meanwhile.