Repository navigation
Refuse malformed printed amounts and invented conditions in the AB2026 ingest - #253
Merged
Merged
Conversation
…6 ingest We answer L2 and L3 of the cloud review of #247 at a28223f. The ingest's printed-amount pattern now refuses a comma after a lone zero, a leading zero and a lead group of four digits. The preservation test now refuses a claim condition that neither the staged row nor the ingest supplies. No staged row prints those forms, and no claim moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
We staged no row under exchequer_impact_static, so the ingest wrote its static scoring_method on no claim, and a mutant that dropped it from the test's list of added conditions survived. We now set that metric on an HM Treasury costings row and require the ingest to add a static scoring method that the preservation helper accepts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
We merged
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.
We close two gaps that a cloud reviewer found in #247's guards at
a28223f2, and a third that we found with mutants, as part of #230. We promised this PR in #247's description. We staged no amount in the forms we now refuse, so the ingest gives every claim the same id, value and conditions as onmain._PRINTED_AMOUNTaccepted "£0,123 million" and "£01 million", and a mutant that allowed "£1234,567 million" passed every test. The pattern now accepts a lone zero, digits with no leading zero, or groups of three digits after a lead of one to three digits. We add those three forms to the test that requires the ingest to refuse a reviewed twin that a producer prints in another form._keeps_conditionschecked each staged key and ignored the keys the ingest adds, so a mutant that wrotehousing_costs: AHCon every claim passed. The helper now allows a condition only when we staged it, or when the ingest canonicalises that condition orprogramand stores the text in a_verbatimfield. It also allows the conditions inINGEST_CONDITIONS, the test's list of what_score,_verdict_conditionsandwith_baseline_conditionwrite.exchequer_impact_static, so the ingest writes its staticscoring_methodon no claim. A new test sets that metric on an HM Treasury costings row and requires the ingest to addscoring_method: static, which the helper accepts.Invariants
_PRINTED_AMOUNTreads every whole number from 0 to 10^12 as that number, with or without thousands commas. Hypothesis draws the numbers._verbatimtexts of those it canonicalises, and the conditions inINGEST_CONDITIONS.Checks
tests/test_uk_ab2026_ingest.py: 105 passed with two workers at9123e32. We deselectedtest_ab2025_ingest_matches_main, because our sparse tree lacks its inputs, and CI runs it.4687 5952 4687 1265 9d62ee7ab0d90ced017a3f8159aeb2a91ada314262b87e7bb64278e5938a5311, the same line it prints ata28223f2.acd5340a: seven of the pattern, three that make the ingest write a condition we never staged, two of the helper, and 13 that each drop one name fromINGEST_CONDITIONS. A test killed 24. At9123e32, the new test kills the 25th, which droppedscoring_method, and two mutants that change what the ingest writes for a static row.🤖 Generated with Claude Code