Repository navigation
test(compat): thrust-compat-plane with a fixture recorder and parity harness, serving S01 and S02 - #79
Merged
Conversation
…harness, serving S01 and S02 First stage of #44. Adds the compat crate (runtime-free, Plane-shaped types stay inside it, #52), mounted beside thrust_api::router() by both composition roots, with the two rows that need no tables: S01 GET /api/instances/ and S02 GET /api/users/me/ (signed out: the pin's 401 with a DRF `detail` body, a JSON object with no `id`; signed in is a 501 until the boot stage builds the profile tables). tools/compat-record/record.py records one fixture per row from the pinned Plane's oracle stack (ba85d4d3d3), after the instance-admin setup that makes S01 report is_setup_done. A shared rules file (tests/parity/normalise.json) is implemented twice, in Python for recording and in Rust for comparing, and a shared case list checks both. Each parity_ test replays a fixture in process through the memory adapters. Controls shown red: a renamed field, a changed status, value and number type in a fixture; a handler with is_setup_done=false fails parity_s01; tokio added to the crate fails scripts/check-deps.sh (now covers the crate); the native root without the merge fails exactly the two new contract tests. EXPECT_MAIN 37 -> 39, native-memory 39/39. Not run here: the other three contract targets. Recorded gaps are in docs/src/testing/status.md (G-15). workspaces_exist is a constant false until the onboarding stage. Refs: plane-byd.12.1 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
5 tasks
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.
What
First of nine PRs for #44 (the 48-route minimum slice). It adds the compat crate and the machinery every later row reuses, and serves the two rows that need no tables.
crates/thrust-compat-plane: runtime-free, so it builds for wasm32. Plane-shaped types stay inside it (chore(contracts): keep compat DTOs out ofthrust-contracts; add thecheck-deps.shrule #52). Both composition roots mountroutes()besidethrust_api::router().GET /api/instances/: alwaysis_setup_done: true.GET /api/users/me/: signed out, the pin answers 401 with{"detail": ...}, a JSON object with noid. A signed-in caller gets a 501 until the boot stage builds the profile tables, never a half-shaped 200.tools/compat-record/record.py(uv script) records one fixture per row from the pinned Plane's oracle stack (ba85d4d3d3). It does the instance-admin setup first, because a fresh pin reportsis_setup_done: false.tests/parity/normalise.json), implemented twice (Python records, Rust compares).normalise-cases.jsonis a hand-written case list that both must pass.tests/parity.rs: oneparity_test per row, in process through the memory adapters, no network.Findings worth a reviewer's eye
users/me401 and the issue's "JSON object with noid" agree: the 401 body is{"detail": ...}./(apps/web/services/api.service.ts), so the redirect loop research/0003 §9 row 2 worries about only applies to private routes./api/instances/sendscache-control: private, max-age=<remaining TTL>, which changes per request, so headers other than content-type, location, www-authenticate and retry-after are not compared.workspaces_existis a constantfalseuntil the onboarding stage adds the workspace read. That is wrong for a database seeded through the slice routes; noted in the code.Controls (each shown failing)
parity_control_*all require a divergence, and passis_setup_done: falsein the handlerparity_s01_instancesfails with the differing pathtokioadded to the cratescripts/check-deps.shexits 1:FORBIDDEN: thrust-compat-plane depends on tokiomergescripts/contract.sh native-memory: exactly the two new contract tests fail, 37 of 39Verified
cargo nextest run --workspace: 1029 passed.scripts/contract.sh native-memory: 39 of 39 (EXPECT_MAIN37 to 39).cargo check -p thrust-server, and-p thrust-worker --target wasm32-unknown-unknown.scripts/check-deps.shcovers the new crate.CI on this PR: all 27 reported checks passed and the PR is
CLEAN, including themaincontract pass onnative-pg,worker-memoryandworker-cf, which I did not run locally.Not run: a recording on a second fresh stack. Gaps are recorded as G-15 in
docs/src/testing/status.md.Effort
Modelled for the rows (research/0003 §8.1): S01 0.9 pd (crud/L) and S02 0.15 pd (crud/S). Most of this PR is shared machinery that the model prices separately (route scaffold, error bodies, serializer fidelity), plus the recorder and harness, which it does not price. I did not time the work, so there is no actual pd to report here.
cargo fmt --checkis not clean at rustfmt's default width, as in every other crate; that gate is #40.Refs: plane-byd.12.1
🤖 Generated with Claude Code