Repository navigation
feat(compat): work items, the list, the create and the detail: S47, S48, X01 - #85
Merged
Merged
Conversation
…48, X01 Stage 6a of the walking skeleton (#44): the three rows the journey's last steps need. X02 (history) and X03 (update) follow in 6b. A work item gains what the app reads and writes: a state, a priority, start and target dates, the time it was completed and last changed and by whom, a description, assignees and labels (migration 0013, `work_item_details`; a work item the slice made reads as the pin's defaults). The ports get `work_item_page`, `work_item_row`, `max_work_item_sort_order` and `Tx::insert_work_item_attrs`, in the memory and Postgres adapters; the page is one statement with a window count (two when the page is empty), so S47 stays within five round trips by construction. #39 is still open and no counter test holds it: recorded in G-21. - thrust-core `issues`: `create_issue`, `list_issues`, `get_issue` behind `issue_reader` and `issue_writer`; the place of a new item is after the greatest in its state (65535, then steps of 10000, as the pin gives them). - `Scope::mint` is now only in `authorize_with_role`, which `authorize` delegates to; `scripts/check-deps.sh` follows. - thrust-compat-plane `issues`: the three handlers; DRF's field messages (a date read as Django does, in three forms; a list of keys read member by member), the pin's pagination envelope and cursors, its order allowlist, and the description cleaned by `thrust_editor_doc::sanitize`. - thrust-editor-doc gets a `yjs` feature (default on) around `yrs`, so the compat crate takes only the sanitiser: `yrs` reaches getrandom and so wasm-bindgen and js-sys on wasm32, which `scripts/check-deps.sh` rightly refused in this crate. - Fixtures S47, S48 and X01 recorded from the pin (55, 55 and 8 exchanges; S32 re-recorded: the normaliser kept request dates as placeholders, so Thrust was sent invalid ones). The normaliser gains `keep_times` for request bodies in both languages. - New deviation D-028 (flat, unfiltered list; null-only parent, estimate, cycle and module; `per_page` of 0 or less is 400, the pin's 500), pending owner confirmation. New gap G-21 and the mutation result in `docs/src/testing/status.md`. Verified: nextest ci workspace 2213 passed; contract 54/54 on native-memory and native-pg; pg_adapter 30; wasm32 check of the Worker and the editor Worker; check-deps clean (and it failed before the `yjs` split: the control); the model reaches every class and found a real divergence (a slice-inserted item got Postgres's clock as `updated_at`; its seed is committed). Mutation: no missed mutant in core or the memory adapter's work item methods; one in compat `issues.rs` (the `archived_at` arm of `order`), equivalent, documented in G-21. Refs: plane-byd.12.2 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
added a commit
that referenced
this pull request
Nov 7, 2026
…k items and relations the page asks for (#97) Stage 6b of #44, after 6a (#85). PATCH on a work item (X03) and its history (X02) against the pin, plus the two reads the work item page makes next, answered empty as D-021 does (sub-issues, issue-relation). - migration 0014: work_item_activities, one row per change an event names, keyed by (event_id, ordinal) so a redelivered event writes nothing - ports: Tx::update_work_item, work_item_history and the activity writers, in the memory and Postgres adapters - core: Permission::UpdateWorkItem and update_issue; the activity consumer (process_event) now also projects history - compat: the PATCH route, history/, sub-issues/ and issue-relation/; fixtures X02 and X03 recorded from the pin - D-029 (six differences from the pin) and G-22 (what is recorded and what is read from source only); contract.sh EXPECT_MAIN 54 to 55 Refs: #44 Co-authored-by: Claude Sonnet 5.5 <[email protected]>
5 tasks
This was referenced Nov 15, 2026
Closed
Merged
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 6a of #44: a member makes a work item, the project lists it and the app opens it. Stage 6 is split as stage 3 was; 6b (X03 update, X02 history, and the peek view's other calls) follows once this merges.
POST /api/workspaces/{slug}/projects/{id}/issues/GET .../issues/cursorandper_page, the next and previous cursors, every order the pin allows (the others are-created_at),updated_at__gt; nothing grouped or filtered (D-028)GET .../issues/{id}/expandHow it works
none, no state,<p></p>), so the slice routes and their tests are untouched except that a slice insert now writesupdated_at = created_at(the model found Postgres's clock being used instead).work_item_page,work_item_row,max_work_item_sort_orderandTx::insert_work_item_attrs, in the memory and Postgres adapters. A page is one statement with a window count (a second only when the page is empty, to still say how many there are). S47 is therefore at most five statements by construction (the caller's membership, a guest's workspace access and the project's flag, the page, its count); chore(worker): setplacement.region = aws:us-east-1; add the 5-round-trip budget counter to the contract suite #39 is still open and no counter test holds it (list_endpoints_stay_within_five_db_round_tripsdoes not exist yet), so this is recorded in G-21 and not asserted.issues:create_issue,list_issues,get_issuebehindissue_readerandissue_writer. A creation, its attributes and itswork_item.createdevent are one transaction. A new item's place is after the greatest in its state (65535, then steps of 10000, as the pin gives them: probed, not guessed).Scope::mintis now only inauthorize_with_role(authorizedelegates to it);scripts/check-deps.shfollows.issues: DRF's readings, probed on the pin and recorded: a date asYYYY-MM-DDwith or without the zeros, asYYYYMMDDor as an ISO week; a list of keys read member by member (null and""members,null, a boolean); a page size with spaces or a plus sign. The description goes throughthrust_editor_doc::sanitize::validate_html_content.thrust-editor-docgets ayjsfeature (default on) aroundyrs; the compat crate takes onlysanitize. The first full verification run failedscripts/check-deps.sh:yrsreachesgetrandomand sowasm-bindgenandjs-syson wasm32, which the guard keeps out of this crate. I fixed the cause rather than add an exception.thrust-editor-workerasks foryjs, so it is unchanged.For your decision
group_by,sub_group_by, the pin's legacy filters and afiltersobject that says anything are refused with 400 (the other choice, answering a grouped or filtered request with a flat list, would be wrong data); aparent_idthat is a work item of the project is refused as not supported yet;per_pageof 0 or less is 400 (the pin answers 500);is_draft: trueandarchived_aton a creation are ignored (the pin answers 500, and archives); a state or label of another project is told as no such object. Full list and the pin's side inDEVIATIONS.md.ammonia(and sohtml5ever) is now in the Worker bundle through the compat crate. I have not measured the bundle; spike 0006 measured the sanitiser alone.Controls
45 one-line breakages, each applied from a backup and restored byte for byte (
cmp), each failing at least one test (nextest exit 100). Two more did not count and were redone: one that did not compile (exit 101, which is not a detection) and one whose sed did not apply.has_nextat the limit; the count past the end off by one; assignees who left, or who are not in the project, shown; labels descending; the greatest place counting a deleted item, or ignoring the state;completed_attaken fromupdated_at; a slice insert not writingupdated_atpg_adaptertestnow()pg_adaptertestcompleted_atset for a cancelled state; the place's step 5000 or its first 65536; guests assignable; the default assignee dropped; equal dates refused; the guest's list unfiltered, and a guest reading what others made; parent kinds swapped and not expanded; the page size cap 1001; the next cursor plus two; the total pages floored; the default order ascending;urgentnot a choice; the list's type name wrong; the description not cleaned;group_byand a priority filter allowed; 200 for 201; the guest's message changed; the compact date refusedThe model's generator-coverage control reaches all 156 classes.
Mutation testing (cargo-mutants 27.1.0, nextest 0.9.140):
issues.rsissues.rskey_list(removed, sincekey_fieldalready answers null and""). The one left is the"archived_at"arm oforder: every listed item is unarchived, so ordering by it is all ties, newest first, which is what the fall-through gives; no route makes an archived item to tell them apart. Documented in G-21work_item_page,work_item_row,max_work_item_sort_order,insert_work_item_attrs,compare_work_itemsmax_work_item_sort_order, which had no test in its own crate; it has a property nowNot mutated: the Postgres adapter, which the generated model and
pg_adapter.rscover.Recording
Three fixtures: S48 (55 exchanges), S47 (55), X01 (8), recorded from the pin on a fresh stack; every earlier fixture is unchanged except S32, which is re-recorded: the normaliser had turned dates in request bodies into placeholders, so Thrust was sent invalid ones (found when S48 needed real dates). Request bodies now keep their times and dates in both normalisers (
keep_times; a shared case innormalise-cases.json). Beyond the journey's own calls, the date edges (19, including week 53 and the first and last year) were probed on the pin; all agree with the tests.Gaps (G-21,
docs/src/testing/status.md)Read from the source, not recorded: what a project guest and a workspace member outside the project see for each row (the Caller by Row matrix),
updated_at__gtwith a date, the envelope's arithmetic over many items (a property), the work items a guest made. Not built: grouping and filtering, the parent, estimate, cycle and modules, the counts of attachments, links and sub work items, a subscription. The model cannot reach an archived item or a draft (no route makes one;pg_adapter.rsholds the counts) nor a page of 1000 rows.Verified
cargo nextest run --profile ci --workspace: 2213 passed, 4 skipped. Doctests pass.scripts/contract.sh native-memoryandnative-pg: 54 of 54 (EXPECT_MAIN53 to 54). The Worker targets are for CI.scripts/check-deps.shclean (it failed before theyjssplit, which is the control for that fix);cargo checkofthrust-workerand ofthrust-editor-workerfor wasm32 builds; clippy clean;scripts/mutants.shkills every control.mod.proptest-regressionsgains one seed, a real counterexample (theupdated_atdivergence above), fixed.cargo fmt --checkreports differences in files this PR does not touch (thrust-adapters-cloudflare); CI does not run it.Effort
Modelled for the rows (research/0003 §8.1): S47 1.25, S48 0.9, X01 2.5, which is 4.65 pd. Most of this PR is the attribute tables, the page's orders and cursors in both adapters and the model extension, and probing the pin for DRF's readings, which the model prices separately or not at all. I did not time the work, so there is no actual pd to report.
Refs: plane-byd.12.2
🤖 Generated with Claude Code