Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Import closure not directory sweep

Platform spec ADR

Import closure not directory sweep

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

ImportClosure and WorkspaceScan modes were conflated in places: directory sweeps pulled unrelated .bd files into compile graphs, breaking determinism and parity with explicit use graphs.

For AssemblyDiscovery::ImportClosure (build, run, lower, test, LSP document snapshots):

RuleDetail
SeedsEntry file, prelude union seeds (D-COMP-BUILD-0022), and each pub mod A.B resolve exactly one module file before traversal
ExpansionAdditional units enter the queue only when a queued file contains a use import that resolves under effective roots
No sweepImportClosure must not enumerate all *.bd under roots (that mode is WorkspaceScan only, for LSP workspace indexing)

WorkspaceScan remains capped by max_units with deterministic sort; it must not be used for beskid build / beskid run / beskid test.

Assembly unit count tracks the transitive use graph plus explicit prelude seeds. Tests assert closure size for fixture projects.

  • compiler/crates/beskid_analysis/src/projects/assembly/loader.rs
  • compiler/crates/beskid_analysis/src/projects/model.rs (AssemblyDiscovery)
  • compiler/crates/beskid_tests/src/projects/composition.rs