Uh oh!
There was an error while loading. Please reload this page.
Document dispatcher protocol in PROTOCOL_MAP - #549
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…very Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Updates the ObjectStack spec documentation map and regenerates/extends JSON Schema artifacts to reflect the HttpDispatcher + Discovery routing model and newly recognized core services.
Changes:
- Documented
dispatcher.zod.tsas a primary (⭐) API protocol and promoteddiscovery.zod.tsto ⭐ inPROTOCOL_MAP.md. - Updated generated JSON schemas to include new
CoreServiceNamevalues (ai,i18n,ui,workflow) and expanded Discovery/Routes outputs to use/api/v1/*examples and include additional namespaces. - Added/updated generated JSON schemas for dispatcher configuration (
DispatcherRoute,DispatcherConfig) and manifestcontributes.routesstructures across multiple response schemas.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/spec/PROTOCOL_MAP.md | Adds dispatcher + promotes discovery to ⭐ in the protocol map. |
| packages/spec/json-schema/system/ServiceStatus.json | Extends service enum with ai/i18n/ui/workflow. |
| packages/spec/json-schema/system/ServiceConfig.json | Extends service enum with ai/i18n/ui/workflow. |
| packages/spec/json-schema/system/KernelServiceMap.json | Extends service enum with ai/i18n/ui/workflow. |
| packages/spec/json-schema/system/CoreServiceName.json | Extends core service enum with ai/i18n/ui/workflow. |
| packages/spec/json-schema/kernel/Manifest.json | Adds generated schema for contributes.routes. |
| packages/spec/json-schema/kernel/ListPackagesResponse.json | Propagates contributes.routes into response schema. |
| packages/spec/json-schema/kernel/InstalledPackage.json | Propagates contributes.routes into response schema. |
| packages/spec/json-schema/kernel/InstallPackageResponse.json | Propagates contributes.routes into response schema. |
| packages/spec/json-schema/kernel/InstallPackageRequest.json | Propagates contributes.routes into request schema. |
| packages/spec/json-schema/kernel/GetPackageResponse.json | Propagates contributes.routes into response schema. |
| packages/spec/json-schema/kernel/EnablePackageResponse.json | Propagates contributes.routes into response schema. |
| packages/spec/json-schema/kernel/DisablePackageResponse.json | Propagates contributes.routes into response schema. |
| packages/spec/json-schema/hub/ComposerResponse.json | Propagates contributes.routes into response schema. |
| packages/spec/json-schema/api/ListPackagesResponse.json | Propagates contributes.routes into API response schema. |
| packages/spec/json-schema/api/InstallPackageResponse.json | Propagates contributes.routes into API response schema. |
| packages/spec/json-schema/api/InstallPackageRequest.json | Propagates contributes.routes into API request schema. |
| packages/spec/json-schema/api/GetPackageResponse.json | Propagates contributes.routes into API response schema. |
| packages/spec/json-schema/api/EnablePackageResponse.json | Propagates contributes.routes into API response schema. |
| packages/spec/json-schema/api/DisablePackageResponse.json | Propagates contributes.routes into API response schema. |
| packages/spec/json-schema/api/CompileManifestResponse.json | Propagates contributes.routes into API response schema. |
| packages/spec/json-schema/api/GetDiscoveryResponse.json | Expands discovery endpoints/features to include more namespaces and /api/v1/* examples. |
| packages/spec/json-schema/api/Discovery.json | Expands discovery schema (routes + features) to include more namespaces and /api/v1/* examples. |
| packages/spec/json-schema/api/ApiRoutes.json | Adds additional route namespaces and updates examples to /api/v1/*. |
| packages/spec/json-schema/api/ApiCapabilities.json | Adds capabilities flags for ai/workflow/notifications/i18n. |
| packages/spec/json-schema/api/DispatcherRoute.json | Adds generated JSON schema for dispatcher route entries. |
| packages/spec/json-schema/api/DispatcherConfig.json | Adds generated JSON schema for dispatcher config. |
| | :--- | :--- | :--- | | ||
| | [`protocol.zod.ts`](src/api/protocol.zod.ts) | ⭐ | **Stack Protocol**. valid requests and responses for the platform. | | ||
| | [`dispatcher.zod.ts`](src/api/dispatcher.zod.ts) | ⭐ | **HttpDispatcher**. Route-to-service mapping for API routing. | | ||
| | [`discovery.zod.ts`](src/api/discovery.zod.ts) | ⭐ | **Service Discovery**. Service registration and API routes discovery. | |
There was a problem hiding this comment.
PROTOCOL_MAP marks discovery.zod.ts as “Service registration and API routes discovery”, but src/api/discovery.zod.ts only defines a discovery response (routes + feature flags + locale). Consider rewording this row to avoid implying an unmodeled “service registration” protocol (or link that concept to kernel/service-registry.zod.ts if that’s what you mean).
| |[`discovery.zod.ts`](src/api/discovery.zod.ts)| ⭐ |**Service Discovery**. Service registration and API routes discovery. | | |
| |[`discovery.zod.ts`](src/api/discovery.zod.ts)| ⭐ |**API Discovery Response**. Describes available API routes, feature flags, and locale metadata. | |
| | [`protocol.zod.ts`](src/api/protocol.zod.ts) | ⭐ | **Stack Protocol**. valid requests and responses for the platform. | | ||
| | [`dispatcher.zod.ts`](src/api/dispatcher.zod.ts) | ⭐ | **HttpDispatcher**. Route-to-service mapping for API routing. | | ||
| | [`discovery.zod.ts`](src/api/discovery.zod.ts) | ⭐ | **Service Discovery**. Service registration and API routes discovery. | |
There was a problem hiding this comment.
The PR description says Phase 1 infrastructure (schemas + tests) already existed and that only PROTOCOL_MAP needed updates, but this PR also modifies/adds many packages/spec/json-schema/** artifacts (e.g., new DispatcherConfig/DispatcherRoute schemas and CoreServiceName enum expansions). Please either update the PR description to reflect the additional non-doc changes, or drop the generated schema changes if they’re unintended.
| "description": "API path prefix" | ||
| }, | ||
| "service": { | ||
| "type": "string", |
There was a problem hiding this comment.
In contributes.routes, service is an unconstrained string. Since HttpDispatcher routes use CoreServiceName (enum), allowing arbitrary values here makes manifests validate even when the dispatcher/service-registry can’t resolve them. Recommend constraining service to the CoreServiceName enum in the source Zod schema and regenerating JSON schema outputs.
| "type": "string", | |
| "$ref": "#/definitions/CoreServiceName", |
| "description": "API path prefix" | ||
| }, | ||
| "service": { | ||
| "type": "string", |
There was a problem hiding this comment.
contributes.routes[].service is typed as a free-form string here as well. If this field is meant to integrate with HttpDispatcher routing, it should be constrained to the same CoreServiceName enum used by DispatcherRoute.service, otherwise invalid service names will pass manifest compilation but fail at routing time.
| "type": "string", | |
| "$ref": "#/definitions/CoreServiceName", |
Phase 1 API Protocol infrastructure was already complete. All requirements (CoreServiceName extensions, ApiRoutesSchema, dispatcher.zod.ts, ManifestSchema.contributes.routes, tests) existed. Only documentation was missing.
Changes
dispatcher.zod.tsto PROTOCOL_MAP.md as primary protocol (⭐)discovery.zod.tsto primary protocol statusContext
The HttpDispatcher protocol defines route-to-service mapping for 14 API namespaces:
Plugins declare routes via
ManifestSchema.contributes.routes, allowing dynamic API extension without kernel changes.Phase 2 Scope
Phase 2 (REST API plugin implementation) requires code outside spec repository - not included in this PR.
Original prompt
Created from VS Code.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.