Repository navigation
feat(compat): answer a reproduced 500 as the pin does; S47's page size of 0 and PQ-403 - #127
Merged
Merged
Conversation
…e of 0 and PQ-403
The internal API answered a failure with thrust-api's own shape,
{"error":{"code":"internal",...}}, an object where the React client reads a
string (research/0007 PQ-107), and an unavailable identity provider as a 502.
PlaneError now answers CoreError::Internal and ::Upstream as the pin's catch-all
500 through thrust_plane_types::plane_500, in into_response, so it holds for `?`
on a CoreError and for a PlaneError::Other built by hand. PlaneError::internal
(cause) is for a request the pin fails on purpose; the cause is the log's and is
never in the body. Every other CoreError answers exactly as before.
S47 (the work-item list) answered 400 for a page size of 0 or less, in a comment
that said the pin answers 500. That was read from the pin's source. It is now
recorded: tools/compat-record/record.py gets nine exchanges, from two recordings
on two fresh stacks (X02 included in the second), and only S47.json changes.
The pin answers 500 for per_page 0, -1 and 0 with a cursor, and for a cursor to
the previous page whose size is not the page size (PQ-403, which the catalogue
had from source only). It is the pin's last check: a cursor that is no cursor,
a window that would start before the first row (page x size < 0), a change date
that is no date and filters that are not JSON each answer their own 400 first,
and a size of 0 on a page before the first has offset 0 and is a 500. The list
now does the same: the offset check takes the size into account, and the 500 is
made in window(), after every other check.
A test is edited on purpose. a_page_size_is_a_whole_number_from_one_to_the_cap
had the cases zero and negative asserting Thrust's own 400, and its comment said
"the pin's being a 500". That was a placeholder for a deviation which round 27
(reproduce every 500) superseded and which the recording now shows is wrong about
the pin, so the test was wrong, not the code. The two cases are not removed
into nothing: they are in the_pins_500_is_the_last_check_of_the_page (nine cases,
each an exchange of the S47 fixture, with the order of the checks) and in two
generated tests over the size range.
Also: a contract test on every target (the 500, its exact body, no cause in it,
the next request answered, and the controls); EXPECT_MAIN 57 to 58; DEVIATIONS
D-028 (4) no longer lists the page size as a deviation.
Not done: D-028 (4) also lists `is_draft: true` and `archived_at` on a creation,
for which the pin answers 500. The S48 fixture holds no such exchange, so it is
from source and is not reproduced here.
Refs: plane-byd.5
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Brings in the asset stage (#124). The three conflicts are the contract suite's expected count (main 59 plus this change's one test is 60), the architecture page's sentence about the compat crate, and DEVIATIONS D-028. The tree is the one of the rebased commit that was tested: 1265 tests in the three Plane-shaped crates, the contract suite's main pass 60 of 60 on native-memory, and clippy clean over the workspace. Refs: plane-byd.5 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 12, 2026
`EXPECT_MAIN` is 63: main's 60 (the compat tests of #124 and #127) and this branch's three. The deployed-Worker count of `stage2-contract.sh` is 57 (the six `oidc_` tests are skipped there), and the docs say so. The one conflict was that line of `scripts/contract.sh`. Measured on native-memory after the merge: the main pass 63 of 63, the sweeper pass 3 of 3. Refs: #58 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 12, 2026
main moved by #127 and #129. Three conflicts, and three things the merge made necessary: - scripts/contract.sh: EXPECT_MAIN is 62 (main's 60, and the two sign-out contract tests). - status.md: main took G-28 (the acceptance list); the sign-out's row is G-29. PLAN.md keeps main's text and this branch's #44 sentence. - X06 joins the acceptance list (tools/compat-record/gen-acceptance.py EXTRA, regenerated acceptance.csv: 54 rows), since the list is now held to the fixtures and the recorder. POST /auth/sign-out/ is a route of the pinned inventory, which the generator checks. - tests/sign_out.rs carries the crate's test-code lint allowance, now that the panic lints apply to thrust-compat-plane (#129). Refs: plane-byd.3 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 12, 2026
`EXPECT_MAIN` is 65: main's 62 (the compat tests of #124, #127 and #130) and this branch's three. The deployed-Worker count of `stage2-contract.sh` is 59 (the six `oidc_` tests are skipped there), and the docs say so. The one conflict was that line of `scripts/contract.sh`, as at the last merge. Measured on native-memory after the merge: the main pass 65 of 65, the sweeper pass 3 of 3. Refs: #58 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 12, 2026
…truction, not by a random draw (#131) `model_asset_methods_match_the_reference_against_postgres` ended with a check that its 24 random sequences had, among them, reached every one of 14 "situations" (AGENTS.md rule 8: what the model must get to, or it proves less than it seems to). Some situations need a chain of unlikely steps: a delete is one step in twenty, and `mark-of-a-deleted-one` then needs a mark of that very asset. The seed is random, so the check failed on a fair share of runs, each time for a different situation: `mark-of-a-deleted-one`, `marked-again` and `cover-replaced` in the three CI failures of one PR (#128, whose changes are not in this crate), which passed on main's merge commits for #124 and #127. Nothing the model compares was ever wrong in those runs. The assertion was wrong, not the code, and it is replaced by a stronger one that does not depend on chance (AGENTS.md rule 3): three pinned sequences, run first through the same `run_case` against the same Postgres, reach every situation by construction, and the test fails at once, naming the situation, if they do not. The random sequences follow, as before, to look for what no one thought to pin; what the run reached is printed (`ASSET-MODEL-OBSERVATION`) and no longer asserted. Measured (2026-11-11, a real Postgres container): the test passes six times in a row (each run draws its own seed), and reaches all 14 situations in the pinned sequences alone. Control: with the last step of the third sequence removed, it fails with `no pinned sequence gets to "cover-replaced"`. Refs: #44 Co-authored-by: Claude Sonnet 5.5 <[email protected]>
This was referenced Nov 12, 2026
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
Second of three changes for #51 (the first, #126, is merged). The internal API now answers a reproduced 500 as the pin does, and S47's page size of 0 or less stops being a 400.
PlaneErroranswersCoreError::Internaland::Upstreamas the pin's catch-all 500 throughthrust_plane_types::plane_500, ininto_response, so it holds for?on aCoreErrorand for aPlaneError::Otherbuilt by hand (the unmerged assets stage builds one).PlaneError::internal(cause)is for a request the pin fails on purpose. Before this, a failure was{"error":{"code":"internal",...}}(an object where the React client reads a string, PQ-107) and an unavailable identity provider was a 502. Every otherCoreErroranswers as before (a test compares them withthrust-api's answer, header for header).per_pageof 0 or less, under a comment saying the pin answers 500. That was read from the source. It is recorded now, and the list does what the recording says.What the pin does (recorded,
S47.json: 9 new exchanges)per_page=0,per_page=-1,cursor=3:0:0&per_page=0{"error":"Something went wrong please try again later"}cursor=5:1:1&per_page=3(a previous-page cursor whose size is not the page size, PQ-403: from source only until now)cursor=3:-1:1&per_page=0(a page before the first, but offset is 0)cursor=abc&per_page=0Invalid cursor parameter.cursor=3:1:0&per_page=-1(offset page x size < 0)Error in parsing...&per_page=0&updated_at__gt=nonsensePlease provide valid detail...&per_page=0&filters=nonsenseinvalid_jsonSo the 500 is the pin's last check, and
window()makes it after every other one; the early offset check now takes the size into account.How it was recorded:
tools/compat-record/record.pyon a fresh oracle stack (the pin's images, workers stopped), twice, because the first recording shaped the second's questions.git diff --statafter the second recording shows onlyS47.jsonchanged,X02(which needsORACLE_DIR) included, so the other 55 of the 56 fixtures are byte-identical across two independent stacks. The stack was torn down afterwards (0 containers, 0 volumes).Evidence
issues.rs/error.rs, one at a timeparity_s47_list_work_itemsamong them), the 500 before the cursor is read, before the filters are read, the offset check ignoring the size, PQ-403 let through, an internal failure falling through tothrust-api's body,Upstreama 502 again, the wrong text, the cause dropped. A kill needed nextest exit 100 and aFAILline.cargo nextest run -p thrust-compat-plane -p thrust-plane-types -p thrust-api-v1(rebased on current main)EXPECT_MAIN57 to 58)native-memory58/58 on the rebased branch;native-pg58/58 (before the rebase)--workspace --all-targets -D warnings, wasm32 Worker clippy,cargo fmt --all --check,scripts/check-deps.sh,scripts/check-plane-500.shRead before merging
a_page_size_is_a_whole_number_from_one_to_the_caphad the caseszeroandnegativeasserting Thrust's own 400; its comment said "the pin's being a 500". That was a placeholder for a deviation round 27 superseded, and the recording shows the test was wrong about the pin. The two cases are not dropped: they move intothe_pins_500_is_the_last_check_of_the_page(9 cases, each an exchange of the fixture, in the pin's order) and two generated tests over the size range.DEVIATIONS.mdD-028 (4) is edited (it is still "pending owner confirmation"): the page size is no longer listed as a deviation.is_draft: trueandarchived_aton a creation (S48), for which "the pin answers 500, and archives". The S48 fixture has no such exchange, so it is from source, and compat still ignores the fields. I have not widened this PR to it. It needs a recording first./api/v1and compat share, not recorded: aper_pagebeyondi64(-99999999999999999999) is a 400 here because it does not parse as ani64; Python'sintwould accept it and the pin would very likely answer 500.Not run here
The two Worker targets (
worker-memory,worker-cf) of the contract suite: CI runs amaincell for each.hermeticcan still fail on the knownthrust-editor-docproperty test (#114), which failed once on #126 and passed on rerun; it is unrelated to this change.Next for #51
The acceptance list with the
comm -3check, and the lints on this crate. That PR is the last one for #51; this one says "Refs #51" on purpose.🤖 Generated with Claude Code