Keep import selection evidence with its declaring source

This commit is contained in:
2026-10-25 14:36:39 +00:00
parent e585decdb2
commit 64be8b4df5
5 changed files with 79 additions and 28 deletions

View File

@@ -111,7 +111,7 @@ input restrictions, performance thresholds, or release gates.
## 2. Avoid Searching All Sources For Each Empty Import Selection
Status: open. Priority: low. Category: algorithmic efficiency.
Status: complete (2026-10-25). Priority: low. Category: algorithmic efficiency.
**Evidence.** `walkDeclarations` calls `recordEmptyImportSelection` for each
optional declaration that admits no source. In
@@ -141,6 +141,15 @@ A broad-fragment behavioral case is useful if existing coverage does not protect
the chosen index handoff. Verify the removed scan by source review rather than
adding timing thresholds or assertions about private lookup counts.
**Completion.** Declaration traversal now receives the declaring source's stable
integer position, captured at admission and carried through mapping and item
imports. Empty selections append evidence directly to that record without
searching the source slice or retaining pointers into it. The broad-fragment
test covers source-slice growth, missing-source rollback, and parent evidence
after child traversal; existing detached evidence, nested item, underlay, and
partial-failure tests remain effective. Focused tests, the development check,
and race-enabled import/destination tests passed with Go 1.26.10 on Linux.
## 3. Restrict Import-Scope Edge Preparation To Relevant Nodes
Status: open. Priority: medium. Category: algorithmic efficiency and allocation