Skip to content

spec(ar): import the type these four specs already use - #3417

Merged
gHashTag merged 1 commit into
masterfrom
spec/trit-imports
Sep 7, 2026
Merged

spec(ar): import the type these four specs already use#3417
gHashTag merged 1 commit into
masterfrom
spec/trit-imports

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Refs #3408

Trit is declared by four specs as pub const Trit = enum(i8). Four other specs use it and carried zero use lines — naming a type they never imported. One line each.

Measured per file before writing anything

spec rustc errors before after delta
ar/coa_planning 69 65 −4
ar/explainability 34 29 −5
ar/proof_trace 25 20 −5
ar/restraint 30 19 −11

And the corpus figure matches that sum exactly:

all 651 specs before after
coded diagnostics 2962 2937 (−25)
unknown type warnings 478 460
rustc accepts 433 433

Acceptance is unchanged and that is expected — each of these files still carries between 19 and 65 other errors. All four backends still generate for all four specs, checked.

The guard from last pass caught this immediately

tools/check_seal_currency.py, added in #3416, reported 10 stale seals by name the moment these specs were edited:

STALE generated-code hash     : 10
  Explainability.json: gen_hash_zig sealed=f52e5c26de65 current=00194918b93a  (specs/ar/explainability.t27)

All 10 refreshed here; the checker reads 0 again. A guard built in one pass catching the very next change is the only evidence that building it was worth anything.

Ten seals for four specs

Explainability.json and ar_Explainability.json. ProofTrace.json and ar_ProofTrace.json. coa_planning.json and ar_coa_planning.json.

That is why the refresh walks every seal rather than calling t27c seal --save, which writes one name and would have left half of them stale — the same trap as #3415. The duplicate-naming decision stays open there.

One process note

for f in $SPECS ran the loop once, with the whole list as a single filename: zsh does not word-split an unquoted variable. Caught by cp refusing the path, and the tree was clean afterwards. Fourth occurrence this session — the fix is a literal list or ${=VAR}.

Refs #3408

`Trit` is declared by four specs as `pub const Trit = enum(i8)`. Four OTHER
specs use it and carried zero `use` lines -- naming a type they never imported.
One line each.

Measured per file before writing anything, and the corpus figure matches the
sum exactly:

  ar/coa_planning     69 -> 65   (-4)
  ar/explainability   34 -> 29   (-5)
  ar/proof_trace      25 -> 20   (-5)
  ar/restraint        30 -> 19   (-11)

  corpus coded diagnostics   2962 -> 2937   (-25)
  unknown-type warnings       478 -> 460
  rustc acceptance            433 -> 433

Acceptance is unchanged and that is expected: each of these files still carries
between 19 and 65 other errors. All four backends still generate for all four
specs.

The seal-currency checker added one pass ago reported 10 stale seals by name the
moment these specs were edited, including every duplicate; all 10 are refreshed
here and the checker reads 0 again. Ten seals for four specs -- Explainability
and ar_Explainability, ProofTrace and ar_ProofTrace, coa_planning and
ar_coa_planning -- which is why the refresh walks every seal rather than calling
`t27c seal --save`, and why the duplicate-naming decision in #3415 stays open.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) September 7, 2026 21:18
@github-actions

github-actions Bot commented Sep 7, 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 7, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-07 21:18:16 UTC

Summary

Status Count
Total Open PRs 16
PRs with Failing Checks 13
PRs with All Checks Green 3
READY 2
FAILING 13
PENDING 0
NO CHECKS YET 0

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

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=9c910e4dfae2 != 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 5be772a into master Sep 7, 2026
26 of 28 checks passed
gHashTag added a commit that referenced this pull request Sep 7, 2026
…ns by case (#3419)

Closes #3418

Two defects in one place, both found by being bitten rather than by review.

A spec can own more than one seal file and `--save` wrote one. Measured over
.trinity/seals: 1313 seals name 728 distinct specs, and 547 specs carry more
than one -- 501 of them the same module under two names, `<Module>.json` beside
`<dir>_<Module>.json`, left by a naming scheme that changed. Refreshing 116
stale seals through this command in #3416 reached 58 and stopped for exactly
that reason; editing four specs in #3417 produced ten stale seals where --save
would have fixed four.

The duplicates are not deletable: math_compare.rs opens
.trinity/seals/PellisFormulas.json by its bare name and that file is one of a
pair. So the tool maintains them. Only hashes and the timestamp are rewritten;
each file keeps its own `module`, because the file is NAMED after that field and
overwriting it would leave a seal whose name and contents disagree.

Second defect, invisible on macOS: seal_file_path derives `ar_restraint.json`
where `ar_Restraint.json` is tracked. 751 filenames match the derived name
exactly, 4 differ only by case, 558 use the older scheme. A case-insensitive
filesystem resolves the pair to one file; the case-sensitive one CI runs on
would grow a SECOND seal for the same spec, and neither would look wrong. An
existing file now wins the lookup.

The test for that half CANNOT FAIL on this machine and says so. Mutation proved
it -- making the lookup case-sensitive leaves the test green here, because
creating `Aa` then `aA` yields one file. It probes the filesystem and skips
loudly rather than reporting a pass it did not earn; it discriminates on Linux,
where CI runs. The other test does kill its mutant here.

The child runs with its own working directory rather than set_current_dir,
which is per-process and would race every other test in this binary under the
default parallel runner.

Left alone and filed: 93 specs carry a seal whose name is not an identifier --
specs/tri/utils/logger.t27 has `"[]const u8".json`, a seal named after a type
string.

compiler.rs is untouched, so FROZEN_HASH is unchanged.

Co-authored-by: lab <lab@example.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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