using StellaOps.Replay.Core; namespace StellaOps.Scanner.ProofSpine; /// /// Represents a complete verifiable decision chain from SBOM to VEX verdict. /// /// Content-addressed ID of this proof spine. /// The artifact (container image, package) this spine evaluates. /// The vulnerability ID being evaluated. /// The policy profile used for evaluation. /// Ordered list of evidence segments in the proof chain. /// Final verdict (affected, not_affected, fixed, under_investigation). /// Human-readable explanation of the verdict. /// Merkle root hash of all segment hashes. /// ID of the scan run that produced this spine. /// When this spine was created. /// If superseded, the ID of the newer spine. /// Optional: Content-addressed ID of the graph root attestation. /// Optional: DSSE envelope containing the graph root attestation. public sealed record ProofSpine( string SpineId, string ArtifactId, string VulnerabilityId, string PolicyProfileId, IReadOnlyList Segments, string Verdict, string VerdictReason, string RootHash, string ScanRunId, DateTimeOffset CreatedAt, string? SupersededBySpineId, string? GraphRootAttestationId = null, DsseEnvelope? GraphRootEnvelope = null); /// /// A single evidence segment in the proof chain. /// public sealed record ProofSegment( string SegmentId, ProofSegmentType SegmentType, int Index, string InputHash, string ResultHash, string? PrevSegmentHash, DsseEnvelope Envelope, string ToolId, string ToolVersion, ProofSegmentStatus Status, DateTimeOffset CreatedAt); public sealed record GuardCondition( string Name, string Type, string Value, bool Passed); /// /// Segment types in execution order. /// public enum ProofSegmentType { SbomSlice = 1, Match = 2, Reachability = 3, GuardAnalysis = 4, RuntimeObservation = 5, PolicyEval = 6 } /// /// Verification status of a segment. /// public enum ProofSegmentStatus { Pending = 0, Verified = 1, Partial = 2, Invalid = 3, Untrusted = 4 }