diff --git a/apps/gateway/src/coord/interaction-coordination.controller.test.ts b/apps/gateway/src/coord/interaction-coordination.controller.test.ts index 6974fcc..d3b2b09 100644 --- a/apps/gateway/src/coord/interaction-coordination.controller.test.ts +++ b/apps/gateway/src/coord/interaction-coordination.controller.test.ts @@ -1,9 +1,20 @@ +const PATH_METADATA = 'path'; import { describe, expect, it, vi } from 'vitest'; import { InteractionCoordinationController } from './interaction-coordination.controller.js'; const user = { id: 'operator-1', tenantId: 'tenant-a' }; describe('InteractionCoordinationController', () => { + it('exposes the neutral canonical route and Mos compatibility alias over identical handlers', () => { + expect(Reflect.getMetadata(PATH_METADATA, InteractionCoordinationController)).toEqual([ + 'api/coord/interaction', + 'api/coord/mos', + ]); + expect(InteractionCoordinationController.prototype.handoff).toBeTypeOf('function'); + expect(InteractionCoordinationController.prototype.observe).toBeTypeOf('function'); + expect(InteractionCoordinationController.prototype.result).toBeTypeOf('function'); + }); + it('derives actor and tenant from the authenticated user rather than handoff input', async () => { const coordination = { handoff: vi.fn(async () => ({ handoffId: 'handoff-1' })), diff --git a/apps/gateway/src/coord/interaction-coordination.controller.ts b/apps/gateway/src/coord/interaction-coordination.controller.ts index 2588a76..092f204 100644 --- a/apps/gateway/src/coord/interaction-coordination.controller.ts +++ b/apps/gateway/src/coord/interaction-coordination.controller.ts @@ -22,7 +22,8 @@ import type { import { InteractionCoordinationService } from './interaction-coordination.service.js'; /** Authenticated interaction-plane boundary for the handoff/observe/result-only interaction coordination contract. */ -@Controller('api/coord/mos') +/** `api/coord/interaction` is canonical; the Mos path remains a compatibility alias. */ +@Controller(['api/coord/interaction', 'api/coord/mos']) @UseGuards(AuthGuard) export class InteractionCoordinationController { constructor( diff --git a/docs/tess/MOS-COORDINATION.md b/docs/tess/MOS-COORDINATION.md index 2eb3c81..07092a8 100644 --- a/docs/tess/MOS-COORDINATION.md +++ b/docs/tess/MOS-COORDINATION.md @@ -52,6 +52,10 @@ The port deliberately omits generic orchestrator verbs. It is tenant- and correlation-scoped; its gateway implementation obtains `actorId`, `tenantId`, and the requester agent from trusted authentication/configuration only. +## HTTP routes + +`/api/coord/interaction` is the canonical HTTP coordination prefix for handoff, observe, and result. `/api/coord/mos` remains a backward-compatible alias with the same handlers and DTOs; new integrations use the neutral canonical prefix. + ## Enforcement point `apps/gateway` owns a `MosCoordinationService` boundary that compares the