Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Notify Smoke Test / Notify Unit Tests (push) Has been cancelled
Notify Smoke Test / Notifier Service Tests (push) Has been cancelled
Notify Smoke Test / Notification Smoke Test (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
Scanner Analyzers / Discover Analyzers (push) Has been cancelled
Scanner Analyzers / Build Analyzers (push) Has been cancelled
Scanner Analyzers / Test Language Analyzers (push) Has been cancelled
Scanner Analyzers / Validate Test Fixtures (push) Has been cancelled
Scanner Analyzers / Verify Deterministic Output (push) Has been cancelled
Signals CI & Image / signals-ci (push) Has been cancelled
Signals Reachability Scoring & Events / reachability-smoke (push) Has been cancelled
Signals Reachability Scoring & Events / sign-and-upload (push) Has been cancelled
Manifest Integrity / Validate Schema Integrity (push) Has been cancelled
Manifest Integrity / Validate Contract Documents (push) Has been cancelled
Manifest Integrity / Validate Pack Fixtures (push) Has been cancelled
Manifest Integrity / Audit SHA256SUMS Files (push) Has been cancelled
Manifest Integrity / Verify Merkle Roots (push) Has been cancelled
devportal-offline / build-offline (push) Has been cancelled
Mirror Thin Bundle Sign & Verify / mirror-sign (push) Has been cancelled
159 lines
4.3 KiB
C#
159 lines
4.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace StellaOps.Reachability.FixtureTests.PatchOracle;
|
|
|
|
/// <summary>
|
|
/// Root model for patch-oracle fixture files.
|
|
/// </summary>
|
|
public sealed record PatchOracleDefinition
|
|
{
|
|
[JsonPropertyName("schema_version")]
|
|
public string SchemaVersion { get; init; } = "patch-oracle/v1";
|
|
|
|
[JsonPropertyName("id")]
|
|
public required string Id { get; init; }
|
|
|
|
[JsonPropertyName("case_ref")]
|
|
public required string CaseRef { get; init; }
|
|
|
|
[JsonPropertyName("variant")]
|
|
public required string Variant { get; init; }
|
|
|
|
[JsonPropertyName("description")]
|
|
public string? Description { get; init; }
|
|
|
|
[JsonPropertyName("expected_functions")]
|
|
public IReadOnlyList<ExpectedFunction> ExpectedFunctions { get; init; } = Array.Empty<ExpectedFunction>();
|
|
|
|
[JsonPropertyName("expected_edges")]
|
|
public IReadOnlyList<ExpectedEdge> ExpectedEdges { get; init; } = Array.Empty<ExpectedEdge>();
|
|
|
|
[JsonPropertyName("expected_roots")]
|
|
public IReadOnlyList<ExpectedRoot> ExpectedRoots { get; init; } = Array.Empty<ExpectedRoot>();
|
|
|
|
[JsonPropertyName("forbidden_functions")]
|
|
public IReadOnlyList<ExpectedFunction> ForbiddenFunctions { get; init; } = Array.Empty<ExpectedFunction>();
|
|
|
|
[JsonPropertyName("forbidden_edges")]
|
|
public IReadOnlyList<ExpectedEdge> ForbiddenEdges { get; init; } = Array.Empty<ExpectedEdge>();
|
|
|
|
[JsonPropertyName("min_confidence")]
|
|
public double MinConfidence { get; init; } = 0.5;
|
|
|
|
[JsonPropertyName("strict_mode")]
|
|
public bool StrictMode { get; init; } = false;
|
|
|
|
[JsonPropertyName("created_at")]
|
|
public DateTimeOffset? CreatedAt { get; init; }
|
|
|
|
[JsonPropertyName("updated_at")]
|
|
public DateTimeOffset? UpdatedAt { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Expected function/node in the graph.
|
|
/// </summary>
|
|
public sealed record ExpectedFunction
|
|
{
|
|
[JsonPropertyName("symbol_id")]
|
|
public required string SymbolId { get; init; }
|
|
|
|
[JsonPropertyName("lang")]
|
|
public string? Lang { get; init; }
|
|
|
|
[JsonPropertyName("kind")]
|
|
public string? Kind { get; init; }
|
|
|
|
[JsonPropertyName("purl_pattern")]
|
|
public string? PurlPattern { get; init; }
|
|
|
|
[JsonPropertyName("required")]
|
|
public bool Required { get; init; } = true;
|
|
|
|
[JsonPropertyName("reason")]
|
|
public string? Reason { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Expected edge in the graph.
|
|
/// </summary>
|
|
public sealed record ExpectedEdge
|
|
{
|
|
[JsonPropertyName("from")]
|
|
public required string From { get; init; }
|
|
|
|
[JsonPropertyName("to")]
|
|
public required string To { get; init; }
|
|
|
|
[JsonPropertyName("kind")]
|
|
public string? Kind { get; init; }
|
|
|
|
[JsonPropertyName("min_confidence")]
|
|
public double? MinConfidence { get; init; }
|
|
|
|
[JsonPropertyName("required")]
|
|
public bool Required { get; init; } = true;
|
|
|
|
[JsonPropertyName("reason")]
|
|
public string? Reason { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Expected root node in the graph.
|
|
/// </summary>
|
|
public sealed record ExpectedRoot
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public required string Id { get; init; }
|
|
|
|
[JsonPropertyName("phase")]
|
|
public string? Phase { get; init; }
|
|
|
|
[JsonPropertyName("required")]
|
|
public bool Required { get; init; } = true;
|
|
|
|
[JsonPropertyName("reason")]
|
|
public string? Reason { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Index entry for an oracle.
|
|
/// </summary>
|
|
public sealed record PatchOracleIndexEntry
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public required string Id { get; init; }
|
|
|
|
[JsonPropertyName("case_ref")]
|
|
public required string CaseRef { get; init; }
|
|
|
|
[JsonPropertyName("variant")]
|
|
public required string Variant { get; init; }
|
|
|
|
[JsonPropertyName("path")]
|
|
public required string Path { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Root model for patch-oracle INDEX.json.
|
|
/// </summary>
|
|
public sealed record PatchOracleIndex
|
|
{
|
|
[JsonPropertyName("version")]
|
|
public string Version { get; init; } = "1.0";
|
|
|
|
[JsonPropertyName("schema")]
|
|
public string Schema { get; init; } = "patch-oracle/v1";
|
|
|
|
[JsonPropertyName("generated_at")]
|
|
public DateTimeOffset? GeneratedAt { get; init; }
|
|
|
|
[JsonPropertyName("description")]
|
|
public string? Description { get; init; }
|
|
|
|
[JsonPropertyName("oracles")]
|
|
public IReadOnlyList<PatchOracleIndexEntry> Oracles { get; init; } = Array.Empty<PatchOracleIndexEntry>();
|
|
}
|