Commit Graph

309 Commits

Author SHA1 Message Date
Joseph Doherty
2816e8f048 feat(storage): rewrite FileStore to use block-based MsgBlock storage
Replace JSONL persistence with real MsgBlock-based block files (.blk).
FileStore now acts as a block manager that creates, seals, and rotates
MsgBlocks while maintaining an in-memory cache for fast reads/queries.

Key changes:
- AppendAsync writes transformed payloads to MsgBlock via WriteAt
- Block rotation occurs when active block reaches size limit
- Recovery scans .blk files and rebuilds in-memory state from records
- Legacy JSONL migration: existing messages.jsonl data is automatically
  converted to block files on first open, then JSONL is deleted
- PurgeAsync disposes and deletes all block files
- RewriteBlocks rebuilds blocks from cache (used by trim/restore)
- InvalidDataException propagates during recovery (wrong encryption key)

MsgBlock.WriteAt added to support explicit sequence numbers and timestamps,
needed when rewriting blocks with non-contiguous sequences (after removes).

Tests updated:
- New FileStoreBlockTests.cs with 9 tests for block-specific behavior
- JetStreamFileStoreCompressionEncryptionParityTests updated to read
  FSV1 magic from .blk files instead of messages.jsonl
- JetStreamFileStoreDurabilityParityTests updated to verify .blk files
  instead of index.manifest.json

All 3,562 tests pass (3,535 passed + 27 skipped, 0 failures).
2026-02-24 12:39:32 -05:00
Joseph Doherty
09252b8c79 feat(storage): add MsgBlock block-based message storage unit
MsgBlock is the unit of storage in the file store — a single append-only
block file containing sequentially written binary message records. Blocks
are sealed (read-only) when they reach a configurable byte-size limit.

Key features:
- Write: appends MessageRecord-encoded messages with auto-incrementing
  sequence numbers and configurable first sequence offset
- Read: positional I/O via RandomAccess.Read for concurrent reader safety
- Delete: soft-delete with on-disk persistence (re-encodes flags byte +
  checksum so deletions survive recovery)
- Recovery: rebuilds in-memory index by scanning block file using
  MessageRecord.MeasureRecord for record boundary detection
- Thread safety: ReaderWriterLockSlim allows concurrent reads during writes

Also adds MessageRecord.MeasureRecord() — computes a record's byte length
by parsing varint field headers without full decode, needed for sequential
record scanning during block recovery.

Reference: golang/nats-server/server/filestore.go:217-267 (msgBlock struct)

12 tests covering write, read, delete, seal, recovery, concurrency,
and custom sequence offsets.
2026-02-24 12:21:33 -05:00
Joseph Doherty
17731e2af5 feat(storage): add binary message record encoding (Go parity)
Add MessageRecord class with Encode/Decode for the binary wire format
used in JetStream file store blocks. Uses varint-encoded lengths,
XxHash64 checksums, and a flags byte for deletion markers.

Go reference: filestore.go:6720-6724, 8180-8250, 8770-8777

13 tests covering round-trip, headers, checksum validation, corruption
detection, varint encoding, deleted flag, empty/large payloads.
2026-02-24 12:12:15 -05:00
Joseph Doherty
2a240c6355 docs: add implementation plan for all 15 structure gaps
50 tasks across 5 parallel tracks (A-E) with full TDD steps,
Go reference citations, file paths, and test_parity.db update
protocol. Task persistence file for session resumption.
2026-02-24 12:05:22 -05:00
Joseph Doherty
f1e42f1b5f docs: add full Go parity design for all 15 structure gaps
5-track parallel architecture (Storage, Consensus, Protocol,
Networking, Services) covering all CRITICAL/HIGH/MEDIUM gaps
identified in structuregaps.md. Feature-first approach with
test_parity.db updates. Targets ~1,194 additional Go test mappings.
2026-02-24 11:57:15 -05:00
Joseph Doherty
0a9db430d5 docs: add test_mappings table with FK relationships
Many-to-many mapping between go_tests and dotnet_tests via
test_mappings table. 988 mappings linking 857 Go tests to
690 .NET tests. Confidence levels: exact, comment_ref, keyword,
manual, auto.
2026-02-24 10:14:58 -05:00
Joseph Doherty
bff24d29c7 docs: add SQLite parity tracking database
test_parity.db contains go_tests (2,937 rows) and dotnet_tests
(2,966 rows) tables for querying Go-to-.NET test mapping across
Claude sessions. 857 mapped, 2,080 unmapped.
2026-02-24 10:12:42 -05:00
Joseph Doherty
0dc2b38415 docs: add Go-to-.NET gap analysis and test mapping
Research documents covering implementation gaps (structuregaps.md)
and full test function mapping (testmapping.md + CSV files) between
the Go NATS server and .NET port. 857/2937 Go tests mapped (29.2%),
2080 unmatched, 2966 .NET-only tests.
2026-02-24 10:07:29 -05:00
Joseph Doherty
1743cfc550 merge: integrate full Go parity worktree — 3,501 tests passing
Phase 1: RAFT wire format, NatsRaftTransport, JetStreamService orchestrator,
FileStore S2 compression + AEAD encryption (IronSnappy, ChaCha20/AesGcm)

