Skip to content

test(witness): pin shape-gate boundaries so a relaxed bound can't accept malformed witnesses (#4)#127

Merged
ruvnet merged 1 commit into
mainfrom
test/witness-boundary-bounds
Jul 7, 2026
Merged

test(witness): pin shape-gate boundaries so a relaxed bound can't accept malformed witnesses (#4)#127
ruvnet merged 1 commit into
mainfrom
test/witness-boundary-bounds

Conversation

@ruvnet

@ruvnet ruvnet commented Jul 7, 2026

Copy link
Copy Markdown
Owner

What / why

Closes the last mutation-surfaced test gap from the AQE beta feedback (#4). verifyWitness's shape gate uses exact checks β€” public_key.length === 64, signature.length === 128, schema === 1 β€” but the existing tests only cover under-length keys/sigs ('short') and schema: 999. So a boundary mutant that relaxes !== 64 β†’ < 64 (or !== 1 β†’ > 1) would accept over-length keys/sigs and schema 0/negative and survive the suite.

Change (test-only)

Pins the other side of each boundary:

  • over-length public_key (65 chars) is rejected
  • over-length signature (129 chars) is rejected
  • schema 0 and -1 are rejected

Mutation-kill verified

The over-length-key test fails under !== 64 β†’ < 64; the schema test fails under !== 1 β†’ > 1; both pass on the real code. (Verified locally, then reverted.)

Tests

Full create-agent-harness suite 384/384; tsc clean. No behaviour change. This completes the #4 mutation-guard set (mcp-scan severity #125, renderer charset #126, witness bounds here).

πŸ€– Generated with claude-flow

… accept malformed witnesses (#4)

Beta feedback #4 (mutation finding): verifyWitness's shape gate uses EXACT checks β€” public_key.length
=== 64, signature.length === 128, schema === 1. The existing tests only cover UNDER-length keys/sigs
('short') and schema 999, so a boundary mutant that relaxes `!== 64` β†’ `< 64` (or `!== 1` β†’ `> 1`)
would accept OVER-length keys/sigs and schema 0/negative and survive the suite.

Adds boundary tests pinning the other side of each bound:
- an over-length public_key (65) is rejected,
- an over-length signature (129) is rejected,
- schema 0 and schema -1 are rejected.

Verified: the over-length-key test FAILS under `!== 64` β†’ `< 64`, and the schema test FAILS under
`!== 1` β†’ `> 1`; both pass on the real code (then reverted).

Test-only; no behaviour change. Full create-agent-harness suite 384/384; tsc clean.

Co-Authored-By: claude-flow <ruv@ruv.net>
@ruvnet ruvnet merged commit cfd373a into main Jul 7, 2026
25 checks passed
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