Repository navigation
Add Fiscal Lab's year-by-year values beside each bill's total - #267
Merged
Merged
Conversation
Max asked on 2026-11-29 for the scorecard to carry more detail than the ten-year totals, "at a minimum the year by year". This adds each bill's central case for each fiscal year, FY2027 to FY2036, beside its unchanged FY2027-2036 total: 1,100 single-year claims, 1,348 in all. Extract (adapter.py) - Each row gains `annual`: the CSV's ten FY columns, printed with the same to_fixed3 the CSV rebuild uses. So the pinned CSV hash covers every committed year. - QC 10: the printed years add exactly to the printed total, and the score table's total line is the same path. Both hold on all 110 bills. Ingest - One claim per bill and year, shaped as PWBM, JCT and NZ Treasury shape their years: the period is the fiscal year, there is no window, and the conditions are the central total's without window_kind. - validate_extract checks the years again: FY2027-FY2036 in order, the CSV's three decimals, and an exact sum to the total. A test pins each clause to its own message. - A year's publication says what it is: window FY<year>, a one-year scope note saying the page gives no low or high case by year, and no range note or superseded values. H.R. 4849's years carry a path_note: they are the November 25 path, and the released path is not recorded. - The 101 pe_gap bills' years get valueless pe_gap rows through the unchanged gap_rows (1,010 rows). The 9 not_computed bills' years get none. - The 248 totals keep their claim ids, and a test pins their sha256. App - Opening a window total lists its own single years under "Year by year" (yearPath, with bun tests). NZ Treasury's totals pick up their years too, since a year's fy label is set aside. Feeds - populations.json (both copies) gains the 1,100 rows: 23.1 MB to 26.4 MB. No existing row changes or moves. The summary counts move with the rows. - lanes.json's Fiscal Lab note gives the new count. NOTES.md and source.json record the new shape, the 1,351 committed figures (1,348 current, 3 superseded) and Max's direction. Checks - Full suite: 5,907 passed, 19 skipped (macOS, Python 3.12). - Fiscal Lab file: 88 passed, including the rebuild from the pinned page, which CI skips. - Double build: deterministic, content hash db0a1928.... - App: 68 bun tests, oxlint and tsc pass. In the preview, H.R. 4849's central total lists FY2027-2036 in order, and its low total shows no table. An NZ Treasury total lists its five years. - Ruff format is clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Round 1 (codex sol62, REQUEST_CHANGES) found 2 P1s and 4 P2s. Each is fixed here with a test: - P1: year rows carried Fiscal Lab's ten-year effect label, so 51 $0 years read "adds to deficits" or "reduces deficits". A year now carries that label as ten_year_effect and has no effect of its own. - P1: the scope notes said spending subject to appropriation is "shown separately"; the page's data carries it for 12 bills and only 11 of their notes show it. The notes now say only that the figure leaves it out, and that interest, which every page's glance table shows, is shown separately. This changes the totals' scope_note in the DB; the feed does not export it. - P2: QC 10 could not see a permuted path. The adapter now reads the rebuilt CSV back and checks each bill's years against its own FY cells; tests use distinct years, so a permutation keeps the sum and only this check fails. - P2: _VALUE.match accepted "70.736\n"; all three sites use fullmatch. - P2: yearPath set fy aside only on candidates and kept duplicate years. It now drops fy and window_kind on both sides and shows no path when two rows claim one year. Tests cover the real NZ Budget 2025 shape. - P2: the year table rounded to hundredths, and H.R. 4849's vintage lived only in path_note, which the feed does not export. Years now print at up to three decimals in one scale per table ($70.736B), and H.R. 4849's windows read "FY2027 (revised build)" with the vintage in source_column. - P2: a rerun bound 1,351 variables in one IN list, over SQLite's oldest 999 limit. Deletes go in chunks of 500; a test caps the limit at 999. - Note: NOTES now says the changelog check reads structured figures. Feeds are regenerated in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The year table now picks one decimal count per path, the fewest (up to three) that print every external year exactly, so H.R. 4849's FY2032 reads $250.940B beside $70.736B, and NZ Treasury's years stay NZ$15M. The feeds are regenerated from the round-1 fixes. Against 1c502c0 exactly 10 rows change: H.R. 4849's FY2027-2036, in window ("FY2027 (revised build)") and source_column (the build vintage). All 7,244 claim ids keep their order, lanes.json is unchanged, and the double build is deterministic (content hash bb71418a...). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 2 (full, codex sol62) found every round-1 item answered but one test gap, and raised one P1 and two P2s: - P1: NOTES.md and source.json said Max made the publishing call "in two steps", counting his request for year-by-year detail as the second. His request and his call on publishing the years are separate: the text now quotes the request and names the publishing call as his decision d3576 on this change. - P2: the year formatter could print a nonzero year as zero ($1 beside $2B, $250,000 beside $2B) and set the PolicyEngine column's decimals from the external years alone. The exactness check now works in currency units, the column moves to a smaller unit when three decimals of the larger one cannot print every external year, and a value the column's decimals would round to zero gets more decimals or its own unit. All 112 real year tables print as before. - P2: the main grid rounds standalone years ($70.74B). Fixing it means changing the grid's formatter for every source (1,839 cells across 40 sources), so it is filed as a follow-up issue rather than changed here. - Round-1 item 4, partly answered: a test now covers the superseded values' own fullmatch; reverting that check fails it for all three cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 3 (scoped) found round 2's P1 closed and raised two P2s in the year formatter: - The exactness check allowed a millionth of a unit of currency, so $7.0000005 counted as exact at no decimals and a $0.51 PolicyEngine value beside it printed as $1. The bound is now float error: a billionth of a unit, or a trillionth of the value. - A value under a dollar beside a path in millions fell through to fmtV and printed as $0. It now tries its own unit at up to three decimals, then two significant figures, so a nonzero value never reads as zero. All 1,110 external cells in the 112 real year tables print as they did at 39b288c. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully 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.
Summary
On 2026-11-29 Max asked for the scorecard to carry more detail than Fiscal Lab's ten-year totals, "at a minimum the year by year". #261 staged each of the 110 Memo Bill Scores bills' FY2027-2036 total (248 claims). This PR adds each bill's central case for each fiscal year, FY2027 to FY2036, beside its unchanged total: 1,100 single-year claims, 1,348 in all.
sources/fiscal-lab-memo-scores/adapter.py)Each row gains
annual, the CSV's ten FY columns. They are printed by the sameto_fixed3that rebuilds the page's CSV, so the pinned CSV hash covers every year.New QC 10 has three parts:
It holds on all 110 bills.
scorecard_db/ingest_fiscal_lab.py)window_kind.fullmatch), and an exact sum. A test pins each clause to its own message.FY<year>, and its scope note says Fiscal Lab gives no low or high case by year.ten_year_effect, since the label describes the total: a $0 year can sit on a bill that adds to deficits. It carries no range note and no superseded values.path_note, in their window (FY2027 (revised build)) and in their source column. The app shows the last two.scope_notein the DB; the feed doesn't export it.gap_rows(1,010). The 9 not_computed bills' years get none.yearPathmatches source, reform, metric, unit and basis, and conditions with the period labels (window_kind,fy) set aside on both sides. When two rows claim one year it shows no path.populations.json(both copies) gains the 1,100 rows, going from 23.1 MB to 26.4 MB each. No existing row changes or moves.lanes.json's Fiscal Lab note gives the new count.Terms
#261 committed 251 Fiscal Lab figures on Max's d3450. This PR commits 1,100 more, following his 11-29 request quoted above. The merge stays Max's call (d3576): the repository would go from 251 to 1,351 Fiscal Lab figures. Nobody has contacted Fiscal Lab, and nobody will.
Not in this PR
Checks
bb71418a….tsc -bpass.windowandsource_column). All 7,244 claim ids keep their order.yearPathover the real feed: 110 Fiscal Lab central totals with 10 years and 2 NZ totals with 5, the same under the old and new matcher.Review
This PR changes data that the scorecard site shows, so an independent review runs before merge.
Round 1 (1c502c0) asked for changes: 2 P1s and 4 P2s, all with values verified correct. The second and third commits answer each one with a test.
Round 2 (full, at 39b288c) found every round-1 item answered except one test gap. It raised:
fullmatchnow has its own test.68b4437 answers these.
Round 3 (scoped, at 68b4437) found the P1 closed: APPROVE, so the independent review has finished. It raised two P2s in the year formatter, both fixed in 62cc939:
All 1,110 external cells in the 112 real year tables still print as at 39b288c.
The reviews are in
~/reviews/fiscal-lab-scorecard-2026-11-26/runs/review-annual-r{1,2,3}/.🤖 Generated with Claude Code