sprints work

This commit is contained in:
StellaOps Bot
2025-12-24 21:46:08 +02:00
parent 43e2af88f6
commit b9f71fc7e9
161 changed files with 29566 additions and 527 deletions

View File

@@ -0,0 +1,121 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace StellaOps.Scanner.Triage.Entities;
/// <summary>
/// Represents a scan that produced triage findings.
/// </summary>
[Table("triage_scan")]
public sealed class TriageScan
{
/// <summary>
/// Unique identifier for the scan.
/// </summary>
[Key]
[Column("id")]
public Guid Id { get; init; } = Guid.NewGuid();
/// <summary>
/// Image reference that was scanned.
/// </summary>
[Required]
[Column("image_reference")]
public required string ImageReference { get; init; }
/// <summary>
/// Image digest (sha256:...).
/// </summary>
[Column("image_digest")]
public string? ImageDigest { get; init; }
/// <summary>
/// Target digest for replay command generation.
/// </summary>
[Column("target_digest")]
public string? TargetDigest { get; init; }
/// <summary>
/// Target reference for replay command generation.
/// </summary>
[Column("target_reference")]
public string? TargetReference { get; init; }
/// <summary>
/// Knowledge snapshot ID used for this scan.
/// </summary>
[Column("knowledge_snapshot_id")]
public string? KnowledgeSnapshotId { get; init; }
/// <summary>
/// When the scan started.
/// </summary>
[Column("started_at")]
public DateTimeOffset StartedAt { get; init; } = DateTimeOffset.UtcNow;
/// <summary>
/// When the scan completed.
/// </summary>
[Column("completed_at")]
public DateTimeOffset? CompletedAt { get; set; }
/// <summary>
/// Scan status (running, completed, failed).
/// </summary>
[Required]
[Column("status")]
public required string Status { get; set; }
/// <summary>
/// Policy file hash used during the scan.
/// </summary>
[Column("policy_hash")]
public string? PolicyHash { get; init; }
/// <summary>
/// Feed snapshot hash for deterministic replay.
/// </summary>
[Column("feed_snapshot_hash")]
public string? FeedSnapshotHash { get; init; }
/// <summary>
/// When the knowledge snapshot was created.
/// </summary>
[Column("snapshot_created_at")]
public DateTimeOffset? SnapshotCreatedAt { get; init; }
/// <summary>
/// Feed versions used in this scan (JSON dictionary).
/// </summary>
[Column("feed_versions", TypeName = "jsonb")]
public Dictionary<string, string>? FeedVersions { get; init; }
/// <summary>
/// Content hash of the snapshot for verification.
/// </summary>
[Column("snapshot_content_hash")]
public string? SnapshotContentHash { get; init; }
/// <summary>
/// Final digest of the scan result for verification.
/// </summary>
[Column("final_digest")]
public string? FinalDigest { get; init; }
/// <summary>
/// Feed snapshot timestamp.
/// </summary>
[Column("feed_snapshot_at")]
public DateTimeOffset? FeedSnapshotAt { get; init; }
/// <summary>
/// Offline kit bundle ID if scan was done with offline kit.
/// </summary>
[Column("offline_bundle_id")]
public string? OfflineBundleId { get; init; }
/// <summary>
/// Navigation property to findings.
/// </summary>
public ICollection<TriageFinding> Findings { get; init; } = new List<TriageFinding>();
}