Phase 2: JetStream cluster fixture + 5 cluster test suites (316 tests),
JetStream core tests (110), FileStore permutation tests (120)

Phase 3: Stress/NoRace (55), Accounts/Auth (37), Message Trace (23),
Config/Reload (40), Events (16)

Total: 895 new tests added (2,606 → 3,501)
2026-02-24 09:27:29 -05:00
Joseph Doherty
c881bf1ed8 docs: mark all 17 tasks completed in task persistence file 2026-02-24 09:25:14 -05:00
Joseph Doherty
99058350c0 feat: add stress/NoRace tests for concurrent operations (Go parity)
Adds 55 new tests across three files in a new Stress/ directory,
covering concurrent pub/sub SubList thread safety, slow consumer
detection under real NatsServer connections, and clustered JetStream
operations under concurrency. All tests carry [Trait("Category",
"Stress")] for selective execution. Go ref: norace_1_test.go,
norace_2_test.go.
2026-02-24 09:15:17 -05:00
Joseph Doherty
fde1710eb0 feat: add auth callout and account limit tests (Go parity)
Adds 37 tests in AuthCalloutTests.cs covering auth callout handler
registration/invocation, timeout, account assignment, max-connections
and max-subscriptions enforcement, user revocation (including wildcard
revocation), and cross-account service import/export communication.
2026-02-24 09:05:28 -05:00
Joseph Doherty
9317b92a9c feat: add message trace tests (Go parity)
23 tests covering MessageTraceContext population, NatsHeaderParser trace
header parsing, HPUB/HMSG Nats-Trace-Dest header propagation through
plain/wildcard/queue-group subscriptions, and server trace option
defaults. References golang/nats-server/server/msgtrace_test.go.
2026-02-24 09:03:05 -05:00
Joseph Doherty
51e47fbe67 feat: add server event and advisory tests (Go parity)
16 tests in tests/NATS.Server.Tests/Events/ServerEventTests.cs covering
server lifecycle stats, account stats isolation, slow consumer / stale
connection counters, JetStream API counters, EventSubjects format
validation, InternalEventSystem sequence generation, and
BuildEventServerInfo identity. References events_test.go.
2026-02-24 09:00:01 -05:00
Joseph Doherty
ec1a9295f9 feat: add advanced config/reload tests (Go parity)
Ports 40 tests from Go's opts_test.go and reload_test.go covering:
NatsOptions defaults, ConfigProcessor parsing round-trips,
ConfigReloader diff/validate semantics, CLI override precedence,
and runtime reload rejection of host/cluster/JetStream changes.
2026-02-24 08:58:24 -05:00
Joseph Doherty
163667bbe2 feat: add JetStream cluster consumer replication tests (Go parity)
Add 60 tests in JsClusterConsumerReplicationTests covering consumer
creation, fetch/delivery, ack tracking, leader failover, state
consistency, and edge cases. Ported from Go jetstream_cluster_2_test.go.
2026-02-24 08:39:32 -05:00
Joseph Doherty
3862f009ba feat: add JetStream cluster meta-cluster governance tests (Go parity) 2026-02-24 07:54:00 -05:00
Joseph Doherty
c33e5e3009 feat: add JetStream cluster advanced and long-running tests (Go parity)
Adds two new test files covering Task 10 of the full Go parity plan:

