BUG — the repo-level CLI story suites never mounted `/api/v1`, so 43 of their tests went red the moment the reads moved
tests/cli/cli-story.test.ts and tests/cli/cli-connect-story.test.ts drive the BUILT @motir/cli binary against a real socket in front of the real route handlers, with a real Postgres behind it. Both call startMcpHttpServer() WITHOUT v1Routes: true, so the server they start serves /api/mcp and nothing else.
From MOTIR-2212 onward the CLI's reads go to /api/v1. Against these two suites every one of those calls hits an unrouted path, so 43 of their 145 tests fail — auth login, link, ready, status, show, and every test built on top of them.
Three further assertions in the same files encode the pre-port shapes and fail once the routes ARE mounted.
Acceptance criteria
- Both suites start their server with
v1Routes: true;pnpm vitest run tests/cliis green (145/145). cli-story.test.ts's build-order--jsonassertion reads the child'skey, notidentifier—--jsonemits the v1 RESOURCE since MOTIR-2345, and the resource names a work item by itsMOTIR-<n>key (ADR §7). Where it compares against the MCP tool's payload it maps across that rename rather than assuming the two agree.cli-story.test.ts's--jsonactivity assertion reads the aggregate as the v1 resource (payload.key, noitemwrapper) and comparespayload.activityagainst the route's own body, fetched fromGET /api/v1/work-items/{key}/activity, not against the MCP tool'sstructuredContent— a different producer with its own shape.cli-connect-story.test.ts's scope-seam floor (expect(new Set(called).size).toBeGreaterThanOrEqual(14)) is lowered to the number of MCP toolspackages/cli/src/mcpClient.tsstill calls at this commit, with a comment saying it falls once per porting card and must never be deleted while any tool remains — it is the only thing keeping that scope check from passing vacuously over an empty set.- No production code changes: the defect is entirely in the test harness wiring and three stale assertions.