Skip to content

Type 17 more accounts the committee reports confirm, and the FDA's appropriation instead of its allowance - #879

Open
banjtheman wants to merge 3 commits into
civictechdc:developfrom
banjtheman:research/typed-figure-followups
Open

banjtheman wants to merge 3 commits into
civictechdc:developfrom
banjtheman:research/typed-figure-followups

Conversation

@banjtheman

Copy link
Copy Markdown
Contributor

Related issue

Refs #147 (epic: financial semantics research: type each dollar amount before money returns to the report). This adds evidence, not a closing change.
Refs #115 (split each account's money into typed sub-amounts). It adds money an account gets from elsewhere when its paragraph says so.

Follows #845 (measure dollar typing against committee reports) and is measured with #860's precision study (what the report says about every typed figure).

What does this change?

The research resolver (docs/research/financial-semantics/appropriation_resolver.py) now types 17 more committee-report accounts with the report's figure. It also stops typing the FDA's $25,000 enforcement allowance as its $6.87 billion appropriation. No account that agreed before disagrees now, and committee reports still contradict one typed figure: TSA's, which is gross versus net.

Each change is measured in both directions. committee_agreement.py starts from the answer key's accounts. appropriation_precision.py starts from every figure the resolver types. Three commits, each passing the research tests on its own:

  • Labor-HHS money from elsewhere (db12a3b). Three phrases add to an account and say so:

    • a proviso that adds rather than qualifies ("Provided further, That in addition to amounts provided herein, $31,428,000 shall be available under section 241 of the PHS Act");
    • "together with $X to be transferred from" a trust fund;
    • a later sentence that says it appropriates ("In addition to other funds appropriated for the Common Fund ..., $12,600,000 is appropriated").

    Committee reports: 658 → 661.

  • Paragraphs that say they appropriate in forms classify_bill's openings miss (7499447). appropriates() reads four forms beside classify_bill's typing: an appropriating verb on the figure ("$24,000,000 is hereby appropriated"), "is additional new budget authority", a purpose opening ("To carry out ..."), and an opening that adds to other funds ("In addition to funds made available from any other source ..., $423,000,000"). 14 accounts agree, and no other changes. The roll-up reads the same paragraphs.

  • The FDA's appropriation, not its allowance (1a9b8d9). The precision study found structured and summed typing the FDA's Salaries and Expenses at "not to exceed $25,000". The rule that a ceiling straight after the purposes is the appropriation took that allowance, which closes one purpose with a semicolon, as the ceiling. Now a ceiling is the appropriation only when no plain figure closes the purposes after it. No other typed figure in the thirteen bills changes.

Numbers, develop → this PR (each script run on both):

develop this PR
Committee reports, agree (structured / summed, of 752) 648 / 658 662 / 675
Committee reports, summed agree % 87.5% 89.8%
All 1,163 answer-key accounts, summed agree 1,061 (91.2%) 1,078 (92.7%)
Committee reports, wrong figures (structured / summed) 1 / 1 1 / 1
Committee reports, summed ADR 0025 errors (wrong figure + figure not in text) 37 (1 + 36) 34 (1 + 33)
Figures typed in the thirteen Senate-reported bills 971 987
Precision, structured (confirmed / unconfirmed) 900 / 71 916 / 71
Precision, summed (confirmed / unconfirmed) 907 / 64 (93.4%) 925 / 62 (93.7%)
Recall, summed (agree / 853 answer-key lines) 658 (77.1%) 675 (79.1%)
Agency roll-ups reproduced, summed (net, gross or explained) 124 130

