Repository navigation
Conversation
…ority score - scripts/triage_core.py is the one scoring path for /triage-bills and the daily pipeline. Each bill gets modelability (the v1 rubric) and a priority score (breadth and fiscal size from the model, plus stage, bipartisan sponsors, a companion bill and ten or more sponsors). - The model reads the bill text (PDF or HTML from the import's bill_text_url; long bills as a marked excerpt) and the state's parameter list from the installed policyengine-us package: every parameter, scale and breakdown, read without importing the model. It names the parameters a bill would change; names not in the list are dropped, and a parametric score with none left is capped at 79. - Structured outputs on Claude Sonnet 5.5 (the model #222 chose) with the server-side refusal fallback; the system prompt and each state's list are the cached prefix, and bills run grouped by state. - auto_triage.py gains --state, --propose/--apply (the review round trip /triage-bills now uses), --no-text and --retriage-changed (rescore when a bill's text hash changes). Issue tables add a Priority column. - scripts/sql/011_add_triage_v2_fields.sql adds the priority and provenance columns; until it runs, saves keep the v1 columns with one warning. - scripts/triage_backtest.py measures v1 and v2 against which 2026 bills were analyzed; triage.yml runs it with backtest_sample and uploads the results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- triage_core.ClaudeCodeClient runs `claude -p` with the same system prompt, JSON schema and model (no tools, no saved session), so local runs use the Claude Code login (such as a Claude Max subscription) instead of an API key. auto_triage.py and triage_backtest.py take --via claude-code; the backtest also takes --workers. GitHub Actions keeps the API. - Bill reads followed one 1,000-row page: the backtest saw 1,000 of the 1,387 scored bills, and the unscored-bill query had the same cap. select_bills now pages by bill_id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- triage_band: modelability 80+ is encoded automatically (p452), 60-79 with priority 50+ goes to a person, the rest from 20 up is held, and below 20 is not modelable. The constants record the backtest behind them (80+ flagged about 7% of scored bills, one in five analyzed in 2026; 60-79 with priority 50+ lifts recall to about 72%). - The state issues list the three bands, each by priority. - The day-3 pipeline re-triages up to 30 bills whose text changed. - /triage-bills documents the bands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Review at a496711
This PR replaces the two triage paths with one scoring module (scripts/triage_core.py). The module reads the bill text, gives the model the state's parameter list from the installed policyengine-us package, and keeps only listed parameter names. It caps a parametric score at 79 when no listed parameter is left. It adds a priority score (breadth, fiscal size, stage, sponsors, companion bill), the triage bands, propose/apply for /triage-bills, re-triage on a text change, a backtest script, and migration 011. The base branch is import-2027-sessions (#243, which sits on #239). The PR needs the #243 import fields (sponsors, bill_text_url, migration 009). #245 (auto-encode) builds on this branch and reads the bands. I found no file overlap with #241, #242 or #246, and no overlap with the recent change on main (#240).
The scoring core is solid. The parameter walk gives the same counts as the description on policyengine-us 2.165.3 (GA 85, NY 235, federal 858). Bracket and breakdown paths resolve correctly. The request and the refusal and truncation handling are tested against the real SDK. My items are about the priority signals and the re-triage path.
Verdict: REQUEST_CHANGES
SHOULD ADDRESS
1. --retriage-changed does not see a new bill version in most states. (scripts/auto_triage.py:107-132, .github/workflows/bill-refresh.yml re-triage step)
bill_text_urlis written one time, at import. Discovery skips bills that are already processed.refresh_bill_status.pyupdates onlystatus,last_actionandlast_action_date.- Most legislatures publish a new version (a committee substitute, an engrossed version) at a new URL. The stored URL continues to point to the introduced text, so its hash does not change, and the bill is never re-scored.
- Also, the scan fetches the text of every scored, unencoded bill on each day-3 run until it finds 30 changes. When few texts change, that is one legislature request and one PDF parse for each bill, every third day, with no time limit on the job.
- Concrete case: GA HB 10 is introduced, then a committee substitute is posted at a new LC number URL. Triage keeps the introduced score.
- Fix: refresh
bill_text_urlfrom the latest OpenStates version when the status refresh runs (here or in #243), and compare URLs before the text is fetched. Alternatively, change the description and the workflow comment so that they say only same-URL changes are found. Put a limit on how many texts one run fetches.
2. The companion-bill signal only sees bills in the same run. (scripts/auto_triage.py:152, scripts/triage_core.py:351-373)
score_billspassesothers=bills, which is the batch of unscored bills (or the changed bills, or the--state/--limitsubset).- Triage runs every three days. If the House bill arrives in one run and the Senate companion arrives in a later run, neither bill gets the 5 points. The first bill is already scored, and the second bill's batch does not contain it.
- Probe:
priority_signals(SB 5, [HB 10, SB 5])findsHB 10.priority_signals(SB 5, [SB 5])finds nothing. - Fix: pass the titles, numbers and sessions of all processed bills in the state (
select_billsalready pages through them). Also give the earlier bill its point when the later bill arrives, or compute the signal when the issue is built.
3. The bipartisan check misses Minnesota and North Dakota. (scripts/triage_core.py:378-387)
- The party key is the first word of the OpenStates party, lowercased. For "Democratic-Farmer-Labor" (MN) and "Democratic-NPL" (ND), the key is the whole hyphenated string. It never equals "democratic".
- Probe: DFL + Republican sponsors give
bipartisan: False. Democratic + Republican giveTrue. - MN is one of the states with the most analyzed bills. The 5 points can move a bill across the priority-50 line of the "needs a person" band.
- Fix: normalize the party with a prefix test (
startswith("democrat"),startswith("republican")) and add tests for the DFL and NPL strings.
SUGGESTION
4. Stage points do not follow the stage labels, and they are never updated. (scripts/triage_core.py:330-348)
- "Second Reading" gets 4, which is less than "Introduced" (6). "Passed Committee" gets 16, the same as "Passed One Chamber", because "passed" matches first. A last action such as "House Committee Amendment 1 adopted" also gets 16. "Vetoed" and "Died in committee" get 4 and 6.
- The score is computed one time, at triage. A bill that later passes a chamber keeps its introduction stage points. For example, a targeted, medium bill goes from 46 to 56 when it passes a chamber, but the stored score stays at 46.
- Fix: map the
STAGE_LABELSvalues fromrefresh_bill_status.pydirectly, and give dead or vetoed bills 0. Recompute the priority from the storedpriority_signalsplus the current status when the issue is built.
5. A partial migration silently removes the text and sponsors. (scripts/auto_triage.py:57, 63-81)
EXTRA_COLUMNSmixes the 009 columns (sponsors,bill_text_url) with the 011 column (bill_text_sha256). If 009 is applied and 011 is not, the select falls back to the base columns.- Triage then reads only summaries and sees no sponsors. The only signals are the per-bill log ("read summary") and the save warning about 011.
- Fix: fall back in two steps (009 columns, then base columns), or print a warning that names the effect. Alternatively, apply 009 and 011 together and say so in the 011 header.
6. Treat the bill text as data. (scripts/triage_core.py:407-435, 486-525)
- The text comes from outside (legislature sites, or the OpenStates source page when there is no version). With #245, a score of 80 or more starts a headless encode run.
- Put the text in delimiters and tell the model in the system prompt to treat it as data, not instructions.
- When the server-side fallback runs, the stored
triage_modelstill saysclaude-sonnet-5-5. Saveresponse.modelinstead.
7. The parameter list does not cover some bills that the tracker follows. (scripts/triage_core.py:103, 220-247)
- The federal list omits
gov/aca,gov/hud,gov/edand the USDA programs other than SNAP. The state lists omitgov/local, so a NY bill that changes NYC income tax rates finds no parameter and is capped at 79. policyengine-usis installed without a version pin, and the score does not record the version. Save the package version withtriage_version, so that a later change in the list can be traced.
8. Smaller points.
FISCAL_POINTSgives "unknown" 10 and "small" 5 (scripts/triage_core.py:340). If this is intentional, say why in the docstring.fetch_bill_textreads the full response before it truncates to 40,000 characters, with no limit on size (scripts/triage_core.py:295-325). A large budget bill PDF is parsed in full. A source landing page longer than 200 characters is saved asbill_text.- Backtest: for the analyzed 2026 bills, the stage signal uses the end-of-session status, not the status at triage. This probably makes the priority AUC of 0.84 too high. Say so next to the result, or remove the stage points in the backtest.
What I checked
- Read the description and all 10 changed files against the base
import-2027-sessions. Also read the import (openstates_monitor.py) and the status refresh (refresh_bill_status.py) for the fields that triage reads. There are no comments or reviews yet. pytestfortest_triage_core.py,test_auto_triage.py,test_triage_backtest.py,test_openstates_monitor.pyandtest_bill_identity.py: 136 passed.ruff checkwith the default rules on the new and changed scripts: clean. The PR changes no frontend files, so I did not run vitest, eslint or the build. No CI check runs on this branch.- Built the parameter lists from
pip install --no-deps policyengine-us(2.165.3, Python 3.12). Results: GA 85, NY 235, MN 234, CA 244, federal 858. All 50 states and DC have a folder. Bracket paths (…single.brackets[0].rate) and breakdown categories (…standard.amount.JOINT) resolve, and invented paths are dropped. On Python 3.10, pip installs an old 1.x release with smaller lists, so the workflows' Python 3.11 is required. - Probed
stage_points,priority_signalsandpriority_scorewith the labels fromrefresh_bill_status.pyand OpenStates party strings. - Checked that the installed SDK (2.16.0) accepts
fallbacks,output_configandbetas, and that theclaude -pflags inClaudeCodeClientexist. - Series: this PR's base is #243 (on #239), and #245 uses this branch as its base. Main has moved since the base, but the new commit (#240) does not touch these files.
- The status refresh reads each bill's versions in its one OpenStates
request and moves bill_text_url to the latest dated version's link
(the importer's bill_text_url pick). Each score stores the link it was
scored on (priority_signals.text_url); --retriage-changed compares links
before fetching any text, reads at most --limit texts (default 30), and
records a new link to the same text without rescoring. Same-link edits
are not detected; the workflow comment says so, and the step has a
30-minute timeout.
- The companion check searches every processed bill in the state, and the
issue build recomputes priority from the stored signals with each bill's
current status and companions (current_priority), so an earlier bill
gets its points when its companion arrives and a bill that passes a
chamber moves up.
- Stage points map refresh_bill_status.STAGE_LABELS directly (dead and
vetoed score 0); the last action is no longer read.
- Party prefixes: Democratic-Farmer-Labor and Democratic-NPL count as
Democratic.
- Selects fall back in two steps (009 columns, then base columns) and print
what each missing migration costs.
- The bill goes to the model inside <bill>/<bill_text> tags, escaped, and
the system prompt says it is data; triage_model saves response.model.
- Parameter lists add gov/local/{state} and, for federal bills, all of
gov/usda plus gov/aca, gov/hud and gov/ed; triage_version records the
policyengine-us version ("v2-2026-12+policyengine-us-2.165.4").
- Bill text downloads stop at 10 MB, PDF pages stop once the excerpt is in
hand, and an HTML page with no enacting clause or first section (a bill
landing page) is not saved as text.
- The backtest holds the stage at Introduced and reports the end-of-session
priority beside it; FISCAL_POINTS explains "unknown".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, Pavel. Fixed in 79e04cc.
Checks: after merging #243 (with #239's fixes), 216 tests pass across The description is updated. #245 takes these changes next. |
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Review at 33798b0
This is a re-review after 79e04cc and the merge of import-2027-sessions (#243 at e0cd58b). The status refresh now reads each bill's versions and moves bill_text_url to the latest version. Re-triage compares links before it fetches text, and it reads at most 30 texts a run. The priority is recomputed when the issue is built, from the stored signals, the current status and a companion among all of the state's bills. The fix commit also maps the stage labels, normalizes the party, delimits the bill text and adds gov/local and more federal subtrees. All eight earlier items are fixed. I found one new problem in the re-triage cap.
Verdict: REQUEST_CHANGES
Earlier items
| # | Item | Status |
|---|---|---|
| 1 | Re-triage does not see a new bill version | Fixed. One new problem in the cap, see item 9. |
| 2 | Companion signal sees only the same run | Fixed |
| 3 | Bipartisan check misses MN and ND | Fixed |
| 4 | Stage points and stale priority | Fixed |
| 5 | Partial migration removes text and sponsors | Fixed |
| 6 | Bill text as data, triage_model |
Fixed |
| 7 | Parameter coverage and package version | Fixed |
| 8 | Smaller points (fiscal "unknown", download size, backtest stage) | Fixed |
How I verified them:
- 1.
text_url_changereturns the latest dated version's link. It returnsNonewhen OpenStates lists only a source page or the link is the same.retriage_candidatesskips v1 scores (notext_url) and includes a bill scored from a summary (text_urlisNone). The search requestsinclude=actions&include=versions, so the refresh makes no extra request. The fallback without migration 009 works. The workflow comment and the 30-minute timeout match the behavior. - 2.
priority_signals(SF 5, [HF 10])finds HF 10 from an earlier run. In the issue build, HF 10 goes from 46 to 51 when SF 5 is in the pool. A bill from another session does not match. - 3. "Democratic-Farmer-Labor" and "Democratic-NPL" now give
democratic. - 4. Every
STAGE_LABELSvalue has points: Second Reading 12, Passed Committee 12, Third Reading 14, Passed One Chamber 16, Vetoed 0, Dead/Withdrawn 0. The importer's andcongress_monitor.py's statuses are also mapped. Your example goes from 46 to 56 after it passes a chamber, and to 40 when it dies. - 5.
select_billstries 009+011, then 009, then the base columns, and prints what each missing migration costs. - 6. The text is inside
<bill>and<bill_text>, and copies of those tags are escaped (case-insensitive).triage_modelsavesresponse.model. - 7. On
policyengine-us2.165.5: GA 85, NY 276 (41 local), CA 380, MN 234, federal 987.triage_versionisv2-2026-12+policyengine-us-2.165.5. - 8. The download stops at 10 MB, and PDF pages stop at 80,000 characters. The backtest now holds the stage at "Introduced" and reports the end-of-session score beside it.
SHOULD ADDRESS
9. A text that cannot be read blocks a re-triage slot on every run, and the blocked bills collect at the top. (scripts/auto_triage.py:193-222)
fetch_changed_billstakes the first 30 candidates by priority. Whenfetch_bill_textreturnsNone, the bill is skipped and nothing is recorded, so the next run fetches it again.- Some failures do not go away: a PDF over 10 MB, an HTML version page with no enacting clause or first section (a resolution), a viewer page under 200 characters, or a legislature site that blocks the request.
- Each such bill stays a candidate until it is encoded. The list is sorted by priority, so these bills stay in the first slots. When 30 of them collect, re-triage fetches the same 30 texts each run and rescores nothing. The log only says "Found 0 bills with a new text version".
- Probe: 40 candidates with a fetch that returns
None. Run 1 and run 2 both fetchnew0tonew29, with 0 changed and 0 moved. - Fix: when the fetch for a new link fails, record the link (
record_text_url) or rescore the bill from its summary. Alternatively, store the failed link inpriority_signalsand skip it until the link changes again. Add a test for two runs with a failed fetch.
SUGGESTION
10. Smaller points.
- The landing-page check (
scripts/triage_core.py:375) accepts a page that has "Enacted" anywhere, for example in a menu ("Enacted Legislation"). Probe: a bill page with that menu item and no bill text passes as bill text. Consider a check for the enacting clause near the start of the text, or a minimum share of the text after the marker. - The band comment at
scripts/triage_core.py:78-80still says "about 72%" recall. With the stage held at "Introduced", the backtest gives 65%. Update the comment to match the description.
What I checked
- Head 33798b0 at the start and at the end. Read the 79e04cc diff (10 files) and the author's reply. The merge of #243 (e0cd58b) was clean and changes none of this PR's files.
- Python 3.12 with
policyengine-us2.165.5:pytestontest_triage_core.py,test_auto_triage.py,test_triage_backtest.py,test_openstates_monitor.py,test_bill_identity.py,test_refresh_bill_text.pyandtest_refresh_bill_status.py: 216 passed. ruff checkwith the default rules on the changed scripts and tests: clean.- Frontend at the head (from #243, not this PR): vitest 123 passed in 9 files, and the build passed.
- Probes for
text_url_change,retriage_candidates,fetch_changed_billsover two runs,priority_signals,current_priority,party_key,stage_pointsfor every label, the tag escape and the landing-page check. - Series: #245 (
auto-encode, af3a343) contains 79e04cc and merges with this head without conflict. This head also merges withmain(cdaec13) without conflict, andmainhas not changed these scripts since the base. The order #239, #243, #244, #245 has no clash.
…bill-text check A new link whose text cannot be read (a PDF over the cap, a page with no bill text, a site that refuses the request) is counted in priority_signals.text_fetch_failed. After RETRIAGE_FETCH_TRIES (2) runs it leaves the re-triage list until its link changes, so unreadable bills no longer take the first slots on every run. text_url still names the link the score was made on. The bill-text check now needs an enacting clause (be it enacted, do enact, hereby enacts, enact:) or a first section; a bare "enact" in a menu item such as "Enacted Legislation" no longer passes. The band comment gives the 65% recall with the stage held at Introduced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, Pavel. Fixed in 0695025. The PR now targets
|
PavelMakarchuk
left a comment
There was a problem hiding this comment.
Review at 0695025
This is a re-review after 0695025. The PR now targets main, because #239 and #243 are merged. When re-triage cannot read the text at a new link, record_fetch_failure now stores priority_signals.text_fetch_failed = {url, tries}. retriage_candidates skips the bill after two failed runs on the same link, and tries again when the link changes. The fix commit also makes the bill-text check stricter and updates the recall comment. Items 9 and 10 are fixed. I found no new problem that blocks the merge.
Verdict: APPROVE
Earlier items
| # | Item | Status |
|---|---|---|
| 1-8 | Round 1 items | Fixed (no change in this commit) |
| 9 | A text that cannot be read holds a re-triage slot | Fixed |
| 10 | Landing-page check and band comment | Fixed |
How I verified them:
- 9. I ran a probe over several runs with my own fake fetch:
- 40 candidates, the first 30 by priority unreadable, a cap of 30. Runs 1 and 2 fetch the 30 bad links. Runs 3 and 4 fetch the other 10. The first bill stores
{"url": ".../v2", "tries": 2}, andtext_urlstill names the scored link. - A transient failure: run 1 fails (
tries1), run 2 reads the text and the bill is rescored. The rescore writes fresh signals withouttext_fetch_failed. - A link that changes after the skip: the new link starts at 0 tries, is tried on two runs, then is skipped. A link that changes back to the scored link is not a candidate. A later good link is read and rescored.
- A new link to the same text clears the key (
record_text_url). - Through
main():--proposeand--dry-runwrite nothing. A normal run writes onlypriority_signalsfor the failed bill. The log line now says how many texts could not be read. current_priorityignores the extra key.fetch_trieshandles signals stored as a JSON string and a malformed value (0).
- 40 candidates, the first 30 by priority unreadable, a cap of 30. Runs 1 and 2 fetch the 30 bad links. Runs 3 and 4 fetch the other 10. The first bill stores
- 10. The menu text "Enacted Legislation" and a status line "Enacted: 2025-05-01" no longer pass. The clause forms for KY, CA, NY, PA, MI, NC and OR pass, and so do "SECTION 1." and "Sec. 1.". The band comment now gives 65% with the stage held at "Introduced", and 72% with the end-of-session stage.
SUGGESTION
11. A link that fails on two runs is skipped until its link changes, and the log does not count the skipped bills. (scripts/auto_triage.py:192-193)
- The workflow runs once a day (
bill-refresh.yml, 6:00am EST). If a legislature site is down or refuses requests on two days in a row, each new version from that site is skipped for good. The bill keeps the score from its earlier text. - After the skip, the bill is not in the candidate count, so a site-wide block shows only on the first two runs.
- Fix (optional): store the date of the last try and try the link again after some days (for example 7). Or print the number of bills that are skipped because of earlier failures, so the log shows a growing number.
12. Two enacting clauses are not in the list. (scripts/triage_core.py:379-383)
- "It is hereby enacted" (VT) and "It is enacted" (RI) do not match. Their bills also have "Sec. 1." or "SECTION 1.", so the check still passes, and VT texts are PDFs, which skip this check. No change is necessary. You can add
\b(?:hereby\s+)?enacted\bafter "is" if you want the comment to cover them.
What I checked
- Head 0695025 at the start and at the end. Read the 33798b0..0695025 diff (4 files) and the author's reply.
- Python 3.12 with
policyengine-us2.165.5:pytest scriptsat the head, withouttest_compute_impacts_datasets.py(needs numpy): 227 passed. The three new tests and the parametrized clause test are in that count. ruff check --isolatedon the four changed files: clean.- Merge with
main(53aaa7d): no conflict.mainchanged no file of this PR since the base. Migration 010 onmainchangesresearch, and this PR's 011 changesprocessed_bills, so they do not clash. On the merged tree:pytest scripts(same exclusion) 266 passed, vitest 131 passed in 10 files, andnext buildpassed. - #245 (
auto-encode, c912652) contains 0695025 and merges with it without conflict. Its readers ofpriority_signalsgo throughcurrent_priority, which ignores the new key. - GitHub reports no CI checks on this branch.
Triage decides which introduced bills get analyzed. Before the 2027 sessions, this PR replaces its two diverging paths with one scoring function that reads the bill and checks the model's actual parameters, and adds a priority score (Teamverse p450). It targets #243, whose import supplies the bill text links and sponsors.
What changes
One scoring path (
scripts/triage_core.py), used by the daily pipeline and by/triage-bills.Two scores for each bill:
Modelability, 0–100, on the v1 rubric.
Priority, 0–100:
STAGE_LABELS; 0 for a dead or vetoed bill);The weights are documented, and the backtest below tests them. The stored score is the score on triage day. The state issues recompute it from the stored signals with each bill's current status and companions, so a bill that passes a chamber moves up, and an earlier bill gets its companion points when the later one arrives.
It reads the bill. The text comes from the import's
bill_text_url, as PDF or HTML.triage_text_truncated).<bill>/<bill_text>delimiters, and the system prompt says it is data, not instructions.It checks the parameters. Each state's list comes from the installed
policyengine-uspackage, whichpip install --no-deps policyengine-usprovides; the model is never imported.gov/local): 85 for Georgia, 276 for New York (with New York City, Yonkers and the MCTD), and 380 for California. The federal list (IRS, all of USDA, SSA, HHS, ACA, HUD and Education) has 987, on policyengine-us 2.165.4.triage_versionrecords the release, e.g.v2-2026-12+policyengine-us-2.165.4.api.policyengine.org/us/metadata, which has required a credential since 17 November, so it fell back to the model's memory.The request.
TRIAGE_MODELoverrides it), with structured outputs and the server-side refusal fallback (fallbacks: "default").triage_modelstores the model that answered (response.model), so a server-side fallback is visible.auto_triage.pygains new options:--statelimits the run to one state.--propose FILEscores and writes the proposals to a file, saving nothing.--apply FILEsaves approved proposals, after a person has dropped or edited them.--no-textscores from the title and summary only.--retriage-changedrescores scored bills that have a new text version. The status refresh (refresh_bill_status.py) now reads each bill's versions in its one OpenStates request and movesbill_text_urlto the latest version. Triage compares that link with the one the score was based on (priority_signals.text_url) before it fetches any text, and reads at most 30 texts a run. A text that changes at the same link is not detected.The per-state issues add a Priority column and order each band by current priority. If migration 011 is missing, the selects keep the 009 columns (sponsors and text links). If 009 is missing too, they fall back to the base columns. Each fallback prints what the run loses.
Bands, set from the backtest below and agreed on 2 December:
/encode-billwill run headless (p452), highest priority first, under a daily cap.triage_bandholds the rule, and the state issues list the bands in that order, each by current priority. The day-3 pipeline also re-triages up to 30 bills with a new text version (30-minute step timeout).Local runs can score through the Claude Code CLI (
--via claude-code), so they use the local Claude Code login and need no API key. Bill reads now page past Supabase's 1,000-row limit; the unscored-bill query used to stop there./triage-billsnow runs--propose, shows the table for approval, then--apply, so the interactive and daily scores are the same scores.Migration.
scripts/sql/011_add_triage_v2_fields.sqladdspriority_score,priority_signals,candidate_parameters,triage_version,triage_model,triage_text_source,triage_text_truncated,bill_text_sha256andtriaged_at;priority_signalsalso holdstext_url, the link the score read. Until it runs, saves keep the v1 columns and print one warning. Migrations 009 and 011 were applied in production on 3 December.Workflows. Both install
pyyaml,pypdfandpolicyengine-us --no-deps. Their manual inputs now reach the shell throughenv:. The status refresh steps also read versions, with no extra requests.Backtest
scripts/triage_backtest.pyre-scores every analyzed 2026 bill and a sample of the rest, then reports AUC and weighted precision and recall for v1's score and v2's modelability and priority, at several thresholds. That sets the bar for automatic encoding (p452).triage.ymlruns it withbacktest_sampleset and uploads the results as an artifact. Locally,--via claude-coderuns it through the Claude Code CLI (claude -p) on the local login, and--workers 4speeds it up.First run (2 December, summaries only)
All 46 analyzed bills and 150 of the other 1,341 scored bills ran, with no errors. Claude Sonnet 5.5 ran through
claude -p. Each sampled bill stands for 8.94, so the "flagged" counts are out of 1,387 scored bills.v2 separates analyzed from unanalyzed bills as well as v1 does, but it is much stricter at the top.
v2_prioritywith the stage held at introduction,v2_priority_end_stage).The label is past choices, there are only 46 positives, and this run read summaries only, so treat the numbers as a guide.
Checks
uv run --python 3.11 --with "anthropic>=1.9" --with pytest --with pyyaml --with pypdf --with requests --with hypothesis pytestontest_triage_core.py,test_auto_triage.py,test_triage_backtest.py,test_openstates_monitor.py,test_bill_identity.py,test_refresh_bill_text.pyandtest_refresh_bill_status.py: 216 passed after Pavel's review, with Read 2027 bills with sponsors, text links and session dates #243 and Tell bills apart by session, ahead of the 2027 sessions #239's fixes merged.response.model, the download cap and PDF page stop, and landing pages.--no-depsinstall. Every Georgia and New York parameter file yields its parameters.ruff checkon the new and changed scripts: clean.Not in this PR
🤖 Generated with Claude Code