Repository navigation
claw: write the text helpers once in specs/claw/text.t27 instead of copying them #10317
Copy link
Copy link
Closed as not planned
Closed as not planned
Copy link
Labels
shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens itClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it
Description
Goal
Seven helper bodies are copied across specs/claw/ and sit in tools/duplicate_bodies_baseline.txt since #10312 (Closes #10311): buf_has, digit_byte, put_count, put_str (gates.t27 + sarif.t27), str_eq (gates.t27 + suggest.t27), has_prefix (service.t27) / starts_with (preview.t27), and the byte-equality loop same in sarif_pins.t27. Write each of them once, in one shared module, and delete the copies, so the ratchet goes down instead of being blessed up.
Boundary
- New file
specs/claw/text.t27(moduleClawText) holding the counted-string helpers with their tests. specs/claw/gates.t27,sarif.t27,suggest.t27,service.t27,preview.t27,sarif_pins.t27: delete the local copies, adduse claw::text;, pass the length as a parameter at each call site.gen/c/claw/gates.cregenerated and the seals whose spec text changed (ClawGates,ClawGatesPins,ClawService) re-saved, in the same commit.- Not touched:
tools/dupe_scan.py, the policy gate files, the behaviour of any helper.
Scenarios
t27c gen-con a spec thatusesclaw::textreturns 0 and the C output holds exactly the helpers the spec names (use_resolve splices them in before the backend runs). The comment in sarif.t27 saying the copies exist "because this file must lower alone" is wrong and is replaced.t27c test-reporton text, gates, sarif, sarif_pins, suggest, service, preview, github_surface and recipes: no failing test, none blocked.python3 tools/dupe_scan.pyis OK and the seven claw groups are gone from the known set.- The gate-topology claw drift step still compiles
gen/c/claw/gates.cand prints "matrix is current";tools/check_seal_currency.pyreports 0 stale generated-code hashes. - preview.t27 keeps a single
use: it importsclaw::textonly, because a secondusewith a same-namedstr_eq(recipes vs text) is reported ambiguous and the qualifiedrecipes::references stop resolving.
Requirements
- Every helper takes its string length as a parameter (gen-c cannot express
.len). - No behaviour change: the moved bodies are the existing ones; the callers differ only by the added length argument.
- No new hand-written code outside
.t27. - Seals and
gen/c/claw/gates.ccome from the lab build of the same tree.
Success Criteria
dupe_scanreports the seven groups no longer present once--blessis run on top of dupe-ledger: bless the claw helper copies from #10283/#10286/#10287/#10288 (Closes #10311) #10312's baseline, and no new group.- All nine claw specs above pass
test-reporton the Railway lab. t27c seal --verifyMATCHes for every claw seal;check_seal_currency.pyshows 0 stale.
Close criteria
Close when the PR that moves the helpers into specs/claw/text.t27 is merged and the dupe baseline no longer lists the seven groups.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
shape-refusedClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens itClosed by the issue-shape gate (specs/policy/issue_shape.t27); a passing edit reopens it
Activity
github-actions commentedon Oct 18, 2026
Closed by the issue-shape gate (specs/policy/issue_shape.t27, #7498): an issue must have the template's sections. Edit the body; an edit that passes reopens it.
exit 0, or a backticked commandclaw: write the text helpers once in specs/claw/text.t27 (Closes #10317)
claw: write the text helpers once in specs/claw/text.t27 (Closes #10317…