Repository navigation
feat(compat): project create and open: S30, S32, S34 to S46 - #84
Merged
Merged
Conversation
Stage 5 of #44. A member makes a project (S30), changes it (S32) and opens it (S34), and every read the project page makes answers: the counts (S35), the caller's own row (S36), their list settings (S37), the labels (S38), the people (S39), the states (S40), the intake state (S41), and the estimates, cycles, modules and views (S42 to S46). S17 and S20 are recorded again with a project in the workspace. Migration 0012 gives a project the rest of its columns and makes its name and key unique in the workspace, gives a project member and their settings row the columns the app reads, and adds the `states` and `labels` tables. A creation is one transaction (the project, its members with their settings, its six states), so two creations racing for one name leave exactly one project and nothing behind (16 real tasks in `pg_adapter.rs`). A member's place in their own list is 10000 below the lowest they hold in the workspace, as on the pin. S20, S40 and S41 are real (the states table was built now, not stubbed until a later stage). S42 to S46 are stubs (D-021, listed), S35's `completed_issues`, `total_cycles` and `total_modules` are 0, and S38 is real with no route that writes a label yet. Two deviations, both pending the owner: D-026 (a project's lead must be an active member of the workspace: the pin lets anyone lead a project, Thrust's schema ties a project member to a workspace member) and D-027 (the logo must be an object; the estimate, default state and cover image take null or an empty string only). DRF's reading of each kind of value is the pin's, probed against it and recorded in fixture S32 (49 exchanges): a lead as an integer, float, list or object, `""` as null, months as `7.0` or ` 7 `, `description_html` of any type, a relation as a non-UUID. The shared key reader and the `py_repr` that writes a value as Python does came out of the first mutation run, which had missed 30 mutants, 17 of them in these readers. Fixtures: 17 new, recorded on a fresh stack (the earlier ones did not change); the fixture header gained `uses` and `binds` so a row that names a project carries the id across fixtures. Controls shown red: 43 one-line breakages (a SQL clause, a migration constraint, a handler line, a core rule); 37 failed a test at once, 5 more after the tests they showed missing were added (a key that differs by case, draft work items in the counts, the states group CHECK, the race path's field choice, a change that names no lead), and one is equivalent (the decorator and the core both refuse a guest with one body). cargo-mutants 27.1.0: core projects.rs 56 tested, 41 caught, 15 unviable, 0 missed; compat projects.rs and workspace_load.rs 202 tested, 101 caught, 98 unviable, 3 missed, 2 of them caught after one recorded case (14 of 14 of `py_string`), the third equivalent (the clash pre-check's `||`: core's conflict path gives the same answer); memory adapter project methods and seed 120 tested, 109 caught, 11 unviable, 0 missed. Model: ProjectLife, the settings-row sort order of a listing, the new `is_workspace_member`, a project whose member is no member of the workspace (146 step classes, up from 145; the coverage sample is 6000, up from 3000, for `HomeKept`). The model found D-026 and its own gap in the listing's sort order; both seeds are in `mod.proptest-regressions`. EXPECT_MAIN 51 -> 53; native-memory and native-pg 53/53; workspace nextest 2097 passed, 4 skipped; doctests pass; Postgres adapter tests 26 passed with the model at 256 cases; worker builds for wasm32; check-deps clean. Refs: plane-byd.12.2 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
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 5 of #44: a member makes a project, changes it and opens it, and every read the project page makes answers. S17 and S20 are recorded again with a project in the workspace (stage 4 could only show
[]).POST /api/workspaces/{slug}/projects/PATCH .../projects/{id}/GET .../projects/{id}/{"error": "You do not have permission"}to a non-member of a secret project, 409 to a non-member of a public oneGET .../project-stats/fieldsandproject_idsGET .../projects/{id}/project-members/me/GET .../projects/{id}/user-properties/GET .../projects/{id}/issue-labels/sort_order: real, with no route that writes one yet, so[]for every project made through the APIGET .../projects/{id}/members/GET .../projects/{id}/states/GET .../projects/{id}/intake-state/[]: stubs (D-021). Each still asks who the caller isHow it works
projectsthe rest of its columns (description, emoji, icon, views, months, time zone, lead, default assignee, external ids) and makes a project's name and key unique in the workspace (exact match, soPlaneandplaneare two names). A project member and their settings row get the columns the app reads, andstatesandlabelsare new. Idempotent like the files before it (migrateapplies every file on every start): each CHECK and foreign key is its own drop and add, a NOT NULL column that needs a backfill is added nullable, filled, then made NOT NULL.Conflict; two creations racing for one name leave exactly one project and nothing behind (16 real tasks inpg_adapter.rs, then a count of every table). A member's place in their own list is 10000 below the lowest they hold in the workspace, or 65535, as on the pin.^.*[&+,:;$^}{*=?@#|'<>.()%!-].*$, including its newline quirk), a name and a key trimmed, and DRF's reading of every kind of value a field may be sent as. That reading was probed against the pinned Plane and recorded (fixture S32 has 49 exchanges): a lead as an integer, a float, a list or an object,""as null, months as7.0or7or1e16,description_htmlof any type, a relation that is no UUID.is_workspace_memberis a new port method (memory, Postgres), used for the lead rule below and held by the model.For your decision
{"project_lead": ["The lead of a project must be a member of its workspace."]}. The pin accepts any user as lead and makes them a project admin without a workspace membership; Thrust's schema ties a project member to a workspace member (migration 0003), which is the rule that keeps a person who left a workspace out of its projects. The model found this when it generated a lead who was not a member. The alternative is to drop that foreign key.logo_propsmust be an object (the column has a CHECK; the app only ever sends one), andestimate,default_stateandcover_image_assettake null or""only (no estimate table, no asset table before the asset stage, and no screen sets a default state before M2). The pin accepts any JSON as a logo, and the id of a state asdefault_state.completed_issues,total_cyclesandtotal_modulesare added; S20 leaves the list (it is real).Controls
43 one-line breakages, each applied from a backup and restored byte for byte (checked with
cmp):is_workspace_memberignoring the active flag; intake states listed; the workspace's states for every project; archived projects counted; labels descending; a settings row overwrittenpg_adaptertestpg_adaptertestproject_stats; the states group CHECK dropped (I had widened it, which no valid input shows); the race path naming the wrong field; a change that names no lead being asked about the leadpg_adaptertest for the counts,projects_tests.rs, a core case in which the lead has left)The Postgres model's generator-coverage control reaches all 146 classes (one new); its sample is now 6000, up from 3000, because
HomeKeptthinned out.Mutation testing (cargo-mutants 27.1.0, nextest 0.9.140):
projects.rsis_workspace_member,workspace_states,project_labels)projects.rs,workspace_load.rspy_string) were caught after one more recorded case (14 of 14py_stringmutants), the third is equivalent: the clash pre-check's||, because core's conflict path gives the same answer. The first run missed 17, mostly in the readers of DRF's valuesis_workspace_member,seedis_workspace_member, the ids a settings row is made with, and the XORs that make a seeded member's and a seeded settings row's id)The first run's 30 survivors were the reason for most of the late work: probing the pin turned up that my
user_fieldandmonths_fielddiffered from it in several ways (""as a lead, a float or list as a lead,"7.0"months,description_htmlof non-text, a nullclose_in), so those are fixed and recorded. A property that I wrote for the seeded ids failed on the correct code first (the XOR is injective on random ids, not on every pair): its domain is now project ids with every high bit set and small user ids, and its comment says why. Not mutated: the Postgres adapter, which the generated model andpg_adapter.rscover.Recording
17 fixtures: S30, S32, S34 to S46, and
S17-after,S20-after. S30 records each field wrong in turn, the journey's project, a name or key taken (and one taken once trimmed), the same name in another workspace, and a project in each workspace; each read row is recorded for the creator, someone outside the workspace, no session and a project that does not exist. Recorded on a fresh stack; every earlier fixture did not change. The fixture header gainedusesandbinds, so a row that names a project carries the id across fixtures; the harness'sIds::preseedandJarhandle them.Gaps (G-20,
docs/src/testing/status.md)Read from the source, not recorded: what a guest and a workspace member outside the project see for every row (the Caller by Row matrix states it), the order of S17 with more than one project (the pin leaves it undefined; Thrust lists the newest first), a lead who is not a workspace member (D-026). Not built: the archive route, intake, a route that writes labels, sanitising
description_html, an estimate / default state / cover image that names a row (D-027). Two limits of reading Python's values: an integer past 2^64 reaches the handler as a float, and months written as"1_0"or with non-ASCII digits are refused (Python'sint()reads them). The model cannot reach a creation racing another (pg_adapter.rsdoes), or a draft work item (the slice never makes one;pg_adapter.rsholds the counts).Verified
cargo nextest run --profile ci --workspace: 2097 passed, 4 skipped. Doctests pass.scripts/contract.sh native-memoryandnative-pg: 53 of 53 (EXPECT_MAIN51 to 53). The Worker targets are for CI.binary(pg_adapter), no test leaky on an idle machine); the model at 256 cases.scripts/check-deps.shclean;scripts/rs cargo check -p thrust-worker --target wasm32-unknown-unknownbuilds.mod.proptest-regressionsgains two seeds, both real counterexamples (D-026, and the model's own gap in a listing's sort order), both fixed. Seeds that my deliberately broken builds wrote are not committed.Effort
Modelled for the rows (research/0003 §8.1): S30 0.4, S32 0.4, S34 0.4, S35 1.0, S36 0.15, S37 0.15, S38 0.15, S39 0.15, S40 0.15, S41 0.15, S42 0.15, S43 0.9, S44 2.5, S45 0.4, S46 0.4, which is 7.45 pd (S17 and S20 are counted in stage 4). Most of this PR is the states and labels tables, the project columns, 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