Two figures move to the unconfirmed side. I traced both, and neither is a resolver error:

  • CDFI Fund, $354,000,000. This is the committee recommendation in the report's summary block. The block sits under a mixed-case heading ("Community Development Financial Institutions Fund"), and parse_summary_blocks reads only ALL-CAPS headings, so the study sees the figure only as text. The same parser builds the answer keys, so the fix belongs with them. It is left out here.
  • CDC Public Health Scientific Services, $591,597,000. This is $481,564,000 plus the $110,033,000 in section 241 funds its paragraph makes available "in addition to amounts provided herein". The report prints that money under the row as a non-add memo, "(110,033)". SAMHSA's summary blocks count the same kind of money in, and two of the Labor-HHS agreements rest on that. Leaving out the section 241 phrases loses those two agreements and one confirmed figure, and adds one unconfirmed figure. Section 241 money is ADR 0025's question of a figure's effect.

Tests: each phrase and form is pinned, and each pin was proved red without its rule. Paragraphs that only limit or direct stay unread. test_a_ceiling_on_one_purpose_gives_way_to_the_figure_after_the_last_purpose is new. In tests/test_appropriation_precision.py, the FDA test now expects all three resolvers to type the appropriation (renamed test_the_fda_appropriation_found_from_this_direction_stays_typed), and the pins move to the measured counts. The README's tables and its precision section are re-measured.

Left out:

  • Reading a mixed-case summary-block heading (the CDFI figure). It changes parse_summary_blocks, and with it the answer keys.
  • Every "In addition, for , $X." sentence. Tried, it lost nine agreements: reports leave out trust-fund reimbursements, next year's advance, fee offsets and payments to a separate fund. The exclusions come from those same nine failures, so they wait for a fresh answer key (the README records this).
  • The five CDC accounts whose extra money a general provision elsewhere in the bill assigns, which a per-paragraph reading can't reach.

With the answer-key fix: #878 (rebuild the committee-report answer keys) re-pins the same research tests on rebuilt keys. A trial merge of both branches has no conflicts in code, only in the README and the pinned tests. Measured on the merge, summed agrees with 732 of 792 committee-report accounts (92.4%), with 2 wrong figures (TSA, and the Coast Guard line whose report contradicts itself), 926 confirmed and 61 unconfirmed typed figures. Whichever PR lands second re-measures.

How to test

uv run python docs/research/financial-semantics/committee_agreement.py
uv run python docs/research/financial-semantics/appropriation_precision.py
uv run python docs/research/financial-semantics/rollup_agreement.py --resolver summed
uv run pytest tests/test_appropriation_resolver.py tests/test_appropriation_precision.py tests/test_rollup_agreement.py

What I ran:

  • Before/after: all three scripts on origin/develop (a clean worktree) and on this branch. The table above is from those runs.
  • The FDA fix, both ways: with the old _closing_figure restored, 4 tests fail: the new unit test, the FDA test for structured and for summed, and the precision pins. With the fix, every typed figure in the thirteen bills was compared before and after. Only the FDA's changes.
  • Each commit on its own: the research tests pass at db12a3b, 7499447 and 1a9b8d9 (checked in a scratch worktree).
  • CI gates: ruff check and ruff format --check are clean. Fast and slow together (-m "not browser"): 4608 passed, 35 skipped (all allowlisted), 15 xfailed. Browser (--run-browser): 30 passed.