JsClusterAdvancedTests.cs (27 tests):
- Large 7-node cluster with R5 stream
- Stream with 20+ subjects and wildcard '>' subject
- 1000-message publish to R3 and R1 streams
- Stream state accuracy after 1000 messages
- 10 streams with mixed replica counts
- Create/publish/delete/recreate cycle (3x)
- Consumer on 1000-message stream with batch fetch
- AckAll for all 1000 messages
- Stream info consistency after 50 interleaved ops
- Meta state after creating and deleting 10 streams
- 5 independent consumers with correct pending counts
- Consumer with wildcard filter subject
- Stream update adding subjects after publishes
- Stream purge then republish
- Fetch empty after purge
- Stream delete cascades consumer removal
- Node removal preserves data reads
- Node restart lifecycle markers
- Leader stepdown with monotonic sequence verification
- Stream info after stepdown with 1000 messages

JsClusterLongRunningTests.cs (15 tests, [Trait("Category", "LongRunning")]):
- 5000 messages in R3 stream maintain consistency
- 100 sequential fetches of 50 messages each
- 50 consumers on same stream all see all messages
- 20 streams in 5-node cluster all independent
- Publish-ack-fetch cycle 100 times
- 10 stepdowns during continuous publishing
- Alternating publish and stepdown (20 iterations)
- Create-publish-delete 20 streams sequentially
- Consumer ack tracking after 10 leader failovers
- Fetch with batch=1 iterated 500 times
- Mixed operations across 5 streams
- Rapid meta stepdowns (20) with version verification
- 10000 small messages in R1 stream
- Stream with max_messages=100 enforces limit after 1000 publishes
- Consumer on max-messages stream tracks correct pending

All 42 tests pass (27 advanced + 15 long-running).
2026-02-24 07:53:50 -05:00
Joseph Doherty
5a22fd3213 feat: add JetStream cluster stream replication and placement tests (Go parity)
Adds 97 tests across two new files covering stream replication semantics
(R1/R3 creation, replica group size, publish preservation, state accuracy,
purge, update, delete, max limits, subjects, wildcards, storage type) and
placement semantics (replica caps at cluster size, various cluster sizes,
concurrent creation, stepdown resilience, long names, re-create after delete).
2026-02-24 07:53:28 -05:00
Joseph Doherty
4fa0be2281 feat: add JetStreamClusterFixture for multi-node cluster tests (Go parity)
Adds a unified JetStreamClusterFixture consolidating the capabilities of all 7
per-suite fixtures (ClusterFormationFixture, ClusterStreamFixture, LeaderFailoverFixture, etc.)
into a single reusable helper for Tasks 6-10. Includes new Go-parity helpers
(WaitOnStreamLeaderAsync, WaitOnConsumerLeaderAsync, GetConsumerLeaderId,
StepDownMetaLeader, SimulateNodeRestart, RemoveNode) matching jetstream_helpers_test.go.
27 smoke tests verify all capabilities pass.
2026-02-24 07:36:32 -05:00
Joseph Doherty
543b791cb5 feat: port remaining JetStream core tests from Go (edge cases, preconditions, direct get)
Adds 110 new tests across 5 files covering gaps identified from Go's jetstream_test.go:

- JetStreamStreamEdgeCaseTests (29 tests): max msgs/bytes enforcement, discard
  old/new policies, max msg size, max msgs per subject, sealed/deny-delete/deny-purge
  config, work queue and interest retention, state tracking, CRUD edges.

- JetStreamConsumerDeliveryEdgeTests (25 tests): AckProcessor unit tests (register,
  drop, ack floor, expiry, redelivery), push consumer heartbeat/flow-control frames,
  pull fetch no-wait, batch limit, filter delivery, wildcard filter, ack explicit
  pending tracking, ack-all clearing, work queue pull consumer.

