Skip to content

skill: a census of what cannot be read is not a census of what is read wrongly - #3226

Merged
gHashTag merged 1 commit into
masterfrom
census-of-what-is-read-wrongly
Sep 5, 2026
Merged

gHashTag merged 1 commit into
masterfrom
census-of-what-is-read-wrongly

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 5, 2026

Copy link
Copy Markdown
Owner

tri unparsed censuses the specs the compiler cannot read. There is no census for
the specs it reads wrongly, and this is one: 14 specs pass parse, pass
typecheck, and emit a declaration that cannot mean anything in any target language.

Minimal reproducer — four lines, and every stage accepts it

module probe {
    pub const Thing = struct {
        ok : u8,
        bad : 0,
    };
}
stage verdict
t27c parse ACCEPTS
t27c typecheck ACCEPTS
gen-rust pub bad: 0,
gen-c 0 bad;
gen-zig field absent from the output entirely

An integer literal is in type position and no stage says a word. Two backends emit
it verbatim into languages that cannot parse it; the third drops the field silently,
which is the more dangerous of the two failures.

Where it comes from

Fourteen corpus specs use a list-valued declaration the parser does not implement:

pub const ExitCode = struct {
    kind : Enum(u8),
    variants :
      - success : 0,
      - command_error : 1,

The intent is an enum with named discriminants. What the parser builds is a struct
whose fields are kind, variants (empty type), then success with type 0,
command_error with type 1, and so on. The generated Rust is:

pub struct ExitCode {
    pub kind: Enum(u8),
    pub variants: ,
    pub success: 0,
    pub command_error: 1,

Measured

specs emitting an empty field type pub f: , 14
of those, present in the debt ledger 3
of those, passing both parse and typecheck 14 of 14
specs with a literal in field-type position 1 (8 fields)

So 11 of the 14 are tracked by nothing at all, and all 14 satisfy every gate this
project runs.

The proposal, and its cost — your call

A typecheck rule refusing an empty field type catches all 14 and needs no
judgement: a field must have a type. But it turns 14 currently-passing specs into
typecheck failures, and docs/reports/suite_expectations.json sits at 152 entries
against a cap of 152
. max_entries re-blesses at min(previous, observed), so
absorbing them needs a deliberate hand edit raising the cap — which the design treats
as exactly that, a hand edit.

The alternatives are worse or bigger:

  • narrowing to "literal in type position" is unambiguous but fires on 1 spec, a rule priced at almost nothing
  • having the emitters refuse instead moves generates from 581 to 567 — the same number moving down, in a more visible place
  • implementing the list/enum form is a language feature, not a repair, and is not mine to author

Reporting rather than shipping. The reproducer above is the durable part.

Skill §566 and a docs/now entry. No code — the three repairs are priced in the issue and none is taken.

Refs #3225

…d wrongly

`tri unparsed` ranks the constructs that stop the parser and its population is
defined by "the compiler refused". Anything the compiler accepted is outside it by
construction, however wrong the result, and that second class is invisible for the
reason that makes it dangerous: every gate is green on it.

Fourteen corpus specs pass parse, pass typecheck, and emit a struct field with no
type. Three are in the debt ledger for other reasons; eleven are tracked by
nothing. A four-line reproducer carries the whole mechanism: `bad : 0,` puts an
integer literal in type position, both stages accept it, Rust emits `pub bad: 0,`,
C emits `0 bad;`, and Zig drops the field entirely.

Recovery is what hides it. A list-valued declaration the parser does not implement
has its items recovered as fields, so the spec comes out looking well-formed.

Records the cheapest detector -- a shape check on the generated output rather than
a parser change -- and prices the three repairs without taking any of them.

Refs #3225

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@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 2696e68 into master Sep 5, 2026
28 checks passed
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-05 01:52:47 UTC

Summary

Status Count
Total Open PRs 15
PRs with Failing Checks 11
PRs with All Checks Green 4
READY 0
FAILING 11
PENDING 0

Seal Status

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

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