Repository navigation
Producer fix: dependency_resolution_facts unions reference edges for import-bearing files - #13526
Conversation
… (drops ImportBearing exemption) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ck; re-ground stale import-bearing prose Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…e all-importer reading once Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… only qualified references become edges; note producers overlap in the edge-source witness Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ied reference) so the dedup control can red Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tates what an importing module's references are Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…d references only Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ames Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
briansrls
left a comment
There was a problem hiding this comment.
APPROVE at exact head 355fdae8eeb2ac8a251705f838da4bf3355d5041, against DESIGN §2/§3/§4b/§5. No blocking finding in this producer repair.
Producer and subject boundary
The false FileReferenceEdges::ImportBearing early return is deleted, rather than worked around separately in each closure consumer. Population and keyed dependency reads continue sharing the per-file producers and union_dedup_import_facts_reference_first. The new reader obtains import presence from ParsedFileReferences.imports, retains qualified chains through the existing structural reference reader, and does not run the bare-name proximity arm for an import-bearing file. It therefore restores the missing qualified-reference channel without extending the homonym heuristic to importers.
This is not a new lexical resolver: skipping that bare-edge arm leaves language binding to the compiler; it does not prove that every authored bare name is bound. Existing import-less proximity and unaccounted-input handling are not discharged here. In particular, the_same_bare_name_without_the_import_still_resolves is a preserved-behavior control over the known defect, not evidence that the planted dependency is correct. #13533's residual obligation remains separate.
The overlapping-producer control is substantive. consumer_imported now both imports and qualifies the same provider. witness_union_has_no_duplicate_target requires that provider in BOTH actual producer outputs, then exactly once in the production union. It no longer relies on the false disjoint-by-file premise.
Emitted-only files
rust_emit_only_basenames is the explicit singleton dry_run. emitted_workspace_basename_dag consumes that exact list alongside the runtime prelude and real DAG membership; arbitrary extras still yield EmittedWorkspaceClosuresDisagree. The runtime crate includes dry_run only when it is in the observed emitted basenames. No fictitious .dag module is added, and this is not a broad filename exemption.
The new witness calls the real emitted_workspace_plan, checks both the emitted and absent cases, and checks the returned runtime module lists. The existing missing/extra control retains the undeclared fx_stray refusal, including with services enabled. The emitter's independent spelling and the workspace pairing obligation remain explicit; this approval does not claim they have already become one shared construction.
Independently verified execution
Workflow 37586216963 explicitly names this head and all five jobs succeeded. Generated includes successful Lint every target and the one-seed stage0 mirror check, covering the regenerated gunbc_rust_emitted_edge.rs.
Rust-unit job 112676825043 checks out e37dac1d6b7f72cf9a3c28d89ddf1f617a9129a0, explicitly merging this head into d0445f3a1f79432789bd81cd3145af7610594043, and runs cargo test --release -p v1-compiler --lib. The log records all five cli_run::import_bearing_reference_edges controls as ok: the qualified-edge RED, test-local imports-only discriminator, import-less control, importing homonym RED, and preserved import-less homonym control. Suite: 1,090 passed, 0 failed, 54 ignored, 0 filtered, 5.05s. None of these five is ignored. The supplied pool-name fixtures avoid a live-corpus unit test. This verifies execution, not individually reported <100ms timings.
I downloaded required-floor artifact 11468720608 and verified its ZIP SHA256 against GitHub's digest: 031b8f47f80d1f2e869fe2a2d51677209034fdf07ee39e9f3c4433454ece90f14. Its TSV records the dedup claim and all seven v2.test.claim.emitted_crate_workspace_witness claims as pass, verdict reached, cost observed. The dedup claim is 34ms CPU / 105ms wall; the new dry_run control is 10ms CPU / 10ms wall. All eight are below their recorded 100ms CPU line. These are actual costs for these claims, not measurements of the overall selection expansion.
Non-blocking receipt correction: the PR body's statement that these Rust tests are not on a required lane is stale; the retrieved CI demonstrates their execution. Its standalone clippy receipt names predecessor a79628262c; exact-head lint is independently supported by the generated job above.
Limits
The +117-edge census, dependent/test-module counts and 60GB emitted-crate-workspace run at e5a16eeaf0 remain author-run evidence; I did not replay them. Closure sizes are correctly treated as selection proxies, not elapsed-cost certificates. Restoring real dependencies is not grounds for reintroducing an undercount; #13530's incidental coupling cleanup remains separate. This approval does not certify every unchanged graph consumer or fix the import-less namespace defect.
I inspected the exact diff, pinned readable source, DESIGN and CI evidence, and locally verified/parsed the downloaded receipt. I did not build the compiler, run a local mutant, or run a whole-repository census. No further semantic change, additional test lane, or corpus-heavy control is requested.
Producer fix:
dependency_resolution_factsunions reference edges for every importerImportBearing("edges owned EXACTLY by import_resolution_facts") was false:v2.std.artifactreferencesv2.std.refinementandv2.std.cross_tree.resolutionreferencesv2.std.layerwithout importing them. TheFileReferenceEdges::ImportBearingearly return is deleted; bothdependency_resolution_factsand_atshare the per-file halves and union through the one authorityunion_dedup_import_facts_reference_first.Reader decision (landed here per parent): in an import-bearing file only qualified references become edges; bare names stay lexically bound (locals plus imports). The bare-name proximity tier is kept only for import-less files and is flagged as its own suspect (follow-up recurring_failure_mode row, separate PR).
Evidence
an_import_bearing_file_carries_its_unimported_reference_edge; mutantthe_imports_only_mutant_fails_the_red; controlan_importless_file_is_unchanged; phantom-homonym REDa_bare_name_in_an_import_bearing_file_is_not_resolved_to_a_pool_homonymwith import-less control. All pass remotely.witness_union_has_no_duplicate_target).dry_run.rswith no .dag module; admitted via declaredrust_emit_only_basenamesbesiderust_runtime_prelude_module(dag/gunbc/rust_emitted_edge.dag), not by filtering the report. Control: an undeclared extra file (fx_stray) still refuses; the runtime crate listsdry_runonly when emitted.--all-targets -D warningsclean on a796282 (exact head), remote.Executing consumers
Partition-test fixture trees: each file references only what it imports, so unaffected. Edge-source witnesses: expected set unchanged. No witness found whose expected edge set must change. The manufactured-dependency census (
src/v2/lens/manufactured_dependency_census.dag) comment restated: counts qualified refs for import-bearing modules, all refs for import-less; a lower bound.Floor: no per-claim floor cost measured beyond the closure/selection proxies above. Rust test module is a receipt only (unit tests not required lane).
Seed-Rust receipt (review 77485 advisory): the new
import_bearing_reference_edgestest module (~130 lines) accompanies a net seed deletion: theFileReferenceEdges::ImportBearingvariant and its early return are removed, and the tests supply pool names rather than resolving the corpus. Mirrorgunbc_rust_emitted_edge.rsregenerated at 355fdae viaclaim_executor --regen-round-cost(changed_paths=1).🤖 Generated with Claude Code