Skip to content

test(oracle): record a non-member's reads of a public project on the pin, which SD-002 and SD-003 rest on - #215

Merged
aRustyDev merged 4 commits into
mainfrom
test/oracle-public-project-non-member
Nov 16, 2026
Merged

aRustyDev merged 4 commits into
mainfrom
test/oracle-public-project-non-member

Conversation

@aRustyDev

Copy link
Copy Markdown
Owner

A follow-up to #58 (closed). It puts a recorded observation under SD-002 and SD-003 of the schema diff, which rested on the pin's source, and records the owner's decision (2026-11-16) that Thrust reproduces what the pin does. Thrust needs no change: it already answers what the pin answers.

Stacked on #214 ("every v1 route reads JSON only"): the two touch the same G-25 row, so this PR's base is #214's branch and its diff is this one commit. Merge #214 first. GitHub then moves this PR to main, and I merge main into this branch (no force push), after which it is one commit on top of main.

The question

SD-002 and SD-003 say that the pin answers member_role: null and sort_order: null for a project the caller is not in, although its schema says non-nullable (EX-006's class, which Thrust reproduces). They rested on the pin's source (the annotations are subqueries on the caller's own membership), because every recorded project body is the owner's, who is in both seeded projects. The owner decided to reproduce it and asked for the evidence.

What the pin answers

Four steps are appended to the projects scenario of record_corpus.py: the owner makes a public project, the seeded member (a workspace member who is not in it) lists the workspace's projects and reads that project, and the owner deletes it. Recorded on the pin:

  • list: PUB (the new one) and WTY (which the earlier create-wrong-type step leaves behind, because the pin answers it 201) have is_member: false, member_role: null, sort_order: null; ORA, which the member is in, has 15 and 65535.0.
  • detail: member_role: null, and no sort_order key at all (the detail does not annotate it).

That is what SD-002 and SD-003 claim. It is now recorded as well as read.

The recording is the pin's

The whole corpus was re-recorded for it on a stack built and seeded from nothing. The seed manifest, nine of the ten resources and the first 26 projects exchanges came out byte-identical to the committed ones, so projects.json only grows (367 lines added, none removed). The new exchanges are appended, not inserted, because the order of a scenario is part of its contract.

The comparison

On the corpus of 112 exchanges (108 before):

target compared accepted unaccepted stale gate
the pin 112 0 (0 differences) 0 0 157 cases, 13 failures, all accepted
Thrust native-memory 112 15 (13 before) 0 0 162 cases, 12 failures, all accepted
Thrust native-pg 112 15 0 0 the same
Thrust worker-cf 112 15 0 0 the same

The controls hold on all four. The first run against Thrust had two unaccepted differences, on the seeded project ORA that the list shows: total_cycles and total_modules (the pin's ORA has one cycle and one module, Thrust has none: D-030 (1)). They are the same two that the owner's own lists carry, so non-member-lists-a-public-project joins EX-C01's exchanges, which is why accepted went from 13 to 15. Nothing about the nulls differs.

What changed

  • record_corpus.py, corpus/projects.json, corpus/INDEX.json: the four steps and their recording; README entries 8 and 9 list the edits to vendored files, in one commit because the corpus alone would fail its own comparison until EX-C01 names the new list.
  • exceptions.yaml: the scope's floor is 112; EX-C01 names the new list.
  • schema/diff-accepted.json: SD-002 and SD-003 cite the recorded exchanges and the owner's decision, and their ref says so.
  • G-25 and the X14 row say 112 and that all three nulls of EX-006 are recorded; the four labels' corpus.json results are the new measurements (a run's gate.json differs from the committed one only by its random port, and I left those as they were).

Checked

The crate tests that read the corpus pass (thrust-api-v1 588 of 588, thrust-plane-types 9 of 9), and all 15 steps of CI's deps job pass. The pin's stack was built and removed again, with its volumes, on this machine. CI's oracle cells run the three Thrust targets against the same corpus.

🤖 Generated with Claude Code

aRustyDev and others added 2 commits November 16, 2026 00:56
…al client sends a form

The owner decided on 2026-11-16 that a body that is a form or multipart is a 415 on every `/api/v1` route that reads a body, which is what D-030 (5) said for the projects and what the oracle's gate already assumed (`json_bodies_only` in `exceptions.yaml`, for all 32 operations). D-031 (5) (states), D-032 (6) (labels) and D-033 (11) (work items) were proposed, one resource at a time, because the confirmation of 2026-11-07 was the projects' only. They are that same decision now, and the records say so.

- D-030 (5) states the rule for the four resources, notes what the pin does (DRF's default parsers, with the same JSON example repeated under each media type; on a project the form is read as lists, so every text field answers "Not a valid string."), and carries the trigger to revisit it: a real client that sends a form, such as an integration, a script or a report from a user. Nothing says one does today: the gate sends JSON only and the corpus has no form exchange. It also says why reading forms would be a feature of its own and not a change to the item: DRF reads HTML input by other rules than JSON (strings only, a list as repeated keys, an empty string for a null), so it is a second input path per field, which can be held to the pin only by form exchanges recorded on it. The compat plane does read urlencoded bodies where a browser sends them (the reset routes).
- D-031 (5), D-032 (6) and D-033 (11) are marked confirmed, as D-030 (5), and no longer "proposed and not yet confirmed" in the headers of their rows.
- The eight register entries SD-004, SD-005, SD-010, SD-011, SD-013, SD-014, SD-015 and SD-016 cite the decision with its dates, and `ref` no longer says "proposed".
- The comments of the four `a_form_or_a_multipart_body_is_a_415` tests, of `request::json_body` (which said forms were "not read here yet") and of the scope in `exceptions.yaml`, and G-25, say the same.

Nothing else changes: the document is byte for byte the committed one (103 findings, 0 unaccepted, 0 stale, 0 ambiguous), the crate's tests are 588 of 588, `cargo fmt --check` is clean, and the 15 steps of CI's `deps` job pass.

Refs: #58
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…pin, which SD-002 and SD-003 rest on

SD-002 and SD-003 of the schema diff say that the pin answers `member_role: null` and `sort_order: null` for a project the caller is not in, although its schema says non-nullable. They rested on the pin's source (the annotations of `views/project.py` are subqueries on the caller's own membership), because every recorded project body is the owner's, who is a member of both seeded projects, and no seeded caller is a workspace member outside a public project. The owner decided on 2026-11-16 that Thrust reproduces it (EX-006's rule), and asked for the evidence.

Four steps are appended to the `projects` scenario of `record_corpus.py`: the owner makes a public project, the seeded `member` (a workspace member who is not in it) lists the workspace's projects and reads that project, and the owner deletes it. They were recorded on the pin, and the pin answers:

- list: `PUB` (the new one) and `WTY` (which the earlier `create-wrong-type` step leaves behind) have `is_member: false`, `member_role: null`, `sort_order: null`; `ORA`, which the `member` is in, has 15 and 65535.0;
- detail: `member_role: null` and no `sort_order` key at all (the detail does not annotate it).

That is what SD-002 and SD-003 claim, and what Thrust already answers: nothing in Thrust changes.

The whole corpus was re-recorded for it on a stack built and seeded from nothing, and everything else came out as committed: the seed manifest, nine of the ten resources and the first 26 `projects` exchanges are byte-identical, so the 26 before the four are unchanged and `projects.json` only grows (367 lines added, none removed).

The comparison, on the corpus of 112 exchanges (108 before):

- the pin, `scripts/oracle-v1.sh plane controls`, on a freshly seeded stack with its snapshot: 112 compared, 0 differences; the gate 157 cases, 13 failures, all accepted; the controls hold;
- Thrust, `native-memory`, `native-pg` and `worker-cf`: 112 compared, 15 accepted (13 before), 0 unaccepted, 0 stale; the gate 162 cases, 12 failures, all accepted; the controls hold. The two more accepted are EX-C01's `total_cycles` and `total_modules` on the seeded project `ORA` (one of each on the pin, none here: D-030 (1)), which the non-member's list shows as the owner's lists do, so `non-member-lists-a-public-project` joins EX-C01's exchanges. Nothing about the nulls differs.

Also changed: `min_exchanges_compared` of the scope is 112; SD-002 and SD-003 cite the recorded exchanges and the owner's decision, and their `ref` says so; G-25 and the X14 row say 112 and that all three nulls of EX-006 are recorded; the four labels' `corpus.json` results are the new measurements (the `gate.json` and `controls.json` of a run differ only by a random port, and are left as they were); README entries 8 and 9 list the edits to the vendored files, which are one commit because the corpus alone would fail its own comparison until EX-C01 names the new list. The crate tests that read the corpus pass (`thrust-api-v1` 588 of 588, `thrust-plane-types` 9 of 9), and the 15 steps of CI's `deps` job pass.

This builds on the commit before it (every v1 route reads JSON only), which touches the same G-25 row.

Refs: #58
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Base automatically changed from docs/v1-reads-json-only to main November 16, 2026 15:53
…oject-non-member

# Conflicts:
#	docs/src/testing/status.md
…oject-non-member

# Conflicts:
#	docs/src/testing/status.md
@aRustyDev
aRustyDev merged commit 16eaa55 into main Nov 16, 2026
16 checks passed
@aRustyDev
aRustyDev deleted the test/oracle-public-project-non-member branch November 16, 2026 19:36
aRustyDev added a commit that referenced this pull request Nov 17, 2026
…y a random draw (#280)

`model_assets_match_the_reference_over_any_sequence` ended with a check that its 256 random sequences had, among them, reached
every one of 17 "situations" (AGENTS.md rule 8: what the model must get to, or it proves less than it seems to). The seed is
random, so the check failed on a share of runs, for the rarest situation: `opened-in-project` on #215 (run 43813860948, a change
to docs and the oracle corpus), the only failure of 4239 test cases. Nothing the model compares was wrong. #131 fixed the same defect in
the self-hosted adapters' twin of this test; this is the core's.

Measured on the unchanged test (2026-11-17): 3000 independent runs of the 256-case batch, 1 would have failed the check, and the
situation it missed was `opened-in-project`. Per sequence, over 100,000 random sequences, `opened-in-project` (a create, an upload,
a confirm, an attach, then an open by someone in the project) is reached by 3.4%, so a batch misses it with probability 1.3e-4,
about one run in 7,900. The next rarest, `attached-some-left-out` (5.5%), is missed once in 1.8 million runs; every other one is
rarer still. The check also did not run at all below 128 cases.

The assertion was wrong, not the code, and it is replaced by one that does not depend on chance (AGENTS.md rule 3): three pinned
sequences, run first through the same `run_model`, 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. `docs/src/testing/techniques/model-based.md` says so.

Controls: with the step that opens the project's asset as a member removed from the second pinned sequence, the test fails with
`no pinned sequence gets to "opened-in-project"`; with `open_asset` planted to skip its access check and `PROPTEST_CASES=1`, a
pinned sequence fails (`left "ok", right "no-access": Open { actor: OutsiderA, asset: 0 }`), so the pinned part catches it alone;
with `PROPTEST_CASES=4` the test passes and the pinned check still runs. `cargo nextest run -p thrust-core`: 1611 passed.

Refs: #44

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant