Files
git.stella-ops.org/src/Scheduler/__Libraries/StellaOps.Scheduler.Queue/Models/SchedulerEnqueueResult.cs
2026-01-06 19:07:48 +02:00

50 lines
1.6 KiB
C#

// -----------------------------------------------------------------------------
// SchedulerEnqueueResult.cs
// Sprint: SPRINT_20260105_002_002_SCHEDULER_hlc_queue_chain
// Task: SQC-009 - Implement HlcSchedulerEnqueueService
// -----------------------------------------------------------------------------
using StellaOps.HybridLogicalClock;
namespace StellaOps.Scheduler.Queue.Models;
/// <summary>
/// Result of an HLC-ordered enqueue operation.
/// Contains the assigned HLC timestamp, job ID, and chain link.
/// </summary>
public sealed record SchedulerEnqueueResult
{
/// <summary>
/// HLC timestamp assigned at enqueue time.
/// This determines the job's position in the total order.
/// </summary>
public required HlcTimestamp Timestamp { get; init; }
/// <summary>
/// Deterministic job ID computed from payload.
/// </summary>
public required Guid JobId { get; init; }
/// <summary>
/// Chain link (SHA-256 hash) proving sequence position.
/// link = Hash(prev_link || job_id || t_hlc || payload_hash)
/// </summary>
public required byte[] Link { get; init; }
/// <summary>
/// SHA-256 hash of the canonical payload.
/// </summary>
public required byte[] PayloadHash { get; init; }
/// <summary>
/// Previous chain link (null for first entry in partition).
/// </summary>
public byte[]? PrevLink { get; init; }
/// <summary>
/// Whether this was a duplicate submission (idempotent).
/// If true, the existing job's values are returned.
/// </summary>
public bool IsDuplicate { get; init; }
}