Repository navigation
feat(compat): the profile half of boot and onboarding: S02 signed in, S07, S10, S11, S27 and the onboard route - #81
Merged
Conversation
… S07, S10, S11, S27 and the onboard route Stage 3a of #44. The signed-in user (short shape for GET, long shape for PATCH), the profile with Plane's 29 keys, the tour and onboarded flags, answered from a new user_profiles table (migration 0008, a directory table keyed by the user: typed columns for what core acts on, a JSON `preferences` object for the long tail of settings). PATCH /api/users/me/onboard/ is built too and is NOT one of the 48 rows of research/0003 section 8.1 (called X04 here): the stock onboarding's last step awaits it (finishUserOnboarding), so a 404 would stop the page finishing and fail the journey's no-404 criterion. Recorded as an inventory gap in docs/src/testing/status.md (G-17). Ports and both adapters get user_by_id, insert_profile, profile and update_profile; the update is ONE statement (every column the patch does not name keeps its value, preferences merge by jsonb ||), because the onboarding page sends several requests at once. Core gets me, update_me, contains_url (Plane's URL regex by hand, differentially tested against the regex itself), is_known_timezone (433 names generated from the oracle container's pytz 2024.1), and sign-up makes the profile and sign-in records when. The compat crate validates the way DRF does (fields.rs); the fixtures pin the messages the pin gave, which corrected one I had derived ("Must be a valid boolean."). The recorder now keeps signed-in sessions and records `as` on each request; the harness keeps a jar and sends it. Recordings on two independent fresh stacks are byte-identical, and the six earlier fixtures did not change. Controls shown red: Postgres update_profile replacing preferences instead of merging fails the model (after the first version of the model could NOT see that, which is why a compound ProfileLife op and a ProfilePrefsMerged class now exist); a read-then-write update_profile loses 29 of 32 concurrent patches and fails the new concurrency test. The model's generator-coverage control sample goes from 1000 to 3000: adding ops thinned out an existing rare class (GotDeletedHidden) to one sample from missing. cargo-mutants: compat crate 177 tested, first run 25 missed (all in fields.rs and one in users.rs), now 0 missed; core profile.rs 49 tested, 3 missed, now 0; core auth.rs diff 3 (1 caught, 2 unviable); memory adapter diff 12 (9 caught, 3 unviable). Not mutated: the Postgres adapter (covered by the generated model and its own tests). EXPECT_MAIN 44 -> 47; native-memory and native-pg 47/47; workspace nextest 1319 passed; Postgres adapter tests 16 passed; 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 3 of #44, first half. The plan had one PR for "boot and onboarding" (S07 to S16, S18, S27). That is too much to review at once, so I split it: this PR is the user and profile half, and the next is the workspace half (S08, S09, S12 to S16, S18). S08 (
users/me/settings) reports the user's workspaces, so it belongs with the second half.GET /api/users/me/signed inGET /api/users/me/profile/PATCH /api/users/me/{field: [message]}PATCH /api/users/me/profile/PATCH /api/users/me/tour-completed/{"message": "Updated successfully"}PATCH /api/users/me/onboard/A route the inventory missed
PATCH /api/users/me/onboard/is not one of the 48 rows of research/0003 §8.1, but the stock onboarding's last step,finishUserOnboarding(apps/web/store/user/profile.store.tsat the pin), awaits it with notry. A 404 would stop the page from finishing and fail #44's own "no 404 in the network log" criterion. I built it and called it X04. The issue and the plan count 48 + X01 to X03, so that number is now 49 + X01 to X03; you may want to correct the issue text. Recorded as G-17.How it works
user_profiles(migration 0008) is a directory table keyed by the user. Typed columns hold what core acts on; the long tail of settings (theme, language, role, ...) is a JSONpreferencesobject, so a new setting costs no migration. The compat layer fills a missing key with Plane's default.update_profileis one statement. The onboarding page sends several requests at once, each changing different fields of one profile, so a read-modify-write would lose changes.contains_urlis Plane's URL regex written by hand, because core carries no regex engine. It is tested differentially against the regex itself (the pattern as a dev-only oracle): 50,000 cases per property, plus the two length limits at their exact edges.tools/compat-record/gen-timezones.py), not copied from anywhere.fields.rs). The fixtures pin the messages the pin gave.What recording corrected
I had derived DRF's boolean message as
"maybe" is not a valid boolean.. The pin saysMust be a valid boolean.The recording caught it on the first run, which is why messages are recorded where they can be.Controls, and one that did not fail
update_profilereplaces preferences instead of mergingProfileLifeop and aProfilePrefsMergedclass (the coverage control now requires a merge-dependent sequence); with those, it failsupdate_profileas read-then-writeGotDeletedHidden) to one sample from missingcontains_urlgenerator1.2.3.256is not an addressMutation testing (cargo-mutants 27.1.0, nextest 0.9.140):
thrust-compat-planefields.rs, 1 inusers.rs); after tests, 1 left, an equivalent one (a hex checkUuid::parse_stralready makes), which I removed;fields.rsrerun 67 of 67 caughtprofile.rsauth.rsdiffNot mutated: the Postgres adapter, which the generated model and
pg_adapter.rscover (schema, constraints, idempotent migration, concurrency).Recording
The recorder keeps signed-in sessions and writes
ason each request; the harness keeps a jar and sends it. Recordings on two independent fresh stacks are byte-identical, and the six earlier fixtures did not change across four fresh recordings.Gaps (G-17)
The messages not recorded are read from DRF's source: a number accepted as text, DRF's boolean spellings (
"yes","off",1), Django's for the flags. Differences kept on purpose: datetimes are always UTC (the pin renders in the user's zone);tokenin the long user is a string of the pin's shape and is not a credential (the pin rotates a real one on every save);avatar_assetandcover_image_assetare ignored until the asset flow exists;onboarding_stepmust be a JSON object (the pin stores any JSON); a body that is not a JSON object is a 400 with Thrust's own message.Verified
cargo nextest run --workspace: 1319 passed.scripts/contract.sh native-memoryandnative-pg: 47 of 47 (EXPECT_MAIN44 to 47). The Worker targets are for CI.binary(pg_adapter)).scripts/check-deps.shclean;cargo check -p thrust-worker --target wasm32-unknown-unknownbuilds.CLEAN, including themaincontract pass onworker-memoryandworker-cfand themutantsjob (no re-run needed this time).I did not commit
mod.proptest-regressionschanges: my deliberately broken builds had appended a seed to it, andmutants.shdisables that persistence for exactly this reason, so I restored it tomain's version.Effort
Modelled for the rows (research/0003 §8.1): S07, S10, S11, S27 at 0.15 pd each (crud/S), 0.6 pd, and X04 unmodelled. Most of this PR is the profile table, a use-case, adapter methods, DRF validation and a model extension, 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