Track the main version through sequence movement
This commit is contained in:
@@ -95,6 +95,7 @@ func assembleLayeredInput[T any](request loadRequest[T], input assembledInput, a
|
||||
var assembly *assemblyAccumulator
|
||||
mainSourceCount := len(input.sources)
|
||||
mainEvidence := input.versionState.evidenceSince(0)
|
||||
projectVersion := sequenceVersionPath(request.protectionVersion())
|
||||
for index, group := range request.underlays {
|
||||
evidenceStart := len(input.versionState.evidenceSince(0))
|
||||
acquired, diagnostics := acquireUnderlayGroupScopes(group, index+1, request.protectionVersion(), accounting, input.versionState, request.sequencePolicy)
|
||||
@@ -107,7 +108,13 @@ func assembleLayeredInput[T any](request loadRequest[T], input assembledInput, a
|
||||
if assembly != nil && assembly.current != nil {
|
||||
lower = assembly.current.collectionPolicies
|
||||
}
|
||||
composition, diagnostics := composeUnderlayGroup(acquired, request.protectionVersion(), request.sequencePolicy, lower)
|
||||
protectionRule := request.protectionVersion()
|
||||
if projectVersion {
|
||||
// The main item's final position is known only after tier assembly.
|
||||
// Source-local checks still run during acquisition above.
|
||||
protectionRule = nil
|
||||
}
|
||||
composition, diagnostics := composeUnderlayGroup(acquired, protectionRule, request.sequencePolicy, lower)
|
||||
sourceStart := len(input.sources)
|
||||
input.sources = append(input.sources, acquired.sources...)
|
||||
if len(diagnostics) != 0 {
|
||||
@@ -160,6 +167,7 @@ func assembleLayeredInput[T any](request loadRequest[T], input assembledInput, a
|
||||
}
|
||||
}
|
||||
if mainComposition != nil {
|
||||
input.versionState.locateMainVersion(mainComposition.root)
|
||||
if assembly == nil {
|
||||
assembly = newAssemblyAccumulator(mainComposition)
|
||||
} else {
|
||||
@@ -175,6 +183,15 @@ func assembleLayeredInput[T any](request loadRequest[T], input assembledInput, a
|
||||
return input, append(versionDiagnostics, diagnostics...)
|
||||
}
|
||||
projectTierSourceDestinations(input.sources[:mainSourceCount], mainEvidence, operations)
|
||||
input.versionState.projectMainVersion(operations)
|
||||
}
|
||||
}
|
||||
if input.versionState != nil {
|
||||
request.effectiveVersion = input.versionState.effectiveRule
|
||||
}
|
||||
if projectVersion && assembly != nil {
|
||||
if diagnostic := projectedUnderlayVersionDiagnostic(assembly.current.applications, input.sources, request.protectionVersion()); diagnostic != nil {
|
||||
return input, append(versionDiagnostics, *diagnostic)
|
||||
}
|
||||
}
|
||||
if assembly == nil && activeOverlay(request.overlay) {
|
||||
|
||||
Reference in New Issue
Block a user