Skip to content

moooon

Motir

Vibe your whole project. Bring an idea — Motir's three AI layers plan it, track it, and ship it, end to end. You're looking at Motir, built in Motir.

  • Vibe Project
  • Open Source
  • AI Agent
  • AI Loop
1
requests
0
upvotes
145
planned
1,361
shipped

Motir · Work items

MOTIR-2379Done

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 failauth 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

  1. Both suites start their server with v1Routes: true; pnpm vitest run tests/cli is green (145/145).
  2. cli-story.test.ts's build-order --json assertion reads the child's key, not identifier--json emits the v1 RESOURCE since MOTIR-2345, and the resource names a work item by its MOTIR-<n> key (ADR §7). Where it compares against the MCP tool's payload it maps across that rename rather than assuming the two agree.
  3. cli-story.test.ts's --json activity assertion reads the aggregate as the v1 resource (payload.key, no item wrapper) and compares payload.activity against the route's own body, fetched from GET /api/v1/work-items/{key}/activity, not against the MCP tool's structuredContent — a different producer with its own shape.
  4. cli-connect-story.test.ts's scope-seam floor (expect(new Set(called).size).toBeGreaterThanOrEqual(14)) is lowered to the number of MCP tools packages/cli/src/mcpClient.ts still 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.
  5. No production code changes: the defect is entirely in the test harness wiring and three stale assertions.