tri types dup: one name, more than one definition - #2794
Merged
Conversation
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>
Contributor
PR DashboardGenerated at: 2026-08-29 10:09:42 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-08-29 10:36:21 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(tri):
tri types dup-- one name, more than one definitionThe 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.
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 forwardfor
}swallowed everything to the next closing brace. Inspecs/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 aline 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