Repository navigation
Description
Context
No wire-compatible route exists. thrust_api::router() (crates/thrust-api/src/lib.rs:269-293) puts only the slice's non-Plane routes under /api/v1 (:278-291), and #47 moves them out. Requests authenticate with Authorization: Bearer through the SessionStore (:82-99), not with X-Api-Key. Errors use a Thrust shape, {"error":{"code","message"}} (:47-49), and every authentication failure is a 401 (:54). The schema has projects (id, workspace_id, name) and a work_items table with no state, priority, labels, assignees, parent or dates (crates/thrust-adapters-postgres/migrations/0001_init.sql:4-8,26-41), and no states or labels table. Spike 0008 (bead plane-b6a) built the v1 oracle as the schema, an exception register and a golden corpus (research/0005; ADR-0122 round 26). The oracle exists only on a local, unpushed branch of the Plane fork, feat/plane-b6a-upstream-sync-oracle (research/0005:4-5; Q-0122.4, QUESTIONS.md:293), and it has only ever run against Plane.
Problem
- M1 includes
/api/v1for projects, states, labels and work items, with the oracle gate on those operations (review §3, FR-01). ADR-0031 keeps v1 wire-compatible and confirms it with the oracle (lines 23, 39). ADR-0032 requires a CI breaking-change diff of the code-first schema (line 41). That diff is not done yet because it "needs the Rust v1 slice" (line 70). - In the pinned schema (
oracle/schema/openapi.v1.json, 130 operations), these resources are the tagsProjects(8),States(5),Labels(5) andWork Items(14): 32 operations, including both theissues/andwork-items/families, search and lookup by identifier. The fuzzer skips seven of them (the six DELETEs and archive, under SX-001 and SX-002,oracle/exceptions.yaml:25-44). The corpus covers six of those seven; it has no exchange forDELETE .../issues/{pk}/. - The gate cannot be pointed at a partial implementation as it stands.
run_conformance.pyruns the whole schema (:56-80), a register entry that matches nothing fails as stale, and the vacuity floors are sized for the full surface (:205-212;exceptions.yaml:22-23: 100 operations tested, 40 with a 2xx). Only seven of the 12 entries touch the 32 operations (EX-001 to EX-004, EX-006, EX-007, EX-011), so the other five would go stale. Staleness is also counted per entry, so reproducing a quirk on one of an entry's operations hides its absence on the others. - The owner chose to reproduce these quirks (ADR-0031 lines 64-74; ADR-0033 lines 79, 83). Only a missing key gets 401; an invalid, expired or inactive key gets 403
{"detail":"Given API token is not valid"}(Planeapps/api/plane/api/middleware/api_authentication.py:32-38). Error bodies come in two shapes. State create returns 200. Aper_pageof 0 or −1, and some work-item create payloads, give 500 (EX-001, EX-002). ADR-0052 still says "revoke key → 401" (line 53). - Every in-scope corpus exchange that passes authentication and permissions carries
x-ratelimit-remainingandx-ratelimit-reset; the 401 and 403 answers carry neither (oracle/NORMALISATION.md:23; Planeapps/api/plane/api/rate_limit.py:47-48, default60/minuteatsettings/common.py:154). The port can reportremaining(crates/thrust-ports/src/lib.rs:208-211). The Workers Rate Limiting binding (ADR-0033, round-29 note) reports only whether a request is allowed.
Proposal
- Routes: serve the 32 operations under
/api/v1/workspaces/{slug}/as a thin surface overthrust-coreuse-cases (ADR-0031 line 60). The project and work-item use-cases are shared with feat(compat): the 48-route minimum slice with the auth-client JSON change #44; the state and label use-cases are new. Each one runs on a&Scopefromauthorize(feat(core): makeScopethe argument of every repository andTxmethod #35), with the workspace resolved from{slug}through membership (feat(core): user-onlyPrincipal, database-authoritative sessions, deleteKvSessionStore#36). - Schema and types: add
workspaces(withslug),workspace_members,api_tokens,statesandlabels, plus the work-item columns and join tables the v1 serializers return. Plane-shaped DTOs, the pagination envelope and error bodies stay out ofthrust-contracts(the rule from chore(contracts): keep compat DTOs out ofthrust-contracts; add thecheck-deps.shrule #52). A reproduced 500 goes throughplane_500()from chore(api): oneplane_500()helper for reproduced 500s; compat parity scoped to the acceptance list #51, or is a handled 500 with the pinned body, never a panic (ADR-0031 line 74). - Auth: look up
X-Api-Keyby its SHA-256 hash (ADR-0052 K1; spike(auth): the two-day Rust auth slice (argon2id, sessions, CSRF, API keys, one OIDC login) #38 tries this shape). Return 401 for a missing key, and 403 with Plane's body for an invalid, expired or inactive one. Rate-limit per key; a 429 carries{"error_code":5900,"error_message":"RATE_LIMIT_EXCEEDED"}andRetry-After. SendX-RateLimit-RemainingandX-RateLimit-Reseton every response that passes authentication and permissions. On Cloudflare the binding does not report these values, so they are derived; if the countdown cannot match Plane's, record a deviation. - Harness home: vendor
oracle/from the fork branch intotools/oracle-v1/with aSOURCEfile that names the commit, or push the branch instead (the owner decides, Q-0122.4). Either way, add the harness to the ADR-0006 tooling register; theuvrule applies. - Scoped gate:
run_conformance.py --scope m1passes Schemathesis--include-tagfor the four tags (the script already passes--exclude-methodand--exclude-path-regex,:77,79). It restricts the register to the in-scope operations, counts staleness per (entry, operation), and uses floors measured on Plane for this scope. - Seed and corpus:
- A fixture loaded through
/internal/seed(crates/thrust-api/src/lib.rs:150-156) reproduces the uuid5 ids, names and seven tokens oforacle/scripts/seed.py, soseed-manifest.jsonapplies unchanged. Before every gate and control run, a reset script loads the fixture again. record_corpus.py --only(:427) records against Thrust, and the result is compared exchange by exchange with the committed corpus for the in-scope operations. Add the missingDELETE .../issues/{pk}/exchange to the corpus, recorded on Plane first.scripts/oracle-v1.sh <target>runs the gate and the corpus comparison, and is one of the planned cells ofgate.
- A fixture loaded through
- Schema diff: generate the 32 operations with utoipa, then run
oasdiff breakingagainst the pinned schema restricted to those operations. The EX-006 nullables are recorded exceptions. Never pass--open.
Acceptance criteria
-
scripts/oracle-v1.sh native-pgandscripts/oracle-v1.sh worker-cfend inVERDICT: PASSwithunaccepted=0,stale=0(per entry and operation) and the scoped floors met. The same scoped run against Plane passes too. - Control: with
run_controls.py --upstream <thrust>, the gate fails C1, C2 and C3 (each breaks one field ofGET .../states/,run_controls.py:33-44) on that operation, and passes C0. The corpus comparison catches C4 (a droppedid, which the schema cannot see). The results are committed. - After normalisation, the corpus comparison shows no difference for the in-scope exchanges in
projects,states,labels,work_items,paginationanderrors. A run that compares zero exchanges fails. Control: making state create return 201 makes it fail. - Contract tests pass on all four targets: no key gives 401; a bogus, expired or inactive key gives 403 with Plane's body; a create by a guest gives 403.
-
oasdiffreports no breaking change for the 32 operations, and the generated schema is committed. - The four list endpoints stay within the round-trip budget from chore(worker): set
placement.region = aws:us-east-1; add the 5-round-trip budget counter to the contract suite #39.
References
- Review: .agents/plans/contrail/reviews/2026-10-19-fable-architecture-review.md (FR-01; §3 M1 row; FR-06)
- ADR-0031 (lines 23, 39, 60, 64-74), ADR-0032 (lines 29, 41, 70), ADR-0122 (lines 44, 77-79, 86, 90), ADR-0033 (lines 31, 79, 83; round-29 note), ADR-0052 (line 53), ADR-0006 (register), ADR-0034 (round-29 note)
research/0005-oracle-harness.md(lines 4-5, 49-55, 64-72, 88-89);spikes/0008-v1-oracle-harness.md; FEATURES §A5 (FEATURES.md:88-91), F-X06 (:135); Q-0122, Q-0122.4, Q-0120.3, Q-0033.2; DEVIATIONS C-2 (DEVIATIONS.md:32), D-002, D-007, D-013crates/thrust-api/src/lib.rs:47-49,54,82-99,150-156,269-293;crates/thrust-ports/src/lib.rs:208-211;crates/thrust-adapters-postgres/migrations/0001_init.sql:4-8,26-41- Plane fork branch
feat/plane-b6a-upstream-sync-oracle(72b2e01497):oracle/exceptions.yaml:12-23,25-44,45-89;oracle/harness/run_conformance.py:56-80,205-212;oracle/harness/run_controls.py:33-44;oracle/harness/record_corpus.py:427;oracle/NORMALISATION.md:23;oracle/scripts/seed.py;oracle/corpus/seed-manifest.json - Plane oracle (
oracle/v1-pin-20261018):apps/api/plane/api/middleware/api_authentication.py:32-38;apps/api/plane/api/rate_limit.py:12-48;apps/api/plane/settings/common.py:154
Finding: FR-01
Activity
Scopethe argument of every repository andTxmethod #35Principal, database-authoritative sessions, deleteKvSessionStore#36/api/v1prefix; reserve it for wire-compatible routes #47aRustyDev commentedon Oct 23, 2026
From the work on #47 (PR #75), which moves the slice's routes out of
/api/v1to/api/_slice: this issue is where the cleanup lands, so it belongs in #58's scope.When #58 serves
/api/v1/workspaces/{slug}/...and the_sliceroutes are replaced:/api/_sliceroutes andSLICE_PREFIX(crates/thrust-api/src/lib.rs), and move the contract suite (wi_path,project_path, the matrix and the model) onto the new routes;the_slice_routes_are_gone_from_the_reserved_v1_prefix(crates/thrust-contract-tests/tests/contract.rs) in the same PR. It asserts that each slice route is a routing 404 through/api/v1, which stops being true once/api/v1is live.#47's last bullet named #44 as the replacement. #44 supplies the compat routes under
/api/and/auth/, not the/api/v1work-item routes, so the bullet has been corrected there.Also:
PLAN.mdnow lists #35, #36 and #47 as #58's blockers, matching the issue body.aRustyDev commentedon Oct 24, 2026
From spike 0002 (#37, PR #77): the slice's list route is unpaged, and that, not the database engine, decides whether the list target holds. Both engines pass the 300 ms list p95 on a realistic list and fail it on an unpaged one:
worker-pg)worker-do)(Numbers are in
research/0011-database-engine-cells.mdonce PR #77 merges, with their conditions: one client in Virginia, n=200 per cell.)The owner decided on 2026-10-24 to read the spike's list criterion on the realistic, paged list, so it passes. That makes paging a requirement of this issue's list routes rather than a property of the slice's. When #58 builds the
/api/v1list routes:bench, and a project the size of the 10,000-item case is part of that measurement;GET .../work-itemsis deleted with the other_sliceroutes, as the earlier comment on this issue says.docs: ADR-0040 accepted as Postgres; spike 0002 decided; the worker-d…
feat(db): engine pass, search routes and the FR-22 order; spike 0002 …
feat(db): make, change and delete a state, as Plane does (migration 0…
feat(core): v1 states: visible_states, create, change and delete a st…
feat(api-v1): the states of /api/v1: list, create, retrieve, change, …
docs(plans): D-030 and D-031 are confirmed by the owner
51 remaining items
chore: merge origin/main (#180 G-26, #181 the count guard, #182 D-19)…
feat(api-v1): describe the Projects operations as an OpenAPI document…
feat(api-v1): describe the States operations in the OpenAPI document,…
feat(api-v1): describe the Labels operations in the OpenAPI document,…
feat(api-v1): describe the Work Items operations in the OpenAPI docum…
aRustyDev commentedon Nov 16, 2026
Closing on the owner's word. The six acceptance criteria are built, and the evidence for each is on
docs/src/testing/status.md(G-24 the round-trip budget, G-25 the oracle gate, the corpus comparison and the schema diff, G-26 the move of the contract suite off the slice):native-memory,native-pgandworker-cf, and the same scope against the pinned Plane (scripts/oracle-v1.sh);oasdiffagainst the 32 operations, done in four pull requests, one per resource (feat(api-v1): describe the Projects operations as an OpenAPI document and diff it against the pinned schema #179 Projects, feat(api-v1): describe the States operations in the OpenAPI document, written from the type the routes answer with #188 States, feat(api-v1): describe the Labels operations in the OpenAPI document, written from the type the routes answer with #193 Labels, feat(api-v1): describe the Work Items operations in the OpenAPI document, which now has all 32 of the pin's operations #203 Work Items):scripts/check-openapi.shdiffs the document thatthrust-api-v1writes from its types against the pin, and every one of its 103 findings is accepted by a register entry that names its reason (tools/oracle-v1/schema/diff-accepted.json);placement.region = aws:us-east-1; add the 5-round-trip budget counter to the contract suite #39.Not part of the criteria, and not done here:
/api/_sliceroutes that have no Plane-shaped counterpart (sign-out-all, session, api-keys, the two activity feeds, attachments) andSLICE_PREFIXstay, as decided on 2026-11-11, until the counterparts exist (feat(compat): the M2 daily-use screens (acceptance list) with every other route stubbed and recorded #46).?expand=assigneessends two statements per distinct assignee: perf(api-v1): ?expand=assignees sends two statements per distinct assignee #123..agents/plans/contrail/DEVIATIONS.mdand not yet confirmed (a form or multipart body is a 415: D-031 (5), D-032 (6), D-033 (11); D-030 (5) is the confirmed one for projects), and two register entries (SD-002, SD-003) rest on the pin's source and not on a recorded exchange. They are being decided.docs(api-v1): every v1 route reads JSON only, to be revisited if a re…
test(oracle): record a non-member's reads of a public project on the …
test(api-v1): hold each request schema to its parser with bodies the …
refactor(api-v1): read a state's request into a typed struct that wri…
refactor(api-v1): read a label's request into a typed struct that wri…
refactor(api-v1): read a project's request into a typed struct that w…
refactor(api-v1): read a work item's request into a typed struct that…
refactor(api-v1): write a request struct, its reader and its schema f…