Preserve inherited source origins and transfer evidence

This commit is contained in:
2026-09-29 22:40:49 +00:00
parent 4207110e2f
commit 462e57df3e
7 changed files with 426 additions and 21 deletions

View File

@@ -201,6 +201,23 @@ func originContainedBy(candidate, container Origin) bool {
return false
}
}
if (len(candidate.contributors) == 0) != (len(container.contributors) == 0) {
return false
}
for _, contributor := range candidate.contributors {
found := false
for _, available := range container.contributors {
if contributor.location == available.location &&
slices.Equal(contributor.source.segments, available.source.segments) &&
sameInheritanceTrace(contributor.trace, available.trace) {
found = true
break
}
}
if !found {
return false
}
}
return true
}