Repository navigation
Description
Context
Follow-up of #44 (closed). Deviation D-024 (owner, 2026-10-24): creating a workspace in Thrust makes the workspace and its creator's membership and nothing else, and the port of Plane's workspace_seed was left for after M1, with an issue to be filed when M1 closed. This is that issue.
What the pin does (tag oracle/v1-pin-20261018, apps/api/plane/bgtasks/workspace_seed_task.py): POST /api/workspaces/ answers 201 and then dispatches workspace_seed.delay(id) to Celery. The task, in this order:
- creates a bot user (
usernameand emailbot_user_<workspace id>@<host of WEB_URL, else plane.so>,display_name"Plane",is_bot,bot_type = WORKSPACE_SEED, an unusable random password) and makes it a workspace admin (role 20); - creates one project named after the workspace, with the identifier set to the first five alphanumeric characters of the name,
cycle_view,module_viewandissue_views_viewon, aProjectMemberand aProjectUserProperty(display filters and properties, fixed) for every workspace member at that moment; - then states, labels, cycles, modules, work items, views and pages from eight JSON files in
apps/api/plane/seeds/data/(projects,states,labels,cycles,modules,issues,views,pages). Each work item also gets anIssueSequence, anIssueActivity("created the issue"), itsIssueLabels, aCycleIssueandModuleIssues. The current cycle runs now to now + 14 days, an upcoming one starts the day after the last cycle ends and runs 14 days, and modulenstarts2ndays from now and runs 14 days.
Everything is created by the bot. The task is not part of the request's transaction: a failure is logged and re-raised, and the workspace stays unseeded with its 201 already sent.
Problem
On the pin, the first GET /api/workspaces/{slug}/projects/ and .../members/ after sign-up are not empty, and the member list contains the bot. On Thrust both are empty (D-024). The oracle is recorded with its workers stopped (tools/compat-record/fresh-oracle.sh runs dc stop worker beat-worker), so the fixtures agree with Thrust, and the parity tests do not see the difference; a real user of the stock app does. PQ-117 and PQ-609 (research/0007) mark this as breaks-clients/affects-parity-tests.
Interactions to check before building, not assumed:
- The pin refuses a project whose name or key is taken (409; G-20). A seeded project named after the workspace, with a five-character key, may collide with the project the feat(compat): the 48-route minimum slice with the auth-client JSON change #44 journey (and test(e2e): Playwright journey suite on the stock React app as the UI oracle #45's) creates. If it does, the journey needs a different name, or the seed a different key.
total_membersandworkspace-members/gain the bot. S09, S14 and S18 fixtures change (parity_s09_*,parity_s14_*,parity_s18_*are the tests D-024 names).- The cycle and module dates come from the clock, so the seed needs an injected clock (AGENTS.md testing rule 6).
Proposal
- Reproduce the seed's observable result: the bot (a user with
is_bot, a workspace admin, inmembers/), the sample project and its members, states, labels, cycles, modules, work items with their sequences and activity, views and pages, in the shapes the acceptance-list routes return. - Source of the seed data: Plane's eight JSON files, copied as data with a
SOURCEnote, asweb/andtools/oracle-v1were (no NOTICE is needed, ADR-0140; the repo is AGPL). I have not counted their rows; counting them is the first step, because it sets the size of the job. - How it runs is open, and is the owner's call: as a
workspace.seedqueue job on thejobstable of feat(jobs): exports and seeding as queue jobs with ajobstable (no workflow engine) #56 (ADR-0073 mapsworkspace_seedto a queue job, and the pin seeds after the 201, so a reader can see an empty workspace for a moment there too), or inline in S14's transaction (simpler, and no empty moment, which differs from the pin and would be a new deviation). The lean is the job, for fidelity with the pin and to keep the seed's many inserts out of the creation request; it then waits for feat(jobs): exports and seeding as queue jobs with ajobstable (no workflow engine) #56. - Seeding must be idempotent per workspace (a redelivered message cannot make a second project or bot), and a failed seed must not fail or roll back the workspace.
- Record S09, S14, S18 (and the projects and work-item reads that now find rows) again with the workers running, so the parity fixtures show the seeded workspace;
fresh-oracle.shgains a way to leave the workers up. The recorder must wait until the seed has finished (it is eventually consistent), asrecord_corpus.pywaits for the Celery worker for another quirk (G-25).
Acceptance criteria
- After a workspace is created and the seed has run,
projects/,members/, the project's states, labels, work items and the bot's membership match the pin's recording made with the workers running (ids, timestamps and the clock-derived dates normalised), asparity_tests with a mutated-fixture control. - Seeding twice (a redelivery) leaves one bot, one sample project and one set of rows; a seed that fails leaves the workspace created and the failure visible (logged and retried per the job machinery), with a contract test on all four targets.
- The seed's clock is injected, and a hermetic test fixes the dates it derives.
- The feat(compat): the 48-route minimum slice with the auth-client JSON change #44 journey still passes (renamed or re-keyed where it collides), on
worker-memoryandworker-cf. - D-024 is revised in
DEVIATIONS.md: closed if the seed is complete, narrowed to what is left if not; G-28's "PQ-117's seed is not run" and the plan row are updated. -
fresh-oracle.sh's comment about the stopped workers is corrected.
References
- D-024 (
.agents/plans/contrail/DEVIATIONS.md), PQ-117 and PQ-609 (research/0007),research/0003lines 397-401 and 580, ADR-0073 (line 83), ADR-0071 (line 138) - The pin:
apps/api/plane/bgtasks/workspace_seed_task.py,apps/api/plane/seeds/data/*.json tools/compat-record/fresh-oracle.sh;docs/src/testing/status.mdG-28, G-30
Blocked by: #56 (for the job form; not for the inline form)
Activity