Repository navigation
Contract doc follow-ups from the #241 review - #249
Merged
Merged
Conversation
Follow-up to Pavel's review of #241. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PavelMakarchuk
approved these changes
Dec 4, 2026
PavelMakarchuk
left a comment
Contributor
There was a problem hiding this comment.
Review at 78b6d16
This PR applies the text fixes from the #241 review to docs/APP_V3_BILL_CONTRACT.md. It corrects the ratio example to 1.0262, states that ratios of 0.9 and 1.1 both go to 10_to_25, and marks the session-date fields and calibration_check as planned in App v3. The stale workflow comment moves to #248.
Verdict: APPROVE
Earlier items from the #241 review
- SUGGESTION 1, ratio example: fixed. Line 48 and line 57 now say 1.0262.
round(-697798094 / -680000000, 4)gives 1.0262.comparison_rowin #246 storesround(ratio, 4), so the example matches what the script writes. - SUGGESTION 2, band edge at 0.9: fixed. Line 58 now says that 0.9 and 1.1 both go to
10_to_25, and thatband_ofrounds the gap first.band_ofin #246 (headd1dd247) doesgap = round(abs(ratio - 1), 4). I ran it for ratios 0.9, 1.1, 0.75, 1.25, 0.5 and 1.5. Each goes to the wider band, as the text says.band_ofgets the unrounded ratio, but the rounded gap and the stored 4-place ratio always give the same band. - SUGGESTION 3, stale comment in
publish-bill.yml: moved to #248. #248 replaces the comment with "approved_at (the merge time) and the review PR." That is correct. - SUGGESTION 4, fields App v3 does not read: fixed. Lines 24 and 29 now say "planned". The fixed
processed_billslist in policyengine-app-v2#1658 (head59a897c) isbill_id,state,bill_number,status,legiscan_url,last_action_date, so it leaves out the session columns. No App v3 PR readscalibration_check.
SUGGESTION
- scripts/sql/010_add_app_v3_bill_fields.sql:8: the column comment still calls
session_namea "session label". The contract (line 23) now says thatsession_nameis the OpenStates session identifier (for example2027_28), not a display name. The migration comment can make a later author use it as a display name. Fix: change the comment to "OpenStates session identifier, as in processed_bills". The migration usesADD COLUMN IF NOT EXISTS, so a comment change has no effect on a database where 010 is applied. - docs/APP_V3_BILL_CONTRACT.md:58: the text describes
band_ofas it is in #246, which is not merged.scripts/compare_estimates.pydoes not exist onmainyet. The line cites "tracker #246", so the text is not wrong, but it is correct only after #246 merges. Fix: merge #246 first, or merge both together. - docs/APP_V3_BILL_CONTRACT.md:24: "its fixed
processed_billslist (below)". The paragraph below (line 31) says that App v3 uses fixed column lists, but it does not give the list. Fix: give the list inline, or write "the fixedprocessed_billslist in policyengine-app-v2#1658".
What I checked
- The full diff of this PR, and the full contract file at
78b6d16. band_ofandcomparison_rowinscripts/compare_estimates.pyat #246 headd1dd247. I ran the example ratio and six band edges in Python.- The fixed column list in policyengine-app-v2#1658 at
59a897c. I searched policyengine-app-v2 PRs forcalibration_checkand found none. scripts/sql/010_add_app_v3_bill_fields.sqlonmain.- The branch starts from
fe43e9c(#241's merge).mainis now53aaa7d, and the branch merges cleanly. No CI checks run on this branch. The PR changes only text, so I ran no tests. - The head was
78b6d16at the start and at the end of this review.
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.
Follow-up to #241 (Pavel's review suggestions 1, 2 and 4). This PR changes only
docs/APP_V3_BILL_CONTRACT.md.What changes
compare_estimates.pystores.10_to_25, and thatband_ofrounds the gap to four places before comparing. Score bills through the Public API App v3 uses (p451 groundwork) #246 makes that code change (56eb57d); before it, floating-point error put a ratio of exactly 0.9 inunder_10.session_start_date,session_end_dateandsession_classification, and forcalibration_check, now mark their App v3 use as planned. App v3's fixedprocessed_billslist in policyengine-app-v2#1658 leaves out the session columns, and no App v3 PR readscalibration_checkyet.Suggestion 3, the stale comment in
publish-bill.yml, is fixed in #248, which rewrites that workflow.Tests
Text only. I recomputed the example ratio:
round(-697798094 / -680000000, 4)= 1.0262.🤖 Generated with Claude Code