You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(scripts): resolve a dotted member path's last segment at the region's top depth (#17001)
`check-adr-0087-registration`'s dotted `type-surface-only` walker narrowed the
search to a nesting region's braces and then counted EVERY same-named definition
inside it, at any depth. A DIRECT member of an object literal whose name recurs
in a nested literal was therefore counted against itself, refused as AMBIGUOUS,
and told to "name a deeper path that resolves to exactly one" -- an instruction
that cannot be carried out, because the member already sits at the depth the path
names. Such a member had no addressable spelling at all and could only be left
out of the marker and described in unchecked prose, which is the failure the
dotted grammar was widened to abolish.
The last segment now resolves at the region's TOP DEPTH only: a definition whose
name starts inside the region but inside a nested object literal opened within it
belongs to the deeper path. This is a NARROWING of the candidate set, never a
tie-break -- the direct member resolves because the nested one stopped being a
candidate for its path, so "take the first" stays unreachable and every refusal
stays loud. A collision at the path's own depth is still refused, now without
prescribing a deeper path that does not exist.
Measured on `packages/client/src/index.ts`: 5 of the 19 `organizations.*` refs
went refused -> resolved, each to its own annotation; the other 14 did not move.
Claude-Session: https://claude.ai/code/session_012GKcPZbMoGq7WPzKLfRBTU
Co-authored-by: Claude <noreply@anthropic.com>
`TSO-D18: a DIRECT member whose name recurs in a NESTED literal resolves to ITSELF -- before #16571 this was refused as AMBIGUOUS against \`organizations.teams.create\` and the printed remedy ("name a deeper path") could not be carried out, because the member already sits at the depth the path names. Got: ${JSON.stringify(shallow)}`,
`TSO-D19: THE OTHER DIRECTION -- the nested spelling still reads the NESTED definition. The top-depth rule narrows what the SHALLOW path may name; it must take nothing away from the deeper one. Got: ${JSON.stringify(deep)}`,
4975
+
);
4976
+
assert(
4977
+
shallow.surface?.type!==deep.surface?.type,
4978
+
`TSO-D20: THE PIN THAT MAKES THE PAIR A READING -- the two spellings resolve to DIFFERENT definitions. Two green one-direction assertions are equally green when every path collapses onto one definition; this is the assertion that is not. Got: ${JSON.stringify([shallow,deep])}`,
`TSO-D21: THE FIRING CONTROL -- on the SAME fixture, a name with NO top-depth definition and two nested ones is still refused with its count. The direct member resolves because the nested one stopped being a candidate for its path, ⛔ never because ties are now broken by position; if this ever resolves, the narrowing became "take the first". Got: ${JSON.stringify(r)}`,
`TSO-D22: THE NONSENSE CONTROL -- a member that exists at NO depth is still refused by the same named finding, so TSO-D18's green is a reading of the fixture and not of an unconditionally-resolving reader. Got: ${JSON.stringify(r)}`,
4992
+
);
4993
+
}
4994
+
}
4995
+
{
4996
+
// TWO definitions at `organizations`'s OWN depth: a class-field arrow and a
4997
+
// second property of the same name. No deeper path can tell them apart, so the
4998
+
// refusal must NOT print the deeper-path remedy #16571 was filed on.
`TSO-D23: a collision at the path's OWN depth is still refused LOUDLY -- and the message no longer prescribes a deeper path, because there is none to write. An unsatisfiable remedy is the defect #16571 recorded; a silent pick of one of the two would be strictly worse than either. Got: ${JSON.stringify(r)}`,
5010
+
);
5011
+
}
5012
+
4881
5013
// -- end to end, through the shipping scan ----------------------------------
0 commit comments