Simplify empty import selection evidence

This commit is contained in:
2026-10-27 15:05:22 +00:00
parent 31ae30372e
commit 791cf16136
11 changed files with 58 additions and 87 deletions

View File

@@ -192,16 +192,16 @@ type SourceInfo struct {
Label string
Path string
// Destination is the effective mapping or sequence-container path. It is a
// detached snapshot. A fallback container is marked by DestinationUnresolved.
// detached snapshot. A fallback container is marked by DestinationIsFallback.
Destination Path
// PlacementMode describes how this source was placed. Mapping is the zero
// value; CLI and overlay sources report mapping placement unless item placement
// was applied to that source.
PlacementMode PlacementMode
// DestinationUnresolved marks Destination as the nearest resolved enclosing
// DestinationIsFallback marks Destination as the nearest resolved enclosing
// container when an enclosing item index is not yet assigned. It is false for
// exact destinations, including an item source's own sequence container.
DestinationUnresolved bool
DestinationIsFallback bool
Layer Layer
Kind SourceKind
UnderlayIndex int
@@ -212,12 +212,12 @@ type SourceInfo struct {
// and failed loads, text is conservatively withheld; successful final source
// records reflect completed sensitivity classification.
VersionEvidence *SourceVersionEvidence
// ImportSelections records completed optional declarations that selected no
// EmptyImportSelections records completed optional declarations that selected no
// sources, in declaration order. Paths are local to this declaring source.
// Each record identifies the declaration mapping, selector, and empty outcome;
// Each record identifies the declaration mapping and selector;
// it does not list candidates or explain why a path was absent. Result, error,
// and callback snapshots detach these records and their paths.
ImportSelections []ImportSelection
EmptyImportSelections []EmptyImportSelection
}
// ImportSelector identifies the selector used by an import declaration.
@@ -232,22 +232,13 @@ const (
ImportSelectorGlob ImportSelector = "glob"
)
// ImportSelectionOutcome identifies the established result of import selection.
type ImportSelectionOutcome string
const (
// ImportSelectionNone means the optional declaration selected no sources.
ImportSelectionNone ImportSelectionOutcome = "none"
)
// ImportSelection records an optional import declaration that selected no
// EmptyImportSelection records an optional import declaration that selected no
// sources. Path is local to the declaring source; Location identifies its
// declaration mapping and source ID.
type ImportSelection struct {
type EmptyImportSelection struct {
Path Path
Location Location
Selector ImportSelector
Outcome ImportSelectionOutcome
}
// SourceVersionEvidence describes a source-local version declaration observed