using System.ComponentModel.DataAnnotations;
namespace StellaOps.BinaryIndex.GoldenSet;
///
/// Configuration options for the GoldenSet module.
///
public sealed class GoldenSetOptions
{
///
/// Configuration section name.
///
public const string SectionName = "BinaryIndex:GoldenSet";
///
/// Current schema version for golden set definitions.
///
[Required]
public string SchemaVersion { get; set; } = GoldenSetConstants.CurrentSchemaVersion;
///
/// Validation options.
///
public GoldenSetValidationOptions Validation { get; set; } = new();
///
/// Storage options.
///
public GoldenSetStorageOptions Storage { get; set; } = new();
///
/// Caching options.
///
public GoldenSetCachingOptions Caching { get; set; } = new();
///
/// Authoring options.
///
public GoldenSetAuthoringOptions Authoring { get; set; } = new();
}
///
/// Authoring options for golden sets.
///
public sealed class GoldenSetAuthoringOptions
{
///
/// Enable AI-assisted enrichment.
///
public bool EnableAiEnrichment { get; set; } = true;
///
/// Enable upstream commit analysis.
///
public bool EnableCommitAnalysis { get; set; } = true;
///
/// Maximum number of commits to analyze per vulnerability.
///
public int MaxCommitsToAnalyze { get; set; } = 5;
///
/// Minimum confidence threshold for auto-accepting AI suggestions.
///
public decimal AutoAcceptConfidenceThreshold { get; set; } = 0.8m;
}
///
/// Validation options for golden sets.
///
public sealed class GoldenSetValidationOptions
{
///
/// Validate that the CVE exists in NVD/OSV (requires network).
///
public bool ValidateCveExists { get; set; } = true;
///
/// Validate that sinks are in the registry.
///
public bool ValidateSinks { get; set; } = true;
///
/// Validate edge format strictly (must match bbN->bbM).
///
public bool StrictEdgeFormat { get; set; } = true;
///
/// Skip network calls (air-gap mode).
///
public bool OfflineMode { get; set; } = false;
}
///
/// Storage options for golden sets.
///
public sealed class GoldenSetStorageOptions
{
///
/// PostgreSQL schema name for golden sets.
///
public string PostgresSchema { get; set; } = "golden_sets";
///
/// Connection string name (from configuration).
///
public string ConnectionStringName { get; set; } = "BinaryIndex";
}
///
/// Caching options for golden sets.
///
public sealed class GoldenSetCachingOptions
{
///
/// Cache duration for sink registry lookups (minutes).
///
public int SinkRegistryCacheMinutes { get; set; } = 60;
///
/// Cache duration for golden set definitions (minutes).
///
public int DefinitionCacheMinutes { get; set; } = 15;
}