Repository navigation
chore(api): move the slice's routes out of the /api/v1 prefix; reserve it for wire-compatible routes - #75
Merged
Conversation
/api/v1 is reserved for routes that are wire-compatible with Plane (ADR-0031, FR-06), and the oracle
checks it (ADR-0122). The slice's own tenant routes now live under /api/_slice/workspaces/{slug}/projects/
{project_id}/...: no Plane route starts with an underscore, and the prefix stays under /api, so every
edge pattern that covers /api/* covers it. Both SLICE_PREFIX constants (thrust-api and the black-box
contract suite) change; nothing else spells the prefix, so wi_path, the matrix, the model and the bench
need no edit.
the_slice_routes_are_gone_from_the_reserved_v1_prefix requests every slice route (eight, from a table)
through the retired prefix with a real token, slug and project: each must be a routing 404, told apart
from a use-case 404 by the absence of the API's JSON error body, and the same request through the live
prefix must not be one. The calls through the retired prefix must also have had no effect (one row
exists at the end, the live create). The test uses the slugged old path, not the issue's
/api/v1/projects/{id}/work-items: that one has answered 404 since #36 added the slug, so a test on it
passes before the move and proves nothing.
Control: with the constants still at /api/v1, native-memory main ran 20 passed and 1 failed (this test
alone). After the move it runs 21 of 21, and contract-all.sh is 16 of 16 with 21 in each main pass,
the worker cells included. With only the router's constant set back, 18 of 21 fail, so a mismatch
between the two constants cannot pass. mutants.sh: 5 of 5 killed, no SocketNotFoundError.
scripts/contract.sh now expects 21 in the main pass. scripts/stage2-contract.sh went from 18 to 21: it
was already stale (the count had been 20), and evidence-and-controls.md says to change both together.
contract-suite.md carries the count measured today.
Refs: plane-byd.11.3.1
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
flows/app.md: the eight route rows and the sequence diagram show /api/_slice/..., and the "Pending rename" paragraph becomes a statement of what is true: the prefix, why it is clear of every Plane route, that it stays under /api, that nothing is served under /api/v1 yet, which test shows it, and that #58 deletes the routes and retires the test. Plane's real v1 URL is quoted unchanged. by-change.md says the same in its routing bullet; its v1 row is still exactly right and stays. ADR-0034 and ADR-0032 get an "issue #47" note in the style of the #35 and #36 notes: the prefix, that /api/* in run_worker_first and the /api Access bypass already cover it (ADR-0011, ADR-0090; nothing in the repository configures either, so this is a reading of the plan and says so), the test, the cleanup owner (#58, not #44, which supplies compat routes), and the stale lib.rs:269-293 anchor, replaced by the symbols SLICE_PREFIX and slice_path. ARCHITECTURE.md carries the same anchor and gets the same fix; SPEC R-F7 gains the prefix; QUESTIONS Q-0030.2 notes the temporary route group; PLAN.md gives #58 the Blocked-by column that GitHub already shows (#35 #36 #47). The mdBook build could not run locally (mdbook-mermaid is not installed); the edited tables were checked for column counts. Refs: plane-byd.11.3.2 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #47 (FR-06).
The slice's own tenant routes move from
/api/v1/workspaces/{slug}/projects/{project_id}/...to/api/_slice/workspaces/{slug}/projects/{project_id}/..., so/api/v1is reserved for routes that arewire-compatible with Plane (ADR-0031) and the oracle can cover it (ADR-0122). Nothing is served under
/api/v1now;the first routes there are #58's.
The code change is two constants (
SLICE_PREFIXinthrust-apiand in the black-box contract suite), because #35 and#36 had already made every path build from one. The work is the test, the counts and the docs.
Commits (one per bead)
chore(api): the prefix moves.the_slice_routes_are_gone_from_the_reserved_v1_prefixrequests all eight slice routes, from a table, through theretired prefix with a real token, slug and project. Each must be a routing 404 (told apart from a use-case 404 by
the absence of the API's JSON error body), and the same request through the live prefix must not be one. The
retired-prefix calls must also have had no effect (one row exists at the end).
scripts/contract.shexpects 21 in the main pass,scripts/stage2-contract.sh21 (it still said 18; the counthad been 20), and
contract-suite.mdcarries the count measured today.docs:flows/app.md,by-change.md, an "issue chore(api): move the slice's routes out of the/api/v1prefix; reserve it for wire-compatible routes #47" note in ADR-0034 and ADR-0032, the stalelib.rs:269-293anchor in ARCHITECTURE.md, SPEC R-F7, Q-0030.2, and feat(api): /api/v1 projects, states, labels and work items with the oracle gate on those operations #58's Blocked-by column in PLAN.md.Deviations from the issue text (owner, 2026-10-23)
The issue's criteria were amended on GitHub, because three of them could not hold as written:
POST /api/v1/projects/{id}/work-itemshas answered 404 since feat(core): user-onlyPrincipal, database-authoritative sessions, deleteKvSessionStore#36 added the slug, so a test on itpasses before the move and proves nothing. The test uses the slugged old path, which answered before the move, and
covers all eight routes.
EXPECT_MAINgoes from 20 to 21, not "unchanged".grep -rn '"/api/v1' crates/thrust-api/src crates/thrust-contract-testsprints onlyRETIRED_SLICE_PREFIX, the one constant in the test that names the old prefix on purpose.The issue's last bullet named #44, which supplies compat routes. #58 builds the
/api/v1work-item routes that replacethe slice's, so it owns deleting the
_sliceroutes, moving the contract suite and retiring the new test. There is acomment on #58 saying so.
Evidence
All local, at the PR head
c9d2ff6; the second commit changes documentation only, so the runs below are from89bef82.native-memory main)native-memory mainafter the movescripts/contract-all.shscripts/mutants.shDOCKER_HOSTset and noSocketNotFoundErrorin the Postgres runcargo nextest run --workspacecargo test --doc --workspacescripts/check-deps.shthrust-worker--no-default-featuresgit grep -n '"/api/v1' -- crates/thrust-api/src crates/thrust-contract-testsRETIRED_SLICE_PREFIXNot verified
/api/*inrun_worker_firstand the/apiAccess bypass (ADR-0011, ADR-0090) cover/api/_slice/..., but nothing in the repository configures either, so that is a reading of the plan, not a test.feat(worker): reject non-canonical-case
/api,/auth,/livepaths and run the Worker first at the Access phase #50 (M6) owns the edge tests. The ADR note says so.mdbook-mermaidis not installed). The edited tables were checked forcolumn counts with a script that was shown to fail on a malformed table.
targets today. If a target ever put a body on a routing 404 that looked like an API error, the retired-prefix half
would fail loudly, not pass.
Heads-up for later issues
entry.mjs, the DO rate limiter and theSELFbinding #43 touches the same files (tests/contract.rsnear:319-334,EXPECT_BINDINGSinscripts/contract.sh): expect atrivial conflict.
/api/v1live again.🤖 Generated with Claude Code