Skip to content

Import resolver: a build-variant copy resolves to the importer's own variant (import contract C8) #3665

Closed

Description

@squid-protocol

Part of #3641. Import contract C8 (decided 2026-09-25): when the same file exists in parallel source trees for different builds, the import means the copy the importer's own build compiles.

What happens: the resolver sees N same-named candidates, finds them equally near, calls the import ambiguous, and draws no edge.

Evidence (import_graph_accuracy.py --buckets, shape truth-names-several-files, validated in docs/self_scan/graph_comparison_ledger.json):

Fix direction: in the import resolver's ambiguity step, before giving up:

  1. Collapse candidates that are the same file after realpath.
  2. Prefer the candidate that shares the importer's variant directory segment, meaning a sibling-directory name that differs among the candidates (scala-2 vs scala-3, jvm vs js, scala-2.12 vs scala-2.13+).

Only if still tied is the import genuinely ambiguous.

Measure: import_graph_accuracy.py --buckets 3 (scala 93.5% recall, objective-c 97.3%). Goldens: import edges and fan-in move for affected files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcore-engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions