Plan: Count a Partial Month in the TANF Work Participation Rate (#3049)

Status: Done (2026-11-01) — U1 merged; U2 and U3 in one MR
Epic: &58
Issues: #3049 (parent) · #3193 U1 (w5) · #3194 U2 (w3) · #3195 U3 (w3)
Branches: feat/3049-tanf-full-week-hours, feat/3049-acf199-full-weeks, fix/3049-wpr-partial-month

Erratum (2026-11-01): U1 admits the full-weeks route to system callers only (SYSTEM), like the other reporting-only batches, not through the summary batch’s canopy-web delegated row, because canopy-reporting is its one caller.

Erratum (2026-11-01): The OpenAPI snapshot U1 updates is docs/modules/ROOT/openapi/tanf.json.

Erratum (2026-11-01): 422 assisted_period_outside_month also covers a period whose assisted_through is before its assisted_from, which has no day in any month.

Erratum (2026-11-01): The daily rate divides by the federal days_per_week (7 in the shipped file), the divisor row_figures uses, not a literal 7.

Erratum (2026-11-01): entries is capped at 500 (an uncoded 422), the same bound the summary batch applies.

Erratum (2026-11-01): U2 and U3 land as one MR on branch fix/3049-wpr-partial-month, on the maintainer’s direction to batch changes that touch the same code.

Erratum (2026-11-01): the drain computes full_week_count on TanfCaseAux beside assisted_from, so the fold reads it rather than recomputing the weeks. The read model (domain.rs's TanfAcf199Snapshot, the CSV export) does not gain the column: the numerators read it in SQL.

Erratum (2026-11-01): the single-parent numerator counts an adult whose meeting week rows number full_week_count, and the two-parent numerator requires each week to hold a row for every tanf_acf199_snapshot_adults member, rather than a NOT EXISTS over failing weeks. The two pinning tests stay, their partial-month row now one that recorded no week; services.adoc's generic row is unchanged.

This is a Design + Scope plan: GitLab owns tracking, the child issues carry the implementer brief, and the plan freezes when U1 starts.

Context

45 CFR 261.22(d)(1): "If a family receives assistance for only part of a month, we will count it as a month of participation if a work-eligible individual is engaged in work for the minimum average number of hours in each full week that the family receives assistance in that month." 261.24(d)(1) says the same for the two-parent rate, "or both work-eligible individuals, if they are both required to work". (d)(2) in both: "If a State pays benefits retroactively (i.e., for the period between application and approval of benefits), it has the option to consider the family to be receiving assistance during the period of retroactivity." ACF’s WPR Q&A (A14, 2012) restates the rule: the family is in the denominator for the month, and in the numerator if the minimum is met "in each full week" of the period.

canopy-reporting keeps a partial-month family in both WPR denominators and never in a numerator. The numerators (single_parent_numerator and two_parent_numerator in services/canopy-reporting/src/reporting/tanf.rs) require s.assisted_whole_month, which the extract derives from the determination’s dates (assisted_whole_month, services/canopy-reporting/src/worker/tanf.rs). The tests the_two_parent_standard_applies_the_core_floors_and_the_whole_month_gate and the_single_parent_arm_counts_a_family_when_one_member_meets_their_own_standard pin that exclusion. The archived Plan: TANF work participation rate — weekly averages, the recorded young-child standard and family type (#2316, #2315, #2975) deferred the per-week test here.

canopy-tanf computes a person’s month from tanf_work_activities rows (hours_per_week over a date span) in row_figures and aggregate_summary (services/canopy-tanf/src/api/work_requirement_handlers.rs), both of which take an arbitrary window, and serves it through POST /v1/work-requirements/activities/summary:batchGet. The limit engine (build_limit_contexts, services/canopy-tanf/src/participation/summary.rs) produces a LimitContext per person for the month: excess_by_row (a RowExcess::Hours or RowExcess::All per capped row, from the job-search replay of 7-day weeks under 45 CFR 261.34 and the vocational-training months under 42 USC 607(d)(8)) and a job-search partial-week credit. row_figures subtracts a row’s whole month excess once, from its month figures, and as_average_week turns hours into an average week by hours × 7 ÷ days_in_month.

Georgia pays a retroactive stretch: "If an application is approved in the month following the month of application, benefits are prorated from the date of approval or from the 30th day after application, whichever is earlier" (PAMMS TANF 1105, rulesets/georgia/.policy-cache/dfcs-tanf/modules/tanf/pages/1105.adoc). An approval after day 30 pays day 30 to the approval day retroactively. The pinned corpus holds no State Plan election under (d)(2).

Scope

In scope:

  • canopy-tanf answers each person’s countable total and core hours for each full week of a given assisted period within a month.

  • canopy-reporting’s extract records each work-eligible adult’s full weeks for a partial-month family, and its assisted period honours the (d)(2) election.

  • The numerators count a partial-month family that meets the standard in every full week; a cited [tanf.wpr] key for (d)(2).

Out of scope:

  • The 261.22(c) and 261.22(b)(3) options, the caseload reduction credit, and any change to the denominators (a partial-month family is in them today, as A14 says).

  • A work-eligible status that changes mid-month (A14’s second paragraph): the extract keeps today’s month-level work-eligibility.

  • Pinning Georgia’s TANF State Plan into the policy corpus: a follow-up issue.

Design

D1 — What a full week is

A full week is seven consecutive days, the definition 261.34(d) gives "for purposes of this paragraph", lying wholly inside the month and wholly inside the family’s assisted period. The weeks are counted from the first assisted day of the month: assisted from the 10th to the 31st, the full weeks are the 10th-16th, 17th-23rd and 24th-30th, and the 31st is not part of one. Assisted from the 1st to a closure on the 12th, the one full week is the 1st-7th.

The weeks are anchored on the family’s assistance, not on [tanf.participation].week_starts_on. That key anchors a person’s job-search weeks, and Georgia’s value is first_participation_day (PAMMS 1820), which a family with several work-eligible adults, or with none participating yet, cannot share. (d)(1) is about "each full week that the family receives assistance", so the family’s period sets the weeks.

D2 — A partial month with no full week does not count

A family assisted for six days or fewer in the month has no full week. The plan does not count it in a numerator. 261.22(b)(1) counts a family whose work-eligible individual "meets the requirements set forth in § 261.31 for the month", and (d)(1) is the accommodation that lets observed weekly participation stand for the month; with no full week there is no observed week to stand for it. Counting such a family would credit participation nobody measured and overstate the rate a State reports to ACF, while not counting it can only understate. The reading is recorded in the code comment and in federal-requirements.adoc, and a family with no full week stays in the denominator as today.

D3 — canopy-tanf’s full-week hours

POST /v1/work-requirements/activities/full-weeks:batchGet, beside summary:batchGet in work_requirement_handlers.rs, with the same admission. Body FullWeeksRequest { month: "YYYY-MM", entries: Vec<FullWeeksEntry { person_id, assisted_from: NaiveDate, assisted_through: Option<NaiveDate> }> } in crates/canopy-contracts-tanf/src/work_requirements.rs. The answer is one FullWeeksOutcome per entry, tagged on outcome like WorkActivitiesSummaryEntry:

  • weeks { person_id, weeks: Vec<FullWeekHours { week_start, total_hours, core_hours }> }. The list is empty when the period holds no full week.

  • work_standard_unrecorded / work_standard_child_unknown, the summary’s own refusals, unchanged.

The arithmetic lives in a new services/canopy-tanf/src/participation/full_weeks.rs, and does not call row_figures, which would subtract a row’s whole month excess in every week it was run on. For one person it takes the month’s activity rows, the month’s LimitContext (the same build_limit_contexts call the summary makes, so the limits are assessed once, by month, as today) and the D1 weeks:

  • A row’s daily rate is hours_per_week ÷ 7. Its month days are the days it overlaps the month (the days row_figures computes), and its week days the days it overlaps one week.

  • A row’s daily excess is 0 with no excess entry; min(excess_hours, hours_per_week × month_days ÷ 7) ÷ month_days under RowExcess::Hours (the same clamp row_figures applies, then spread over the row’s month days); and the full daily rate under RowExcess::All.

  • The row’s countable hours in a week are (daily rate − daily excess) × week days, floored at zero.

  • The week’s total_hours sums every row’s countable hours; core_hours sums the rows is_core_activity admits. The job-search partial-week credit is month-level and is not attributed to a week: it already counts in the month figures and cannot be placed on a day.

So a row held all week with no excess contributes exactly hours_per_week, and over a whole month the weeks' countable hours sum to the row’s month countable hours less the credit. An entry whose assisted_from is after the month, or whose assisted_through is before it, is 422 assisted_period_outside_month; a batch with no entries answers an empty list.

D4 — The extract records full weeks

TanfDeterminationSummary (services/canopy-reporting/src/clients/mod.rs) gains determined_at, which GET /v1/determinations already serves. The assisted period for the month is [start, expiration], where start is the determination’s effective_date when [tanf.wpr].count_retroactive_assistance_period is true, and otherwise the later of effective_date and the legal day of determined_at in the jurisdiction’s timezone (legal_timezone on the reporting state, loaded by load_legal_timezone in services/canopy-reporting/src/main.rs and already used by the SNAP worker; a decision instant is never read as its UTC date). The flag is the (d)(2) option: required in each pack’s [tanf.wpr] and loaded into TanfWprParams (services/canopy-reporting/src/params.rs). Georgia sets false, cited to 261.22(d)(2) with the note that no State Plan election is in the pinned corpus while PAMMS 1105 shows a retroactive stretch exists. default sets false (the federal default), test-max sets true and test-min sets false, each cited fixture. assisted_whole_month is computed on the same period, in services/canopy-reporting/src/worker/tanf.rs, and the period is carried on TanfCaseAux beside it; domain.rs's TanfAcf199Snapshot gains full_week_count: Option<i32> and the store’s insert (services/canopy-reporting/src/store/) writes it with the week rows.

For a family that is not assisted for the whole month, the extract calls D3 for its work-eligible adults and stores the weeks in a new child table. Migration services/canopy-reporting/migrations/20270311000000_acf199_adult_full_weeks.sql:

CREATE TABLE tanf_acf199_snapshot_adult_weeks (
    snapshot_id UUID NOT NULL REFERENCES tanf_acf199_snapshots(id) ON DELETE CASCADE,
    person_id UUID NOT NULL,
    week_start DATE NOT NULL,
    total_hours NUMERIC(6,2) NOT NULL,
    core_hours NUMERIC(6,2) NOT NULL,
    PRIMARY KEY (snapshot_id, person_id, week_start)
);
ALTER TABLE tanf_acf199_snapshots ADD COLUMN full_week_count INTEGER
    CHECK (full_week_count IS NULL OR full_week_count >= 0);
ALTER TABLE tanf_acf199_snapshot_adult_weeks OWNER TO canopy_reporting_owner;
REVOKE ALL ON tanf_acf199_snapshot_adult_weeks FROM PUBLIC;
GRANT SELECT, INSERT ON tanf_acf199_snapshot_adult_weeks TO canopy_reporting_app;

with COMMENT ON lines for the table and each column, as 20270219000000_acf199_family_type.sql carries for tanf_acf199_snapshot_adults.

full_week_count is the number of D1 weeks in the family’s period: NULL for a whole-month family, 0 for a family with none. It is stored with the snapshot, so a numerator can tell "no weeks" from "weeks not recorded". The rows are written in the snapshot’s own transaction, under its generation_id lifecycle. A D3 refusal for an adult leaves that adult without week rows, as the month summary’s refusal leaves the adult’s month hours empty today.

D5 — The numerators

Each numerator counts a family that meets the month test as today (assisted_whole_month and the averages), or a partial-month family that meets the week test:

  • Single parent: full_week_count >= 1, and one adult whose week rows cover all full_week_count weeks and meet that adult’s own standard (young_child_standard picks 20/20, else 30/20) in every one.

  • Two parent: full_week_count >= 1, and for every week the two adults' combined hours meet the family’s standard (childcare_funded picks 55/50, else 35/30); a week missing either adult’s row fails.

The SQL is a NOT EXISTS over the weeks that fail, inside the existing queries, with the week rows joined through tanf_acf199_snapshot_adults. The all-family rate keeps single_parent_num + two_parent_num (#2975).

Risks

  • A partial month with no full week is never counted (fail-closed, by D2’s reading). The State’s reported rate can only be understated by it, never overstated. The reading is stated in federal-requirements.adoc beside 261.22(d) so a reviewer sees it.

  • A week’s share of a capped row’s excess is spread evenly (silent). The month average already spreads excess evenly, and the week figures use the same rule, so a week can never count hours the month refused. A week that the job-search replay barred in full can still show some hours if the row’s other weeks carried the excess; the month average has the same property. A canopy-tanf unit test pins that a week’s countable hours never exceed its logged hours and that the weeks' excess sums to the month’s.

  • A refused adult has no week rows (fail-closed). A single-parent family whose only adult is refused cannot meet the week test; that matches the month path, where the adult’s averages are empty.

  • A new required pack key (fail-closed). A pack without [tanf.wpr].count_retroactive_assistance_period refuses to boot canopy-reporting, naming the key; U2 adds it to the four packs that carry [tanf.wpr].

  • The legal day of determined_at (silent if wrong). Using the UTC date would move the period’s start a day early every evening; U2 tests a decision at 23:30 Eastern.

Units (weights by complexity) — U1 → U2 → U3

Weights: 1 trivial · 2 small · 3 medium · 5 large · 8 very large. One unit = one independently shippable MR = one child issue.

U1 (w5) — canopy-tanf’s full-week hours

Files: crates/canopy-contracts-tanf/src/{work_requirements,paths}.rs, services/canopy-tanf/src/api/work_requirement_handlers.rs (or a child module under src/api/work_requirement_handlers/ if the file passes the route-module cap), services/canopy-tanf/src/participation/full_weeks.rs, services/canopy-tanf/src/api/mod.rs, docs/modules/ROOT/pages/api/canopy-tanf.adoc, openapi/tanf.json.

D1 and D3. Unit tests in full_weeks.rs (regression, each failed by a mutation): the weeks of a period starting on the 10th of a 31-day month are the 10th, 17th and 24th; of a closure on the 12th, the 1st; of a 6-day period, none; of a February 1-28 period in a non-leap year, four; a row spanning a whole week contributes its hours_per_week; a row starting mid-week contributes its share; core and non-core split by is_core_activity; a RowExcess::All row contributes nothing; a capped row’s weekly countable hours never exceed its logged hours in that week, and over a whole month the weeks sum to the month’s countable hours less the credit. Contract tests in crates/canopy-contracts-tanf/tests/ round-trip FullWeeksRequest and each FullWeeksOutcome arm through its outcome tag, and the OpenAPI snapshot carries the route. Route tests (regression): the batch answers in input order, a refusal stays in its entry, an empty batch answers an empty list, and an out-of-month period is its coded 422.

U2 (w3) — The extract and the (d)(2) key

Files: services/canopy-reporting/migrations/20270311000000_acf199_adult_full_weeks.sql, services/canopy-reporting/src/{clients/mod,params,domain}.rs, services/canopy-reporting/src/store/ (the snapshot insert), services/canopy-reporting/src/worker/tanf.rs, services/canopy-reporting/src/worker/tanf/{family_row,tests}.rs, rulesets/{georgia,default,test-max,test-min}/jurisdiction.toml and their citations.toml where the pack carries [tanf.wpr], docs/modules/ROOT/pages/data-models/canopy-reporting.adoc, docs/modules/ROOT/pages/rulesets.adoc.

D4. A contract test pins determined_at on TanfDeterminationSummary against canopy-tanf’s TanfDeterminationRead. Tests (regression, each failed by a mutation): a whole-month family records no weeks and a NULL count; a family approved on the 10th records its full weeks per adult and a count of 3; with the key false, a determination effective on the 2nd and decided on the 10th starts its period on the 10th, and with it true on the 2nd; a decision at 23:30 Eastern on the 9th starts the period on the 9th; a refused adult has no week rows; the rows commit or roll back with their snapshot. cargo xtask migrations-lint clean.

U3 (w3) — The numerators

Files: services/canopy-reporting/src/reporting/tanf.rs, docs/modules/ROOT/pages/federal-requirements.adoc, docs/modules/ROOT/pages/api/canopy-reporting.adoc, docs/modules/ROOT/pages/services.adoc.

D5. The two pinning tests are replaced by their 261.22(d) forms, not deleted. Tests (regression, each failed by a mutation): a single-parent family with three full weeks all at 30/20 counts, and with one week at 29 does not; a young-child adult at 20/20 in every week counts; two adults where only the second meets every week count; a two-parent family meeting 35/30 combined in every week counts, and one with an adult’s row missing for a week does not; a childcare-funded two-parent family needs 55/50; a family with full_week_count = 0 is in the denominator and not the numerator; whole-month families are unchanged. federal-requirements.adoc gains the 261.22(d) and 261.24(d) rows with D2’s reading. This unit’s MR closes #3049.

Verification

  1. cargo xtask test — the unit and integration lanes pass (see Testing).

  2. cargo xtask dev restart (U2 adds a migration and a pack key), then cargo xtask e2e.

  3. cargo xtask migrations-lint, policy audit (tanf), quality-budgets, test-lanes-lint --static.

  4. cargo xtask validate — the pre-push battery is green.

  5. U1 and U2 close their child issues with Relates to #3049; U3 closes #3049. After U3 merges, the plan moves to plans/archive/ with Done.

Documentation Updates

  • api/canopy-tanf.adoc (the full-weeks route), data-models/canopy-reporting.adoc (the table and column), api/canopy-reporting.adoc (the numerator rule), services.adoc

  • CHANGELOG.adoc — one entry per unit under == Unreleased

  • rulesets.adoc for [tanf.wpr].count_retroactive_assistance_period; federal-requirements.adoc rows (U3)

Review log

round vendor resolved model verdict

1

anthropic

claude-fable-5-1 (gadhs/pi plan review at exit_plan_mode)

no-ship (fixed): no contract test for the new wire; D3’s arithmetic contradicted row_figures (now a per-day spread in its own module); the migration lacked the owner and grants trio; the archived plan’s path was wrong

2

google

gemini-4-argon (second-vendor review)

no-ship (fixed): the same row_figures and as_average_week mismatch plus the unspecified credit (now month-level); test-min's value; the domain and store seams; contract tests for FullWeeks* and determined_at

Edit this page · default