Files
git.stella-ops.org/src/Scanner/__Libraries/StellaOps.Scanner.ChangeTrace/Models/ByteDelta.cs
2026-01-12 12:24:17 +02:00

52 lines
1.4 KiB
C#

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