- JetStreamPublishPreconditionTests (21 tests): expected-last-seq match/mismatch,
  duplicate window dedup acceptance/rejection, window expiry allows re-publish,
  PublishPreconditions unit tests (IsDuplicate, Record, TrimOlderThan,
  CheckExpectedLastSeq), pub ack stream/seq fields, sequential writes enforcement.

- JetStreamAccountLimitTests (17 tests): max streams per account (1/3/unlimited),
  slot freed on delete, Account.TryReserveStream/ReleaseStream unit tests,
  JetStreamStreamCount tracking, account info stream/consumer counts, stream names
  sorted, consumer names list, error code 10027 on limit exceeded.

- JetStreamDirectGetTests (18 tests): direct get by sequence (first/middle/last),
  subject preservation, non-existent sequence error, empty stream error, zero seq
  error, multiple independent retrieves, STREAM.MSG.GET API, get-after-delete,
  get-after-purge, memory storage, backend type reporting, consistency between
  direct get and stream msg get.

Go reference: golang/nats-server/server/jetstream_test.go
2026-02-24 06:47:17 -05:00
Joseph Doherty
3e972f217e feat: add FileStore 6-way permutation tests (Go testFileStoreAllPermutations parity)
Port 20 tests across the {NoCipher, ChaCha, Aes} x {NoCompression, S2Compression}
matrix from Go's testFileStoreAllPermutations (filestore_test.go:55), yielding 120
total Theory executions in FileStorePermutationTests.cs.

Also fix PushFrame.Subject property missing compilation error that was blocking
the test build (JetStreamConsumerDeliveryEdgeTests.cs:119).

Tests covered (each runs 6x):
  Store_and_load_basic                       TestFileStoreBasics:86
  Store_multiple_messages_load_by_sequence   TestFileStoreBasics:86
  LoadLastBySubject_returns_most_recent_for_subject
  Remove_single_message_updates_state        TestFileStoreBasics:129
  Purge_clears_all_messages                  TestFileStorePurge:710
  TrimToMaxMessages_enforces_limit           TestFileStoreMsgLimitBug:518
  Block_rotation_when_exceeding_block_size   TestFileStoreAndRetrieveMultiBlock:1527
  GetState_returns_correct_counts            TestFileStoreBasics:104
  Snapshot_and_restore_round_trip            TestFileStoreSnapshot:1799
  ListAsync_returns_ordered_messages         TestFileStoreTimeStamps:683
  MaxAge_prunes_expired_messages             TestFileStoreAgeLimit:616
  Recovery_after_reopen_preserves_messages   TestFileStoreBasicWriteMsgsAndRestore:181
  Large_payload_store_and_load               64 KiB random payload variant
  Multiple_subjects_filter_by_subject        TestFileStoreBasics multi-subject
  Sequential_writes_maintain_ordering        TestFileStoreSelectNextFirst:304
  Store_creates_files_on_disk                disk-presence variant
  Write_and_read_same_block                  TestFileStoreWriteAndReadSameBlock:1510
  Stored_messages_have_non_decreasing_timestamps TestFileStoreTimeStamps:683
  Remove_out_of_order_collapses_first_seq    TestFileStoreCollapseDmap:1561
  Snapshot_after_removes_preserves_remaining TestFileStoreSnapshot:1904
2026-02-24 06:43:48 -05:00
Joseph Doherty
6bcd682b76 feat: add NatsRaftTransport with NATS subject routing ($NRG.*)
Implements RaftSubjects static class with Go's $NRG.* subject constants
and NatsRaftTransport which routes RAFT RPCs over those subjects using
RaftAppendEntryWire / RaftVoteRequestWire encoding. 43 tests cover all
subject patterns, wire encoding fidelity, and transport construction.
2026-02-24 06:40:41 -05:00
Joseph Doherty
9cc9888bb4 feat: add S2 compression and AEAD encryption for FileStore (Go parity)
Replace Deflate+XOR with IronSnappy S2 block compression and ChaCha20-Poly1305 / AES-256-GCM
AEAD encryption, matching golang/nats-server/server/filestore.go. Introduces FSV2 envelope
format alongside existing FSV1 for backward compatibility. Adds 55 new tests across
S2CodecTests, AeadEncryptorTests, and FileStoreV2Tests covering all 6 cipher×compression
permutations, tamper detection, and legacy format round-trips.
2026-02-24 06:29:34 -05:00
Joseph Doherty
2c9683e7aa feat: upgrade JetStreamService to lifecycle orchestrator
Implements enableJetStream() semantics from golang/nats-server/server/jetstream.go:414-523.

