Skip to content

tri types dup: one name, more than one definition - #2794

Merged
gHashTag merged 3 commits into
masterfrom
w704-duplicate-types
Aug 29, 2026
Merged

tri types dup: one name, more than one definition#2794
gHashTag merged 3 commits into
masterfrom
w704-duplicate-types

Conversation

@gHashTag

Copy link
Copy Markdown
Owner

feat(tri): tri types dup -- one name, more than one definition

The quantifier census had to answer "unbounded" for a set of names not because
the type is infinite but because WHICH type is undetermined: the name has several
definitions and nothing says which one a spec means. Nothing in this repository
reported that.

299 struct definition(s), 275 distinct name(s)
21 name(s) defined more than once
    CONFLICTED (field lists differ)  16
    DUPLICATED (same fields twice)    5

CONFLICTED and DUPLICATED are separated on purpose. A consumer that picks either
definition of a CONFLICTED name is wrong half the time and says nothing; a
DUPLICATED name is harmless to a resolver and is still worth naming, because it
is the state a conflict starts from, one edit ago.

MY OWN SCANNER WAS WRONG TWICE, and both were found by cross-checking against
grep -c '^\s*struct ' BEFORE shipping.

  • struct CallID(str); -- a newtype has no braced body, so scanning forward
    for } swallowed everything to the next closing brace. In
    specs/account/repo.t27 that is three newtypes and then a real
    struct Info { ... }, which vanished.
  • struct PollSlow {} -- an empty body closing on its own line. Scanning for a
    line that STARTS with } walked past it and took the next three with it.

First version: 284 definitions, 17 duplicated names, 15 conflicted. Correct:
299 / 21 / 16. Nothing would have caught this — the wrong numbers were entirely
plausible, and the only reason they were checked is that a second, independent
count existed.

AND THE CENSUS HAD ITS OWN COPY of that scanner with the same two bugs, which is
why it reported 15. Both commands now call one implementation: two
implementations of one measurement is two numbers that can disagree, and these
did.

Eight tests, five of them for what the scanner must NOT do: a newtype must not
swallow the next definition, an empty one-line body must not either, field ORDER
is part of a definition, two definitions in ONE file still count as two, and two
newtypes over different payloads conflict rather than match.

Refs #2774

Co-Authored-By: Claude Opus 5 noreply@anthropic.com

The quantifier census had to answer "unbounded" for a set of names not because
the type is infinite but because WHICH type is undetermined: the name has several
definitions and nothing says which one a spec means. Nothing in this repository
reported that.

    299 struct definition(s), 275 distinct name(s)
    21 name(s) defined more than once
        CONFLICTED (field lists differ)  16
        DUPLICATED (same fields twice)    5

CONFLICTED and DUPLICATED are separated on purpose. A consumer that picks either
definition of a CONFLICTED name is wrong half the time and says nothing; a
DUPLICATED name is harmless to a resolver and is still worth naming, because it
is the state a conflict starts from, one edit ago.

MY OWN SCANNER WAS WRONG TWICE, and both were found by cross-checking against
`grep -c '^\s*struct '` BEFORE shipping.

  * `struct CallID(str);` -- a newtype has no braced body, so scanning forward
    for `}` swallowed everything to the next closing brace. In
    specs/account/repo.t27 that is three newtypes and then a real
    `struct Info { ... }`, which vanished.
  * `struct PollSlow {}` -- an empty body closing on its own line. Scanning for a
    line that STARTS with `}` walked past it and took the next three with it.

First version: 284 definitions, 17 duplicated names, 15 conflicted. Correct:
299 / 21 / 16. Nothing would have caught this — the wrong numbers were entirely
plausible, and the only reason they were checked is that a second, independent
count existed.

AND THE CENSUS HAD ITS OWN COPY of that scanner with the same two bugs, which is
why it reported 15. Both commands now call one implementation: two
implementations of one measurement is two numbers that can disagree, and these
did.

Eight tests, five of them for what the scanner must NOT do: a newtype must not
swallow the next definition, an empty one-line body must not either, field ORDER
is part of a definition, two definitions in ONE file still count as two, and two
newtypes over different payloads conflict rather than match.

Refs #2774

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

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-29 10:09:42 UTC

Summary

Status Count
Total Open PRs 9
PRs with Failing Checks 7
PRs with All Checks Green 2
READY 0
FAILING 7
PENDING 0

Seal Status

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

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

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

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-29 10:21:19 UTC

Summary

Status Count
Total Open PRs 9
PRs with Failing Checks 7
PRs with All Checks Green 2
READY 0
FAILING 7
PENDING 0

Seal Status

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

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

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

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-08-29 10:36:21 UTC

Summary

Status Count
Total Open PRs 8
PRs with Failing Checks 7
PRs with All Checks Green 1
READY 0
FAILING 7
PENDING 0

Seal Status

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

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 1886e32 into master Aug 29, 2026
30 checks passed
@gHashTag
gHashTag deleted the w704-duplicate-types branch August 29, 2026 10:37
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