Repository navigation
Description
Context
The shared router answers every internal failure with one Thrust-shaped body: CoreError::Internal becomes 500 {"error":{"code":"internal","message":"internal error"}} (crates/thrust-api/src/lib.rs:47-48,61), and the real cause travels only in the InternalErrorDetail response extension that the root logs (crates/thrust-api/src/lib.rs:34-37,69-71, crates/thrust-worker/src/lib.rs:156-158). No compat-plane crate exists yet; it arrives with #44. The round-27 owner decision is to reproduce all of Plane's 500 responses (research/0007 line 7; DEVIATIONS C-1, DEVIATIONS.md:27,31), and ADR-0031 (round 27, line 74) reads "reproduce" as the same status and body returned as a deliberate, handled error, never a crash of the process.
Problem
- Plane has three different 500 texts, and the text is part of the contract (
research/0007PQ-409, line 213; line 201). Atoracle/v1-pin-20261018:{"error":"Something went wrong please try again later"}from the base handlers (apps/api/plane/api/views/base.py:107,apps/api/plane/app/views/base.py:107),{"error":"An unexpected error occurred"}on project create (apps/api/plane/api/views/project.py:320,337),{"error":"Internal server error"}on the generic asset GET (apps/api/plane/api/views/asset.py:474). - The 500 set is larger than EX-001/EX-002 (ADR-0122 round 27, line 94). Without one helper each handler builds its own body, or reproduces the crash itself, which costs a failed request and an instance reset (
research/0004§7). - The oracle register still says
rust_expectation: fixfor EX-001 and EX-002 (oracle/exceptions.yaml:68,89on the Plane fork branchfeat/plane-b6a-upstream-sync-oracle), which round 27 superseded. - The parity obligation is unbounded:
research/0007counts 157 quirks, 53 breaks-clients, 93 affects-parity-tests and 11 informational (lines 38-49), every v1 and compat entry defaulting toreproduce; F-X13 still names the 290 P0 rows (FEATURES.md:137).
Proposal
plane_500(kind: Plane500, cause: impl Into<String>) -> Response<Body>in the crate that holds the Plane-shaped types (chore(contracts): keep compat DTOs out ofthrust-contracts; add thecheck-deps.shrule #52), used by compat-plane and/api/v1.enum Plane500 { SomethingWentWrong, UnexpectedError, InternalServerError }with the bytes copied from the pin. It sets the status, writes the exact body and attachesInternalErrorDetail(cause), so the cause is logged and never returned.- Every reproduced 500 calls it. No handler writes
StatusCode::INTERNAL_SERVER_ERRORitself or panics to produce a 500. - Parity scope (FR-18 (2)): the compat-plane oracle and replay obligation is the F-X13 acceptance list as revised in round 29 (the 48-route slice from feat(compat): the 48-route minimum slice with the auth-client JSON change #44 plus the M2 screens from feat(compat): the M2 daily-use screens (acceptance list) with every other route stubbed and recorded #46). A quirk on a route outside the list is not a test obligation until the route joins the list. Breaks-clients quirks on routes in the list get a test home (TH-corpus, TH-gate, TH-replay or TH-unit,
research/0007line 36). - Edit EX-001 and EX-002 to
rust_expectation: reproduceon the oracle branch. - Out of scope: FR-18 (3) audit logging at P1 and (4) flags as a table. Those are the Track A tier edits (FEATURES F-E06, F-E00a; ADR-0048 and ADR-0008, round-29 notes).
Acceptance criteria
-
parity_plane_500_bodiescompares eachPlane500variant's status and body bytes with fixtures undertests/parity/fixtures/taken from the oracle (oracle/corpus/assets.json#workspace-asset-uploadfor the base text, the pinned source for the other two). Changing one byte of a fixture makes it fail (control). -
grep -rn "INTERNAL_SERVER_ERROR"over the compat-plane and/api/v1sources matches only the helper. - A contract test reproduces one recorded 500 on a route in the acceptance list (for example
per_page=0, PQ-402) on all four targets: status 500, the exact Plane body, and the next request to the same target succeeds. - The compat replay and oracle route set is generated from the acceptance list, and
comm -3of the two sorted lists is empty. -
oracle/exceptions.yamlEX-001 and EX-002 readrust_expectation: reproduce.
References
- Review: .agents/plans/contrail/reviews/2026-10-19-fable-architecture-review.md (FR-18)
research/0007-plane-quirks-catalog.mdlines 7, 9, 36, 38-49, 201, 213 (PQ-409), 206 (PQ-402)- ADR-0031 (round 27, line 74), ADR-0034 (round 27 tripwires, line 68), ADR-0122 (line 94), ADR-0006 panic policy
DEVIATIONS.md:27,31(C-1);FEATURES.md:137(F-X13)crates/thrust-api/src/lib.rs:34-37,47-48,61,69-71- Plane at
oracle/v1-pin-20261018:apps/api/plane/api/views/base.py:107,apps/api/plane/app/views/base.py:107,apps/api/plane/api/views/project.py:320,337,apps/api/plane/api/views/asset.py:474; oracle branchoracle/exceptions.yaml:45-89
Blocked by: #44
Finding: FR-18
Activity
feat(plane-types): one plane_500() for the pin's three 500 texts (#126)
docs(plans): bring the M0 and M1 status rows up to the evening of 202…
docs(plans): bring the M0 and M1 status rows up to the evening of 202…