- JetStreamService.StartAsync(): validates config, creates store directory
  (including nested paths via Directory.CreateDirectory), registers all
  $JS.API.> subjects, logs startup stats; idempotent on double-start
- JetStreamService.DisposeAsync(): clears registered subjects, marks not running
- New properties: RegisteredApiSubjects, MaxStreams, MaxConsumers, MaxMemory, MaxStore
- JetStreamOptions: adds MaxStreams and MaxConsumers limits (0 = unlimited)
- FileStoreConfig: removes duplicate StoreCipher/StoreCompression enum declarations
  now that AeadEncryptor.cs owns them; updates defaults to NoCipher/NoCompression
- FileStoreOptions/FileStore: align enum member names with AeadEncryptor.cs
  (NoCipher, NoCompression, S2Compression) to fix cross-task naming conflict
- 13 new tests in JetStreamServiceOrchestrationTests covering all lifecycle paths
2026-02-24 06:03:46 -05:00
Joseph Doherty
14019d4c58 docs: add full Go parity implementation plan (17 tasks, 3 phases)
Phase 1: RAFT transport, JetStream orchestration, FileStore S2/AEAD
Phase 2: JetStream cluster tests (~360), core tests (~100), FileStore (~100)
Phase 3: Stress, accounts/auth, message trace, config/reload, events
Target: 3,100+ tests from current 2,606
2026-02-24 05:42:29 -05:00
Joseph Doherty
0b349f8ecf docs: add full Go parity design
Bottom-up layered approach: implementation gaps first (RAFT transport,
JetStream orchestration, FileStore S2/crypto), then test ports across
3 phases targeting ~445 new tests for full Go behavioral parity.
2026-02-24 05:35:13 -05:00
Joseph Doherty
116307f7e5 merge: integrate full production parity worktree — 2,606 tests passing
25-task plan fully executed across 6 waves:
- Wave 0: Scaffolding and namespace setup
- Wave 2: Internal data structures (AVL, ART, GSL, THW)
- Wave 5: Storage interfaces (StreamStore/ConsumerStore)
- Waves 3-5: FileStore (160 tests), RAFT (100 tests), JetStream clustering (70 tests), concurrency stress (30 tests)
- Wave 6 batch 1: Monitoring, config reload, client protocol, MQTT, leaf nodes
- Wave 6 batch 2: Accounts/auth, gateways, routes, JetStream API, JetStream cluster
2026-02-24 04:54:59 -05:00
Joseph Doherty
cf83148f5e docs: mark all 25 tasks completed in task persistence file
All tasks from the full production parity plan are now complete.
Final test suite: 2,606 passing, 0 failures, 27 skipped.
2026-02-23 22:56:14 -05:00
Joseph Doherty
3ff801865a feat: Waves 3-5 — FileStore, RAFT, JetStream clustering, and concurrency tests
Add comprehensive Go-parity test coverage across 3 subsystems:
- FileStore: basic CRUD, limits, purge, recovery, subjects, encryption,
  compression, MemStore (161 tests, 24 skipped for not-yet-implemented)
- RAFT: core types, wire format, election, log replication, snapshots
  (95 tests)
- JetStream Clustering: meta controller, stream/consumer replica groups,
  concurrency stress tests (90 tests)

Total: ~346 new test annotations across 17 files (+7,557 lines)
Full suite: 2,606 passing, 0 failures, 27 skipped
2026-02-23 22:55:41 -05:00
Joseph Doherty
f1353868af feat: Wave 6 batch 2 — accounts/auth, gateways, routes, JetStream API, JetStream cluster tests
Add comprehensive Go-parity test coverage across 5 subsystems:
- Accounts/Auth: isolation, import/export, auth mechanisms, permissions (82 tests)
- Gateways: connection, forwarding, interest mode, config (106 tests)
- Routes: connection, subscription, forwarding, config validation (78 tests)
- JetStream API: stream/consumer CRUD, pub/sub, features, admin (234 tests)
- JetStream Cluster: streams, consumers, failover, meta (108 tests)

