Repository navigation
Conversation
… bracket parsing in static verifier [STW-SHIELD-4A4A-1]
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Owner
Author
|
Folded |
This branch was previously 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.
Automated Steward Delivery —
STW-SHIELD-4A4A-1Task: Fix Interval NaN/non-finite bounds bypass and nested bracket parsing in static verifier
Layer:
core_logicScope-Locked Target Files:
packages/core/src/solvers/interval.ts, packages/core/src/static-verify.ts, packages/core/src/solvers/solvers.test.tsSpecification
[CORE_LOGIC] Reject non-finite bounds (!Number.isFinite) and non-2-element arrays in Interval constructor and Interval.from, validate non-negative transfer amounts in analyzeLedgerSafety, and replace the non-greedy /[[\s\S]*?]/ regex in parseBracketBlock with balanced bracket depth parsing so nested interval arrays like [40, 60] are not truncated.
Target Files: packages/core/src/solvers/interval.ts, packages/core/src/static-verify.ts, packages/core/src/solvers/solvers.test.ts
Acceptance Criteria: All existing and new unit tests in solvers.test.ts pass via
npm test && npm run build, covering NaN bounds, negative transfer amounts, and nested interval bracket parsing.Evidence: concrete_bug_or_edge_case @ packages/core/src/solvers/interval.ts:5-17
Anti-Slop & Verification Receipt
5/5 Passed(Score:100/10)zero_unrequested_abstractions:Truezero_cosmetic_churn:Truezero_silent_error_swallowing:Truenon_tautological_tests:Trueminimal_loc_solution:TrueIntervalconstructor validatesNumber.isFinite(min)andNumber.isFinite(max)in addition tomin <= max, preventingNaNandInfinitybypasses.Interval.fromenforcesvalue.length === 2for array inputs before constructing the interval.analyzeLedgerSafetyrejects negative transfer amounts (amount.min < 0) so negative transfers cannot inflate the sender's balance.parseBracketBlockreplaces the non-greedy regex/\[[\s\S]*?\]/with balanced bracket depth tracking (consistent withparseBracedBlocksin the same file) so nested interval arrays such as[40, 60]are parsed intact.solvers.test.tsthoroughly verifyNaN/infinite bounds, non-2-element arrays, negative transfer amounts, and both unit and end-to-end static verification of nested bracket blocks without mock theater or cosmetic churn.