Skip to content

chore(api): move the slice's routes out of the /api/v1 prefix; reserve it for wire-compatible routes #47

Closed

Description

@aRustyDev

Context

thrust_api::router() (crates/thrust-api/src/lib.rs:269-293) mounts the slice's routes under /api/v1/projects/{project_id}/work-items... and /api/v1/projects/{project_id}/activity (:278-291). The contract suite builds the same paths (crates/thrust-contract-tests/src/lib.rs:145-146, wi_path; tests/contract.rs:398), and so does the bench (src/bin/bench.rs:72). docs/src/flows/app.md:16-23 and :68 document them, and docs/src/testing/by-change.md:17 states "Every public route is under /api/v1".

Problem

  • In Plane, api/v1/ is the public API (apps/api/plane/urls.py:21). Its work-item routes are /api/v1/workspaces/<slug>/projects/<uuid:project_id>/work-items/, with a trailing slash, an activities/ collection and attachments keyed by id (apps/api/plane/api/urls/work_item.py:100-145).
  • The slice's routes have no workspace slug, no trailing slash and attachments keyed by name. They are neither Plane-shaped nor documented as anything else, so the prefix misleads (FR-06).
  • ADR-0031 makes /api/v1 wire-compatible, and ADR-0122's oracle checks it against Plane. A non-Plane route under that prefix falls outside what the oracle checks, yet any client reads it as part of the public API.
  • FR-06 also defers the core OpenAPI surface (ADR-0032) to M4. At P0 the router has two surfaces, compat-plane and /api/v1, and the slice routes belong to neither.

Proposal

Acceptance criteria

  • grep -rn '"/api/v1' crates/thrust-api/src crates/thrust-contract-tests prints only the RETIRED_SLICE_PREFIX constant in tests/contract.rs, the one place the suite names the old prefix, on purpose.
  • scripts/contract-all.sh is green on all 16 cells, with EXPECT_MAIN raised from 20 to 21 for the new test.
  • A new contract test shows each of the eight slice routes, requested through /api/v1/workspaces/{slug}/projects/{id}/... with a real token, slug and project, answering a routing 404 on every target. Control: it fails against the router before the move. (POST /api/v1/projects/{id}/work-items, without the slug, has answered 404 since feat(core): user-only Principal, database-authoritative sessions, delete KvSessionStore #36, so a test on it would pass before the move and prove nothing.)
  • docs/src/flows/app.md and docs/src/testing/by-change.md show the new prefix. ADR-0034 and ADR-0032 (round-29 notes) state the two P0 surfaces.

References

  • Review: .agents/plans/contrail/reviews/2026-10-19-fable-architecture-review.md (FR-06)
  • crates/thrust-api/src/lib.rs:269-293; crates/thrust-contract-tests/src/lib.rs:145-146; tests/contract.rs:398; src/bin/bench.rs:72
  • docs/src/flows/app.md:16-23, :68; docs/src/testing/by-change.md:17, :31
  • Plane oracle (oracle/v1-pin-20261018): apps/api/plane/urls.py:18-22; apps/api/plane/api/urls/work_item.py:100-145
  • ADR-0031, ADR-0032 (round-29 note), ADR-0034 (round-29 note), ADR-0122, ADR-0011, ADR-0090; SPEC R-F7; Q-0030.2

Finding: FR-06

Amended 2026-10-23 with the owner while planning the work (PR #75): the contract-test bullet and the last bullet of the proposal, and the first three acceptance criteria, for the reasons given in them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:appprio:p0review:fable-2026-10-19

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions