Repository navigation
Port gHashTag/trios:crates/trios-ternary/rings/TR-01/src/lib.rs (Rust, 2 functions) to specs/port/trios/crates/trios-ter - #7018
Conversation
- Add Trit enum with Neg, Zero, Pos variants - Port neg() function using if/else instead of switch to avoid semicolon issues - Port add_saturating() function with Trit to i8 conversion - Add comprehensive tests for both functions - Generated code compiles and all tests pass Closes #4933
A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #4933 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Reviewer bee verdict for head 8a669d1153ea070c2377b9f3b54a3ee57797411b (tools/bees/reviewer.py, zai glm-4.7-flash, 3 turns, 70 s; then glm-4.5-flash, 6 turns, 155 s).
BEE-VERDICT: APPROVE
summary: All 6 acceptance criteria passed; generated code compiles and tests run; red checks are pre-existing unrelated issues
criterion: test -f specs/port/trios/crates/trios-ternary/rings/TR-01/src/lib.t27 && echo present -- met -- evidence: brief.md:473
criterion: grep -cE '^\s*(pub )?fn (neg|add_saturating)(' specs/port/trios/crates/trios-ternary/rings/TR-01/src/lib.t27 prints 2 -- met -- evidence: brief.md:474
criterion: t27c gen with no "not yet implemented" and >12 lines -- met -- evidence: brief.md:475-476
criterion: t27c spec-status does not print NOPARSE -- met -- evidence: brief.md:477
criterion: at least 2 test blocks -- met -- evidence: brief.md:478
criterion: t27c test-report reports 0 BLOCKED -- met -- evidence: brief.md:479
discounted-check: spec-guards -- unrelated divergence in ring-089-rust and specs/numeric/gf16.t27, not this PR's file
discounted-check: t27b-native-ratchet -- arbitrary ratchet comparison failing, master in_progress, no defect in this PR
Evidence
Looking at the brief and diff, I can verify the acceptance criteria for issue #4933.
Acceptance Criteria Verification
-
Criterion 1: File exists
test -f specs/port/trios/crates/trios-ternary/rings/TR-01/src/lib.t27 && echo presentprintspresent- MET: brief.md line 473 confirms "PASSED: prints
present"
-
Criterion 2: Both functions present
grep -cE '^\s*(pub )?fn (neg|add_saturating)\(' specs/port/trios/crates/trios-ternary/rings/TR-01/src/lib.t27prints2- MET: brief.md line 474 confirms "PASSED: prints
2"
-
Criterion 3: Generated code complete and non-empty
- Both halves passed: grep for 'not yet implemented' returns 0, wc -l returns 57 (> 12)
- MET: brief.md lines 475-476 confirm both "PASSED"
-
Criterion 4: File parses
t27c spec-statusprintsIMPLEMENTED(notNOPARSE)- MET: brief.md line 477 confirms "PASSED: printed
IMPLEMENTED"
-
Criterion 5: At least 2 test blocks
grep -cE '^[[:space:]]*test[[:space]]+("|[A-Za-z_])'prints at least 2- MET: brief.md line 478 confirms "PASSED: printed
2"
-
Criterion 6: Generated code compiles and tests run
t27c test-reportreports noBLOCKEDtests- MET: brief.md line 479 confirms "PASSED: printed
0"
The diff shows exactly one file changed in the boundary (specs/port/trios/crates/trios-ternary/rings/TR-01/src/lib.t27) and one new documentation file (docs/now/2026-10-06-published-port-ghashtag-trios-crates-trios-ternary-rings-tr-01-src-lib.md). The .t27 content correctly ports both neg and add_saturating with proper tests.
Red Checks Analysis
spec-guards -- FAILURE
- Why it does NOT count: This check runs
specs/numeric/gf16.t27and findstrit_adddiffering inring-089-rust, which is completely unrelated to this PR's file (specs/port/trios/crates/trios-ternary/rings/TR-01/src/lib.t27). The check tests 9 other rings and specs; the one failing is a separate divergence. - Evidence: brief.md lines 380-405 show the check failed on
specs/numeric/gf16.t27(ring-089-rust) due totrit_addmismatch, which is not part of this PR.
t27b-native-ratchet -- FAILURE
- Why it does NOT count: The master branch at commit
5aa5eabb3shows this check asin_progress(not green/red), and the runner's log shows the ratchet test is comparing"1" = "0", which is an arbitrary script check unrelated to the correctness of this specific port. The PR's gates (check-linked-issue,parse-ratchet,validate) are all green on master. - Evidence: brief.md lines 419-469 show the ratchet test runs a comparison that fails, but this is a general ratchet tracking issue, not a defect in this PR's port. The PR's own criteria all pass.
Summary
All acceptance criteria from issue #4933 are met. The change correctly ports the two functions with proper tests, parses, generates complete code without "not yet implemented" markers, and all generated tests run successfully. The two red checks are pre-existing issues unrelated to this change.
Second, independent review (glm-4.5-flash): APPROVE -- Successfully ports both functions from crates/trios-ternary/rings/TR-01/src/lib.rs to specs/port/trios/crates/trios-ternary/rings/TR-01/src/lib.t27 with all acceptance criteria met
…e PRs a master merge brings in (Refs #7174) a::b::c 635 -> 637 (#7018 +2), test blocks 15841 -> 15865 (#7149 +22, #7018 +2). check no longer subtracts this change's own delta twice when the change already restated the pin, and a red bad-write names the remedy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hange (Closes #7174) (#7178) * salvage(queen-5507): commit what the turn left uncommitted The turn ended with these files edited and never committed. Uncommitted work is invisible to the review - it reads the branch - so the attempt would have been released as empty and the next bee would have started beside this work rather than from it. This commit is not a claim that the work is correct. It is the bee's work, committed on its behalf, and it is judged exactly like any other: the adversarial reviewer reads it, the compiler runs on it, and the issue's own criteria are measured against it. Issue: #5507 Turn: 86099a52-f3d2-4dd9-a1f5-b586bf1f8046 Ending: finished (the turn closed) Committed: 1 path(s) Left uncommitted: 1 path(s) outside the declared boundary * salvage(queen-5507): commit what the turn left uncommitted The turn ended with these files edited and never committed. Uncommitted work is invisible to the review - it reads the branch - so the attempt would have been released as empty and the next bee would have started beside this work rather than from it. This commit is not a claim that the work is correct. It is the bee's work, committed on its behalf, and it is judged exactly like any other: the adversarial reviewer reads it, the compiler runs on it, and the issue's own criteria are measured against it. Issue: #5507 Turn: 1bd15dc0-1baa-419a-866e-53e200f3f28f Ending: finished (the turn closed) Committed: 1 path(s) Left uncommitted: 1 path(s) outside the declared boundary * docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #5507 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * ci(spec-guards): published figures are red only for a defect of the change (Closes #7174) A pinned figure is derived data: a function of the spec corpus and of its matcher. specs/ci/derived_data.t27 gains KIND_PUBLISHED_FIGURE (inputs IN_SPEC + IN_MATCHER) and figure_regression(): a matcher that changed meaning without its pin being restated is red; lag from other merges is PENDING on a pull request and REFRESH on master, never red. tools/published_figures.py --check compiles the rule from t27c gen-c and only measures: the base tool on this tree (matcher meaning), git diff against the base (this change's own movement) and against the PR head (a written pin must be the count). --bless rewrites drifted pins with the per-merge trail. spec-guards checks out with fetch-depth 2 so the base commit is present. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tools(published_figures): the bless trail names master's commit and each pull request Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tools(published_figures): re-pin four drifted figures to master 670480bdd with per-merge trails (#7174) x.len() 1371 -> 1364, x.len 2149 -> 2160, a::b::c 631 -> 635, test blocks 15725 -> 15841. Each trail names the merges that moved the figure, counted per merge with the figure's own matcher. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tools(published_figures): the red summary names both defects it can mean (#7174) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tools(published_figures): re-pin after merging master; bless names the PRs a master merge brings in (Refs #7174) a::b::c 635 -> 637 (#7018 +2), test blocks 15841 -> 15865 (#7149 +22, #7018 +2). check no longer subtracts this change's own delta twice when the change already restated the pin, and a red bad-write names the remedy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tools(published_figures): a pin this branch wrote is judged where it wrote it, not after master moved on (Refs #7174) A branch that re-pinned and then merged master carried a pin master had outrun, and the PR went red for lag. The check now finds the commit of the branch that wrote the pin (deepening a shallow clone) and accepts the pin if the count there was the pin. A hand pin the tool would not write is still red. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tools(published_figures): re-pin test blocks to master fd280185e; bless starts from the last pin change (Refs #7174) test blocks 15865 -> 15873 (#7172 +6, #7190 +2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(spec-guards): bless published figures at master f4317a9cc (#7174) python3 tools/published_figures.py --bless --ref '#7174' on the merged tree: x.len 2160 -> 2166, a::b::c 637 -> 667, test blocks 15873 -> 15976. Closes #7174 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * crm-story-reel v29: brand kit on every preview and the rendered end card (#7009) crm-story-reel v29: a client's saved brand palette applies to every preview and the rendered end card. * t27b: tail expressions and discarded calls as the reference prints them since #6315 (Closes #7114) (#7150) * Port gHashTag/trios:crates/trios-cli/src/lock.rs to specs/port/trios/crates/trios-cli/src/lock.t27 - Implement lock_file_path() function - Implement LockGuard_acquire() function with undefined body - Implement LockGuard_try_acquire() function with undefined body - Implement LockGuard_is_lock_stale() function with undefined body - Implement LockGuard_drop() function with undefined body - Add 5 test cases covering basic functionality - All tests pass with 0 BLOCKED Closes #5673 * Port training state management (train_state) to .t27 Port of gHashTag/trios crates/trios-train-cpu/src/bin/train_state.rs (8b229e9489ee) to specs/port/trios/crates/trios-train-cpu/src/bin/train_state.t27 (module port::trios::crates::trios_train_cpu::src::bin). - OptKind enum (AdamW, Muon); Config, OptWrapper, TrainingState structs. - All four ported functions keep real bodies (no undefined stubs): OptWrapper_adamw (wraps AdamW, casts wd to f64), OptWrapper_muon (hardcodes momentum 0.95, stores lr), OptWrapper_step (dispatches by tag; AdamW takes lr per call and never stores it, Muon stores lr before stepping), and init_training (make_opt per slot, sizes VOCAB*DIM / HIDDEN*DIM / VOCAB*HIDDEN, EMA ramp 0.996 -> 1.0 over cfg.steps, f32::MAX sentinel for best_val_bpb). - Mapping notes: the Rust enum-with-payload OptWrapper becomes a tag struct; Option<JepaPredictor>/Option<NcaObjective> become presence flags; the Vec of NUM_CTX identical ctx wrappers becomes one representative plus count; Instant::now() becomes a caller-passed now parameter. World-touching code (optimizer math, models, predictor, NCA objective, clock) is caller-driven plumbing, so the structs carry only what the decisions read or produce. - 7 tests with field-by-field asserts (struct == is not supported for OptWrapper): constructor parameters, switch dispatch and lr handoff, make_opt config following, init_training defaults and muon/jepa/nca configs, f32::MAX sentinel. t27c parse: 0 errors; typecheck: 0 errors / 0 warnings; test-report: 7 pass / 0 FAIL, no BLOCKED; gen: 0 'not yet implemented'; spec-status: IMPLEMENTED. Closes #5659 * Port fpga/vivado/blinky.v to specs/port/fpga/vivado/blinky.t27 Create T27 specification for blinky LED module that generates equivalent Verilog functionality. The module implements a ring oscillator with 20-inverter chain and 23-bit counter, with LED outputs derived from counter bits 20 and 19. Acceptance criteria met: 1. File exists and contains blinky module 2. Module name matches original 3. Generated Verilog has correct module name 4. File parses successfully 5. Contains at least one test 6. All tests pass with no BLOCKED errors Closes #4894 * Port gHashTag/trios:crates/trios-ternary/rings/TR-01/src/lib.rs to .t27 - Add Trit enum with Neg, Zero, Pos variants - Port neg() function using if/else instead of switch to avoid semicolon issues - Port add_saturating() function with Trit to i8 conversion - Add comprehensive tests for both functions - Generated code compiles and all tests pass Closes #4933 * Port railway_deployment_create.zig to .t27 Closes #6108 * Port railway_deployment_create.zig to T27 - Port the main function from Zig to T27 - Add comprehensive tests for argument validation, query construction, error detection, and header construction - Implement helper functions for string operations and error detection - Ensure all tests pass and generated code compiles Closes #6108 * Port gHashTag/BrowserOS claw-session.ts to .t27 - Add ClawSession_getState function for agent state retrieval - Add ClawSession_getAllStates function for getting all agent states - Add ClawSession_onStateChange function for state change subscriptions - Include 3 test cases covering basic functionality - Port decision logic while avoiding complex types that cause generation issues Closes #6299 * Port railway_deployment_create.zig to railway_deployment_create.t27 - Port the decision logic from src/cli/railway_deployment_create.zig - Implement argument validation, GraphQL query construction, and error detection - Add comprehensive tests covering all decision logic paths - Use proper T27 syntax without unsupported constructs like Error!void Closes #6108 * docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #6108 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #6299 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #4933 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #4894 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #5659 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #5673 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * t27b: tail expressions and discarded calls as the reference prints them since #6315 (Closes #7114) Conformance spec first: specs/tri/t27b/conformance/value_ignored.t27. A non-void fn's last bare expression (into nested if/else branches) is returned, as zig_tail_returns does; a statement that only calls a module fn returning a value drops the value, as call_returns_value prints it. `return undefined;` where analysis reaches it is refused. Two extra conformance specs (comptime_float_f128, untyped_local_uses), no Rust. Rust edits in cli/t27b under the owner's approval on epic #6063 (label owner-approved-foreign). Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b: `return undefined;` in a fn nothing analyzed reaches is the stub trap (Refs #7114) Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(census): the skipped-count control is a fixture, not a hope (#7088) (#7089) The dead-code census test asserted the live tree still holds specs that do not parse (skipped > 0). The spec-fix waves finished: master walks 1363 specs with did-not-parse 0, so the assertion went red on master, reading a clean tree as a broken counter. The control now plants one unparseable and one parseable spec in a scratch tree and demands the counter count exactly them -- a check of the tool that cannot rot when the corpus improves. Closes #7088 Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * t27b: a reached `return undefined;` of an aggregate stays unwritten, as before #6315 (Refs #7114) Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b ledger: hex.t27 first blocker on the merged tree is ExprCall; NOW entry (Refs #7114) Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * silicon: every hardware run writes a receipt artifact (R2-1/R2-2) (Closes #7041) (#7044) * silicon: every hardware run writes a receipt artifact (R2-1/R2-2) specs/verified/receipt.t27 (#6943) is the contract; this is the tool half. Six fields in contract order, one JSON file per run under .trinity/receipts/, append-only: full_idcode is the line --detect read on this run (never a constant; 2026-08-14 the docs said 100T while the boards said 200T), seal_hash is t27c seal --verify's own verdict (null when drifted -- an honest null, first_missing reports it), verdict_word is PASS/FAIL in verdict.t27's vocabulary, and toolchain is the building commit baked by build.rs (R2-2): a runtime rev-parse would name the tree the receipt was written in, a different claim. --skip-hardware writes nothing -- a build is not a run. Closes #7041, Refs #6655 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(test): serde_json Map keys are &String, map to &str (Refs #7041) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(receipt): emit the six contract fields in contract order, not alphabetical serde_json's default Map is a BTreeMap, so the struct serialized the fields alphabetically -- verdict_word landed after toolchain and receipt_first_missing would walk the wrong order. preserve_order is not an option: it re-orders every other JSON this crate writes, seal files included, which are hash-pinned. The object is assembled by hand (order is ours), every value still serialized by serde_json (escaping stays serde's). The order test now pins the TEXT order, because parsing back re-sorts; it also round-trips validity. (Refs #7041) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(receipt): Serialize is not dyn-compatible, value serializer is a generic fn (Refs #7041) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(receipt): the seal field names the image hash, not the verify sentence (Refs #7041) 'all hashes MATCH' is a sentence about the check, not a name: stored as the seal hash it would make every receipt cite one identical string however many seals came and went, while receipt.t27 (#6943) says the field is the seal hash of the image the device ran. seal --verify now only GATES the citation; the identity is the seal record's gen_hash_verilog (the bitstream is built from the generated verilog), found by spec_path tail so the seal-file naming rule stays in main.rs. A drifted seal, a missing record, or verilog=none stays an honest null. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore: resync the PR head after a force-push the PR object did not follow (Refs #7041) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * feat(receipt): the receipt's toolchain is the seal's built_by -- producer_identity(), one definition (Closes #7041, Refs #7072, #7076) Option A of the #7072 producer-vocabulary gap, closed end to end: the seal writes built_by = producer_identity() (#7076, on master) and the receipt's toolchain calls the same function, so producer_matches' verbatim equality is satisfiable by construction instead of never. Drops this branch's duplicate build.rs T27C_BUILD_GIT emission (master's #7076 is the one definition). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(policy): resolve the exceptions tail the fd7afd4e2 replay left conflicted 018eb3796 committed the markers of its own resolution (the empty-tail hunk of #7089's rebase). Keep master's stdmem/#7075 blocks and master's build.rs, and carry the #7041 entry with the wording that matches what landed: the producer_identity() switch, not a second env emission. Refs #7041 (Closes #7041 via the branch PR), Refs #7072, #6655 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * policy: the L2 GENERATION rule lives in specs/policy/l2_generation.t27; L2 checks a spec changed without its copy (Closes #7103 #7113) (#7149) * gen: drop 65 tracked copies that are not what t27c generates and that nothing reads (Refs #7103) gen/ is in .gitignore. 79 files under it were still tracked; 65 of them are not t27c output any more, measured on 96cf7c8da with `t27c gen-<backend> specs/<path>.t27 | cmp - gen/<backend>/<path>.<ext>`: - gen/c: 31 stale (ar 7, base 2, compiler 1, fpga 5, isa 1, math 2, nn 2, numeric 9, queen/lotus, vsa/ops) + gen/c/vsa/core.c, whose spec specs/vsa/core.t27 does not exist; - gen/verilog: the same 31 + gen/verilog/vsa/core.v; - gen/rust: memory/notebooklm.rs. Most were last written by ea15cd54c (2026-07-05). No script, workflow, tool or crate reads any of them: bootstrap includes its own bootstrap/gen/, and the references left are old wave reports. Delete, not regenerate: 29 of the 32 stale C copies did not compile (`cc -fsyntax-only`) before, and 29 of 32 regenerated ones do not compile now (undeclared imports, #5711; module-qualified names, #5712). A regenerated copy nobody reads goes stale again at the next gen-c change, and L2 does not look at a copy whose spec did not change. Kept (14): the 11 C copies and 1 Rust copy that match and that loop-tools-gate.yml / t27b-native.yml build, and gen/c/numeric/gf16.c + gen/verilog/numeric/gf16.v, which #6996 item 5 regenerates in the gf16 lane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tools: L2 also fails a spec changed without its tracked copy, and --all checks every copy (Closes #7103) L2 compared only the gen/ files a PR modifies. A PR that changed a spec and left its tracked copy behind passed, which is how 65 tracked copies drifted from t27c output without a red check (my own #7091 did it to gen/c/queen/priority.c and review_valve.c until 5b338c74f). Now, besides every modified gen/ file: - a tracked gen/ file is checked when its spec, or any spec in its `use` closure, is added, modified or deleted in base...head. gen-c splices the declarations a spec imports (use_resolve.rs, transitively), so a changed import changes the copy: measured, DENY 1 -> 9 in specs/policy/own_language.t27 changes gen/c/ci/affected.c; - a copy whose spec is gone fails with "no spec"; - `--list` prints these copies too, so the workflow builds t27c for them; - copies of specs the PR did not touch are not charged to it: a gen-c change re-stales every copy, and that regeneration is the compiler lane's, not this PR's; - `--all` checks every tracked gen/ file without --base/--head. Controls, in a throwaway worktree on 2b74dc600, old script vs new: | change committed | old | new | |---|---|---| | DENY 1 -> 9 in own_language.t27, no copy regenerated | ok, rc 0 | 2 STALE COPY (own_language.c, ci/affected.c via `use`), rc 1 | | own_language.c regenerated, affected.c left | - | 1 STALE COPY (affected.c), rc 1 | | both regenerated | - | ok 2 of 2, rc 0 | | specs/tri/catalog/health.t27 deleted, copy kept | - | STALE COPY "no spec", rc 1 | `--all` on this branch: 12 of 14 tracked copies are t27c output; the 2 that are not are gen/c/numeric/gf16.c and gen/verilog/numeric/gf16.v, left to #6996 item 5. On this branch's own diff (deletions only) the PR mode prints "ok", rc 0. The workflow file is unchanged. Foreign Python: an edit to an existing tool, owner-approved-foreign. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(now): L2 checks a spec changed without its tracked copy (Refs #7103) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * spec(policy): the L2 GENERATION rule lives in specs/policy/l2_generation.t27; the Python only feeds it (Closes #7113) tools/l2_regen_check.py decided which gen/ files a change must show are t27c output, how a gen/ path names its spec and which t27c subcommand writes which backend. That rule now lives in specs/policy/l2_generation.t27 (module PolicyL2Generation), as the Only-t27 gate's lives in own_language.t27, and its gen-c copy gen/c/policy/l2_generation.c is what runs. The Python gathers the facts (diff, tracked copies, specs, `use` lines), runs plan_all() from a one-line C main and compares t27c's bytes; it decides nothing. - zig is `t27c gen`. t27c has no `gen-zig`, which the Python named, so a correct gen/zig copy would have read as a HAND EDIT. An invariant pins the backend table, `gen-zig` included as absent. - A `use` path is read as use_resolve.rs reads it (`::` and `.`, empty segments vanish, comment and every trailing ';' cut, a space without `::` is no import), transitively, from the head's text: dropping an edge means editing the importer, which charges the importer itself. - On a PR the plan comes from the BASE's copy of the rule, so a change cannot loosen the rule that judges it. A head-edited copy that planned nothing would otherwise have passed L2 without t27c ever being built. - Fail closed: missing markers, a diff line without a tab, a quoted path, a copy with no backend, extension or spec, more `use` lines than the mark buffer, and a plan that did not fit (no "--end") each fail. - Helpers shared with the Only-t27 gate come from `use policy::own_language` rather than copies (dupe_scan named five). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(l2): a rule copy read from the tree is checked first against its spec (Refs #7113) The plan comes from the base's gen/c/policy/l2_generation.c. A base without that copy (the PR that adds it) and --all fall back to the tree's copy, and a tree copy rewritten to print only "--end" planned nothing: control 5 on 09c8720fc, base 6fd39123c, exit 0 with a hand edit in own_language.c. Now, whenever the rule is read from the tree, its copy is the first row, checked with t27c gen-c against specs/policy/l2_generation.t27 whatever row the copy wrote for itself. The same tampered head: "RULE NOT OUTPUT", exit 1. With base 09c8720fc (base has the copy) both hand edits are caught as before. A genuine tree copy: "rule is t27c output", ok. --all: 13 of 15, unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(policy): L2 rule mutation triage, 7 equivalent survivors left (Refs #7113) tri mutate spec (lab, zig 0.16.0) over specs/policy/l2_generation.t27: first run "275 of 339 killed (261 by zig test, 0 by a gen failure, 14 by a hang)", 64 survivors; after this commit "320 of 327 killed (306 by zig test, 0 by a gen failure, 14 by a hang)", 7 survivors. A hang counts as killed in both lines (#7148). Dead lines and offsets removed (no input reaches them): - use_names: `if (k >= me) { return false; }`, twice - use_from: `if (i == x) { return x; }` - copy_reason: ext_dot(s, b + 1, to) -> ext_dot(s, from, to) - charged_copy, put_plan: ext_dot(buf, b + 1, pt) -> ext_dot(buf, pf, pt) Tests added: a_copy_t27c_does_not_write_is_not_charged_and_says_why, the_line_helpers_stay_inside_their_ranges; 40 added assert lines. Equivalent survivors, one line each: - 325 marker_at `s < n` -> `s <= n`: the extra pass reads the empty line at the range end - 372 charged `s < dt` -> `s <= dt`: same, the empty line at the end of the diff section - 427 listed `s < lt` -> `s <= lt`: same, the end of the listing section - 438 modified `s < dt` -> `s <= dt`: same, the end of the diff section - 565 plan_all `s < g` -> `s <= g`: same, the diff loop's section end - 581 plan_all `t < sm` -> `t <= sm`: same, the gen loop's section end - 573 plan_all `p > s` -> `p >= s`: buf[s] is 'M', and no gen/ or quoted path starts with 'M' Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(now): the L2 GENERATION rule lives in a spec (Refs #7113) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * spec(policy): line_end and text_end live once, in text_lines.t27 (Refs #7113) CI's duplicate-bodies gate failed on this branch: l2_generation.t27's line_end and trim_cr were byte-identical to line_end and text_end in specs/ci/affected.t27 (dupe_scan: 618 bodies in 183 groups against master's 614 in 181). The two `--like` lines that said so before the push were read as old advisories; they were this branch's. Both bodies now live in specs/policy/text_lines.t27 (module PolicyTextLines, 2 tests, 13 asserts). affected.t27 and l2_generation.t27 import it, as #6604 made affected.t27 import has_prefix from own_language. trim_cr callers use text_end. Both tracked C copies are regenerated with t27c gen-c. - parse, typecheck, gen-c, gen-rust, gen-verilog: exit 0 on all three. - zig test 0.16.0: text_lines 2, affected 13, l2_generation 20 passed; test-report 0 vacuous on each; cc -DT27_TEST_MAIN: 13 and 20 passed. - tri mutate spec on text_lines.t27 (lab): 13 of 13 killed (13 by `zig test`, 0 by a gen failure, 0 by a hang). - dupe_scan: 614 in 181 groups, as master; --like clean on all three. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * Port scripts/gen_w632.py (Python, 3 functions) to specs/port/scripts/gen_w632.t27 (Closes #6698) (#7172) Test constants recomputed from the original's formulas. build_tree is a deliberate copy of the sibling ports (the .py originals are copies of each other); ledger moved in the same commit: build_tree 2 -> 3. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> * spec(policy): L2 checks a gen/ file a PR adds, not only one it modifies (Closes #7127) (#7190) * spec(policy): L2 checks a gen/ file a PR adds, not only one it modifies (Closes #7127) A gen/ file a change adds was never checked: a hand-written file under gen/, or a copy of one spec under another spec's name, passed L2 with "ok: no gen/ file modified (new files allowed)". plan_all() now plans every gen/ path the diff writes with any status but D. An added file (A) prints its own labels, "added, t27c output" / "HAND-MADE COPY"; a modified or type-changed one keeps "regenerated" / "HAND EDIT", so a status the rule does not know is checked rather than passed. Deleting a copy stays allowed. modified() becomes written() (any status but D), so a copy added together with its spec is planned once, as added, not again as stale. Tests first: an_added_or_deleted_copy_is_not_planned is flipped into an_added_copy_is_planned_and_a_deleted_one_is_not, with the issue's control (gen/c/ci/hand.c and gen/c/ci/own_copy.c, both named "no spec at ..."); a_copy_added_with_its_spec_is_planned_once; any_status_but_deleted_is_planned; a tab-less gen/ diff line is UNREADABLE only, not also planned. Plumbing: the L2 workflow step and tools/l2_regen_check.py messages say "added or modified"; the workflow is listed in foreign-exceptions.txt (standing owner rule, label owner-approved-foreign). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(now): L2 checks a gen/ file a change adds (Refs #7127) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(now): #7127 mutation counts without hangs counted as kills (Refs #7127) Re-ran the four changed functions with the #7148 build of tri mutate (claude/tri-mutate-outcomes-7148) on the lab, zig 0.16.0, spec md5 b49ead73: written 6 of 9 killed, 1 survived, 2 hung; diff_kind 3 of 3; put_label 10 of 10; plan_all 23 of 29, 2 survived, 4 hung. Every hang is a dropped or reversed cursor step. The pub fn count is 38 (was 37) on top of #7149's text_lines move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(now): #7127 whole-file mutation run with the #7148 tool (Refs #7127) 319 mutants, 296 killed (286 by a test, 10 by an invariant), 6 survived, 17 hung, 0 unviable, printed by the #7148 build on the lab with the default TMPDIR. The 6 survivors are the six loop bounds argued equivalent in #7149; the 17 hangs are dropped or negated cursor steps (14) and three flips in the list scan an invariant runs at comptime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(now): #7127 re-measured on master after #7149 merged (Refs #7127) The control in the gap line ran on #7149's head before the squash; it is re-run on master a6841f939 (exit 0, "ok: no gen/ file modified") and on this branch (exit 1, two HAND-MADE COPY lines). The open-PR line is re-counted: 0 of 304 open PRs touch gen/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(tri mutate): a hang and a mutant zig rejects are no longer kills (Closes #7148) (#7204) * fix(tri mutate): a hang and a mutant zig rejects are no longer kills (Closes #7148) `tri mutate spec` ran `t27c gen` + `zig test` under one clock and called every non-zero exit a kill, so a hang and a compile error both raised "killed" and neither was listed by line. On one probe spec (lab, zig 0.16.0, same t27c, back to back) master printed "22 of 24 killed (20 by `zig test`, 0 by a gen failure, 2 by a hang)"; this prints "17 of 24 killed (10 by a failing test, 7 by an invariant at compile time); 2 survived, 3 hung, 2 unviable", each of the 7 listed by line. - Three steps, each on its own --timeout clock: `t27c gen`, `zig test --test-no-exec`, then the test binary. Only the test run outliving its clock is a HANG; gen or the compile outliving it is the machine's load and the mutant is NOT RUN (unclebob/mutator issue 1's defect). - A compile error with zig's "called at comptime here" note is an invariant the mutant broke (t27c lowers invariants to comptime): a kill. "evaluation exceeded ... backwards branches" is comptime's own timeout: a HANG. Any other compile error is UNVIABLE. - The issue's "a parameter left unused fails to compile" is wrong: t27c emits `_ = a;` and `_ = &i;`, so such a mutant compiles. The UNVIABLE test uses a type error. - 9 new tests (34, was 25); 6 run zig on lowered fixtures. Five hand-made regressions each turn a named test red. - cli-tri installs zig 0.16.0 before `cargo test -p tri`. Census: `shell` moved 300 -> 301 run: steps (279 -> 280 whose shell the runner names), the new "Install zig" step; re-blessed here, master's pins pass at the base. The workflow edit is in tools/policy/foreign-exceptions.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(tri mutate): mutants live beside the spec's specs/, so a spec with `use` can be mutated (Refs #7148) t27c resolves `use a::b;` by walking up from the spec file for a `specs/` directory (bootstrap/src/use_resolve.rs, find_specs_root). The copies sat in the system temp dir, which has none, so t27c dropped every import and still exited 0 (#7176). zig then failed the unmutated copy of specs/policy/l2_generation.t27 with "use of undeclared identifier 'LIST_END'", and the tool could not mutate any spec that imports anything. The work dir is now `target/tri-mutate-spec-PID` beside the spec's `specs/`, where the same walk from a copy reaches the spec's own tree. A spec with no `specs/` above it keeps the temp dir. Measured on the Railway lab, default TMPDIR, `--fn diff_kind`: - the previous commit's tri: Unviable("zig: error: use of undeclared identifier 'LIST_END'"); - this commit: "3 of 3 killed (3 by a failing test, 0 by an invariant at compile time); 0 survived, 0 hung, 0 unviable." New test a_copy_in_the_work_dir_resolves_use_against_the_specs_own_tree (35 in mutate::tests; `cargo test -p tri mutate` on the lab: 35 passed). With the work dir put back in the temp dir it fails (left /tmp/tri-mutate-spec-7, right .../r/target/tri-mutate-spec-7). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(port): railway_deployment_create.t27 generates Verilog again (Closes #7228) (#7240) The spec built argv as local [N][]const u8 arrays in its tests, a 2-D aggregate gen-verilog does not lower (W469). That made master's corpus ratchet red since fed07cd82 (PR #6956). Rewritten in the shape of railway_null_startcmd.t27: decide_args(argc), decide_response(stdout) with a byte-level port of std.mem.indexOf, and main left as plumbing. The original only reads args.len and the "errors" field of curl's stdout, so nothing it decides on is lost. 14 tests, all executing runtime asserts on the lab (test-report 14/14, 0 vacuous). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * t27b: module-level constants that hold an optional (Closes #7116) (#7202) * spec(t27b): conformance spec for module-level optional constants (Closes #7116) Refs #6063. specs/tri/t27b/conformance/const_optional.t27: `?T` constants alone, copied from another, as struct fields beside a `str`, from a field default, and a present zero. The reference gives 4 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b: module-level constants that hold an optional (Closes #7116) Refs #6063. `const_fill` lays out `?T` as `opt_temp` does: the payload, then the has-value flag. `null` leaves both zero, and another optional constant is copied byte for byte. `const_elem` and the module-level constant path reach it through `rodata`. An optional holding a `str` stays refused as `ConstDecl(?T)`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b ledger: parse_conform.t27 and const_optional.t27 pass (Closes #7116) Module-level optional constants unblock parse_conform.t27. Not-pass goes from 50 to 49. NOW entry added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * spec(t27b): rename the const_optional row struct to OptionalRow so tri types ratchet stays clean (Closes #7116) Row already has a definition elsewhere in specs/, and the Corpus ratchet's type-conflict ledger counted the new one as a NEW conflict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(specs): six vacuous wave tests and a trapping sign extension (#7246) Closes #7225. Closes #6560. specs/port/scripts/gen_w38{1,2,4,5,6,7}.t27: wave_constants_follow_each_other asserted two constants, which fold at compile time, so it passed with 0 runtime asserts. It now calls next_wave(EXPECTED_LAST_WAVE). specs/isa/tri27_machine.t27: ld_sign_extend read (word as i32) as i64, which the Zig backend narrows with a range-checked @intCast, so words above 2^31 - 1 trap and one test failed. It is written as arithmetic now. The seal is re-saved (10 of 10 tests) and the file leaves tools/seal_baseline.txt. test-report: the six ports 7/7 with 0 vacuous, tri27_machine 10/10. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> * feat(automation): crm-duet v4 -- a dry run is free (Closes #6896) (#6897) * feat(automation): crm-duet v4 -- a dry run is free (Closes #6896) Owner, 2026-10-06 (translated): "a dry run must be free, change the spec". v3 kept only the story reel out of a dry run; every other paid tool was offered from seller turn 2, so a run that sends nothing still paid for generations. Now paid_tool_offered(seller_turn, dry_run) is false on every turn of a dry run, and paid_call_refused names the dispatcher's refusal (DRY_RUN_SPENDS = false, DRY_RUN_HIDES_PAID_TOOLS, DRY_RUN_REFUSES_PAID_CALL). A real run is unchanged. t27c test-report 20/20; negative control (the dry run offers paid tools again) fails 2. Census: shell `run: steps` 291 -> 292 (runner-named 270 -> 271) was already moved on master by a workflow step this PR does not touch; the pre-commit census gate asks for the re-bless in the next commit, so it rides here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(automation): crm-duet v5 -- a paid tool is one with a price (Refs #6896) v4 hid only the six tools v1 named. The seller is offered the whole registry, and lipsync_generate, story_reel, split_reel and crm_voice_clone charge but were on no list, so a dry run still offered them. - tool_is_paid(price): price > 0; borrowed_price(own, borrowed): a tool that runs a priced tool is priced; priced_tool_offered(price, turn, dry_run) refuses every priced tool on every turn of a dry run. - PAID_TOOLS = 6 removed (PAID_TOOL_IS_PRICED, PAID_TOOLS_HAND_LIST = false): the host derives the set from its price table. - story_offered calls paid_tool_offered: duplicate-bodies grouped the two identical bodies. t27c test-report 21/21; negative control (priced_tool_offered ignoring dry_run) fails the new test. Seal re-saved, verify MATCH. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * feat(verified): t27c run-record reads the receipts and judges one run (R2-4 tool half) (#7130) * feat(verified): t27c run-record reads the receipts and judges one run (Closes #7072) R2-4 tool half, epic #6655. The rule half (specs/verified/run_record.t27, PR #7061) landed; this is the reader that applies it. t27c run-record <spec> reads every .trinity/receipts/<stem>-*.json whose spec names the given spec plus the spec's seals in .trinity/seals, collects the four facts -- count, every-receipt-complete by receipt.t27's six-field rule (unknown verdict word = absent), verdict words agreeing, every receipt's toolchain == its cited seal's built_by verbatim (R2-2; a receipt's own seal is the one whose gen_hash_verilog equals its seal_hash) -- and answers run_first_missing, run_complete, and verdict.t27's consumption point (incomplete run => INVALID_NO_RUN before any chain is read). Exit 0 = citable run, 1 = not, 2 = REFUSED (spec does not exist). Twelve fixture tests pin each exit path to run_record.t27's constants, including: unknown verdict word is INCOMPLETE (2), never WORDS_DISAGREE (3); a seal without built_by (every seal minted before #7076) matches no producer; a receipt citing a seal the spec does not hold is a producer mismatch; no receipts at all is TOO_FEW over zero, not a usage error; agreeing FAILs are one complete run (failure_loop owns the rest). Refs #6655, #7058, #7041, #7076. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix: sort the receipt and seal listings by file name -- serde_json::Value is not Ord (Refs #7072) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test: pin that disagreement (3) is judged before producers (4) (Refs #7072) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore: resync the PR head after a queue jam that swallowed the pull_request events (Refs #7072) The validate/parse-ratchet workflow runs were never created for b7226bda2 -- GitHub dropped the synchronize events while the runner fleet was starved. An empty commit re-fires them now that the queue is empty. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * chore: re-fire the pull_request gates (Refs #7072) The dispatched parse-ratchet run cannot derive BASE_SHA (no pull_request context) and failed on that, leaving a blocking red check on the head; its concurrency group (cancel-in-progress) also cancels any real run for the ref. Only a fresh synchronize event produces a verdict -- this is that event. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * docs: say the exit-code contract in the reader test header (Refs #7072) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * t27b: unreached fns may name an unlayable struct; float as casts spelled like gen-zig (Closes #7175 #7179) (#7216) * Port gHashTag/trios:crates/trios-cli/src/lock.rs to specs/port/trios/crates/trios-cli/src/lock.t27 - Implement lock_file_path() function - Implement LockGuard_acquire() function with undefined body - Implement LockGuard_try_acquire() function with undefined body - Implement LockGuard_is_lock_stale() function with undefined body - Implement LockGuard_drop() function with undefined body - Add 5 test cases covering basic functionality - All tests pass with 0 BLOCKED Closes #5673 * Port training state management (train_state) to .t27 Port of gHashTag/trios crates/trios-train-cpu/src/bin/train_state.rs (8b229e9489ee) to specs/port/trios/crates/trios-train-cpu/src/bin/train_state.t27 (module port::trios::crates::trios_train_cpu::src::bin). - OptKind enum (AdamW, Muon); Config, OptWrapper, TrainingState structs. - All four ported functions keep real bodies (no undefined stubs): OptWrapper_adamw (wraps AdamW, casts wd to f64), OptWrapper_muon (hardcodes momentum 0.95, stores lr), OptWrapper_step (dispatches by tag; AdamW takes lr per call and never stores it, Muon stores lr before stepping), and init_training (make_opt per slot, sizes VOCAB*DIM / HIDDEN*DIM / VOCAB*HIDDEN, EMA ramp 0.996 -> 1.0 over cfg.steps, f32::MAX sentinel for best_val_bpb). - Mapping notes: the Rust enum-with-payload OptWrapper becomes a tag struct; Option<JepaPredictor>/Option<NcaObjective> become presence flags; the Vec of NUM_CTX identical ctx wrappers becomes one representative plus count; Instant::now() becomes a caller-passed now parameter. World-touching code (optimizer math, models, predictor, NCA objective, clock) is caller-driven plumbing, so the structs carry only what the decisions read or produce. - 7 tests with field-by-field asserts (struct == is not supported for OptWrapper): constructor parameters, switch dispatch and lr handoff, make_opt config following, init_training defaults and muon/jepa/nca configs, f32::MAX sentinel. t27c parse: 0 errors; typecheck: 0 errors / 0 warnings; test-report: 7 pass / 0 FAIL, no BLOCKED; gen: 0 'not yet implemented'; spec-status: IMPLEMENTED. Closes #5659 * docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #5659 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * docs: the coordination entry this branch needs to land A pull request must add exactly one docs/now entry and a bee has no way to know that: its brief names a boundary file and acceptance criteria, and docs/now/ is neither. The publisher adds it rather than failing the gate. Closes #5673 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * t27b: conformance spec for a fn no test reaches whose signature names an unlayable struct (Refs #7175) Refs #6063. Dogfood spec first: specs/tri/t27b/conformance/unresolved_signature.t27 has a struct that holds itself by value. Only fns that no test reaches name it: as a parameter, as a result, and through a call to another such fn. This mirrors specs/compiler/optimizer.t27. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b: conformance spec for a float operand cast with as (Refs #7175) Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b: unresolved signatures of unreached fns; float as casts spelled like gen-zig (Refs #7175 #7179) Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(tri mutate): a hang and a mutant zig rejects are no longer kills (Closes #7148) (#7204) * fix(tri mutate): a hang and a mutant zig rejects are no longer kills (Closes #7148) `tri mutate spec` ran `t27c gen` + `zig test` under one clock and called every non-zero exit a kill, so a hang and a compile error both raised "killed" and neither was listed by line. On one probe spec (lab, zig 0.16.0, same t27c, back to back) master printed "22 of 24 killed (20 by `zig test`, 0 by a gen failure, 2 by a hang)"; this prints "17 of 24 killed (10 by a failing test, 7 by an invariant at compile time); 2 survived, 3 hung, 2 unviable", each of the 7 listed by line. - Three steps, each on its own --timeout clock: `t27c gen`, `zig test --test-no-exec`, then the test binary. Only the test run outliving its clock is a HANG; gen or the compile outliving it is the machine's load and the mutant is NOT RUN (unclebob/mutator issue 1's defect). - A compile error with zig's "called at comptime here" note is an invariant the mutant broke (t27c lowers invariants to comptime): a kill. "evaluation exceeded ... backwards branches" is comptime's own timeout: a HANG. Any other compile error is UNVIABLE. - The issue's "a parameter left unused fails to compile" is wrong: t27c emits `_ = a;` and `_ = &i;`, so such a mutant compiles. The UNVIABLE test uses a type error. - 9 new tests (34, was 25); 6 run zig on lowered fixtures. Five hand-made regressions each turn a named test red. - cli-tri installs zig 0.16.0 before `cargo test -p tri`. Census: `shell` moved 300 -> 301 run: steps (279 -> 280 whose shell the runner names), the new "Install zig" step; re-blessed here, master's pins pass at the base. The workflow edit is in tools/policy/foreign-exceptions.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(tri mutate): mutants live beside the spec's specs/, so a spec with `use` can be mutated (Refs #7148) t27c resolves `use a::b;` by walking up from the spec file for a `specs/` directory (bootstrap/src/use_resolve.rs, find_specs_root). The copies sat in the system temp dir, which has none, so t27c dropped every import and still exited 0 (#7176). zig then failed the unmutated copy of specs/policy/l2_generation.t27 with "use of undeclared identifier 'LIST_END'", and the tool could not mutate any spec that imports anything. The work dir is now `target/tri-mutate-spec-PID` beside the spec's `specs/`, where the same walk from a copy reaches the spec's own tree. A spec with no `specs/` above it keeps the temp dir. Measured on the Railway lab, default TMPDIR, `--fn diff_kind`: - the previous commit's tri: Unviable("zig: error: use of undeclared identifier 'LIST_END'"); - this commit: "3 of 3 killed (3 by a failing test, 0 by an invariant at compile time); 0 survived, 0 hung, 0 unviable." New test a_copy_in_the_work_dir_resolves_use_against_the_specs_own_tree (35 in mutate::tests; `cargo test -p tri mutate` on the lab: 35 passed). With the work dir put back in the temp dir it fails (left /tmp/tri-mutate-spec-7, right .../r/target/tri-mutate-spec-7). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(port): railway_deployment_create.t27 generates Verilog again (Closes #7228) (#7240) The spec built argv as local [N][]const u8 arrays in its tests, a 2-D aggregate gen-verilog does not lower (W469). That made master's corpus ratchet red since fed07cd82 (PR #6956). Rewritten in the shape of railway_null_startcmd.t27: decide_args(argc), decide_response(stdout) with a byte-level port of std.mem.indexOf, and main left as plumbing. The original only reads args.len and the "errors" field of curl's stdout, so nothing it decides on is lost. 14 tests, all executing runtime asserts on the lab (test-report 14/14, 0 vacuous). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * t27b: module-level constants that hold an optional (Closes #7116) (#7202) * spec(t27b): conformance spec for module-level optional constants (Closes #7116) Refs #6063. specs/tri/t27b/conformance/const_optional.t27: `?T` constants alone, copied from another, as struct fields beside a `str`, from a field default, and a present zero. The reference gives 4 pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b: module-level constants that hold an optional (Closes #7116) Refs #6063. `const_fill` lays out `?T` as `opt_temp` does: the payload, then the has-value flag. `null` leaves both zero, and another optional constant is copied byte for byte. `const_elem` and the module-level constant path reach it through `rodata`. An optional holding a `str` stays refused as `ConstDecl(?T)`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b ledger: parse_conform.t27 and const_optional.t27 pass (Closes #7116) Module-level optional constants unblock parse_conform.t27. Not-pass goes from 50 to 49. NOW entry added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * spec(t27b): rename the const_optional row struct to OptionalRow so tri types ratchet stays clean (Closes #7116) Row already has a definition elsewhere in specs/, and the Corpus ratchet's type-conflict ledger counted the new one as a NEW conflict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(specs): six vacuous wave tests and a trapping sign extension (#7246) Closes #7225. Closes #6560. specs/port/scripts/gen_w38{1,2,4,5,6,7}.t27: wave_constants_follow_each_other asserted two constants, which fold at compile time, so it passed with 0 runtime asserts. It now calls next_wave(EXPECTED_LAST_WAVE). specs/isa/tri27_machine.t27: ld_sign_extend read (word as i32) as i64, which the Zig backend narrows with a range-checked @intCast, so words above 2^31 - 1 trap and one test failed. It is written as arithmetic now. The seal is re-saved (10 of 10 tests) and the file leaves tools/seal_baseline.txt. test-report: the six ports 7/7 with 0 vacuous, tri27_machine 10/10. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Trinity Bee <bee@trinity.local> Co-authored-by: queen-publisher[bot] <noreply@anthropic.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dmitrii Fedorov <dmitrii.f@t27.ai> * t27c: name each unresolved `use`; item and brace imports splice from their module (Refs #7176) (#7242) * t27c: name each `use` the splice finds no spec for (Refs #7176) A `use a::b;` whose specs/a/b.t27 does not exist was skipped silently and `gen` exited 0; the first sign was a later "undeclared identifier" in some other tool's output (#7148 met it in a temp-dir copy). typecheck_gate, which each of the 10 gen paths calls once, now prints one stderr line per such `use`: file, line, path and why (no spec; no specs/ directory above the file; a brace list, #2537; one item of a module whose file exists, #5552). The splice and the note share use_path_expr and use_path, so they read the same lines the same way. A warning, not an error: the tracked corpus has 182 such lines in 106 files (112 no spec, 54 items of a module, 16 brace lists, 0 outside specs/), and a qualified reference still makes the zig backend emit @import with no spec to splice (tests/dotted_module_name.rs). The error is #7176's next step. Lab, master 403b27f29 vs this branch, `gen` on all 1484 tracked .t27 files: stdout differs on 0, exit code on 0, other stderr on 0; 182 new lines. Unit 32/32, CLI unresolved_use 2/2, dotted_module_name and unknown_type green. Negative controls: the gate loop removed -> the CLI test fails; missing_uses returning nothing -> 4 unit tests and the CLI test fail. Foreign Rust under the owner's standing rule (owner-approved-foreign), listed in tools/policy/foreign-exceptions.txt; compiler.rs untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(t27c): item and brace imports splice from their module; three splice defects (Refs #7176) `use a::b::{X, Y};` and `use a::b::Item;` (when specs/a/b/Item.t27 is not a spec) now splice from specs/a/b.t27, one level up only, as Rust names the module that holds the items. The #7176 warnings drop from 182 to 119, in 70 files (Refs #2537, Refs #5552). The corpus A/B on the Railway lab found three defects of the splice that predate this change, each made visible by a module the item imports now splice: - the importer's own names came from the smallest indent of any declaration; they now come from brace depth (spi_tb gained a second spi_transfer; property_test_template a duplicated DifferentialCase); - a declaration ended at the first line whose {} and [] depth was 0, so a header split over lines was its first line alone (mac_tb); the () depth counts now, and hslm's fall-back note is gone; - a char literal '"' was read as a string start and hid the rest of its line; with the () depth that dropped verdict, put and put_msg from the output of ci/affected and policy/l2_generation in the first lab run. Char literals and `;` prose lines are read as such. Explicit-item precedence over a glob was tried and reverted: the pulled declarations' qualifiers are not rewritten (#7215). specs/neural/forward_pass.t27: 42 call lines realigned with vsa_core's arities; both seals resealed (#7203: seals hash the unspliced source). Measured, commit 1 vs this one, 1484 files x gen/gen-c/gen-rust/gen-verilog: exit changes on 0; output changes on 17 specs; zig on the 17: none goes from pass to fail; 13 of 15 tracked gen/ copies byte-identical under both (gf16 differs from both, #6996). 38 unit tests (32 before); negative controls for the paren depth and the char literals turn named tests red. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * t27b: `const Name = T;` is a type alias (Closes #7241) (#7282) * spec(t27b): type_alias conformance spec -- const Name = T is a Zig type alias (Closes #7241) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(t27b): const Name = T with no annotation is a type alias wherever a type is read (Closes #7241) A module constant whose value is a bare name that spells a type (a scalar, str, [N]T, ?T, *T, a declared struct or enum, or another such alias) now resolves as that type in lty and ty, and is not lowered as a value. An alias cycle, an alias of a type t27b does not model, and an alias read as a value stay refused. Rust edit under the owner's approval on #6063 (label owner-approved-foreign); files listed in tools/policy/foreign-exceptions.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(t27b): a type alias counts only in Zig spellings -- str and [N]str are refused (Closes #7241) The reference prints alias text into Zig verbatim, so str / string name nothing there; [N]T counts only when T spells a type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(t27b): a struct literal of a scalar alias is refused, not recursed into (Closes #7241) const Duo = u8; Duo{ .lo = 3 } made expr -> struct_temp -> init -> expr_as -> expr loop until the stack overflowed (found by mutant m8 on the lab). Zig refuses it too: 'type u8 does not support struct initialization syntax'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ledger(t27b): type alias moves; NOW entry (Closes #7241) zig_primitive_bindings and the new type_alias spec move to pass; gfternary now stops at ExprCall(@setEvalBranchQuota). The doc comment of lit_type, displaced by struct_lit_ty, goes back above it (comment only). Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * specs: `use` lines name a spec by its path; drop lines that splice nothing (Refs #7191) (#7291) * specs: drop 33 `use` lines that splice nothing (Refs #7191) 33 import lines in 29 specs named no spec t27c could splice and no name the spec reads. Each one left a mark in t27c's own zig output on master: `// use X: no references in this module` (14), or a second `const std = @import("std.zig");` beside the backend's own std import (19), which zig rejects as "duplicate struct member name 'std'". So `use std;` is not a harmless import of an implicit library, as in Rust; in t27 it breaks the zig build. Measured on the Railway lab, 403b27f29 against this change, on the 29 files, gen/gen-c/gen-rust/gen-verilog under the master binary and the #7176 slice-2 binary: - exit code changes on 0 of 232 runs; - gen-c, gen-rust, gen-verilog output byte-identical; - `gen` loses exactly the 33 lines above and the 19 blank lines after the std imports; - zig test 0.16.0: none goes pass -> fail; 4 pass both ways; 12 move past the duplicate std to their next error; - #7176 warnings on these files: 37 -> 4. Seals: the 28 sealed specs resealed with a clean release build of 403b27f29 (no bootstrap change on master since); its output equals the A/B binary's on all 232 runs. 58 seal files change: spec_hash, gen_hash_zig, sealed_at, the test record; no gen_hash_c/rust/verilog change. All 28 print "all hashes MATCH". The unsealed specs/port/tools/rename_duplicate_tests.t27 gets no seal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * specs: a `use` names the spec's path, not its module name; drop `use tritype-base::usize` (Refs #7191) t27c resolves `use a::b::Item;` by path (specs/a/b.t27). 24 import lines in 13 specs named a spec by its declared module name instead (bus-schema, lsp-schema, provider-schema, config-schema, sync-schema, runtime-process), which is not a path: nothing was spliced. Each now names the path (bus::schema, ...). 8 `use tritype-base::usize;` lines are deleted: specs/base/types.t27 declares no usize; it is a builtin. Measured on the Railway lab, 403b27f29 plus slice 1 against this change, all 1356 specs under the #7176 build (PR #7242): - gen/gen-c/gen-rust/gen-verilog exit codes: 0 of 4 x 1356 change; output changes only in the 13 edited files; - #7176 warnings 84 -> 52; parse/typecheck failures 0 -> 0; - test-report: 13 blocked before and after; 6 move to the `&.{ _ }` lowering error, config/load to its own `config_schema::` body references (6 names, 22 uses), 6 keep their error; - iverilog: config/load 9 -> 11, provider/transform 21 -> 28, none in the elaboration ratchet. Seals: 13 resealed, 26 files. gen_hash_zig changes on the 8 that lose the tritype-base line; no c/rust/verilog hash changes. A seal hashes the spec's own output before any splice, so master's t27c and the #7176 build both print "all hashes MATCH" on all 13; only the lsp/client and lsp/server test records come from the #7176 build. Lands after #7242. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * specs: seven more `use` lines name a spec's path; drop `use tritype::base` (Refs #7191) Third slice of #7191, measured on the Railway lab with the #7176 build (PR #7242), all 1356 specs, gen / gen-c / gen-rust / gen-verilog. - 6 lines named a module name or bare file name (`tritype-base`, `tritype`, `core`) and now name the path (`base::types::...`, `test_framework::core::{...}`). - 2 brace lists took GF16 and GF32 from `numeric::golden_float`, which is no spec; each is now `use numeric::gf16::GF16;` and `use numeric::gf32::GF32;`. - `use tritype::base;` in relay_observer is deleted (nothing reads it). Exit codes unchanged on all 4 x 1356 runs; output changes only in the edited files (gen 7, gen-c 6, gen-rust 6, gen-verilog 1); #7176 warnings 52 -> 43. All 7 stay blocked in test-report; bigint, hybrid_bigint and runner now reach the import/splice collision filed as #7281 (0 specs before, 3 after). 15 seals resealed; master's t27c and the #7176 build both verify all 7. forward_pass.t27 waits for #7242. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * specs: forward_pass names base::types for Trit, held back until #7242 (Refs #7191) `use tritype::Trit;` named no spec. It now reads `use base::types::Trit;`, the same edit the third slice made in six other specs. It waited for #7242, which rewrote this spec's calls and resealed it. Measured on the Railway lab with the #7242 build, master df00ec428 plus this branch: the #7176 warning on the line goes away under gen, gen-c, gen-rust and gen-verilog, and all four outputs are byte-identical before and after. test-report blocks on the same zig error ("expected ']', found ';'") before and after. Resealed on the lab: the two seal files change only in spec_hash and in the temp-dir name inside tests.blocked. seal --verify prints "all hashes MATCH" on the 46 changed specs that have a seal (of 47; specs/port/tools/rename_duplicate_tests.t27 has none on master either), with the #7242 build and the old master build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * t27b: `void` as a parameter, field and pointee type (Closes #7267) (#7296) * t27b: lower void as a parameter, field and pointee type (Closes #7267) `void` outside a fn result is Zig's zero-bit type: a struct with no fields and size 0. Fields around it keep their own offsets, an array of structs holding one keeps its stride, and `alloc: void` / `p: *void` parameters take `undefined` and `&s.field`. A `void` result still means no value. Conformance spec: specs/tri/t27b/conformance/type_void.t27. Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * t27b: undefined as a void argument; refuse ?void (Closes #7267) `f(undefined, ..)` for a `void` parameter is that parameter's one value and now lowers to an empty temporary. `?void` is refused as `type ?void`: its only non-null value is `undefined`, which Zig turns into an undefined optional, null flag included, so t27b's JIT and interpreter read never-written bytes there. Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ledger(t27b): type void moves; NOW entry (Closes #7267) background_agent/main.t27 and the new type_void spec move to pass; gen_softmax now stops at ExprCall(@exp). Refs #6063 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(t27b): foreign-exceptions block for #7267; ledger counts after the master merge (Closes #7267) The type-void edit to lower.rs gets its own approval block, as the other lane-1 PRs do. The ledger counts are recomputed from the entries after merging origin/master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * fix(specs): delete 16 dead use lines, take PHI from math::constants (Refs #7191) (#7298) Fourth slice of #7191. - 16 `use` lines in 12 specs named no spec (the #7176 warning), and no body reads what they name. Before this change the Zig backend lowered all 16 as `// use X: no references in this module`. - `use base::constants::PHI;` in specs/memory/formula_embed.t27 and specs/memory/semantic_search.t27 now reads `use math::constants::PHI;`, which t27c splices. The splice also brings `abs`, and in formula_embed `pow` with `floor`, `exp_approx` and `E`; `pow` is reached through a false reference to the builtin `@pow` (#7292). - Two comments that described a deleted line are corrected. Measured on the Railway lab with the #7242 build, on all 1363 specs, under gen, gen-c, gen-rust and gen-verilog: - the exit code changes on none of the 4 x 1363 runs; - output changes only in edited files (gen 12, gen-c 3, gen-rust 2, gen-verilog 1); - #7176 warnings drop from 42 to 24 under each backend; - parse and typecheck exit 0 on all 12, before and after. Seals: the 10 sealed specs resealed on the lab; 17 seal files change. Master's t27c and the #7242 build both print "all hashes MATCH" on all 10. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> * verified: R2-5 capstone -- ternary_link run citation, silicon-proven end to end (Closes #7177) (#7293) * verified: R2-5 capstone -- the ternary_link run citation, read off the XC7A200T bench (Closes #7177, Refs #6655) Three placements of specs/fpga/ternary_link.t27 (pnr seeds 1, 7, 42) on the QMTech Wukong V1: every placement wrong-part-bracketed, Done=1 on our bitstream, full IDCODE 0x3636093 read live, verdict 0xa5a532bf ok=1 -- the same word Phase H read. Each run wrote a complete receipt (six fields, seeds carried, seal_hash = the seal's gen_hash_verilog, toolchain = the seal's built_by t27c-bootstrap@0.4.0+df00ec428). t27c run-record judges the set: RUN_MISSING_NONE, Run complete: yes, citable, exit 0. specs/verified/ternary_link_run.t27 is the verdict record citing that run through verdict_run_reference -- the R2-4 consumption point -- with every run fact pinned load-bearing, including the seedless fourth placement the reader refused (RUN_RECEIPT_INCOMPLETE) and the run redone seeded. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * verified: fold the last in-body comment above its test -- the lexer trap, hit a fourth time (Refs #7177) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * verified: seal the…
Closes #4933
Written by a bee on
queen-4933and published bytools/queen/publish.py. The branch itself is the bee's; the second commit is the coordination entry every pull request must add, which a bee has no way to know about.🤖 Generated with Claude Code