using System;
namespace StellaOps.Provcache;
///
/// Fluent builder for constructing a VeriKey (provenance identity key).
/// VeriKey is a composite hash that uniquely identifies a provenance decision context.
///
///
///
/// VeriKey = SHA256(source_hash || sbom_hash || vex_hash_set_hash || merge_policy_hash || signer_set_hash || time_window)
///
///
/// Each component ensures cache invalidation when relevant inputs change:
///
/// - source_hash: Different artifacts get different keys
/// - sbom_hash: SBOM changes (new packages) create new key
/// - vex_hash_set: VEX updates create new key
/// - policy_hash: Policy changes create new key
/// - signer_set_hash: Key rotation creates new key (security)
/// - time_window: Temporal bucketing enables controlled expiry
///
///
///
public sealed partial class VeriKeyBuilder
{
private string? _sourceHash;
private string? _sbomHash;
private string? _vexHashSetHash;
private string? _mergePolicyHash;
private string? _signerSetHash;
private string? _timeWindow;
private readonly ProvcacheOptions _options;
///
/// Creates a new VeriKeyBuilder with default options.
///
public VeriKeyBuilder() : this(new ProvcacheOptions())
{
}
///
/// Creates a new VeriKeyBuilder with the specified options.
///
/// Provcache configuration options.
public VeriKeyBuilder(ProvcacheOptions options)
{
_options = options ?? throw new ArgumentNullException(nameof(options));
}
}