Skip to content

claw: write the text helpers once in specs/claw/text.t27 (Closes #10317) - #10318

Merged
gHashTag merged 1 commit into
masterfrom
claw-text-helpers
Oct 18, 2026
Merged

gHashTag merged 1 commit into
masterfrom
claw-text-helpers

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Closes #10317

What

Seven helper bodies were copied across specs/claw/ and blessed into the dupe ledger by #10312. This writes them once in specs/claw/text.t27 and makes every importer use claw::text;:

  • put_str, digit_byte, put_count, buf_has: gates + sarif
  • str_eq: gates + suggest
  • has_prefix: service + preview (starts_with)
  • the same loop in sarif_pins (now str_eq)

The question this answers

Can gen-c lower a spec that uses a shared claw module? Yes. use_resolve splices the imported declarations a spec references into it before every backend runs, so the importer's C holds exactly the helpers it names. The sarif.t27 comment saying the copies exist "because this file must lower alone" was wrong and is rewritten.

One trap, kept out

preview.t27 now imports claw::text only. With both claw::recipes and claw::text imported, str_eq is declared in two modules with different text and use_resolve reports it ambiguous (not spliced); the qualified recipes::str_eq references then no longer resolve and the zig runner blocks the spec. preview only used recipes::str_eq in tests, which now compare with == (the form service.t27's tests already use).

Measured on the Railway lab

  • test-report: text 7, gates 18, sarif 15, sarif_pins 4, suggest 16, service 8, preview 18, github_surface 10, recipes 11 tests, 0 failing, 0 blocked.
  • gate-topology claw audit: harness built from the regenerated gen/c/claw/gates.c prints "matrix is current".
  • gen/c/claw/t27f_gate.c regenerates byte-identical.
  • t27c seal --verify MATCH for the claw seals; check_seal_currency.py: 0 stale generated-code hashes.

Ledger

tools/duplicate_bodies_baseline.txt moves down in this commit: bytes_eq 3 -> 2; buf_has, digit_byte, has_prefix, put_count, put_str, str_eq removed.

Known red not from this PR

python3 tools/dupe_scan.py still reports log_frame (copied by particle_engine, #10310), which master's ledger lacks. #10316 blesses it; this PR does not, so the two do not collide.

Changed outside the specs

gen/c/claw/gates.c regenerated and the ClawGates, ClawGatesPins and ClawService seals re-saved, all from the lab build of this tree (the gen/c and seal gates require them in the same commit).

🤖 Generated with Claude Code

put_str, digit_byte, put_count, buf_has, str_eq and has_prefix lived as
copies in gates, sarif, suggest, service, preview and sarif_pins. They now
live in specs/claw/text.t27 and every importer says `use claw::text;`. The
sarif.t27 comment claiming the copies exist because the file must lower alone
was wrong: use_resolve splices the imported helpers in before gen-c runs.

preview.t27 swaps its `use claw::recipes;` for `use claw::text;`: it needs a
single use, since recipes::str_eq and text::str_eq are reported ambiguous
together and the qualified references stop resolving. Its tests compare
strings with == instead.

Measured on the Railway lab: test-report passes on text, gates, sarif,
sarif_pins, suggest, service, preview, github_surface and recipes; the
gate-topology claw audit still builds from gen/c/claw/gates.c and reports a
current matrix; check_seal_currency reports 0 stale.

gen/c/claw/gates.c is regenerated and the ClawGates, ClawGatesPins and
ClawService seals re-saved in this commit. The dupe ledger moves down in the
same commit (bytes_eq 3 -> 2; buf_has, digit_byte, has_prefix, put_count,
put_str, str_eq removed). log_frame, which master's ledger lacks since
particle_engine, is left to #10316.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-18 08:41:06 UTC

Summary

Status Count
Total Open PRs 50
PRs with Failing Checks 47
PRs with All Checks Green 3
READY 0
FAILING 47
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 47 + 0 + 0 = 47, and there are 50 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=0f8c66b9ed0e != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

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.

claw: write the text helpers once in specs/claw/text.t27 instead of copying them

1 participant