Skip to content

fix(tri): a seal is a digest and a path, not a line - #3367

Merged
gHashTag merged 2 commits into
masterfrom
s2-reseal
Sep 6, 2026
Merged

fix(tri): a seal is a digest and a path, not a line#3367
gHashTag merged 2 commits into
masterfrom
s2-reseal

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Refs #3366

tri reseal check exited 1 on every clean checkout, and obeying its advice silently reverted #3280.

Reproduced, then fixed, on one clean tree

old binary new binary
tri reseal check seal: 23f03e8a97d5588d / actual: 23f03e8a97d5588d, exit 1 seal matches: 23f03e8a97d5588d, exit 0

Same tree, git status --porcelain -- bootstrap/ empty both times. That is the historical control.

Cause

bootstrap/stage0/FROZEN_HASH is <64-hex> <WS> <repo-relative-path> (FROZEN.md §4). reseal.rs:68 compared raw.trim() — the whole line — against a bare digest, so the mismatch branch was unconditional.

Three consequences

  1. The check failed always.
  2. Its stated consequence was falsebootstrap/build.rs:246 does .split_whitespace().next(), so cargo build passes.
  3. Obeying it corrupted the seal, with no error anywhere. The write emitted the digest alone, deleting the path token that 3d3b5b858 (fix(rust): .len() is usize, so the bridge that already exists can apply (+2) #3280) restored one day earlier. build.rs reads only the first token, so nothing in the repository objects.

The fix

seal_line / seal_digest / seal_path read the seal exactly as build.rs:242-246 does. The rewrite carries the path token through.

Why nothing caught it, and what now does

Every fixture in the module was a bare hash or a conflict marker. The new fixture is the line actually on disk, and the_whole_line_is_not_the_digest is its control — it asserts the fixture still reproduces the defect, so a fixture that stops carrying a path token fails loudly instead of testing nothing.

the_rewrite_preserves_the_path_token reads the write site, because the defect lived there and not in a predicate. It failed first on my own comment, which had quoted the old spelling — a quotation satisfying the grep it exists to fail. The comment now says why it does not quote it.

802 crate tests pass.

Provenance

Found by an adversarial sweep for the class "a tool emits advice that a deliberate recorded decision contradicts" (#3355) — 19 agents, 0 errors, 5 survivors. This is the only survivor where obeying the advice leaves no error behind; the sweep's own synthesis ranked it first for that reason.

`tri reseal check` exited 1 on every clean checkout. `reseal.rs:68` compared
`raw.trim()` -- the whole `<64-hex> <WS> <repo-relative-path>` line that
FROZEN.md §4 specifies and that is on disk -- against a bare 64-hex digest. On
the real file that comparison can never hold, so the mismatch branch was
unconditional: it printed two identical hashes and called them a disagreement.

Three consequences, and the third is the serious one:

- the check failed always;
- its stated consequence was false, since `bootstrap/build.rs:246` reads
  `split_whitespace().next()` and `cargo build` passes;
- obeying it wrote the digest alone, deleting the path token restored by
  `3d3b5b858` (#3280) one day earlier -- and `build.rs` reads only the first
  token, so that corruption produced no error anywhere.

`seal_line` / `seal_digest` / `seal_path` now read the seal exactly as
`build.rs:242-246` does: first non-empty non-`#` line, then the first token.
The rewrite carries the path token through, falling back to the sealed name
when the file has none.

Nothing caught this because every fixture in the module was a bare hash or a
conflict marker. The new fixture is the line that is actually on disk, and
`the_whole_line_is_not_the_digest` is its control: it asserts the fixture still
reproduces the defect, so a fixture that stops carrying a path token fails
loudly instead of testing nothing.

`the_rewrite_preserves_the_path_token` reads the write SITE, because the defect
lived there and not in a predicate. It failed first on my own comment, which had
quoted the old spelling -- a quotation satisfying the grep it exists to fail --
so the comment now says why it does not quote it.

Historical control on one clean tree: the old binary exits 1 printing
`seal: 23f03e8a97d5588d / actual: 23f03e8a97d5588d`; the new one prints
`seal matches: 23f03e8a97d5588d` and exits 0. 802 crate tests pass.

Found by an adversarial sweep for the class "a tool emits advice that a
deliberate recorded decision contradicts" (Refs #3355), which returned five
survivors from 19 agents with zero errors. This is the only one where obeying
the advice leaves no error behind.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-06 06:24:47 UTC

Summary

Status Count
Total Open PRs 15
PRs with Failing Checks 10
PRs with All Checks Green 5
READY 3
FAILING 10
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=23f03e8a97d5 != 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).

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-06 06:47:21 UTC

Summary

Status Count
Total Open PRs 15
PRs with Failing Checks 10
PRs with All Checks Green 5
READY 4
FAILING 10
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=23f03e8a97d5 != 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 aa059f2 into master Sep 6, 2026
37 checks passed
@gHashTag
gHashTag deleted the s2-reseal branch September 6, 2026 07:06
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.

1 participant