Commit Graph

466 Commits

Author SHA1 Message Date
Joseph Doherty
5dee4f5fa6 chore: expand .gitignore with standard .NET/Visual Studio entries 2026-02-22 21:15:39 -05:00
Joseph Doherty
2e1e1bb341 fix: resolve slopwatch issues — add logging to empty catches and eliminate test timing delays
Replace empty catch blocks with meaningful log statements in NatsServer,
NatsClient, and Program. Add WaitForReadyAsync() to NatsServer for
deterministic server startup. Replace Task.Delay/Thread.Sleep in tests
with PING/PONG protocol flush and SubscribeCoreAsync for reliable
subscription synchronization.
2026-02-22 21:14:16 -05:00
Joseph Doherty
539b2b7588 feat: add structured logging, Shouldly assertions, CPM, and project documentation
- Add Microsoft.Extensions.Logging + Serilog to NatsServer and NatsClient
- Convert all test assertions from xUnit Assert to Shouldly
- Add NSubstitute package for future mocking needs
- Introduce Central Package Management via Directory.Packages.props
- Add documentation_rules.md with style guide, generation/update rules, component map
- Generate 10 documentation files across 5 component folders (GettingStarted, Protocol, Subscriptions, Server, Configuration/Operations)
- Update CLAUDE.md with logging, testing, porting, agent model, CPM, and documentation guidance
2026-02-22 21:05:53 -05:00
Joseph Doherty
b9f4dec523 docs: update CLAUDE.md with verified build and test commands
Remove template UnitTest1.cs placeholder. Add actual project structure,
run commands for the NATS server host, and update test command examples
to reference the real project paths.
2026-02-22 20:34:42 -05:00
Joseph Doherty
c7fc703d7e feat: add integration tests using NATS.Client.Core NuGet package
Validates the server against the official NATS .NET client library with
tests for basic pub/sub, wildcard (* and >) matching, fan-out to
multiple subscribers, and PING/PONG keepalive. All 5 tests pass without
requiring any server changes.
2026-02-22 20:32:16 -05:00
Joseph Doherty
96e584c382 feat: add NATS.Server.Host console app with basic CLI arguments 2026-02-22 20:29:23 -05:00
Joseph Doherty
1bc6870238 feat: implement NatsServer orchestrator with accept loop and message routing 2026-02-22 20:27:31 -05:00
Joseph Doherty
8db2de37cd feat: implement NatsClient connection handler with read/write pipeline 2026-02-22 20:24:35 -05:00
Joseph Doherty
c78dc67973 feat: implement NATS protocol parser with System.IO.Pipelines
Add NatsParser that reads NATS protocol commands from
ReadOnlySequence<byte>. Identifies commands by first 2 bytes using
case-insensitive bit masking. Handles PUB/HPUB payload reading with
stateful _awaitingPayload for split-packet scenarios. Uses Span<Range>
for zero-allocation argument splitting and ParseSize for ASCII decimal
parsing. Includes CommandType enum, ParsedCommand struct, and
ProtocolViolationException.

14 tests covering PING, PONG, CONNECT, INFO, SUB (with/without queue),
UNSUB (with/without max), PUB (with/without reply, zero payload),
HPUB, multiple commands, and case insensitivity.
2026-02-22 20:19:37 -05:00
Joseph Doherty
bc8fee8e39 fix: address SubList code review findings 2026-02-22 20:14:48 -05:00
Joseph Doherty
afc419ce3f feat: implement SubList trie with wildcard matching and cache 2026-02-22 20:07:35 -05:00
Joseph Doherty
9e36b7c0fc feat: add protocol constants, ServerInfo, ClientOptions, and NatsOptions 2026-02-22 20:00:13 -05:00
Joseph Doherty
270ab27ce3 feat: add Subscription types and subject validation with wildcard matching 2026-02-22 19:53:49 -05:00
Joseph Doherty
05b07407a8 feat: scaffold solution with NATS.Server library, host, and test projects 2026-02-22 19:48:44 -05:00
Joseph Doherty
61824260df feat: add detailed implementation plan for base NATS server port
10 tasks from scaffolding through integration tests, each with
TDD steps, exact file paths, and complete code. Bottom-up order:
SubList → Parser → Client → Server → Integration.
2026-02-22 19:45:53 -05:00
Joseph Doherty
0ea71ace79 Add CLAUDE.md and base server design document
Design covers the minimal NATS server port: pub/sub with wildcards
and queue groups over System.IO.Pipelines, targeting .NET 10.
2026-02-22 19:37:32 -05:00