Total: ~608 new test annotations across 22 files (+13,844 lines)
All tests pass individually; suite total: 2,283 passing, 3 skipped
2026-02-23 22:35:06 -05:00
Joseph Doherty
9554d53bf5 feat: Wave 6 batch 1 — monitoring, config reload, client protocol, MQTT, leaf node tests
Port 405 new test methods across 5 subsystems for Go parity:
- Monitoring: 102 tests (varz, connz, routez, subsz, stacksz)
- Leaf Nodes: 85 tests (connection, forwarding, loop detection, subject filter, JetStream)
- MQTT Bridge: 86 tests (advanced, auth, retained messages, topic mapping, will messages)
- Client Protocol: 73 tests (connection handling, protocol violations, limits)
- Config Reload: 59 tests (hot reload, option changes, permission updates)

Total: 1,678 tests passing, 0 failures, 3 skipped
2026-02-23 21:40:29 -05:00
Joseph Doherty
921554f410 feat: define StreamStore/ConsumerStore interfaces from Go store.go
Port IStreamStore, IConsumerStore, StoreMsg, StreamState, SimpleState,
ConsumerState, FileStoreConfig, StoreCipher, StoreCompression types.
Rename Models.StreamState → ApiStreamState to avoid namespace conflict.
2026-02-23 21:06:16 -05:00
Joseph Doherty
256daad8e5 feat: port internal data structures from Go (Wave 2)
- AVL SequenceSet: sparse sequence set with AVL tree, 16 tests
- Subject Tree: Adaptive Radix Tree (ART) with 5 node tiers, 59 tests
- Generic Subject List: trie-based subject matcher, 21 tests
- Time Hash Wheel: O(1) TTL expiration wheel, 8 tests

Total: 106 new tests (1,081 → 1,187 passing)
2026-02-23 20:56:20 -05:00
Joseph Doherty
636906f545 feat: scaffold namespaces for data structures, FileStore, and RAFT
Add stub source files for Internal/Avl, Internal/SubjectTree, Internal/Gsl,
Internal/TimeHashWheel, Raft/RaftState, and Raft/IRaftNode, plus empty test
directories for all new namespaces and a Concurrency suite directory.
2026-02-23 20:42:42 -05:00
Joseph Doherty
4a4d27c878 docs: add full production parity implementation plan
25 tasks across 6 waves targeting ~1,415 new tests:
- Wave 2: Internal data structures (AVL, SubjectTree, GSL, TimeHashWheel)
- Wave 3: FileStore block engine with 160 tests
- Wave 4: RAFT consensus (election, replication, snapshots, membership)
- Wave 5: JetStream clustering + NORACE concurrency
- Wave 6: Remaining subsystem test suites (config, MQTT, leaf, accounts,
  gateway, routes, monitoring, client, JetStream API/cluster)
2026-02-23 20:40:33 -05:00
Joseph Doherty
d445a9fae1 docs: add full production parity design
6-wave implementation plan covering RAFT consensus, FileStore block
engine, internal data structures, JetStream clustering, and remaining
subsystem test suites. Targets ~1,160 new tests for ~75% Go parity.
2026-02-23 20:31:57 -05:00
Joseph Doherty
08cedefa5c merge: integrate go-dotnet-test-parity — 212 new tests across 4 phases
Phase A: Foundation (64 tests) — client pub/sub, parser, sublist, routes,
gateways, leafnodes, accounts, server config
Phase B: Distributed Substrate (39 tests) — filestore, memstore, RAFT,
config reload, monitoring endpoints
Phase C: JetStream Depth (34 tests) — stream lifecycle, publish/ack,
consumer delivery, retention, API, cluster, failover
Phase D: Protocol Surfaces (75 tests) — MQTT packet parsing, QoS/session,
JWT claim edge cases

