up
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
Manifest Integrity / Validate Schema Integrity (push) Has been cancelled
Manifest Integrity / Validate Contract Documents (push) Has been cancelled
Manifest Integrity / Validate Pack Fixtures (push) Has been cancelled
Manifest Integrity / Audit SHA256SUMS Files (push) Has been cancelled
Manifest Integrity / Verify Merkle Roots (push) Has been cancelled
devportal-offline / build-offline (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled

This commit is contained in:
StellaOps Bot
2025-12-13 18:08:55 +02:00
parent 6e45066e37
commit f1a39c4ce3
234 changed files with 24038 additions and 6910 deletions

View File

@@ -45,6 +45,11 @@ public sealed class SignalsOptions
/// </summary>
public SignalsOpenApiOptions OpenApi { get; } = new();
/// <summary>
/// Retention policy configuration for runtime facts and artifacts.
/// </summary>
public SignalsRetentionOptions Retention { get; } = new();
/// <summary>
/// Validates configured options.
/// </summary>
@@ -57,5 +62,6 @@ public sealed class SignalsOptions
Cache.Validate();
Events.Validate();
OpenApi.Validate();
Retention.Validate();
}
}

View File

@@ -0,0 +1,87 @@
namespace StellaOps.Signals.Options;
/// <summary>
/// Retention policy configuration for runtime facts.
/// </summary>
public sealed class SignalsRetentionOptions
{
/// <summary>
/// Configuration section name.
/// </summary>
public const string SectionName = "Signals:Retention";
/// <summary>
/// Time-to-live for runtime facts in hours. Default is 720 (30 days).
/// Set to 0 to disable automatic expiration.
/// </summary>
public int RuntimeFactsTtlHours { get; set; } = 720;
/// <summary>
/// Time-to-live for callgraph artifacts in hours. Default is 2160 (90 days).
/// Set to 0 to disable automatic expiration.
/// </summary>
public int CallgraphTtlHours { get; set; } = 2160;
/// <summary>
/// Time-to-live for reachability states in hours. Default is 720 (30 days).
/// Set to 0 to disable automatic expiration.
/// </summary>
public int ReachabilityStateTtlHours { get; set; } = 720;
/// <summary>
/// Maximum number of runtime facts per subject. Default is 10000.
/// Older facts are evicted when the limit is reached.
/// </summary>
public int MaxRuntimeFactsPerSubject { get; set; } = 10000;
/// <summary>
/// Enable automatic cleanup of expired facts. Default is true.
/// </summary>
public bool EnableAutoCleanup { get; set; } = true;
/// <summary>
/// Cleanup interval in minutes. Default is 60.
/// </summary>
public int CleanupIntervalMinutes { get; set; } = 60;
/// <summary>
/// Archive expired facts to CAS before deletion. Default is true.
/// </summary>
public bool ArchiveBeforeDelete { get; set; } = true;
/// <summary>
/// CAS path for archived facts.
/// </summary>
public string ArchiveCasPath { get; set; } = "cas://signals/archive/runtime-facts";
/// <summary>
/// Validates retention options.
/// </summary>
public void Validate()
{
if (RuntimeFactsTtlHours < 0)
{
throw new ArgumentException("RuntimeFactsTtlHours must be >= 0.");
}
if (CallgraphTtlHours < 0)
{
throw new ArgumentException("CallgraphTtlHours must be >= 0.");
}
if (ReachabilityStateTtlHours < 0)
{
throw new ArgumentException("ReachabilityStateTtlHours must be >= 0.");
}
if (MaxRuntimeFactsPerSubject <= 0)
{
throw new ArgumentException("MaxRuntimeFactsPerSubject must be > 0.");
}
if (CleanupIntervalMinutes <= 0)
{
throw new ArgumentException("CleanupIntervalMinutes must be > 0.");
}
}
}