Repository navigation
claw: write the text helpers once in specs/claw/text.t27 (Closes #10317) - #10318
Merged
Merged
Conversation
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>
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.
Closes #10317
What
Seven helper bodies were copied across
specs/claw/and blessed into the dupe ledger by #10312. This writes them once inspecs/claw/text.t27and makes every importeruse claw::text;:put_str,digit_byte,put_count,buf_has: gates + sarifstr_eq: gates + suggesthas_prefix: service + preview (starts_with)sameloop in sarif_pins (nowstr_eq)The question this answers
Can gen-c lower a spec that
uses a shared claw module? Yes.use_resolvesplices 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::textonly. With bothclaw::recipesandclaw::textimported,str_eqis declared in two modules with different text and use_resolve reports it ambiguous (not spliced); the qualifiedrecipes::str_eqreferences then no longer resolve and the zig runner blocks the spec. preview only usedrecipes::str_eqin 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.gen/c/claw/gates.cprints "matrix is current".gen/c/claw/t27f_gate.cregenerates byte-identical.t27c seal --verifyMATCH for the claw seals;check_seal_currency.py: 0 stale generated-code hashes.Ledger
tools/duplicate_bodies_baseline.txtmoves down in this commit:bytes_eq 3 -> 2;buf_has,digit_byte,has_prefix,put_count,put_str,str_eqremoved.Known red not from this PR
python3 tools/dupe_scan.pystill reportslog_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.cregenerated and the ClawGates, ClawGatesPins and ClawService seals re-saved, all from the lab build of this tree (thegen/cand seal gates require them in the same commit).🤖 Generated with Claude Code