Repository navigation
move off of claim executor - #9399
gunbai-bot[bot] wants to merge 1 commit into
Conversation
…collapsed into one global bare slot
`fn_nodes` holds ONE bare-name slot per spelling plus one qualified slot per
declaration, and `lookup_fn` is a plain map get with no caller context. Two
modules that both declare `section_1` therefore fight over a single entry, and
the loser's OWN calls execute the winner's body with no diagnostic anywhere.
THE SILENT FACE SHIPPED. Four plan carriers in dag/gunbc/plans each declare
`status_block` and `section_1` .. `section_9` and each folds its body by calling
them BARE -- import_namespace_program, v2_corpus_self_host,
branch_merge_admission_model, wave2_prep_design. One carrier won all ten slots,
so import-namespace-program.md was emitted carrying v2-corpus-self-host's entire
body under its own title and slug: a well-formed markdown file, byte-stable
across runs, with nothing refusing.
WHY IT WAS INVISIBLE: the type layer already resolves per module
(`lookup_resolved_sig` tries the module's own `local` before `parents`), so
typecheck bound each carrier's calls to its own sections and only the runtime
collapsed them. The collision was even COMPUTED -- `ambiguous_bare_function_names`
-- and `lookup_fn` never consulted it.
THE FIX: `lookup_fn_from(name, site_file)` resolves a bare name claimed by more
than one module to the referring file's OWN module first, then falls through to
the shared slot. Wired at `eval_call` and both `eval_var` tiers, with a new
`file_module_paths` index built in the walk that was already visiting every item.
SCOPE, GATED DELIBERATELY. The tier fires only for names in
`ambiguous_bare_function_names`, so the resolution of every name exactly one
module declares is byte-for-byte what it was; only the colliding population
moves, and it moves toward the module that authored the reference.
WHAT IS NOT CLAIMED. This is not the namespace program. A bare reference to a
name the referring module does NOT declare, claimed by two OTHER modules, is
still picked by walk order with nothing said -- that residue stays counted in
`PreparedClaimScope::ambiguous_bare_names`, whose doc is corrected here: the
count is unchanged and its SUBJECT has narrowed, so a reader taking it as the
silent-pick population would now overcount. The terminal wall is namespace-only
resolution, where ambiguous bare binding has no constructor.
EVIDENCE, MEASURED A/B ON ONE REMOTE DISPATCH rather than predicted. An owned
fixture pair (sentinels 100/200, structurally identical so neither peer is
privileged by anything the author wrote) plus a witness asserting BOTH
directions in one row: exactly one bare slot exists, so under the defect at
least one conjunct is false whichever peer won, which makes the conjunction
order-independent where a single-direction row would be a coin flip.
fix applied: main row true, control true
fix reverted: main row FALSE, control true
The control asserts bare CROSS-module references still resolve -- the direction
a repair that narrowed resolution instead of ordering it would break.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Closing — this is not a change. Its head ( Nothing is lost by closing this: no commit here is absent from #9393. What I was using the branch for is worth stating, since it is still in flight and is a claim #9393 does not itself make. That PR's witness proves interpreter behavior — two modules declaring the same bare name each reach their own declaration. It does not prove that the shipped artifact is repaired, which is a separate question: the fix could order resolution correctly while the projection path still emits a wrong body for some other reason. I am regenerating both plan projections from a binary built on that commit to confirm — sent from merry-bear-547 |
Auto-opened by session-dashboard for session
merry-bear-547.Pushing to
verify-cm470advances this PR.Worker attestation
Before flipping this PR to ready for review, confirm each item:
npm test,cargo test) and the result.Closes #Ndirective.Summary
TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.
Test plan