diff --git a/docs/plans/2026-02-23-nats-strict-full-go-parity-map.md b/docs/plans/2026-02-23-nats-strict-full-go-parity-map.md new file mode 100644 index 0000000..96c7b9f --- /dev/null +++ b/docs/plans/2026-02-23-nats-strict-full-go-parity-map.md @@ -0,0 +1,19 @@ +# NATS Strict Full Go Parity Map + +| Capability | Behavior | Tests | Docs | +| --- | --- | --- | --- | +| Strict capability inventory guardrail | done | done | closed | +| Account-scoped remote delivery | open | open | open | +| Idempotent inter-server interest propagation | open | open | open | +| Gateway reply remap and leaf loop-marker transparency | open | open | open | +| MQTT packet-level parser and writer | open | open | open | +| MQTT session and QoS acknowledgement runtime | open | open | open | +| MQTT auth/TLS/keepalive integration | open | open | open | +| JetStream retention runtime semantics | open | open | open | +| JetStream consumer ack/backoff/replay/flow state machine | open | open | open | +| JetStream mirror/source runtime semantics | open | open | open | +| FileStore durable invariants and recovery contract | open | open | open | +| RAFT quorum/next-index/snapshot/membership semantics | open | open | open | +| JetStream meta/replica governance contracts | open | open | open | +| Runtime profiling and config option drift closure | open | open | open | +| Differences and parity-map synchronization | open | open | open | diff --git a/tests/NATS.Server.Tests/Parity/NatsCapabilityInventory.cs b/tests/NATS.Server.Tests/Parity/NatsCapabilityInventory.cs new file mode 100644 index 0000000..12f704a --- /dev/null +++ b/tests/NATS.Server.Tests/Parity/NatsCapabilityInventory.cs @@ -0,0 +1,52 @@ +namespace NATS.Server.Tests.Parity; + +public sealed record CapabilityRow(string Capability, string Behavior, string Tests, string Docs); + +public sealed class NatsCapabilityInventoryReport +{ + public NatsCapabilityInventoryReport(IReadOnlyList rows) + { + Rows = rows; + } + + public IReadOnlyList Rows { get; } + + public IReadOnlyList InvalidRows => Rows + .Where(r => !IsDone(r.Behavior) && IsClosed(r.Docs)) + .Concat(Rows.Where(r => !IsDone(r.Tests) && IsClosed(r.Docs))) + .Distinct() + .ToArray(); + + private static bool IsDone(string status) => string.Equals(status, "done", StringComparison.OrdinalIgnoreCase); + private static bool IsClosed(string status) => string.Equals(status, "closed", StringComparison.OrdinalIgnoreCase); +} + +public static class NatsCapabilityInventory +{ + public static NatsCapabilityInventoryReport Load(string relativePath) + { + var repositoryRoot = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "..")); + var mapPath = Path.Combine(repositoryRoot, relativePath); + File.Exists(mapPath).ShouldBeTrue(); + + var rows = new List(); + foreach (var rawLine in File.ReadLines(mapPath)) + { + var line = rawLine.Trim(); + if (!line.StartsWith("|", StringComparison.Ordinal) || line.Contains("---", StringComparison.Ordinal)) + continue; + + var cells = line.Trim('|').Split('|').Select(static c => c.Trim()).ToArray(); + if (cells.Length < 4 || string.Equals(cells[0], "Capability", StringComparison.OrdinalIgnoreCase)) + continue; + + rows.Add(new CapabilityRow( + cells[0], + cells[1], + cells[2], + cells[3])); + } + + return new NatsCapabilityInventoryReport(rows); + } +} diff --git a/tests/NATS.Server.Tests/Parity/NatsStrictCapabilityInventoryTests.cs b/tests/NATS.Server.Tests/Parity/NatsStrictCapabilityInventoryTests.cs new file mode 100644 index 0000000..d2905a1 --- /dev/null +++ b/tests/NATS.Server.Tests/Parity/NatsStrictCapabilityInventoryTests.cs @@ -0,0 +1,12 @@ +namespace NATS.Server.Tests.Parity; + +public class NatsStrictCapabilityInventoryTests +{ + [Fact] + public void Strict_capability_inventory_has_no_open_items_marked_done_without_behavior_and_tests() + { + var report = NatsCapabilityInventory.Load( + "docs/plans/2026-02-23-nats-strict-full-go-parity-map.md"); + report.InvalidRows.ShouldBeEmpty(); + } +}