Limit inheritance policy work to the relevant scope

This commit is contained in:
2026-10-24 14:10:44 +00:00
parent 8253993005
commit 5c5f2af6cc
7 changed files with 258 additions and 43 deletions

View File

@@ -109,10 +109,11 @@ func (scope identifiedSequenceInheritanceScope) applicationPolicy() sequencePoli
func (scope identifiedSequenceInheritanceScope) slotOverhead() int { return 0 }
func (scope identifiedSequenceInheritanceScope) templates() []inheritanceExecutionTemplate {
result := make([]inheritanceExecutionTemplate, len(scope.graph.nodes))
policyIndex := newInheritancePolicyIndex(scope.policies)
for index, node := range scope.graph.nodes {
result[index] = inheritanceExecutionTemplate{
entry: document.Entry{Value: node.item}, path: node.path,
collectionPolicies: inheritancePolicyScopeAtPath(scope.policies, node.path),
collectionPolicies: policyIndex.localize(node.path),
parent: node.parent, hasParent: node.hasParent,
hasDirective: node.directive != nil, cancelled: node.cancelled,
directive: document.Entry{Value: node.directive}, directivePath: node.directivePath,