Skip to content

[STW-SHIELD-4A4A-1] Fix Interval NaN/non-finite bounds bypass and nested bracket parsing in static verifier - #36

Closed
connerkup wants to merge 1 commit into
mainfrom
steward/stw-shield-4a4a-1
Closed

connerkup wants to merge 1 commit into
mainfrom
steward/stw-shield-4a4a-1

Conversation

@connerkup

Copy link
Copy Markdown
Owner

Automated Steward Delivery — STW-SHIELD-4A4A-1

Task: Fix Interval NaN/non-finite bounds bypass and nested bracket parsing in static verifier
Layer: core_logic
Scope-Locked Target Files: packages/core/src/solvers/interval.ts, packages/core/src/static-verify.ts, packages/core/src/solvers/solvers.test.ts

Specification

[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

  • Deterministic Gate: Passed target_files scope lock, secret & anti-slop gates (3 files, 169 diff lines).
  • 5-Point Anti-Slop Rubric: 5/5 Passed (Score: 100/10)
    • zero_unrequested_abstractions: True
    • zero_cosmetic_churn: True
    • zero_silent_error_swallowing: True
    • non_tautological_tests: True
    • minimal_loc_solution: True
  • Critic Audit Rationale: The diff cleanly and concisely implements all requirements of STW-SHIELD-4A4A-1 across the specified target files:
  1. Interval constructor validates Number.isFinite(min) and Number.isFinite(max) in addition to min <= max, preventing NaN and Infinity bypasses.
  2. Interval.from enforces value.length === 2 for array inputs before constructing the interval.
  3. analyzeLedgerSafety rejects negative transfer amounts (amount.min < 0) so negative transfers cannot inflate the sender's balance.
  4. parseBracketBlock replaces the non-greedy regex /\[[\s\S]*?\]/ with balanced bracket depth tracking (consistent with parseBracedBlocks in the same file) so nested interval arrays such as [40, 60] are parsed intact.
  5. Unit tests in solvers.test.ts thoroughly verify NaN/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.

… bracket parsing in static verifier [STW-SHIELD-4A4A-1]
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
shielded-shell-website Skipped Skipped Nov 3, 2026 5:00am UTC

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Deploying shielded-shell with  Cloudflare Pages  Cloudflare Pages

Latest commit: bff0550
Status:⚡️  Build in progress...

View logs

@connerkup

Copy link
Copy Markdown
Owner Author

Folded STW-SHIELD-4A4A-1 (bff0550) into the team integration branch steward/dev (#37) to unblock downstream DAG tasks.

@connerkup connerkup closed this Nov 3, 2026

This branch was previously deployed

1 inactive deployment
Preview — bff05503 Deployed Nov 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant