Publish detached sanitized source evidence

This commit is contained in:
2026-10-15 16:12:21 +00:00
parent 1e47ee21cd
commit 43c994a32a
11 changed files with 414 additions and 9 deletions

View File

@@ -197,6 +197,19 @@ type SourceInfo struct {
Kind SourceKind
UnderlayIndex int
ImportedFrom *Location
// VersionCheck is the sanitized source-local version declaration observed
// during an enabled source-version load. It is nil otherwise.
VersionCheck *SourceVersionCheck
}
// SourceVersionCheck describes a source-local version declaration observed
// during an enabled load. Text is empty when classification or conservative
// early-access redaction withholds it; Present and Null retain their meaning.
type SourceVersionCheck struct {
Path Path
Version Version
Location *Location
Redacted bool
}
// Diagnostic is a safe structured problem report. Message and source labels must
@@ -267,9 +280,20 @@ func cloneLocations(locations []Location) []Location {
func cloneSourceInfo(source SourceInfo) SourceInfo {
source.Destination = source.Destination.clone()
source.ImportedFrom = cloneLocation(source.ImportedFrom)
source.VersionCheck = cloneSourceVersionCheck(source.VersionCheck)
return source
}
func cloneSourceVersionCheck(value *SourceVersionCheck) *SourceVersionCheck {
if value == nil {
return nil
}
cloned := *value
cloned.Path = value.Path.clone()
cloned.Location = cloneLocation(value.Location)
return &cloned
}
func cloneSourceInfos(sources []SourceInfo) []SourceInfo {
if sources == nil {
return nil