Total: 1081 tests passing, 0 failures.
2026-02-23 20:08:07 -05:00
Joseph Doherty
553483b6ba feat: phase D protocol surfaces test parity — 75 new tests across MQTT and JWT
MQTT packet parsing (41 tests), QoS/session delivery (8 tests),
and JWT claim edge cases (43 new tests). All 4 phases complete.
1081 total tests passing, 0 failures.
2026-02-23 20:06:54 -05:00
Joseph Doherty
61b1a00800 feat: phase C jetstream depth test parity — 34 new tests across 7 subsystems
Stream lifecycle, publish/ack, consumer delivery, retention policy,
API endpoints, cluster formation, and leader failover tests ported
from Go nats-server reference. 1006 total tests passing.
2026-02-23 19:55:31 -05:00
Joseph Doherty
28d379e6b7 feat: phase B distributed substrate test parity — 39 new tests across 5 subsystems
FileStore basics (4), MemStore/retention (10), RAFT election/append (16),
config reload parity (3), monitoring endpoints varz/connz/healthz (6).
972 total tests passing, 0 failures.
2026-02-23 19:41:30 -05:00
Joseph Doherty
7ffee8741f feat: phase A foundation test parity — 64 new tests across 11 subsystems
Port Go NATS server test behaviors to .NET:
- Client pub/sub (5 tests): simple, no-echo, reply, queue distribution, empty body
- Client UNSUB (4 tests): unsub, auto-unsub max, unsub after auto, disconnect cleanup
- Client headers (3 tests): HPUB/HMSG, server info headers, no-responders 503
- Client lifecycle (3 tests): connect proto, max subscriptions, auth timeout
- Client slow consumer (1 test): pending limit detection and disconnect
- Parser edge cases (3 tests + 2 bug fixes): PUB arg variations, malformed protocol, max control line
- SubList concurrency (13 tests): race on remove/insert/match, large lists, invalid subjects, wildcards
- Server config (4 tests): ephemeral port, server name, name defaults, lame duck
- Route config (3 tests): cluster formation, cross-cluster messaging, reconnect
- Gateway basic (2 tests): cross-cluster forwarding, no echo to origin
- Leaf node basic (2 tests): hub-to-spoke and spoke-to-hub forwarding
- Account import/export (2 tests): stream export/import delivery, isolation

Also fixes NatsParser.ParseSub/ParseUnsub to throw ProtocolViolationException
for short command lines instead of ArgumentOutOfRangeException.

Full suite: 933 passed, 0 failed (up from 869).
2026-02-23 19:26:30 -05:00
Joseph Doherty
36847b732d docs: add go-to-dotnet test parity implementation plan (30 tasks, 4 phases)
30-task plan across 4 gated phases:
- Phase A (Foundation): Client, Parser, SubList, Server, Routes, Gateways, Leaf Nodes, Accounts
- Phase B (Distributed Substrate): RAFT, Storage, Config/Reload, Monitoring
- Phase C (JetStream Depth): Core, Clustering
- Phase D (Protocol Surfaces): MQTT, JWT

Includes concrete test code, TDD steps, and task dependency tracking.
2026-02-23 17:36:07 -05:00
Joseph Doherty
f6fab376ad docs: add go-to-dotnet systematic test parity design
Systematic mapping of 3,451 Go test functions against .NET port
reveals ~18% coverage. Design defines 4-phase hybrid dependency-first
approach: Foundation (client/routing/sublist) -> Distributed substrate
(RAFT/storage) -> JetStream depth -> Protocol surfaces (MQTT/JWT).
2026-02-23 17:24:57 -05:00
Joseph Doherty
0684ca4861 docs: add post-strict full go parity plan 2026-02-23 17:01:29 -05:00
Joseph Doherty
b88cad96e8 docs: add post-strict full go parity design 2026-02-23 16:59:29 -05:00
Joseph Doherty
560b9332d5 merge: integrate strict full go parity worktree 2026-02-23 16:31:21 -05:00
Joseph Doherty
081ff1b0db docs: synchronize strict full go parity evidence and status 2026-02-23 15:03:35 -05:00
Joseph Doherty
1c0fc8fc11 feat: add runtime profiling parity and close config runtime drift 2026-02-23 14:56:27 -05:00
Joseph Doherty
148ff9ebb6 feat: implement jetstream governance runtime parity semantics 2026-02-23 14:54:30 -05:00