feat: Add VEX compact fixture and implement offline verifier for Findings Ledger exports

- Introduced a new VEX compact fixture for testing purposes.
- Implemented `verify_export.py` script to validate Findings Ledger exports, ensuring deterministic ordering and applying redaction manifests.
- Added a lightweight stub `HarnessRunner` for unit tests to validate ledger hashing expectations.
- Documented tasks related to the Mirror Creator.
- Created models for entropy signals and implemented the `EntropyPenaltyCalculator` to compute penalties based on scanner outputs.
- Developed unit tests for `EntropyPenaltyCalculator` to ensure correct penalty calculations and handling of edge cases.
- Added tests for symbol ID normalization in the reachability scanner.
- Enhanced console status service with comprehensive unit tests for connection handling and error recovery.
- Included Cosign tool version 2.6.0 with checksums for various platforms.
This commit is contained in:
StellaOps Bot
2025-12-02 21:08:01 +02:00
parent 6d049905c7
commit 47168fec38
146 changed files with 4329 additions and 549 deletions

View File

@@ -12,13 +12,13 @@ public class LedgerMetricsTests
public void ProjectionLagGauge_RecordsLatestPerTenant()
{
using var listener = CreateListener();
var measurements = new List<Measurement<double>>();
var measurements = new List<(double Value, KeyValuePair<string, object?>[] Tags)>();
listener.SetMeasurementEventCallback<double>((instrument, measurement, tags, state) =>
{
if (instrument.Name == "ledger_projection_lag_seconds")
{
measurements.Add(measurement);
measurements.Add((measurement, tags.ToArray()));
}
});
@@ -36,17 +36,17 @@ public class LedgerMetricsTests
public void MerkleAnchorDuration_EmitsHistogramMeasurement()
{
using var listener = CreateListener();
var measurements = new List<Measurement<double>>();
var measurements = new List<(double Value, KeyValuePair<string, object?>[] Tags)>();
listener.SetMeasurementEventCallback<double>((instrument, measurement, tags, state) =>
{
if (instrument.Name == "ledger_merkle_anchor_duration_seconds")
{
measurements.Add(measurement);
measurements.Add((measurement, tags.ToArray()));
}
});
LedgerMetrics.RecordMerkleAnchorDuration(TimeSpan.FromSeconds(1.5), "tenant-b");
LedgerMetrics.RecordMerkleAnchorDuration(TimeSpan.FromSeconds(1.5), "tenant-b", 10);
var measurement = measurements.Should().ContainSingle().Subject;
measurement.Value.Should().BeApproximately(1.5, precision: 0.001);
@@ -58,13 +58,13 @@ public class LedgerMetricsTests
public void MerkleAnchorFailure_IncrementsCounter()
{
using var listener = CreateListener();
var measurements = new List<Measurement<long>>();
var measurements = new List<(long Value, KeyValuePair<string, object?>[] Tags)>();
listener.SetMeasurementEventCallback<long>((instrument, measurement, tags, state) =>
{
if (instrument.Name == "ledger_merkle_anchor_failures_total")
{
measurements.Add(measurement);
measurements.Add((measurement, tags.ToArray()));
}
});
@@ -81,13 +81,13 @@ public class LedgerMetricsTests
public void AttachmentFailure_IncrementsCounter()
{
using var listener = CreateListener();
var measurements = new List<Measurement<long>>();
var measurements = new List<(long Value, KeyValuePair<string, object?>[] Tags)>();
listener.SetMeasurementEventCallback<long>((instrument, measurement, tags, state) =>
{
if (instrument.Name == "ledger_attachments_encryption_failures_total")
{
measurements.Add(measurement);
measurements.Add((measurement, tags.ToArray()));
}
});
@@ -104,7 +104,7 @@ public class LedgerMetricsTests
public void BacklogGauge_ReflectsOutstandingQueue()
{
using var listener = CreateListener();
var measurements = new List<Measurement<long>>();
var measurements = new List<(long Value, KeyValuePair<string, object?>[] Tags)>();
// Reset
LedgerMetrics.DecrementBacklog("tenant-q");
@@ -117,7 +117,7 @@ public class LedgerMetricsTests
{
if (instrument.Name == "ledger_ingest_backlog_events")
{
measurements.Add(measurement);
measurements.Add((measurement, tags.ToArray()));
}
});
@@ -133,13 +133,13 @@ public class LedgerMetricsTests
public void ProjectionRebuildHistogram_RecordsScenarioTags()
{
using var listener = CreateListener();
var measurements = new List<Measurement<double>>();
var measurements = new List<(double Value, KeyValuePair<string, object?>[] Tags)>();
listener.SetMeasurementEventCallback<double>((instrument, measurement, tags, state) =>
{
if (instrument.Name == "ledger_projection_rebuild_seconds")
{
measurements.Add(measurement);
measurements.Add((measurement, tags.ToArray()));
}
});
@@ -156,7 +156,7 @@ public class LedgerMetricsTests
public void DbConnectionsGauge_TracksRoleCounts()
{
using var listener = CreateListener();
var measurements = new List<Measurement<long>>();
var measurements = new List<(long Value, KeyValuePair<string, object?>[] Tags)>();
// Reset
LedgerMetrics.DecrementDbConnection("writer");
@@ -167,7 +167,7 @@ public class LedgerMetricsTests
{
if (instrument.Name == "ledger_db_connections_active")
{
measurements.Add(measurement);
measurements.Add((measurement, tags.ToArray()));
}
});
@@ -185,13 +185,13 @@ public class LedgerMetricsTests
public void VersionInfoGauge_EmitsConstantOne()
{
using var listener = CreateListener();
var measurements = new List<Measurement<long>>();
var measurements = new List<(long Value, KeyValuePair<string, object?>[] Tags)>();
listener.SetMeasurementEventCallback<long>((instrument, measurement, tags, state) =>
{
if (instrument.Name == "ledger_app_version_info")
{
measurements.Add(measurement);
measurements.Add((measurement, tags.ToArray()));
}
});