Repository navigation
test(contract): move the engine pass onto /api/v1 with API keys - #125
Merged
Merged
Conversation
…rkspace search too `mutant_search_case_sensitive` (a `contains` that does not fold case, which `scripts/mutants.sh` runs the engine pass against and requires to fail) was only in `search_work_items`, the slice's per-project search. `/api/v1`'s search is another function, `search_workspace_work_items`, so an engine pass that goes through `/api/v1` would not see the mutant at all. It is in both now, through the same `fold` closure. Without it, the engine pass moved onto `/api/v1` passed 4 of 4 against the mutant (measured: exit 0), which `scripts/mutants.sh` would have reported as SURVIVED; with it, the two search tests fail. Refs: #58 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The four `engine_` tests (`engine.rs`, `scripts/contract.sh <target> engine`) went
through the slice's routes with a Bearer session. They go through `/api/v1` with
the fixture's API key now, and the pass starts the target with
`THRUST_V1_RATE_LIMIT=1000000/minute` as well, because the 10,000 creates of 50
writers are far more than Plane's 60 requests a minute per key.
- The 50-writer test checks the numbers as before (no duplicate, contiguous from
1, none reused after the deletes). Each writer deletes the work items it made,
because the pin lets a member delete only those, and the whole list is read
back by cursor (a thousand to a page) and compared with the numbers made and
not deleted. The `sort_order` check is dropped: the pin reads the greatest one
of a state before it inserts, so two creates at once can share a place.
- The search tests go through the pin's workspace search
(`/workspaces/{slug}/issues/search/`). The oracle is the pin's: a work item
matches when its name has the query in it (any case), or its project's
identifier does, or the query says its number as a whole number; the first 100
newest first; a description is not searched (the test says so with a
control). The two deliberately wrong matchers (case-sensitive, prefix-only)
still have to differ from it on the corpus. A stranger to the workspace and a
member of no project are answered with nothing, not refused; a blank or
missing text is no search.
- The bulk seed's numbering is checked through `/api/v1`; its own `sort_order`
and plain description are not shown there and are not held to the pin's rule.
Measured (2026-11-11): the engine pass, 4 of 4, on native-memory, native-pg,
worker-memory and worker-cf (183 s on worker-cf for the 10,000 creates).
Controls: the `duplicate-sequence-number` mutant fails 2 of the 4 (the 10k test
and the bulk seed), and the `case-sensitive-search` mutant fails the 2 search
tests (with the mutant also on the workspace search, the previous commit).
Refs: #58
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
G-26 lists stage 2a as moved, and says that the case-sensitive-search mutant was found surviving the moved pass and is now in the workspace search too. The contract-suite and mutation pages say which surface the engine pass uses, the pin's workspace search it compares with, and where the mutant sits. Refs: #58 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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
Stage 2a of moving the contract suite off the slice's
/api/_sliceroutes (G-26 indocs/src/testing/status.mdis the ledger; the shape is the owner's choice of 2026-11-11: staged, work-item tests onto/api/v1with API keys). Stage 1 was #122. This moves the engine pass: the fourengine_tests ofengine.rs.Part of #58 (not closing it).
Stage 2b (the model test and the access matrices) is not here. The model is a spec of the slice's behaviour, with attachments, the activity feeds,
with_deletedand bearer actors in it, so it cannot move whole; carving a/api/v1model out of it is a design of its own, and I will propose it separately.What changed
engine.rs: the four tests go through/api/v1with the fixture's API key. The pass needs the target started with a very high/api/v1limit (the 10,000 creates of 50 writers are far over Plane's 60 requests a minute per key), soscripts/contract.shexportsTHRUST_V1_RATE_LIMIT=1000000/minutefor theenginepass, as it already does fororacle.lib.rsof the suite:v1_list_all(a whole list by cursor, a thousand to a page),v1_searchandv1_search_hits.thrust-adapters-memory:mutant_search_case_sensitiveis insearch_workspace_work_itemstoo (see below).What the tests say now (the pin's answers)
sort_ordercheck is dropped: the pin reads the greatest one of a state before it inserts, so two creates at once can share a place./workspaces/{slug}/issues/search/): a work item matches when its name has the query in it (any case), or its project identifier does, or the query says its number as a whole number; the first 100, newest first. A description is not searched, and a control says so. A stranger and a member of no project are answered with nothing, not refused (the old route said 404 and 403); a blank or missing text is no search. The two deliberately wrong matchers (case-sensitive, prefix-only) must still differ from the oracle on the corpus./api/v1. Its ownsort_orderand plain description are not shown there and are not held to a rule.A finding: the mutant was on the wrong search
scripts/mutants.shruns this pass againstmutant_search_case_sensitiveand requires it to fail. That mutant was only in the slice's per-projectsearch_work_items;/api/v1searches throughsearch_workspace_work_items. Measured on this branch before the fix: the engine pass passed 4 of 4 against the mutant (exit 0), which the script would have reported as SURVIVED. The mutant is in both searches now (its own commit), and the two search tests fail against it.Evidence (2026-11-11, local)
scripts/contract.sh <target> engine: 4 passed, 4 expected, onnative-memory,native-pg,worker-memoryandworker-cf(183 s onworker-cf). On Postgres the pin's search, withILIKEand escaping, agrees with the oracle on all 400 generated queries.duplicate-sequence-numberfails 2 of 4 (the 10k test and the bulk seed);case-sensitive-searchfails the 2 search tests (and passed 4 of 4 before the second commit).cargo nextest run -p thrust-adapters-memory: 529 passed.cargo fmt --all --checkandcargo clippy -p thrust-contract-tests -p thrust-adapters-memory --all-targets -- -D warnings: clean.scripts/mutants.sh(themutantsjob runs it) and the main pass on the four targets (not touched here; the memory adapter's change is inside acfgthat the default build does not take).contract-all.sh, so CI runs it only throughmutants.Not done (G-26)
Stage 2b (the model test and the matrices), and then what stays on the slice until the routes that replace it exist: sign-out and sign-out-everywhere, the session info, OIDC, API-key management, the activity feeds, attachments, and the tests that use a slice work item as their vehicle (the outbox, redelivery, sweeper and panic tests, the create limit, the cookie and CSRF tests, the bench).
🤖 Generated with Claude Code