Skip to content

Commit a1e6a1f

Browse files
fix: address all PR review comments — CHANGELOG accuracy, test alignment
- CHANGELOG.md: Fix handlerReady description to say "omitted = unverified/unknown" instead of "default false" to match actual .optional() schema semantics - CHANGELOG.md: Remove references to notImplemented() and serviceUnavailable() helpers that were removed in 5bf1696, keep only routeNotFound() - http-dispatcher.root.test.ts: Update POST-to-root test to expect semantic 404 (ROUTE_NOT_FOUND with handled: true) instead of handled: false, matching the new dispatch fallback behavior Agent-Logs-Url: https://github.com/objectstack-ai/spec/sessions/284f8784-d253-4a1a-85f4-bcc2fda55523 Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
1 parent b529574 commit a1e6a1f

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111
- **Discovery Schema — `ServiceStatus` enum & `handlerReady` field** — Added `'registered'`
1212
status to `ServiceInfoSchema` to distinguish routes that are declared in the dispatcher
13-
table but whose HTTP handler has not been verified. Added `handlerReady` boolean field
14-
(default `false`) so clients can filter handler-ready services before displaying endpoints.
13+
table but whose HTTP handler has not been verified. Added optional `handlerReady` boolean
14+
field (omitted = unverified/unknown) so clients can filter handler-ready services before
15+
displaying endpoints when the value is explicitly `true`.
1516
- **Discovery Schema — `RouteHealthReportSchema`** — New schema for automated route/handler
1617
coverage reporting at startup. Includes per-route health entries (`pass`, `fail`, `missing`,
1718
`skip`) and summary counters.
@@ -54,8 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5455
### Fixed
5556
- **Runtime Dispatcher — semantic error differentiation**`HttpDispatcher.dispatch()` now
5657
returns typed 404 (`ROUTE_NOT_FOUND`) with diagnostic info instead of bare `{ handled: false }`.
57-
Added `notImplemented()` (501), `serviceUnavailable()` (503), and `routeNotFound()` (404)
58-
helper methods.
58+
Added `routeNotFound()` (404) helper method.
5959
- **Runtime Dispatcher — `/health` handler** — Added health endpoint returning `status`,
6060
`timestamp`, `version`, and `uptime`.
6161
- **Runtime Dispatcher — `handlerReady` in discovery**`getDiscoveryInfo()` now emits

packages/runtime/src/http-dispatcher.root.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,16 @@ describe('HttpDispatcher Root Handling', () => {
6161
expect(data.routes).toBeDefined();
6262
});
6363

64-
it('should NOT handle POST request to root path ("")', async () => {
64+
it('should return semantic 404 for POST request to root path ("")', async () => {
6565
const context = { request: {} };
6666
const method = 'POST';
6767
const path = '';
6868

6969
const result = await dispatcher.dispatch(method, path, {}, {}, context);
7070

71-
expect(result.handled).toBe(false);
71+
// The dispatcher now returns a typed 404 (ROUTE_NOT_FOUND) instead of { handled: false }
72+
expect(result.handled).toBe(true);
73+
expect(result.response?.status).toBe(404);
74+
expect(result.response?.body?.error?.type).toBe('ROUTE_NOT_FOUND');
7275
});
7376
});

0 commit comments

Comments
 (0)