Skip to content

tri misread: a bare colon in a type, and the comment that deletes the next field - #3244

Merged
gHashTag merged 2 commits into
masterfrom
misread-swallowed-field
Sep 5, 2026
Merged

gHashTag merged 2 commits into
masterfrom
misread-swallowed-field

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 5, 2026

Copy link
Copy Markdown
Owner

An inline # comment on a struct field consumes the rest of the line and the
declaration that follows it
. The following field is deleted from every backend, and
both parse and typecheck accept the spec.

Five lines, and a field disappears

module probe {
    pub const Thing = struct {
        a : Float  # note,
        b : String,
    };
}
stage verdict
t27c parse ACCEPTS
t27c typecheck ACCEPTS
gen-rust pub a: Floatb:String, — one field
gen (Zig) a: Floatb:String, — one field
gen-c Floatb:String a; — one field

All three backends agree, and all three are wrong the same way. Field b is gone.

A 2×2 that killed my first hypothesis

I first thought this needed a non-primitive type. It does not:

type fields out
u8 2 ✓
u8 # note 1 ✗
Float 2 ✓
Float # note 1 ✗

My earlier probe looked healthy only because the commented field was the last one,
so there was nothing left to swallow.

Measured on the corpus

specs/tri/pipeline/pipeline_parallel.t27 loses four declarations to one comment:

pub id: U8command:Stringargs:Stringgroup_id:U8status:JobStatus,

Durable evidence was already on disk: 11 seal files under .trinity/seals/ are
named after the wreckage rather than after a module — "[]const u8", Str = "",,
String # phi, trinity, gematria, evolution, safety. Each points at a spec that
exists and already has a correctly-named seal, so they are extra seals created from a
parse artifact.

Shipped with it: a new shape in tri misread

rust: pub a: Xb:Y, — a bare colon inside a type. A Rust type never has one; a
path spells its separator ::.

It is named for what the output shows, not for a cause, and that took a correction:
I called it RustSwallowedField first, and the corpus answered with two of eight hits
being something else — pub env: Vec<str:str>, a map type [str: str] the emitter
cannot spell. Same footprint, different wreck. The module's own header says to name a
shape by the output because the intent is exactly what was lost, and I broke that rule
on the first try.

The census now reads 22 / 1 / 0 / 1 / 8 with all five shapes firing on the control.

Not proposed here

The repair is in the lexer or the field parser, which is further upstream than
anything this pass has touched, and the correct behaviour of # inside a declaration
is a language question rather than a mapping one.

Refs #3243

An inline `#` comment on a struct field consumes the rest of the line AND the
declaration that follows. Five lines reproduce it; `parse` and `typecheck` both
accept; all three backends emit one field where the spec wrote two, and the second
is gone. specs/tri/pipeline/pipeline_parallel.t27 loses four declarations to one
comment.

Found from a seal file named `agent_"[]const u8".json`. A seal is named after a
module, so a seal named after a type expression meant something upstream had read
one as the other. Eleven such seals exist, each pointing at a spec that already
carries a correctly-named one.

The new shape is named for what the OUTPUT shows: a bare colon inside a type,
which a Rust type never has since a path spells its separator `::`. I called it
RustSwallowedField first and the corpus corrected me -- two of eight hits are
`pub env: Vec<str:str>`, a map type the emitter cannot spell, the same footprint
from a different wreck. This module's header states that rule and I broke it on
the first try.

Census now reads 22 / 1 / 0 / 1 / 8 with all five shapes firing on the control.
Two new unit tests: one asserting both wrecks are caught, one asserting a path
type and a nested generic are not.

Refs #3243

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

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-05 04:03:12 UTC

Summary

Status Count
Total Open PRs 20
PRs with Failing Checks 11
PRs with All Checks Green 9
READY 0
FAILING 11
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=2d58d9d3160d != 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 5, 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 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-05 05:06:38 UTC

Summary

Status Count
Total Open PRs 21
PRs with Failing Checks 16
PRs with All Checks Green 5
READY 0
FAILING 16
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=2d58d9d3160d != 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 5, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

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

@gHashTag
gHashTag merged commit 6d05fa6 into master Sep 5, 2026
33 of 35 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.

1 participant