Repository navigation
Conversation
Follow-ups from the #244 review (suggestions 11 and 12). 11. A link whose text could not be read on RETRIAGE_FETCH_TRIES runs was skipped until the link changed, so a site that was down on two daily runs hid each new version from it for good, and the skipped bills left the log. record_fetch_failure now stores the date of the failed try in priority_signals.text_fetch_failed.last_try, and retriage_candidates makes the bill a candidate again once RETRIAGE_RETRY_DAYS (7) days have passed since that try. A retry that fails again counts a try and starts the wait over; a link tried on fewer than RETRIAGE_FETCH_TRIES runs is retried on the next run, as before. Each --retriage-changed run prints how many bills it leaves out this way. Records written before this change hold {url, tries} with no date. They are treated as due: the link is tried once more on the next run, and a failure then records the date. #244 merged on 3 December, so such rows are at most a day or two old and few; the alternative (skip until 7 days from now) would need the candidate filter to write a date, or a hard-coded deploy date. An unreadable date counts as no date. 12. _BILL_TEXT_MARKERS also matches "It is hereby enacted" (VT) and "It is enacted" (RI), with both added to the parametrized clause cases. Status text such as "Enacted: 2025-05-01" still does not match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups from the #248 review (suggestions 1, 2 and 4). 1. Two publish runs could deploy at once, and modal_app.py pre-renders the pages from Supabase at deploy time, so an older deploy that finished last left the later bill off the live pages. The checkout, Modal install and redeploy steps move to a new `deploy` job with `needs: publish` and the concurrency group publish-bill-deploy (cancel-in-progress: false). The group is on the deploy job only: GitHub keeps one pending run per group, so on the publish job a third run would cancel the second before it wrote its Supabase row, while a cancelled pending deploy is safe because the newest deploy reads every published row. The deploy job has `contents: read`, the Modal secrets and its own Python 3.11 setup, and runs only when publish succeeds (the default for `needs`). 2. The reform id and the manual PR number are checked as whole strings with bash's [[ =~ ]] in place of `printf | grep -Eq`, which passed a value with one matching line. The step sets `shell: bash` and LC_ALL=C, so [a-z] means ASCII a to z. 4. The contract says that a review PR from a fork does not publish on merge, with the command to publish it. Checked with actionlint, and by running the step locally with a stub gh (no secrets, no API calls): bill/ga-sb168 gives ga-sb168; bill/x + newline + y (which the grep check passed), bill/, feature/x, bill/ga$(id), bill/GA-SB168 and bill/-ga are refused; a manual run for a stubbed merged PR passes, and "1; echo pwned", 219 + newline + x, an empty value and non-ASCII digits are refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups from the #249 review (suggestions 1 to 3). 1. Migration 010's column comment called research.session_name "the bill's session label"; it now says "OpenStates session identifier, as in processed_bills", as the contract does. Comment only: 010 is applied in production, and no DDL changes. 2. The band_of text describes scripts/compare_estimates.py from #246, which is not merged, so it is marked "Planned (#246)", as the doc marks other planned items. 3. "its fixed processed_bills list (below)" pointed at a list the doc does not give. It now names the list in policyengine-app-v2#1658 and gives it inline: bill_id,state,bill_number,status,legiscan_url, last_action_date. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-up from the #250 review (suggestion 1). The rule from #250 is that a film or TV production credit drops a bill only when nothing more specific than broad income tax wording matches. The overtime phrases name a household provision, but they ran after the production-credit check, so "No tax on overtime; film production credit" and an omnibus abstract with an overtime deduction and a film credit dropped. The overtime check (both the phrases and bare "overtime" with income tax context) now runs before the production-credit check; the broad keywords still come after it. Both examples are added as True cases, the title to test_relevance and the abstract next to the omnibus film-credit case. Suggestion 3 (New York local real property tax credits) needs no change. Also drops the unused `import json` (ruff F401) from this file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-ups from the #251 review (suggestions C, D and E). C. The reach test runs on one year of the trace (the map's model.year), so a credit that joins the income tax in a later year shows as "not moved", and the markdown did not say which year. The line now reads "Not moved in RI in the 2026 trace: ...", and the sources line adds "trace year 2026". The line also named tx_income_tax, which the map does not have: resolve() now returns unreached_variables, the outcome variables the map names for each unreached outcome, and the line names only those (with its own wording when the map has none). JSON saved before this field still renders, naming both variables as before. D. A --reform-json file that cannot be read or parsed (bad JSON, an empty file, a missing path) exits 1 with "<path>: <error>", as the other reform-file checks do, in place of a traceback. A file that is not UTF-8 is caught the same way. E. Tests for the reform-dict path of the outcome check: the Texas homestead exemption as a reform dict drops state_income_tax, as the kind does. The trace records no Georgia homestead parameter, so the Georgia case adds a made-up one (whose reader reaches nothing) to a copy of the fixture map in the test; the fixture files are unchanged, so they still match --save-fixtures. Alone it drops the outcome; with main.flat_rate the readers of both paths are checked together and the outcome stays. Checked offline on a copy of the 3 December downloads: TX homestead (as a kind and as a reform dict) and an RI child tax credit dict give the new lines, and the three bad files exit 1 with one line each. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Pavel's suggestions from the reviews of #244 and #248–#251, which merged before they could go in. One commit per source PR. #250's suggestion 2 (omnibus bills dropped by older exclusions) predates #250 and has its own PR, stacked on this one.
#244: triage
record_fetch_failurestores the date of the last try. After two failed tries, a link waits 7 days (RETRIAGE_RETRY_DAYS) and is tried once more; a failed retry restarts the wait. Each run prints how many bills are waiting. A row from before this change has no date, so it counts as due and gets one retry, which then records a date._BILL_TEXT_MARKERSmatches "It is (hereby) enacted". "Enacted: 2025-05-01" and "Enacted Legislation" still don't match.#248: publishing
modal deploysteps move to adeployjob (needs: publish, concurrency grouppublish-bill-deploy, no cancelling). The publish job has no group, so no Supabase write is cancelled. A cancelled pending deploy is safe, since the newest deploy reads every published row.[[ =~ ]]underLC_ALL=C, so a value with one good line no longer passes.gh workflow run publish-bill.yml -f pr=N.#249: contract doc
session_namecomment says "OpenStates session identifier, as in processed_bills" (comment only; 010 is applied).band_oftext is marked "Planned (Score bills through the Public API App v3 uses (p451 groundwork) #246)".processed_billscolumns App v3 reads are named inline, with policyengine-app-v2#1658.#250: relevance filter
import json.#251: readiness lookup
tx_income_tax). The sources line gives the trace year.resolve()returnsunreached_variables; older saved JSON still renders.--reform-jsonfile exits 1 with<path>: <error>, not a traceback.main.flat_rate(outcome kept). Neither the live trace nor the fixture has a Georgia homestead parameter, so the GA test adds one to a copy of the map inside the test; the fixture files are unchanged.Checks
pytest scripts/(withouttest_compute_impacts_datasets.py): 288 passed (278 onmain).ruff checkon every changed file: clean.ruff check scripts/as a whole still reports 8 errors in files this PR doesn't touch (9 onmain).actionlintonpublish-bill.yml: clean. The "Read the review PR" step, run locally with a fakegh:bill/ga-sb168passes;bill/x+ newline +y,bill/,feature/x,bill/ga$(id), uppercase and leading-dash IDs are refused, as are PR numbers with text, newlines or non-ASCII digits.🤖 Generated with Claude Code