Skip to content

spec(t27f): rebuild rule for the exporter wasm, sealed inputs, one build record - #10241

Merged
gHashTag merged 2 commits into
masterfrom
spec/t27f-build-10229
Oct 18, 2026
Merged

gHashTag merged 2 commits into
masterfrom
spec/t27f-build-10229

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

Closes #10229

T27F hot loop: a make-style, seal-gated rule for the exporter wasm (t27-mcp/wasm/t27f.wasm, which the graph page and the MCP tools t27f_graph, t27f_outline and t27f_view run).

What this adds

  • specs/t27f/build.t27 -- every rule of the wasm rebuild: REUSE, or the first reason to run again (closure of the exporter specs and their imports, zig version, t27c binary hash, export.zig, outputs); refusal of a root whose seal is missing or stale; the drift verdict per file; the one record format. 5 tests, 0 vacuous, 1 invariant. A mutated rule fails 2 tests (negative control).
  • gen/rust/t27f/build.rs -- t27c gen-rust output of that spec (force-added, gen/ is ignored).
  • .trinity/seals/t27f_*.json -- the exporter specs and their imports are now sealed (t27c seal --save), so the seal closure tracks them.
  • Record format: # input lines (closure, zig, t27c) then <sha256> <file> lines, so any repository can check a vendored copy with grep -v '^#' t27f.build | shasum -a 256 -c - and no code of ours.

Measured on the Railway lab

run time
cold rebuild (gen + gen-js x5, zig, record) 1111 ms
REUSE hit (seal verify + hashes only) 218-243 ms

The cold run reproduced trinity's vendored wasm byte for byte (sha 7b2a0f0c), so it is deterministic. Negative controls on the lab: a changed spec constant -> REBUILD (closure); a changed byte in a vendored file -> check exits 1 and names the file; a missing or stale seal -> REFUSED.

Not in this PR: the tri t27f glue

tri t27f [build|check] needs 40 lines of hand-written Rust in cli/tri/src/main.rs (spawn t27c and zig, read files). The lefthook foreign-budget gate (check_budget, shrink-only, no label lifts it) refuses any diff that adds more foreign lines than it deletes, and I found no in-scope deletion to pair it with (the unused-code warnings are in other modules, and their items are used by tests). So the glue is parked as a patch in the shared notes folder (t27f-tri-glue-parked.patch), not committed and not pushed around the gate. The generated build.rs is not mounted yet. Until the glue lands, the rule runs only through the parked patch; the check side needs no tri (see the t27-mcp and trinity PRs: shasum -c over the record).

Attribution note: the task text said Opus 5.5, the session attribution reminder says Sonnet 5.5, which is the model that ran; commits use the Sonnet line.

🤖 Generated with Claude Code

…ild record (Closes #10229)

specs/t27f/build.t27 holds every rule of the T27F wasm build: REUSE or the
first reason to run again (closure of the exporter specs, zig version, t27c
binary, export.zig, outputs), the refusal of a root whose seal is missing
or stale, the drift verdict per file, and the one record format (`#` input
lines plus `<sha256>  <file>` lines that `shasum -a 256 -c` reads).
5 tests, 0 vacuous, 1 invariant; the negative control fails 2 tests.

The exporter specs and their imports are now sealed (t27c seal --save),
so the seal closure tracks them. gen/rust/t27f/build.rs is the t27c
output; it is not mounted in tri yet: the 40 lines of `tri t27f` glue
would add hand-written Rust and the shrink-only foreign-budget gate
refuses that, so the glue is parked as a patch (see the PR body).

Measured on the Railway lab with the glue applied: cold 1111 ms,
REUSE hit 218-243 ms.

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-18 05:27:20 UTC

Summary

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

These columns do not partition: 0 + 48 + 0 + 0 = 48, 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).

The t27b ratchet reported specs/t27f/build.t27 UNLISTED: the reference
passes it and the ledger did not name it. One row, in sorted order.

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-10-18 05:32:19 UTC

Summary

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

These columns do not partition: 0 + 48 + 0 + 0 = 48, 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).

@gHashTag
gHashTag merged commit 9a326af into master Oct 18, 2026
27 of 31 checks passed
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.

T27F hot loop: rebuild the exporter wasm only when its sealed inputs changed

1 participant