using System.Text.Json.Serialization;
namespace StellaOps.Scanner.ChangeTrace.Models;
///
/// Byte-level change delta (rolling hash window granularity).
///
public sealed record ByteDelta
{
///
/// Scope of this delta: always "byte" for byte deltas.
///
[JsonPropertyName("scope")]
public string Scope { get; init; } = "byte";
///
/// Byte offset where the change begins.
///
[JsonPropertyName("offset")]
public required long Offset { get; init; }
///
/// Size of the changed region in bytes.
///
[JsonPropertyName("size")]
public required int Size { get; init; }
///
/// Rolling hash of the "before" bytes.
///
[JsonPropertyName("fromHash")]
public required string FromHash { get; init; }
///
/// Rolling hash of the "after" bytes.
///
[JsonPropertyName("toHash")]
public required string ToHash { get; init; }
///
/// Binary section containing this change (e.g., ".text", ".data").
///
[JsonPropertyName("section")]
public string? Section { get; init; }
///
/// Optional context description for this change.
///
[JsonPropertyName("context")]
public string? Context { get; init; }
}