Add Canonical JSON serialization library with tests and documentation
- Implemented CanonJson class for deterministic JSON serialization and hashing. - Added unit tests for CanonJson functionality, covering various scenarios including key sorting, handling of nested objects, arrays, and special characters. - Created project files for the Canonical JSON library and its tests, including necessary package references. - Added README.md for library usage and API reference. - Introduced RabbitMqIntegrationFactAttribute for conditional RabbitMQ integration tests.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
# Router Sprint Archives
|
||||
|
||||
These sprint plans were deleted on 2025-12-05 during test refactors. They have been restored from commit `53508ceccb2884bd15bf02104e5af48fd570e456` and placed here as archives (do not reactivate without review).
|
||||
|
||||
## Archive Audit Notes (2025-12-19)
|
||||
|
||||
- Task tables in archived sprints were audited against current code/tests and updated where clearly implemented.
|
||||
- Remaining `TODO`/`BLOCKED` rows represent real gaps (mostly missing wiring and/or failing or missing tests).
|
||||
- `SPRINT_INDEX.md` reflects the audit status; “working directory” paths were corrected where the implementation moved into `src/__Libraries/*`.
|
||||
|
||||
@@ -26,27 +26,27 @@ Implement request handling in the Microservice SDK: receiving REQUEST frames, di
|
||||
|
||||
| # | Task ID | Status | Description | Notes |
|
||||
|---|---------|--------|-------------|-------|
|
||||
| 1 | HDL-001 | TODO | Define `IRawStellaEndpoint` interface | Takes RawRequestContext, returns RawResponse |
|
||||
| 2 | HDL-002 | TODO | Define `IStellaEndpoint<TRequest, TResponse>` interface | Typed request/response |
|
||||
| 3 | HDL-003 | TODO | Define `IStellaEndpoint<TResponse>` interface | No request body |
|
||||
| 4 | HDL-010 | TODO | Implement `RawRequestContext` | Method, Path, Headers, Body stream, CancellationToken |
|
||||
| 5 | HDL-011 | TODO | Implement `RawResponse` | StatusCode, Headers, Body stream |
|
||||
| 6 | HDL-012 | TODO | Implement `IHeaderCollection` abstraction | Key-value header access |
|
||||
| 7 | HDL-020 | TODO | Create `IEndpointRegistry` for handler lookup | (Method, Path) → handler instance |
|
||||
| 8 | HDL-021 | TODO | Implement path template matching (ASP.NET-style routes) | Handles `{id}` parameters |
|
||||
| 9 | HDL-022 | TODO | Implement path matching rules (case sensitivity, trailing slash) | Per spec |
|
||||
| 10 | HDL-030 | TODO | Create `TypedEndpointAdapter` to wrap typed handlers as raw | IStellaEndpoint<T,R> → IRawStellaEndpoint |
|
||||
| 11 | HDL-031 | TODO | Implement request deserialization in adapter | JSON by default |
|
||||
| 12 | HDL-032 | TODO | Implement response serialization in adapter | JSON by default |
|
||||
| 13 | HDL-040 | TODO | Implement `RequestDispatcher` | Frame → RawRequestContext → Handler → RawResponse → Frame |
|
||||
| 14 | HDL-041 | TODO | Implement frame-to-context conversion | REQUEST frame → RawRequestContext |
|
||||
| 15 | HDL-042 | TODO | Implement response-to-frame conversion | RawResponse → RESPONSE frame |
|
||||
| 16 | HDL-043 | TODO | Wire dispatcher into connection read loop | Process REQUEST frames |
|
||||
| 17 | HDL-050 | TODO | Implement `IServiceProvider` integration for handler instantiation | DI support |
|
||||
| 18 | HDL-051 | TODO | Implement handler scoping (per-request scope) | IServiceScope per request |
|
||||
| 19 | HDL-060 | TODO | Write unit tests for path matching | Various patterns |
|
||||
| 20 | HDL-061 | TODO | Write unit tests for typed adapter | Serialization round-trip |
|
||||
| 21 | HDL-062 | TODO | Write integration tests for full REQUEST/RESPONSE flow | With InMemory transport |
|
||||
| 1 | HDL-001 | DONE | Define `IRawStellaEndpoint` interface | `src/__Libraries/StellaOps.Microservice/IStellaEndpoint.cs` |
|
||||
| 2 | HDL-002 | DONE | Define `IStellaEndpoint<TRequest, TResponse>` interface | `src/__Libraries/StellaOps.Microservice/IStellaEndpoint.cs` |
|
||||
| 3 | HDL-003 | DONE | Define `IStellaEndpoint<TResponse>` interface | `src/__Libraries/StellaOps.Microservice/IStellaEndpoint.cs` |
|
||||
| 4 | HDL-010 | DONE | Implement `RawRequestContext` | `src/__Libraries/StellaOps.Microservice/RawRequestContext.cs` |
|
||||
| 5 | HDL-011 | DONE | Implement `RawResponse` | `src/__Libraries/StellaOps.Microservice/RawResponse.cs` |
|
||||
| 6 | HDL-012 | DONE | Implement `IHeaderCollection` abstraction | `src/__Libraries/StellaOps.Microservice/IHeaderCollection.cs` |
|
||||
| 7 | HDL-020 | DONE | Create `IEndpointRegistry` for handler lookup | `src/__Libraries/StellaOps.Microservice/EndpointRegistry.cs` |
|
||||
| 8 | HDL-021 | DONE | Implement path template matching (ASP.NET-style routes) | `src/__Libraries/StellaOps.Router.Common/PathMatcher.cs` |
|
||||
| 9 | HDL-022 | DONE | Implement path matching rules (case sensitivity, trailing slash) | `src/__Libraries/StellaOps.Router.Common/PathMatcher.cs` |
|
||||
| 10 | HDL-030 | DONE | Create `TypedEndpointAdapter` to wrap typed handlers as raw | `src/__Libraries/StellaOps.Microservice/TypedEndpointAdapter.cs` |
|
||||
| 11 | HDL-031 | DONE | Implement request deserialization in adapter | `src/__Libraries/StellaOps.Microservice/TypedEndpointAdapter.cs` |
|
||||
| 12 | HDL-032 | DONE | Implement response serialization in adapter | `src/__Libraries/StellaOps.Microservice/TypedEndpointAdapter.cs` |
|
||||
| 13 | HDL-040 | DONE | Implement `RequestDispatcher` | `src/__Libraries/StellaOps.Microservice/RequestDispatcher.cs` |
|
||||
| 14 | HDL-041 | DONE | Implement frame-to-context conversion | `src/__Libraries/StellaOps.Microservice/RequestDispatcher.cs` |
|
||||
| 15 | HDL-042 | DONE | Implement response-to-frame conversion | `src/__Libraries/StellaOps.Microservice/RequestDispatcher.cs` |
|
||||
| 16 | HDL-043 | TODO | Wire dispatcher into transport receive loop | Microservice does not subscribe to `IMicroserviceTransport.OnRequestReceived` |
|
||||
| 17 | HDL-050 | DONE | Implement `IServiceProvider` integration for handler instantiation | `src/__Libraries/StellaOps.Microservice/RequestDispatcher.cs` |
|
||||
| 18 | HDL-051 | DONE | Implement handler scoping (per-request scope) | `CreateAsyncScope()` in `RequestDispatcher` |
|
||||
| 19 | HDL-060 | DONE | Write unit tests for path matching | `tests/StellaOps.Microservice.Tests/EndpointRegistryTests.cs` |
|
||||
| 20 | HDL-061 | DONE | Write unit tests for typed adapter | `tests/StellaOps.Microservice.Tests/TypedEndpointAdapterTests.cs` |
|
||||
| 21 | HDL-062 | TODO | Write integration tests for full REQUEST/RESPONSE flow | Pending: end-to-end InMemory wiring + passing integration tests |
|
||||
|
||||
## Handler Interfaces
|
||||
|
||||
@@ -162,7 +162,7 @@ Before marking this sprint DONE:
|
||||
|
||||
| Date (UTC) | Update | Owner |
|
||||
|------------|--------|-------|
|
||||
| | | |
|
||||
| 2025-12-19 | Archive audit: initial status reconciliation pass. | Planning |
|
||||
|
||||
## Decisions & Risks
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Implement the core infrastructure of the Gateway: node configuration, global rou
|
||||
|
||||
**Goal:** Gateway can maintain routing state from connected microservices and select instances for routing decisions.
|
||||
|
||||
**Working directory:** `src/Gateway/StellaOps.Gateway.WebService/`
|
||||
**Working directory:** `src/__Libraries/StellaOps.Router.Gateway/`
|
||||
|
||||
**Parallel track:** This sprint can run in parallel with Microservice SDK sprints (7000-0003-*) once the InMemory transport is complete.
|
||||
|
||||
@@ -15,7 +15,7 @@ Implement the core infrastructure of the Gateway: node configuration, global rou
|
||||
- **Upstream:** SPRINT_7000_0001_0002 (Common), SPRINT_7000_0002_0001 (InMemory transport)
|
||||
- **Downstream:** SPRINT_7000_0004_0002 (middleware), SPRINT_7000_0004_0003 (connection handling)
|
||||
- **Parallel work:** Can run in parallel with SDK core sprint
|
||||
- **Cross-module impact:** None. All work in `src/Gateway/StellaOps.Gateway.WebService/`
|
||||
- **Cross-module impact:** None. All work in `src/__Libraries/StellaOps.Router.Gateway/`
|
||||
|
||||
## Documentation Prerequisites
|
||||
|
||||
@@ -29,23 +29,23 @@ Implement the core infrastructure of the Gateway: node configuration, global rou
|
||||
|
||||
| # | Task ID | Status | Description | Notes |
|
||||
|---|---------|--------|-------------|-------|
|
||||
| 1 | GW-001 | TODO | Implement `GatewayNodeConfig` | Region, NodeId, Environment |
|
||||
| 2 | GW-002 | TODO | Bind `GatewayNodeConfig` from configuration | appsettings.json section |
|
||||
| 3 | GW-003 | TODO | Validate GatewayNodeConfig on startup | Region required |
|
||||
| 4 | GW-010 | TODO | Implement `IGlobalRoutingState` as `InMemoryRoutingState` | Thread-safe implementation |
|
||||
| 5 | GW-011 | TODO | Implement `ConnectionState` storage | ConcurrentDictionary by ConnectionId |
|
||||
| 6 | GW-012 | TODO | Implement endpoint-to-connections index | (Method, Path) → List<ConnectionState> |
|
||||
| 7 | GW-013 | TODO | Implement `ResolveEndpoint(method, path)` | Path template matching |
|
||||
| 8 | GW-014 | TODO | Implement `GetConnectionsFor(serviceName, version, method, path)` | Filter by criteria |
|
||||
| 9 | GW-020 | TODO | Create `IRoutingPlugin` implementation `DefaultRoutingPlugin` | Basic instance selection |
|
||||
| 10 | GW-021 | TODO | Implement version filtering (strict semver equality) | Per spec |
|
||||
| 11 | GW-022 | TODO | Implement health filtering (Healthy or Degraded only) | Per spec |
|
||||
| 12 | GW-023 | TODO | Implement region preference (gateway region first) | Use GatewayNodeConfig.Region |
|
||||
| 13 | GW-024 | TODO | Implement basic tie-breaking (any healthy instance) | Full algorithm in later sprint |
|
||||
| 14 | GW-030 | TODO | Create `RoutingOptions` for configurable behavior | Default version, neighbor regions |
|
||||
| 15 | GW-031 | TODO | Register routing services in DI | IGlobalRoutingState, IRoutingPlugin |
|
||||
| 16 | GW-040 | TODO | Write unit tests for InMemoryRoutingState | |
|
||||
| 17 | GW-041 | TODO | Write unit tests for DefaultRoutingPlugin | Version, health, region filtering |
|
||||
| 1 | GW-001 | DONE | Implement `GatewayNodeConfig` | Implemented as `RouterNodeConfig` in `src/__Libraries/StellaOps.Router.Gateway/Configuration/RouterNodeConfig.cs` |
|
||||
| 2 | GW-002 | DONE | Bind `GatewayNodeConfig` from configuration | `AddRouterGateway()` binds options in `src/__Libraries/StellaOps.Router.Gateway/DependencyInjection/RouterServiceCollectionExtensions.cs` |
|
||||
| 3 | GW-003 | TODO | Validate GatewayNodeConfig on startup | `RouterNodeConfig.Validate()` exists but is not wired to run on startup |
|
||||
| 4 | GW-010 | DONE | Implement `IGlobalRoutingState` as `InMemoryRoutingState` | `src/__Libraries/StellaOps.Router.Gateway/State/InMemoryRoutingState.cs` |
|
||||
| 5 | GW-011 | DONE | Implement `ConnectionState` storage | `src/__Libraries/StellaOps.Router.Common/Models/ConnectionState.cs` |
|
||||
| 6 | GW-012 | DONE | Implement endpoint-to-connections index | `src/__Libraries/StellaOps.Router.Gateway/State/InMemoryRoutingState.cs` |
|
||||
| 7 | GW-013 | DONE | Implement `ResolveEndpoint(method, path)` | `src/__Libraries/StellaOps.Router.Gateway/State/InMemoryRoutingState.cs` |
|
||||
| 8 | GW-014 | DONE | Implement `GetConnectionsFor(serviceName, version, method, path)` | `src/__Libraries/StellaOps.Router.Gateway/State/InMemoryRoutingState.cs` |
|
||||
| 9 | GW-020 | DONE | Create `IRoutingPlugin` implementation `DefaultRoutingPlugin` | `src/__Libraries/StellaOps.Router.Gateway/Routing/DefaultRoutingPlugin.cs` |
|
||||
| 10 | GW-021 | DONE | Implement version filtering (strict semver equality) | `src/__Libraries/StellaOps.Router.Gateway/Routing/DefaultRoutingPlugin.cs` |
|
||||
| 11 | GW-022 | DONE | Implement health filtering (Healthy or Degraded only) | `src/__Libraries/StellaOps.Router.Gateway/Routing/DefaultRoutingPlugin.cs` |
|
||||
| 12 | GW-023 | DONE | Implement region preference (gateway region first) | `src/__Libraries/StellaOps.Router.Gateway/Routing/DefaultRoutingPlugin.cs` |
|
||||
| 13 | GW-024 | DONE | Implement basic tie-breaking (any healthy instance) | Implemented (ping/heartbeat + random/round-robin) in `src/__Libraries/StellaOps.Router.Gateway/Routing/DefaultRoutingPlugin.cs` |
|
||||
| 14 | GW-030 | DONE | Create `RoutingOptions` for configurable behavior | `src/__Libraries/StellaOps.Router.Gateway/Configuration/RoutingOptions.cs` |
|
||||
| 15 | GW-031 | DONE | Register routing services in DI | `src/__Libraries/StellaOps.Router.Gateway/DependencyInjection/RouterServiceCollectionExtensions.cs` |
|
||||
| 16 | GW-040 | TODO | Write unit tests for InMemoryRoutingState | Not present (no tests cover `InMemoryRoutingState`) |
|
||||
| 17 | GW-041 | TODO | Write unit tests for DefaultRoutingPlugin | Not present (no tests cover `DefaultRoutingPlugin`) |
|
||||
|
||||
## GatewayNodeConfig
|
||||
|
||||
@@ -125,7 +125,7 @@ Before marking this sprint DONE:
|
||||
|
||||
| Date (UTC) | Update | Owner |
|
||||
|------------|--------|-------|
|
||||
| | | |
|
||||
| 2025-12-19 | Archive audit: updated working directory and task statuses based on current `src/__Libraries/StellaOps.Router.Gateway/` implementation. | Planning |
|
||||
|
||||
## Decisions & Risks
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@ Implement the HTTP middleware pipeline for the Gateway: endpoint resolution, aut
|
||||
|
||||
**Goal:** Complete HTTP → transport → microservice → HTTP flow for basic buffered requests.
|
||||
|
||||
**Working directory:** `src/Gateway/StellaOps.Gateway.WebService/`
|
||||
**Working directory:** `src/__Libraries/StellaOps.Router.Gateway/`
|
||||
|
||||
## Dependencies & Concurrency
|
||||
|
||||
- **Upstream:** SPRINT_7000_0004_0001 (Gateway core)
|
||||
- **Downstream:** SPRINT_7000_0004_0003 (connection handling)
|
||||
- **Parallel work:** Can run in parallel with SDK request handling sprint
|
||||
- **Cross-module impact:** None. All work in `src/Gateway/StellaOps.Gateway.WebService/`
|
||||
- **Cross-module impact:** None. All work in `src/__Libraries/StellaOps.Router.Gateway/` (pipeline wiring lives in the host app, e.g. `examples/router/src/Examples.Gateway/`).
|
||||
|
||||
## Documentation Prerequisites
|
||||
|
||||
@@ -26,27 +26,27 @@ Implement the HTTP middleware pipeline for the Gateway: endpoint resolution, aut
|
||||
|
||||
| # | Task ID | Status | Description | Notes |
|
||||
|---|---------|--------|-------------|-------|
|
||||
| 1 | MID-001 | TODO | Create `EndpointResolutionMiddleware` | (Method, Path) → EndpointDescriptor |
|
||||
| 2 | MID-002 | TODO | Store resolved endpoint in `HttpContext.Items` | For downstream middleware |
|
||||
| 3 | MID-003 | TODO | Return 404 if endpoint not found | |
|
||||
| 4 | MID-010 | TODO | Create `AuthorizationMiddleware` stub | Checks authenticated only (full claims later) |
|
||||
| 5 | MID-011 | TODO | Wire ASP.NET Core authentication | Standard middleware order |
|
||||
| 6 | MID-012 | TODO | Return 401/403 for unauthorized requests | |
|
||||
| 7 | MID-020 | TODO | Create `RoutingDecisionMiddleware` | Calls IRoutingPlugin.ChooseInstanceAsync |
|
||||
| 8 | MID-021 | TODO | Store RoutingDecision in `HttpContext.Items` | |
|
||||
| 9 | MID-022 | TODO | Return 503 if no instance available | |
|
||||
| 10 | MID-023 | TODO | Return 504 if routing times out | |
|
||||
| 11 | MID-030 | TODO | Create `TransportDispatchMiddleware` | Dispatches to selected transport |
|
||||
| 12 | MID-031 | TODO | Implement buffered request dispatch | Read entire body, send REQUEST frame |
|
||||
| 13 | MID-032 | TODO | Implement buffered response handling | Read RESPONSE frame, write to HTTP |
|
||||
| 14 | MID-033 | TODO | Map transport errors to HTTP status codes | |
|
||||
| 15 | MID-040 | TODO | Create `GlobalErrorHandlerMiddleware` | Catches unhandled exceptions |
|
||||
| 16 | MID-041 | TODO | Implement structured error responses | JSON error envelope |
|
||||
| 17 | MID-050 | TODO | Create `RequestLoggingMiddleware` | Correlation ID, service, endpoint, region, instance |
|
||||
| 18 | MID-051 | TODO | Wire forwarded headers middleware | For reverse proxy support |
|
||||
| 19 | MID-060 | TODO | Configure middleware pipeline in Program.cs | Correct order |
|
||||
| 20 | MID-070 | TODO | Write integration tests for full HTTP→transport flow | With InMemory transport + SDK |
|
||||
| 21 | MID-071 | TODO | Write tests for error scenarios (404, 503, etc.) | |
|
||||
| 1 | MID-001 | DONE | Create `EndpointResolutionMiddleware` | `src/__Libraries/StellaOps.Router.Gateway/Middleware/EndpointResolutionMiddleware.cs` |
|
||||
| 2 | MID-002 | DONE | Store resolved endpoint in `HttpContext.Items` | `src/__Libraries/StellaOps.Router.Gateway/RouterHttpContextKeys.cs` |
|
||||
| 3 | MID-003 | DONE | Return 404 if endpoint not found | `src/__Libraries/StellaOps.Router.Gateway/Middleware/EndpointResolutionMiddleware.cs` |
|
||||
| 4 | MID-010 | DONE | Create `AuthorizationMiddleware` stub | Implemented as claims-based middleware: `src/__Libraries/StellaOps.Router.Gateway/Authorization/AuthorizationMiddleware.cs` |
|
||||
| 5 | MID-011 | DONE | Wire ASP.NET Core authentication | Host app responsibility; see `examples/router/src/Examples.Gateway/Program.cs` |
|
||||
| 6 | MID-012 | DONE | Return 401/403 for unauthorized requests | 403 in `AuthorizationMiddleware`; 401 comes from auth middleware |
|
||||
| 7 | MID-020 | DONE | Create `RoutingDecisionMiddleware` | `src/__Libraries/StellaOps.Router.Gateway/Middleware/RoutingDecisionMiddleware.cs` |
|
||||
| 8 | MID-021 | DONE | Store RoutingDecision in `HttpContext.Items` | `src/__Libraries/StellaOps.Router.Gateway/RouterHttpContextKeys.cs` |
|
||||
| 9 | MID-022 | DONE | Return 503 if no instance available | `src/__Libraries/StellaOps.Router.Gateway/Middleware/RoutingDecisionMiddleware.cs` |
|
||||
| 10 | MID-023 | DONE | Return 504 if routing times out | Timeouts handled during dispatch in `src/__Libraries/StellaOps.Router.Gateway/Middleware/TransportDispatchMiddleware.cs` |
|
||||
| 11 | MID-030 | DONE | Create `TransportDispatchMiddleware` | `src/__Libraries/StellaOps.Router.Gateway/Middleware/TransportDispatchMiddleware.cs` |
|
||||
| 12 | MID-031 | DONE | Implement buffered request dispatch | `src/__Libraries/StellaOps.Router.Gateway/Middleware/TransportDispatchMiddleware.cs` |
|
||||
| 13 | MID-032 | DONE | Implement buffered response handling | `src/__Libraries/StellaOps.Router.Gateway/Middleware/TransportDispatchMiddleware.cs` |
|
||||
| 14 | MID-033 | DONE | Map transport errors to HTTP status codes | `src/__Libraries/StellaOps.Router.Gateway/Middleware/TransportDispatchMiddleware.cs` |
|
||||
| 15 | MID-040 | TODO | Create `GlobalErrorHandlerMiddleware` | Not implemented (errors handled per-middleware) |
|
||||
| 16 | MID-041 | TODO | Implement structured error responses | Not centralized; responses vary per middleware |
|
||||
| 17 | MID-050 | TODO | Create `RequestLoggingMiddleware` | Not implemented |
|
||||
| 18 | MID-051 | DONE | Wire forwarded headers middleware | Host app responsibility; see `examples/router/src/Examples.Gateway/Program.cs` |
|
||||
| 19 | MID-060 | DONE | Configure middleware pipeline in Program.cs | Host app uses `UseRouterGateway()`; see `examples/router/src/Examples.Gateway/Program.cs` |
|
||||
| 20 | MID-070 | TODO | Write integration tests for full HTTP→transport flow | `examples/router/tests` currently fails to build; end-to-end wiring not validated |
|
||||
| 21 | MID-071 | TODO | Write tests for error scenarios (404, 503, etc.) | Not present |
|
||||
|
||||
## Middleware Pipeline Order
|
||||
|
||||
@@ -162,11 +162,11 @@ Before marking this sprint DONE:
|
||||
|
||||
| Date (UTC) | Update | Owner |
|
||||
|------------|--------|-------|
|
||||
| | | |
|
||||
| 2025-12-19 | Archive audit: updated working directory and task statuses based on current gateway library + examples. | Planning |
|
||||
|
||||
## Decisions & Risks
|
||||
|
||||
- Authorization middleware is a stub that only checks `User.Identity?.IsAuthenticated`; full RequiringClaims enforcement comes in SPRINT_7000_0008_0001
|
||||
- Streaming support is not implemented in this sprint; TransportDispatchMiddleware only handles buffered mode
|
||||
- Authorization is implemented as claims-based middleware (not a stub); see `src/__Libraries/StellaOps.Router.Gateway/Authorization/AuthorizationMiddleware.cs`
|
||||
- TransportDispatchMiddleware supports both buffered and streaming dispatch; see `src/__Libraries/StellaOps.Router.Gateway/Middleware/TransportDispatchMiddleware.cs`
|
||||
- Correlation ID is generated per request and logged throughout
|
||||
- Request body is fully read into memory for buffered mode; streaming in SPRINT_7000_0005_0004
|
||||
|
||||
@@ -6,14 +6,14 @@ Implement connection handling in the Gateway: processing HELLO frames from micro
|
||||
|
||||
**Goal:** Gateway receives HELLO from microservices and maintains live routing state. Combined with previous sprints, this enables full end-to-end HTTP → microservice routing.
|
||||
|
||||
**Working directory:** `src/Gateway/StellaOps.Gateway.WebService/`
|
||||
**Working directory:** `src/__Libraries/StellaOps.Router.Gateway/` + `src/__Libraries/StellaOps.Router.Transport.InMemory/`
|
||||
|
||||
## Dependencies & Concurrency
|
||||
|
||||
- **Upstream:** SPRINT_7000_0004_0002 (middleware), SPRINT_7000_0003_0001 (SDK core with HELLO)
|
||||
- **Downstream:** SPRINT_7000_0005_0001 (heartbeat/health)
|
||||
- **Parallel work:** Should coordinate with SDK team for HELLO frame format agreement
|
||||
- **Cross-module impact:** None. All work in Gateway.
|
||||
- **Cross-module impact:** None. All work in router libraries (`src/__Libraries/StellaOps.Router.Gateway/` + `src/__Libraries/StellaOps.Router.Transport.InMemory/`).
|
||||
|
||||
## Documentation Prerequisites
|
||||
|
||||
@@ -26,23 +26,23 @@ Implement connection handling in the Gateway: processing HELLO frames from micro
|
||||
|
||||
| # | Task ID | Status | Description | Notes |
|
||||
|---|---------|--------|-------------|-------|
|
||||
| 1 | CON-001 | TODO | Create `IConnectionHandler` interface | Processes frames per connection |
|
||||
| 2 | CON-002 | TODO | Implement `ConnectionHandler` | Frame type dispatch |
|
||||
| 3 | CON-010 | TODO | Implement HELLO frame processing | Parse HelloPayload, create ConnectionState |
|
||||
| 4 | CON-011 | TODO | Validate HELLO payload | ServiceName, Version, InstanceId required |
|
||||
| 5 | CON-012 | TODO | Register connection in IGlobalRoutingState | AddConnection |
|
||||
| 6 | CON-013 | TODO | Build endpoint index from HELLO | (Method, Path) → ConnectionId |
|
||||
| 7 | CON-020 | TODO | Create `TransportServerHost` hosted service | Starts ITransportServer |
|
||||
| 8 | CON-021 | TODO | Wire transport server to connection handler | Frame routing |
|
||||
| 9 | CON-022 | TODO | Handle new connections (InMemory: channel registration) | |
|
||||
| 10 | CON-030 | TODO | Implement connection cleanup on disconnect | RemoveConnection from routing state |
|
||||
| 11 | CON-031 | TODO | Clean up endpoint index on disconnect | Remove all endpoints for connection |
|
||||
| 12 | CON-032 | TODO | Log connection lifecycle events | Connect, HELLO, disconnect |
|
||||
| 13 | CON-040 | TODO | Implement connection ID generation | Unique per connection |
|
||||
| 14 | CON-041 | TODO | Store connection metadata | Transport type, connect time |
|
||||
| 15 | CON-050 | TODO | Write integration tests for HELLO flow | SDK → Gateway registration |
|
||||
| 16 | CON-051 | TODO | Write tests for connection cleanup | |
|
||||
| 17 | CON-052 | TODO | Write tests for multiple connections from same service | Different instances |
|
||||
| 1 | CON-001 | DONE | Create `IConnectionHandler` interface | Superseded by event-driven transport handling (no `IConnectionHandler` abstraction) |
|
||||
| 2 | CON-002 | DONE | Implement `ConnectionHandler` | Superseded by `InMemoryTransportServer` frame processing + gateway `ConnectionManager` |
|
||||
| 3 | CON-010 | TODO | Implement HELLO frame processing | InMemory HELLO is handled, but HelloPayload serialization/deserialization is not implemented |
|
||||
| 4 | CON-011 | TODO | Validate HELLO payload | Not implemented (no HelloPayload parsing) |
|
||||
| 5 | CON-012 | DONE | Register connection in IGlobalRoutingState | `src/__Libraries/StellaOps.Router.Gateway/Services/ConnectionManager.cs` |
|
||||
| 6 | CON-013 | TODO | Build endpoint index from HELLO | Requires HelloPayload endpoints to be carried over the transport |
|
||||
| 7 | CON-020 | DONE | Create `TransportServerHost` hosted service | Implemented as gateway `ConnectionManager` hosted service |
|
||||
| 8 | CON-021 | DONE | Wire transport server to connection handler | `ConnectionManager` subscribes to `InMemoryTransportServer` events |
|
||||
| 9 | CON-022 | DONE | Handle new connections (InMemory: channel registration) | Channel created by client; server begins listening after HELLO |
|
||||
| 10 | CON-030 | DONE | Implement connection cleanup on disconnect | `src/__Libraries/StellaOps.Router.Gateway/Services/ConnectionManager.cs` |
|
||||
| 11 | CON-031 | DONE | Clean up endpoint index on disconnect | `src/__Libraries/StellaOps.Router.Gateway/State/InMemoryRoutingState.cs` |
|
||||
| 12 | CON-032 | DONE | Log connection lifecycle events | `src/__Libraries/StellaOps.Router.Gateway/Services/ConnectionManager.cs` + `src/__Libraries/StellaOps.Router.Transport.InMemory/InMemoryTransportServer.cs` |
|
||||
| 13 | CON-040 | DONE | Implement connection ID generation | InMemory client uses GUID connection IDs |
|
||||
| 14 | CON-041 | TODO | Store connection metadata | No explicit connect-time stored (only `LastHeartbeatUtc`, `TransportType`) |
|
||||
| 15 | CON-050 | TODO | Write integration tests for HELLO flow | End-to-end gateway registration not covered by passing tests |
|
||||
| 16 | CON-051 | TODO | Write tests for connection cleanup | Not present |
|
||||
| 17 | CON-052 | TODO | Write tests for multiple connections from same service | Not present |
|
||||
|
||||
## Connection Lifecycle
|
||||
|
||||
@@ -208,11 +208,11 @@ Before marking this sprint DONE:
|
||||
|
||||
| Date (UTC) | Update | Owner |
|
||||
|------------|--------|-------|
|
||||
| | | |
|
||||
| 2025-12-19 | Archive audit: updated working directory and task statuses based on current gateway/in-memory transport implementation. | Planning |
|
||||
|
||||
## Decisions & Risks
|
||||
|
||||
- Initial health status is `Unknown` until first heartbeat
|
||||
- Connection ID format: GUID for InMemory, transport-specific for real transports
|
||||
- HELLO validation failure disconnects the client (logs error)
|
||||
- Duplicate HELLO from same connection replaces existing state (re-registration)
|
||||
- HELLO payload parsing/validation is not implemented (transport currently does not carry HelloPayload)
|
||||
- Duplicate HELLO semantics are not validated by tests
|
||||
|
||||
@@ -28,7 +28,7 @@ Implement the RabbitMQ transport plugin. Uses message queue infrastructure for r
|
||||
|---|---------|--------|-------------|-------|
|
||||
| 1 | RMQ-001 | DONE | Create `StellaOps.Router.Transport.RabbitMq` classlib project | Add to solution |
|
||||
| 2 | RMQ-002 | DONE | Add project reference to Router.Common | |
|
||||
| 3 | RMQ-003 | BLOCKED | Add RabbitMQ.Client NuGet package | Needs package in local-nugets |
|
||||
| 3 | RMQ-003 | DONE | Add RabbitMQ.Client NuGet package | `RabbitMQ.Client` referenced in `src/__Libraries/StellaOps.Router.Transport.RabbitMq/StellaOps.Router.Transport.RabbitMq.csproj` |
|
||||
| 4 | RMQ-010 | DONE | Implement `RabbitMqTransportServer` : `ITransportServer` | Gateway side |
|
||||
| 5 | RMQ-011 | DONE | Implement connection to RabbitMQ broker | |
|
||||
| 6 | RMQ-012 | DONE | Create request queue per gateway node | |
|
||||
@@ -53,8 +53,8 @@ Implement the RabbitMQ transport plugin. Uses message queue infrastructure for r
|
||||
| 25 | RMQ-061 | DONE | Consider at-most-once delivery semantics | Using autoAck=true |
|
||||
| 26 | RMQ-070 | DONE | Create RabbitMqTransportOptions | Connection, queues, durability |
|
||||
| 27 | RMQ-071 | DONE | Create DI registration `AddRabbitMqTransport()` | |
|
||||
| 28 | RMQ-080 | BLOCKED | Write integration tests with local RabbitMQ | Needs package in local-nugets |
|
||||
| 29 | RMQ-081 | BLOCKED | Write tests for connection recovery | Needs package in local-nugets | |
|
||||
| 28 | RMQ-080 | TODO | Write integration tests with local RabbitMQ | Test project exists but currently fails to build (fix pending) |
|
||||
| 29 | RMQ-081 | TODO | Write tests for connection recovery | Test project exists but currently fails to build (fix pending) |
|
||||
|
||||
## Queue/Exchange Topology
|
||||
|
||||
@@ -208,6 +208,7 @@ Before marking this sprint DONE:
|
||||
| Date (UTC) | Update | Owner |
|
||||
|------------|--------|-------|
|
||||
| 2025-12-05 | Code DONE but BLOCKED - RabbitMQ.Client NuGet package not available in local-nugets. Code written: RabbitMqTransportServer, RabbitMqTransportClient, RabbitMqFrameProtocol, RabbitMqTransportOptions, ServiceCollectionExtensions | Claude |
|
||||
| 2025-12-19 | Archive audit: RabbitMQ.Client now referenced and restores; reopened remaining test work as TODO (tests currently failing build). | Planning |
|
||||
|
||||
## Decisions & Risks
|
||||
|
||||
@@ -216,4 +217,4 @@ Before marking this sprint DONE:
|
||||
- Prefetch count limits concurrent processing
|
||||
- Connection recovery uses RabbitMQ.Client built-in recovery
|
||||
- Streaming is optional (throws NotSupportedException for simplicity)
|
||||
- **BLOCKED:** RabbitMQ.Client 7.0.0 needs to be added to local-nugets folder for build to succeed
|
||||
- Remaining work is test hardening (unit + integration), not a NuGet availability blocker.
|
||||
|
||||
@@ -27,30 +27,30 @@ Create comprehensive test coverage for StellaOps Router projects. **Critical gap
|
||||
|
||||
| # | Task ID | Status | Priority | Description | Notes |
|
||||
|---|---------|--------|----------|-------------|-------|
|
||||
| 1 | TST-001 | TODO | High | Create shared testing infrastructure (`StellaOps.Router.Testing`) | Enables all other tasks |
|
||||
| 2 | TST-002 | TODO | Critical | Create RabbitMq transport test project skeleton | Critical gap |
|
||||
| 3 | TST-003 | TODO | High | Implement Router.Common tests | FrameConverter, PathMatcher |
|
||||
| 4 | TST-004 | TODO | High | Implement Router.Config tests | validation, hot-reload |
|
||||
| 5 | TST-005 | TODO | Critical | Implement RabbitMq transport unit tests | ~35 tests |
|
||||
| 6 | TST-006 | TODO | Medium | Expand Microservice SDK tests | EndpointRegistry, RequestDispatcher |
|
||||
| 7 | TST-007 | TODO | Medium | Expand Transport.InMemory tests | Concurrency scenarios |
|
||||
| 8 | TST-008 | TODO | Medium | Create integration test suite | End-to-end flows |
|
||||
| 9 | TST-009 | TODO | Low | Expand TCP/TLS transport tests | Edge cases |
|
||||
| 10 | TST-010 | TODO | Low | Create SourceGen integration tests | Optional |
|
||||
| 1 | TST-001 | DONE | High | Create shared testing infrastructure (`StellaOps.Router.Testing`) | `src/__Libraries/__Tests/StellaOps.Router.Testing/` |
|
||||
| 2 | TST-002 | DONE | Critical | Create RabbitMq transport test project skeleton | `src/__Libraries/__Tests/StellaOps.Router.Transport.RabbitMq.Tests/` |
|
||||
| 3 | TST-003 | DONE | High | Implement Router.Common tests | `src/__Libraries/__Tests/StellaOps.Router.Common.Tests/` |
|
||||
| 4 | TST-004 | DONE | High | Implement Router.Config tests | `src/__Libraries/__Tests/StellaOps.Router.Config.Tests/` |
|
||||
| 5 | TST-005 | TODO | Critical | Implement RabbitMq transport unit tests | Project exists but currently fails to build |
|
||||
| 6 | TST-006 | TODO | Medium | Expand Microservice SDK tests | RequestDispatcher tests missing; integration suite failing |
|
||||
| 7 | TST-007 | DONE | Medium | Expand Transport.InMemory tests | `src/__Libraries/__Tests/StellaOps.Router.Transport.InMemory.Tests/` |
|
||||
| 8 | TST-008 | TODO | Medium | Create integration test suite | `src/__Libraries/__Tests/StellaOps.Router.Integration.Tests/` currently failing |
|
||||
| 9 | TST-009 | DONE | Low | Expand TCP/TLS transport tests | Projects exist in `src/__Libraries/__Tests/` |
|
||||
| 10 | TST-010 | TODO | Low | Create SourceGen integration tests | Test project exists; examples currently fail to build |
|
||||
|
||||
## Current State
|
||||
|
||||
| Project | Test Location | Status |
|
||||
|---------|--------------|--------|
|
||||
| Router.Common | `tests/StellaOps.Router.Common.Tests` | Exists (skeletal) |
|
||||
| Router.Config | `tests/StellaOps.Router.Config.Tests` | Exists (skeletal) |
|
||||
| Router.Transport.InMemory | `tests/StellaOps.Router.Transport.InMemory.Tests` | Exists (skeletal) |
|
||||
| Router.Transport.Tcp | `src/__Libraries/__Tests/` | Exists |
|
||||
| Router.Transport.Tls | `src/__Libraries/__Tests/` | Exists |
|
||||
| Router.Transport.Udp | `tests/StellaOps.Router.Transport.Udp.Tests` | Exists (skeletal) |
|
||||
| **Router.Transport.RabbitMq** | **NONE** | **MISSING** |
|
||||
| Router.Common | `src/__Libraries/__Tests/StellaOps.Router.Common.Tests/` | Exists |
|
||||
| Router.Config | `src/__Libraries/__Tests/StellaOps.Router.Config.Tests/` | Exists |
|
||||
| Router.Transport.InMemory | `src/__Libraries/__Tests/StellaOps.Router.Transport.InMemory.Tests/` | Exists |
|
||||
| Router.Transport.Tcp | `src/__Libraries/__Tests/StellaOps.Router.Transport.Tcp.Tests/` | Exists |
|
||||
| Router.Transport.Tls | `src/__Libraries/__Tests/StellaOps.Router.Transport.Tls.Tests/` | Exists |
|
||||
| Router.Transport.Udp | `src/__Libraries/__Tests/StellaOps.Router.Transport.Udp.Tests/` | Exists |
|
||||
| **Router.Transport.RabbitMq** | `src/__Libraries/__Tests/StellaOps.Router.Transport.RabbitMq.Tests/` | Exists (currently failing build) |
|
||||
| Microservice | `tests/StellaOps.Microservice.Tests` | Exists |
|
||||
| Microservice.SourceGen | N/A | Source generator |
|
||||
| Microservice.SourceGen | `src/__Libraries/__Tests/StellaOps.Microservice.SourceGen.Tests/` | Exists |
|
||||
|
||||
## Test Counts Summary
|
||||
|
||||
@@ -81,7 +81,7 @@ Before marking this sprint DONE:
|
||||
|
||||
| Date (UTC) | Update | Owner |
|
||||
|------------|--------|-------|
|
||||
| | | |
|
||||
| 2025-12-19 | Archive audit: updated task/status tables to reflect current test project layout and known failing areas. | Planning |
|
||||
|
||||
## Decisions & Risks
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
This document provides an overview of all sprints for implementing the StellaOps Router infrastructure. Sprints are organized for maximum agent independence while respecting dependencies.
|
||||
|
||||
> **Archive notice (2025-12-19):** This index lives under `docs/router/archived/` and is not an active tracker. Statuses and working directories were audited against current repo layout; remaining `TODO` items reflect real gaps (mostly missing wiring and/or failing tests).
|
||||
|
||||
## Key Documents
|
||||
|
||||
| Document | Purpose |
|
||||
@@ -121,29 +123,30 @@ These sprints can run in parallel:
|
||||
|
||||
| Sprint | Name | Status | Working Directory |
|
||||
|--------|------|--------|-------------------|
|
||||
| 7000-0001-0001 | Router Skeleton | TODO | Multiple (see sprint) |
|
||||
| 7000-0001-0002 | Common Library | TODO | `src/__Libraries/StellaOps.Router.Common/` |
|
||||
| 7000-0002-0001 | InMemory Transport | TODO | `src/__Libraries/StellaOps.Router.Transport.InMemory/` |
|
||||
| 7000-0003-0001 | SDK Core | TODO | `src/__Libraries/StellaOps.Microservice/` |
|
||||
| 7000-0001-0001 | Router Skeleton | DONE | Multiple (see sprint) |
|
||||
| 7000-0001-0002 | Common Library | DONE | `src/__Libraries/StellaOps.Router.Common/` |
|
||||
| 7000-0002-0001 | InMemory Transport | DONE | `src/__Libraries/StellaOps.Router.Transport.InMemory/` |
|
||||
| 7000-0003-0001 | SDK Core | DONE | `src/__Libraries/StellaOps.Microservice/` |
|
||||
| 7000-0003-0002 | SDK Handlers | TODO | `src/__Libraries/StellaOps.Microservice/` |
|
||||
| 7000-0004-0001 | Gateway Core | TODO | `src/Gateway/StellaOps.Gateway.WebService/` |
|
||||
| 7000-0004-0002 | Gateway Middleware | TODO | `src/Gateway/StellaOps.Gateway.WebService/` |
|
||||
| 7000-0004-0003 | Gateway Connections | TODO | `src/Gateway/StellaOps.Gateway.WebService/` |
|
||||
| 7000-0005-0001 | Heartbeat & Health | TODO | SDK + Gateway |
|
||||
| 7000-0005-0002 | Routing Algorithm | TODO | `src/Gateway/StellaOps.Gateway.WebService/` |
|
||||
| 7000-0005-0003 | Cancellation | TODO | SDK + Gateway |
|
||||
| 7000-0005-0004 | Streaming | TODO | SDK + Gateway + InMemory |
|
||||
| 7000-0005-0005 | Payload Limits | TODO | `src/Gateway/StellaOps.Gateway.WebService/` |
|
||||
| 7000-0006-0001 | TCP Transport | TODO | `src/__Libraries/StellaOps.Router.Transport.Tcp/` |
|
||||
| 7000-0006-0002 | TLS Transport | TODO | `src/__Libraries/StellaOps.Router.Transport.Tls/` |
|
||||
| 7000-0006-0003 | UDP Transport | TODO | `src/__Libraries/StellaOps.Router.Transport.Udp/` |
|
||||
| 7000-0004-0001 | Gateway Core | TODO | `src/__Libraries/StellaOps.Router.Gateway/` |
|
||||
| 7000-0004-0002 | Gateway Middleware | TODO | `src/__Libraries/StellaOps.Router.Gateway/` |
|
||||
| 7000-0004-0003 | Gateway Connections | TODO | `src/__Libraries/StellaOps.Router.Gateway/` + `src/__Libraries/StellaOps.Router.Transport.InMemory/` |
|
||||
| 7000-0005-0001 | Heartbeat & Health | DONE | `src/__Libraries/StellaOps.Microservice/` + `src/__Libraries/StellaOps.Router.Gateway/` |
|
||||
| 7000-0005-0002 | Routing Algorithm | DONE | `src/__Libraries/StellaOps.Router.Gateway/` |
|
||||
| 7000-0005-0003 | Cancellation | DONE | `src/__Libraries/StellaOps.Router.Gateway/` + `src/__Libraries/StellaOps.Router.Transport.InMemory/` |
|
||||
| 7000-0005-0004 | Streaming | DONE | `src/__Libraries/StellaOps.Router.Gateway/` + `src/__Libraries/StellaOps.Router.Transport.InMemory/` |
|
||||
| 7000-0005-0005 | Payload Limits | DONE | `src/__Libraries/StellaOps.Router.Gateway/` |
|
||||
| 7000-0006-0001 | TCP Transport | DONE | `src/__Libraries/StellaOps.Router.Transport.Tcp/` |
|
||||
| 7000-0006-0002 | TLS Transport | DONE | `src/__Libraries/StellaOps.Router.Transport.Tls/` |
|
||||
| 7000-0006-0003 | UDP Transport | DONE | `src/__Libraries/StellaOps.Router.Transport.Udp/` |
|
||||
| 7000-0006-0004 | RabbitMQ Transport | TODO | `src/__Libraries/StellaOps.Router.Transport.RabbitMq/` |
|
||||
| 7000-0007-0001 | Router Config | TODO | `src/__Libraries/StellaOps.Router.Config/` |
|
||||
| 7000-0007-0002 | Microservice YAML | TODO | `src/__Libraries/StellaOps.Microservice/` |
|
||||
| 7000-0008-0001 | Authority Integration | TODO | Gateway + Authority |
|
||||
| 7000-0007-0001 | Router Config | DONE | `src/__Libraries/StellaOps.Router.Config/` |
|
||||
| 7000-0007-0002 | Microservice YAML | DONE | `src/__Libraries/StellaOps.Microservice/` |
|
||||
| 7000-0008-0001 | Authority Integration | DONE | `src/__Libraries/StellaOps.Router.Gateway/` + `src/Authority/*` |
|
||||
| 7000-0008-0002 | Source Generator | TODO | `src/__Libraries/StellaOps.Microservice.SourceGen/` |
|
||||
| 7000-0009-0001 | Reference Example | TODO | `examples/router/` |
|
||||
| 7000-0010-0001 | Migration | TODO | Multiple (final integration) |
|
||||
| 7000-0010-0001 | Migration | DONE | Multiple (final integration) |
|
||||
| 7000-0011-0001 | Router Testing Sprint | TODO | `src/__Libraries/__Tests/` |
|
||||
|
||||
## Critical Path
|
||||
|
||||
|
||||
Reference in New Issue
Block a user