Skip to content

feat(compat): the 48-route minimum slice with the auth-client JSON change #44

Closed

Description

@aRustyDev

Context

Today thrust_api::router() (crates/thrust-api/src/lib.rs:269-293) serves the spike slice only: work items, activity and attachments, with no /auth routes. The tree has neither a compat crate nor a React app. docs/src/architecture/app.md:119-120 says thrust-compat-plane does not exist and there is no web/ directory, although Q-0005.2 (answered in round 15) moves the frontend into this repository. research/0003 §8.1 lists what the stock React UI needs for "sign up, onboard, create workspace, create project, create work item, see it in the list". That is 48 route rows (S01 to S48) on 42 distinct paths, plus X01 to X03 to open the item.

Problem

  • At the pin, the slice is estimated at 39.3 pd (26.7 to 66.7) and every P0 row React uses at 207.6 pd (research/0003 §15.6, lines 817 and 819). FR-01 says to build the slice first and bound everything after it by the M2 acceptance list (feat(compat): the M2 daily-use screens (acceptance list) with every other route stubbed and recorded #46). ADR-0034's round-27 tripwires reopen it if the slice costs more than 66 pd or the re-estimated P0 exceeds 364 pd (adrs/api/0034-internal-api-compat-layer-and-core-openapi.md:68; Q-0009.1, QUESTIONS.md:280).
  • The auth-client JSON change is the largest lever inside the Q-R2 allowed areas (research/0003 §9 row 1, line 528; ADR-0034 :60). Today sign-in is a browser form POST to /auth/sign-in/ with a CSRF token fetched as JSON (apps/web/core/components/account/auth-forms/password.tsx:122-125, :150-151 at the oracle pin), and the server answers 302 ?error_code=. Emulating that costs about 16 pd and 41 of the 545 rows. Q-0009.1 says to make the change before reopening ADR-0034.
  • Two React behaviours fix shapes. Any 401 sends the app to /?next_path= (apps/web/core/services/api.service.ts:29-31), so a 401 must mean only "no or expired session"; a role failure must be a 403. An unauthenticated GET /api/users/me/ must return a JSON object with no id (research/0003 §9 rows 2 and 3).
  • In Plane, seven slice handlers dispatch background tasks, so the outbox sits on the slice's write path (§8.1, line 500). The project page fires 13 reads and the workspace wrapper 9 (§1 item 5).

Proposal

Acceptance criteria

  • Every row S01 to S48 and X01 to X03 has a route. A parity_ test per row compares status and normalised body with a fixture recorded from the pinned oracle (in tests/parity/fixtures/). Control: a mutated fixture fails.
  • Contract tests on all four targets: a slice read with no session gets 401; a member lacking the role gets 403; an unauthenticated GET /api/users/me/ gets a JSON object with no id.
  • git diff --stat ba85d4d3d3 -- apps/web packages, run against the imported tree, lists only auth-client and base-URL or service-layer files (Q-R2).
  • Against wrangler dev with the Cloudflare set, the stock React app completes sign up, onboarding, workspace, project, work item and list, and the browser network log shows no 404. That journey becomes the first test(e2e): Playwright journey suite on the stock React app as the UI oracle #45 journey.
  • The closing comment records actual pd against 39.3 pd and says whether either ADR-0034 tripwire fired.

References

  • Review: .agents/plans/contrail/reviews/2026-10-19-fable-architecture-review.md (FR-01; §3 M1 row)
  • research/0003-compat-plane-inventory.md §1, §8, §8.1 (lines 439-507), §8.2, §9 (lines 522-539), §15.6 (lines 794-833)
  • ADR-0034 (:60, :68; round-29 note), ADR-0001 (:43, walking skeleton), ADR-0013 (round-29 note), ADR-0050, ADR-0052
  • Q-0009.1, Q-R2, Q-0005.1, Q-0005.2, Q-0010.1; FEATURES F-X13, F-A03, F-B01 to F-B03; DEVIATIONS D-013
  • spikes/0009-compat-plane-inventory.md; slice definition scripts/compat-inventory/p0_slice.py (off-repo, spikes/README.md:54; chore(plans): bring the compat-inventory and spike-0004 scripts into this repository under tools/ #55)
  • Plane oracle (oracle/v1-pin-20261018): apps/web/core/components/account/auth-forms/password.tsx:122-125,150-151, apps/web/core/services/api.service.ts:29-31
  • crates/thrust-api/src/lib.rs:269-293; docs/src/architecture/app.md:115-124
  • Beads: plane-byd.3

Blocked by: #35, #36, #37, #38, #47

Finding: FR-01

Activity

  1. added this to the M1 Walking skeleton milestone on Oct 20, 2026
  2. added
    area:app
    review:fable-2026-10-19
    on Oct 20, 2026
  3. 6 remaining items

  4. aRustyDev commented on Nov 12, 2026

    @aRustyDev
    OwnerAuthor

    Closing #44: the walking skeleton runs, and what is not measured

    The stock React app now signs a user up, onboards them, makes a workspace, a project and a work item, and lists it, against the Worker with the Cloudflare set, with no 404 in the browser's network log. Five acceptance criteria, in order.

    1. Every row has a route and a parity_ test against the pin

    Done, and more. The acceptance list is now a file (crates/thrust-compat-plane/tests/parity/acceptance.csv): 56 rows, S01 to S48 and X01 to X08, all served, each with a fixture recorded from the pinned Plane (69 fixtures, one parity_ test each). scripts/check-acceptance-list.sh holds the list, the fixtures and the oracle recorder to the same rows in CI. Controls: a mutated fixture fails (parity_control_* in tests/parity.rs), and so do a missing, extra or pending row.

    X04 to X08 are routes the 48 rows lack: the onboarding call (X04), a cover's own address (X05), sign-out (X06), and two stubs the first journey needs (X07 stickies, X08 cover pictures). PRs: #79 to #85, #97, #120, #124, #127, #129, #130, #132.

    2. Contract tests on all four targets

    The main pass (62 tests) runs on native-memory, native-pg, worker-memory and worker-cf in CI, and was green on the last PR. Among them, a slice read with no session is 401 (S02 answers a JSON object with no id: compat_users_me_without_a_session_is_401_json_with_no_id), and a caller without the role is 403 with the pin's two bodies (error from its decorator, detail from a permission class): a stranger to the workspace, a member outside a project, and the rest. The guest rows are in the hermetic tests/workspace_load.rs. S17 and S47 send 3 statements per list against the budget of 5, measured on native-pg and worker-cf (G-24).

    3. Q-R2: only the auth client differs from the pin

    The command as written, git diff --stat ba85d4d3d3 -- apps/web packages, cannot run in this repository: the import is a vendored copy (web/SOURCE) and the pin's objects are not here. Its equivalent is scripts/check-web-diff.sh (CI job web): it compares tree hashes against web/PIN-MANIFEST and requires the set of files that differ to equal web/ALLOWED-CHANGES exactly. Result: 3869 files, 2 differ: apps/web/components/account/auth-forms/password.tsx and apps/web/services/auth.service.ts. The base URL is empty at build time (same origin), so it needed no edit, and the collab provider and branding are untouched. (The issue's apps/web/core/... paths have no core/ segment at the pin.)

    Narrower than proposed: only password.tsx and signOut changed. unique-code.tsx, reset-password.tsx, hooks/oauth/core.tsx and packages/services/.../auth.service.ts stay at the pin, because the server routes they call (magic code, password reset, social login) are not built, and a client change would only move the failure.

    4. The journey

    #132: e2e/journey.spec.ts drives the built app in Chromium against the Worker, which serves it. It fails on any 404 or 5xx (the allowlist is empty) and cannot pass without proving something: /_info must say CSRF enforcement is off, the app's files must be files and not the fallback page (a missing hashed asset is a 200 text/html), a minimum of API responses, a 201 for the work item and the list after a reload with the title on it. Its control, a route answering 404 in the browser, must fail it by naming the 404. worker-cf e2e is a cell of the contract matrix, green in CI (35 of 35 checks). It is the first #45 journey.

    5. Actual pd, and the two tripwires

    Actual pd per effort class was not recorded. There is no time log, pd is the owner's attention (PLAN.md), and the model's unit costs are inputs, not measurements. So this comment gives a bound, not a figure.

    A measured figure can still be added to this issue by the owner; ADR-0034's re-check would then use it.

    Deviations and decisions

    Each is in DEVIATIONS.md, with the pin's behaviour beside it.

    • Decided: D-021 (stubs outside the list, now including X07 and X08), D-022 (the auth client posts JSON; confirmed 2026-11-11), D-024 (workspace_seed is not reproduced in M1; port it after).
    • Pending the owner: D-023 (password strength rule), D-025 (workspaces_exist read live), D-026 (a project's lead must be a member), D-027 (three project fields hold less), D-028 (work items listed flat and unfiltered), D-029 (X03 and X02 in six ways), D-035 (the asset stage builds the cover only), D-036 (sign-out).

    Known gaps (G-30, G-29)

    • Opening a work item calls GET .../work-items/{id}/description-versions/, which the pin answers and Thrust does not: a 404 outside this journey.
    • A change to web/ alone runs the web job (the Q-R2 gate and a build) and not the journey's cell: the classifier keeps web/ out of rust.
    • The journey signs up; sign-in and sign-out were checked by hand in a real browser, not in CI.
    • The native server does not serve the app (ADR-0011), so there is no native target.
    • Uploads go through an API-hosted one-time PUT address on every target; an R2 presigned URL, which takes the bytes off the Worker, is not built.

    Follow-ups

    1. The workspace_seed port (D-024): feat(compat): port Plane's workspace_seed, so a new workspace is not empty #138.
    2. An R2 SigV4 presign for uploads, with a real-R2 smoke test: feat(storage): presigned PUT for uploads on R2, so cover bytes bypass the Worker #139.
    3. description-versions, and whatever else opening a work item calls: not a separate issue, because feat(compat): the M2 daily-use screens (acceptance list) with every other route stubbed and recorded #46's criteria already cover it; the details are in a comment on #46.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:appprio:p0review:fable-2026-10-19

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions