Repository navigation
A unit arm's parent enum is read off its carried owner, not re-looked-up by bare name (fixes NoSuchVariable for artifact_path(FleetConvergeYamlArtifact)) - #12215
Conversation
…-up by the owner's bare name lookup_variant_parent_enum discarded the owner coproduct node the arm's locals binding already carries (constructor_binding_authority) and looked the owner up again by spelling. With v2.std.artifact GeneratedArtifact (a record) in the same closure as gunbc.generated_artifact GeneratedArtifact (a coproduct), that lookup answered the record, no VariantValueBinding was stamped, and the interpreter raised NoSuchVariable for artifact_path(FleetConvergeYamlArtifact). Adds test.claim.variant_owner_homonym_witness (red before on both rows with no-such-variable, green after) and a receipt on a_bare_type_name_binds_the_wrong_declaration. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
briansrls
left a comment
There was a problem hiding this comment.
APPROVE-MERGE at exact head 1b9d2be0ef78c598e69942c5a696b7fdc98f37bb.
The repair is at the earliest unjustified boundary. A unit arm's locals binding already carries its owning coproduct node; lookup_variant_parent_enum now consumes that node and reads the owner's authored name rather than discarding the identity and re-looking it up through the closure-wide bare-name map. The old name-based route survives only as the fallback when no carried coproduct owner exists.
That directly restores infer_var_binding_kind's VariantValueBinding stamp, which is the fact the interpreter needed before eval_var; it does not introduce a second resolution rule or turn the legitimate homonym into a false ambiguity.
The witness discriminates both the minimal geometry (record and coproduct named HomonymOwner) and the real activation specimen (v2.std.artifact GeneratedArtifact beside gunbc.generated_artifact GeneratedArtifact), and the recurring-failure receipt correctly states that this closes only the value-position unit-arm route while leaving the existing type-position trigger open.
The .dag authority and regenerated v1_compiler_infer.rs agree. All five required checks pass and GitHub reports CLEAN. No condition remains unless the head moves.
Fixes the interpreter
NoSuchVariablethat proud-dove-705 reported on #12101:artifact_path(FleetConvergeYamlArtifact)failed at run time whenever the closure also reachedgunbc.auth.heal_publisher_provision.How the chain was re-derived (DESIGN §6b)
v1_interpretereval_varfell through toNoSuchVariablebecause the reference carried noVariantValueBinding.v1.compiler.inferinfer_var_binding_kindstamps it, but only whenlookup_variant_parent_enumreturns an owner.constructor_binding_authoritysays so: "the binding edge carries the owner; no name re-lookup".lookup_variant_parent_enumignored that node and looked the owner up again by its bare name throughlookup_type_for, which checks the closure-wide ident map first.v2.std.artifactGeneratedArtifact(a record) andgunbc.generated_artifactGeneratedArtifact(a coproduct) share a name.heal_publisher_provision's closure reaches the record, so the lookup found the record, not aDisj, and no binding was stamped.This is not an ambiguity to refuse. No module reads
GeneratedArtifactbare in a position two declarations could answer, and the arm names exactly one owner. That owner's identity was simply thrown away. So the right outcome is correct evaluation, not a resolve-time refusal.The repair
lookup_variant_parent_enumnow reads the parent name off the carried owner, usinglocal_coproduct_owner_from_locals, the helperinfer_record_litalready uses for the same reason. The old bare-name lookup survives only as a fallback for arms whose locals carry no coproduct owner. The.dagis the authority;v1_compiler_infer.rsis the regenerated mirror, and a second--required-regenrun shows no drift for it.Evidence
test.claim.variant_owner_homonym_witnesshas two rows:HomonymOwnerbeside a recordHomonymOwner.gunbc.generated_artifactbesidev2.std.artifact.no-such-variable: FirstHomonymArmno-such-variable: FleetConvergeYamlArtifactThe original repro (a module importing
heal_publisher_provisionand callingartifact_path(FleetConvergeYamlArtifact)) now evaluates to.github/workflows/fleet-converge.yml.Roster
This class is already rostered as
gunbc.recurring_failure_modea_bare_type_name_binds_the_wrong_declaration. I added a receipt for this second specimen rather than a new row. The fix covers only the value-position unit-arm route; the type-position trigger that row names is untouched.Not in this PR
--required-regenstill reports drift inv1_compiler_emit_rust.rs. That comes from main's #12034 (theitem_is_effectful_calleeinlining): the drift was present before this change was applied, and this change does not touch05_emit_rust.dag.🤖 Generated with Claude Code