Index import dependencies for local scope scheduling

This commit is contained in:
2026-10-25 14:41:07 +00:00
parent 64be8b4df5
commit 8dfaf44d1d
7 changed files with 135 additions and 16 deletions

View File

@@ -152,7 +152,7 @@ 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
Status: complete (2026-10-25). Priority: medium. Category: algorithmic efficiency and allocation
scaling.
**Evidence.** `scheduleAcquisitionScopes` in
@@ -190,3 +190,16 @@ coverage in [imports_test.go](../../internal/engine/imports_test.go) and
existing destination/provenance evidence tests. Cover broad independent item
scopes if a consequential gap remains; verify index construction and edge
visitation bounds by source review without new performance gates.
**Completion.** Scheduling now builds an importer-to-target adjacency index once
for an acquisition and shares it across outer and pending item scopes. Grouped
scheduling builds its own index once. Local preparation visits only adjacency
lists for participating identities, includes only edges with both endpoints in
the local slot map, and allocates edge storage as needed rather than reserving
the whole graph per scope. For the broad sibling family, preparation is O(E + P)
before the unchanged stable Kahn scheduling. The inclusion graph and cycle
diagnostics remain unchanged. Tests cover excluded endpoints/unselected slots
and broad main/underlay item scopes with retained helper origins and projected
destinations. Focused scheduling tests, the development check, documentation
links, and `go test -race ./...` passed with Go 1.26.10 on Linux. No timing or
allocation thresholds were introduced.