Checklist

  • Linked the issue above (Refs #147, Refs #115; research, nothing to close)
  • Ran the CI gates locally and they pass (see What CI checks)
  • New or changed behavior has tests
  • For a bug fix: the test fails without the fix, and I ran it both ways to check
  • Disclosed AI assistance below, if any

AI assistance

Written with Claude Code (Claude Opus 5.5). The rules, traces, mutation checks and measurements were run in a Claude Code session, and the commits carry a Co-Authored-By line.

🤖 Generated with Claude Code

banjtheman and others added 3 commits November 4, 2026 12:47
…says so

Fifteen Labor-HHS accounts typed a figure their committee report does not
state, twelve of them health agencies whose report figure is the top line
plus money from elsewhere. Three phrases add to an account and say so:

- a proviso that adds rather than qualifies: "Provided further, That in
  addition to amounts provided herein, $31,428,000 shall be available under
  section 241 of the PHS Act", or its "(1) $79,200,000 ...; (2) ..." form,
  the one exception to reading nothing after the first proviso;
- "together with $X to be transferred from" a trust fund, and "together
  with $X from the amounts available under section 241";
- a later sentence that says it appropriates: "In addition to other funds
  appropriated for the Common Fund ..., $12,600,000 is appropriated".

Committee reports: 658 -> 661 of 752 (87.9%); all accounts 1,061 -> 1,064;
no agreement lost, wrong figures still the one gross-versus-net account,
roll-ups unchanged.

Every "In addition, for <purpose>, $X." sentence was tried too and lost
nine agreements to wrong figures: reports leave out trust-fund
reimbursements, next year's advance, fee-offset amounts and payments to a
separate fund. Excluding those would add seven agreements, but the
exclusions come from the same nine failures, so they wait for a fresh
answer key; the README records it. The five CDC accounts' extra money is
assigned by a general provision elsewhere in the bill, out of reach of a
per-paragraph reading.

Tests pin each phrase (each proved red without its rule), the
trust-fund-reimbursement sentence staying out, and committee-report
agreement at >= 661.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…openings miss

Of the 19 committee-report accounts where the resolver typed nothing
although the report's figure was in the text, 16 were paragraphs
classify_bill never types as appropriations: its APPROP rule reads only a
"For ..." opening and "there is appropriated". 14 state that they
appropriate in another form, and `appropriates` reads those four forms
beside classify_bill's typing:

- an appropriating verb on the figure ("$24,000,000 is hereby
  appropriated", "$2,000,000 is provided");
- "is additional new budget authority";
- a purpose opening "To carry out / make / conduct ...";
- an opening that adds to other funds ("In addition to funds made
  available from any other source ..., $423,000,000").

All 14 agree and no other account changes: committee reports 661 -> 675 of
752 (89.8%), all accounts 1,064 -> 1,078 (92.7%), wrong figures still the
one gross-versus-net account, no unconfirmed figure added. The roll-up now
sums the same paragraphs: 124 -> 130 of 156 agency totals reproduced.

classify_bill's rules are civictechdc#736's (copied into the package with a parity
check), so the forms live in the resolver and the README records them for
that classifier. The README's tables are now the current code's, with the
step sections marked as each step's effect when made. Tests pin each form
(each proved red without it) and paragraphs that only limit or direct
staying unread; the slow gates move to >= 675 committee-report agreements
and the new roll-up counts.

Against develop's precision study, which starts from every typed figure,
this and the Labor-HHS commit before it move structured from 900 to 915
confirmed and summed from 907 to 924. Structured's unconfirmed count rises
from 71 to 72 by one correct figure: the CDFI Fund's $354,000,000 is its
report summary block's committee recommendation, but the block sits under a
mixed-case heading that parse_summary_blocks does not read. The study's pins
and the README's precision table are re-measured here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The precision study found the structured and summed resolvers typing the FDA's Salaries and
Expenses at "not to exceed $25,000", one purpose's enforcement allowance, where the paragraph
appropriates $6,872,405,000. The rule that a ceiling straight after the purposes is the
appropriation read the allowance, which closes one purpose with a semicolon, as that ceiling.
A ceiling now states the appropriation only when no plain figure closes the purposes after it.
No other typed figure in the thirteen bills changes.

Re-measured against develop's precision study with the Labor-HHS and appropriates() commits:
structured 916 confirmed, 71 unconfirmed, 662 recalled; summed 925, 62, 675. The README's
precision section now names the two figures those commits add to the unconfirmed side, both
traced: the CDFI Fund's $354,000,000 is its report summary block's figure, under a mixed-case
heading parse_summary_blocks does not read, and CDC Public Health Scientific Services' section
241 money is a non-add memo in its report where SAMHSA's blocks count the same money in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant