Project consumed version evidence through sequence appends
This commit is contained in:
@@ -662,7 +662,7 @@ func projectAcquiredDestinations(composed *composedDocument, scope acquisitionSc
|
||||
}
|
||||
contributionPrefix = appendDestination(container, Path{}.Index(start))
|
||||
contributionInsideItem = true
|
||||
projectSourceVersionEvidence(contribution.processing, contributionPrefix)
|
||||
projectSourceVersionEvidence(contribution.processing, contributionPrefix, nil, sourceIndex)
|
||||
} else if contributionInsideItem {
|
||||
exactDestination := appendDestination(contributionPrefix, contribution.destination)
|
||||
contribution.source.Destination = exactDestination.clone()
|
||||
@@ -672,7 +672,9 @@ func projectAcquiredDestinations(composed *composedDocument, scope acquisitionSc
|
||||
sources[position].Destination = exactDestination
|
||||
sources[position].destinationUnresolved = false
|
||||
}
|
||||
projectSourceVersionEvidence(contribution.processing, exactDestination)
|
||||
projectSourceVersionEvidence(contribution.processing, exactDestination, nil, sourceIndex)
|
||||
} else {
|
||||
projectSourceVersionEvidence(contribution.processing, contribution.destination, currentComposition.sequenceRanges, sourceIndex)
|
||||
}
|
||||
if contribution.nested != nil && contribution.nested.acquisition != nil {
|
||||
for _, nestedScope := range contribution.nested.acquisition {
|
||||
@@ -684,9 +686,28 @@ func projectAcquiredDestinations(composed *composedDocument, scope acquisitionSc
|
||||
projectScope(composed, scope, Path{}, false, "")
|
||||
}
|
||||
|
||||
func projectSourceVersionEvidence(processing *sourceVersionProcessingResult, destination Path) {
|
||||
func projectSourceVersionEvidence(processing *sourceVersionProcessingResult, destination Path, ranges []sequenceRange, sourceIndex int) {
|
||||
if processing != nil && processing.evidence != nil {
|
||||
processing.evidence.destination = destination.clone()
|
||||
evidence := processing.evidence
|
||||
evidence.destination = destination.clone()
|
||||
// Rebuild from source-local paths on each handoff: an input can be
|
||||
// composed first on its own and then at a different offset in its tier.
|
||||
evidence.projectedPaths = nil
|
||||
paths := evidence.sensitivityPaths()
|
||||
for index, path := range paths {
|
||||
for _, assigned := range ranges {
|
||||
if assigned.sourceIndex != sourceIndex || !pathContains(assigned.path, path) || len(path.segments) <= len(assigned.path.segments) {
|
||||
continue
|
||||
}
|
||||
position := len(assigned.path.segments)
|
||||
item, ok := schemaIndex(path.segments[position])
|
||||
if ok && path.segments[position].kind != pathSegmentKey {
|
||||
path.segments[position] = pathSegment{kind: pathSegmentIndex, index: assigned.start + item}
|
||||
}
|
||||
}
|
||||
paths[index] = path
|
||||
}
|
||||
evidence.projectedPaths = paths
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user