chore(api): one `plane_500()` helper for reproduced 500s; compat parity scoped to the acceptance list

Aberta
#51 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
5/5
Tempo estimado
Mais de uma semana
Facilidade para iniciantes
25/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
rust
Domínio
api, backend, testing

Direção de pesquisa

Start with the Plane 500 response behavior in crates/thrust-api/src/lib.rs and the referenced pinned Plane handlers to confirm the three exact bodies. Then review the acceptance list and fixtures under tests/parity/fixtures/; done means the helper, parity and contract checks, route set, and oracle expectations all meet the listed criteria. This issue is blocked by #44 and spans API behavior, tests, and oracle data.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

area:app prio:p0 review:fable-2026-10-19

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/0007 PQ-409, line 213; line 201). At oracle/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: fix for EX-001 and EX-002 (oracle/exceptions.yaml:68,89 on the Plane fork branch feat/plane-b6a-upstream-sync-oracle), which round 27 superseded.
  • The parity obligation is unbounded: research/0007 counts 157 quirks, 53 breaks-clients, 93 affects-parity-tests and 11 informational (lines 38-49), every v1 and compat entry defaulting to reproduce; 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 (#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 attaches InternalErrorDetail(cause), so the cause is logged and never returned.
  • Every reproduced 500 calls it. No handler writes StatusCode::INTERNAL_SERVER_ERROR itself 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 #44 plus the M2 screens from #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/0007 line 36).
  • Edit EX-001 and EX-002 to rust_expectation: reproduce on 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_bodies compares each Plane500 variant's status and body bytes with fixtures under tests/parity/fixtures/ taken from the oracle (oracle/corpus/assets.json#workspace-asset-upload for 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/v1 sources 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 -3 of the two sorted lists is empty.
  • oracle/exceptions.yaml EX-001 and EX-002 read rust_expectation: reproduce.

References

  • Review: .agents/plans/contrail/reviews/2026-10-19-fable-architecture-review.md (FR-18)
  • research/0007-plane-quirks-catalog.md lines 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 branch oracle/exceptions.yaml:45-89

Blocked by: #44

Finding: FR-18

Linguagem predominante
Rust
Estrelas
0
Forks
0
Merge médio
1h 35min
PRs com merge (30d)
67

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de aRustyDev/thrust

Todas as issues de aRustyDev/thrust

Issues semelhantes

Mais issues de Rust

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.