Repository navigation
Conversation
A referential figure is attributed only when the account its text names resolves to an account in the same bill's structure (ADR 0025). The resolver maps a text_account to the one node whose trailing whole headings spell the name, normalising only case, whitespace and the separator (em dash or comma), and abstains on no match or several. It never falls back to the figure's own heading path. Exercised on H.R. 4366 v4 SEC. 256 and H.R. 1865 enrolled Sec. 253 as development examples; the expected nodes were read by hand, so independent_evidence stays not_checked. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
ADR 0025 (#875) attributes a referential figure, one whose account is named in its text rather than given by its position, only when (1) the text names exactly one account and (2) that name resolves to an account in the same bill's structure. #869 covered (1): H.R. 4366 Senate amendment v4, SEC. 256, now records
text_accountfor its two rescissions. This PR covers (2). Until now, neither figure was attributed.What changes
docs/research/financial-semantics/figure_example.py, the bounded experiment:resolve_text_account(bill, name)returns the ordinal of the one parsed node whose trailing whole headings spell the name, or None.Figuregainstext_account_ordinalandtext_account_heading_path. The ordinal, with the record's existing source sha256 and parser revision, is the resolved node's ADR 0019 identity.heading_path,text_accountandfiscal_yearstay separate facts, and funding years stay None.ADR 0018 is unaffected: the tree does not change. The resolver reads the parsed headings and changes nothing.
Development examples (not holdouts)
Both are Military Construction and Veterans Affairs provisions; see Reach below.
id329E…DE3B, Medical Community Careid718C…1041Elsewhere in the same lists, H.R. 1865 Sec. 125's "Military Construction, Defense-Wide" matches three headings (titles I, IV, V) and abstains. Its "NATO Security Investment Program" does not match the heading "Security investment program" and abstains. These are limits, not errors.
Corpus check (manual, all filled lists)
Across all 58 bill versions in the corpus, #869's rule fills names in 10 lists (6 bills). I read every name against the bill by hand:
The abstentions fall into three groups:
Reach: one drafting shape, one subcommittee
"Following accounts in the amounts specified:" occurs only in Military Construction and Veterans Affairs divisions. That is #869's reader, not the resolver. Other subcommittees rescind from named accounts routinely, in shapes
text_accountdoes not read yet:The names in those shapes take the forms this resolver already handles ("U.S. Customs and Border Protection, Salaries and Expenses"; "Rural Development Programs—Rural Housing Service—…"). A few would need more:
Evidence: manual only
The expected nodes were read from each bill by hand. That makes them an acceptance case, not independent evidence.
independent_evidencestaysnot_checked, and the findings are in the README, not the record.Tests and negative controls
The SEC. 256 assertions extend #869's existing test, so there is no second parse of the same node. A new slow test covers Sec. 253. A fast test on a constructed bill calls the resolver directly. Each mutation below was applied and its test observed red, then reverted:
difflibratio > 0.9)Gates (run locally on this branch)
uv run ruff check .): passeduv run ruff format --check .): passeduv run pytest -m "not slow and not browser"): 2368 passed, 4 skipped, 15 xfaileduv run pytest -m browser --run-browser): 30 passeduv run pytest -m slow --deselect tests/test_govinfo_corpus_parity.py): 2232 passed, 30 skippedOut of scope
Widening #869's list grammar, committing S.Rept. 118-43, the rescission-row check, cross-bill or cross-year matching, abbreviated report names ("Medical Services (MS)"), Treasury Account Symbols, and any classifier, display, export, total, roll-up or cross-version pairing. #736's contribution credit is preserved. #734, #736 and #739 are not touched.
Next
Commit S.Rept. 118-43 as a frozen input and implement ADR 0025's rescission-row check, matching each row to a figure typed as a rescission by resolved account and amount, starting with the VA Administrative Provisions block. That check is what can move
independent_evidenceoffnot_checked.🤖 Generated with Claude Code