Repository navigation
test(claw): kill the three text.t27 mutation survivors - #10714
Merged
Merged
Conversation
A mutation sweep of specs/claw/text.t27 left 3 of 44 single-operator mutants alive: - put_count's clip `w + k < cap` changed to `<=` - has_prefix's length guard `s_len < p_len` changed to `<=` - has_prefix's byte-loop reject changed to return true New tests: - has_prefix_rejects_a_mismatch_that_fits: a first-byte mismatch, a last-byte mismatch, and a string exactly equal to the prefix. - put_count_clipped_write_leaves_the_byte_at_cap_alone: cap 3 for a 4-digit count; the byte at index cap stays untouched. Sweep: 44/44 caught. text 9/9 in t27c and t27b. The committed gen-c output regenerates byte-identically. The claw_ClawText seal is resaved, and 32/32 seals verify. Closes #10713 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
October 18, 2026 23:13
Contributor
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.
What
This closes three holes that a mutation sweep found in
specs/claw/text.t27, the byte-text helpers that 21 TRI CLAW specs share. Only tests change; production code does not.has_prefix:if (s_len < p_len)<to<=has_prefix("claw-v", 6, "claw-v", 6) == truehas_prefix: byte-loop rejectreturn falsetoreturn truehas_prefix("xlaw-v0.1", 9, "claw-v", 6) == false,has_prefix("claw-x0.1", 9, "claw-v", 6) == falseput_count:if (w + k < cap)<to<=put_count(&out, 3, 0, 1050)returns 4, writes "105", and leavesout[3]at 0Before this PR, every
has_prefixreject in the tests used a string shorter than the prefix, so the byte loop never had to say no. No test gaveput_counta cap shorter than the number.Verification (Railway lab)
Mutation sweep of text.t27: 44 single-operator mutants over the non-test lines. 44 of 44 caught (was 41 of 44).
text, t27c
test-reportand t27b: 9 of 9 tests pass (was 7), 0 vacuous passes.Dependents still pass in t27c and t27b:
gen-cregenerated all 7 committedgen/c/claw/*.cfiles byte-identically. Importers splice the helpers, not text's tests, so no C changes.seal --saveforclaw_ClawText, thenseal --verifyoverspecs/claw/*.t27plusspecs/verified/gen_file_check.t27: 32 of 32 match. The first--saverefused because zig was not on PATH. I re-ran it with zig on PATH, without--force.Left
15 claw specs have still never been mutation-swept: check_latest, check_state, ledger_union, merge_lane, push_gate, queue_cost, refresh, required_red, sarif, sarif_feed, service, shape_race, social_visuals, suggest_feed, t27f_gate.
Closes #10713
🤖 Generated with Claude Code