Skip to content

feat(e2e): the first browser journey, the stock app against a Worker that serves it - #132

Merged
aRustyDev merged 4 commits into
mainfrom
feat/web-serve-and-journey
Nov 12, 2026
Merged

aRustyDev merged 4 commits into
mainfrom
feat/web-serve-and-journey

Conversation

@aRustyDev

@aRustyDev aRustyDev commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Part of #44: its last acceptance criterion ("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"). Does not close it: the closing comment (pd against 39.3, the ADR-0034 tripwires) is still to write.

What changes

The Worker serves the app. scripts/worker-dev.sh takes THRUST_ASSETS_DIR and writes an [assets] block into the throwaway copy of the config (never the shared wrangler.toml): one single-page app, every path the Worker handles run first in both forms, as ADR-0011 requires.

Two stubs, found by walking the journey. The home page asked for GET /api/workspaces/{slug}/stickies/ and the project form's cover picker for GET /api/unsplash/, and both were 404. They are D-021 stubs, recorded from the pin as X07 (ten exchanges) and X08 (three) and added to the acceptance list (now 56 rows). The pin answers [] for Unsplash when no key is configured (the oracle has none), and the paginator's envelope over no rows for the stickies. The paginator code moved out of S47 into src/page.rs so both lists page the same way.

The journey. e2e/journey.spec.ts (Playwright 1.65.0, pnpm 11.10.0, lockfile committed) drives the built app in Chromium: sign-up, the profile and workspace steps, the welcome tour, a project, a work item, and the list after a reload (so it is the server's list). It fails on any 404 or 5xx; the allowlist is empty. scripts/e2e.sh <target> [controls] runs it; the contract suite gains an e2e pass; worker-cf e2e is now a cell of contract-all.sh, so CI plans it (contract-cell.yml builds the app and gets the browser for that pass only). e2e/ counts as a rust-side change in the classifier.

It cannot pass without proving something

/_info must say CSRF enforcement is off; more than 20 files must come from /assets/ and none may be the fallback page (a missing hashed file is answered 200 text/html, so a 404 check cannot see it); more than 30 /api/ responses; a 201 for the creation (S48) and a 200 list (S47) after it; the title on screen before and after the reload. My first version assumed the app re-fetches the list after saving; it does not (it fills its store from the create response), which is why the reload is there.

Verified

  • cargo fmt --check; clippy -D warnings native and wasm32; cargo nextest run --profile ci --workspace: 3564 passed; doctests; check-web-diff.sh, check-plane-500.sh, check-acceptance-list.sh, check-topology.sh, check-placement.sh, the generator's self-test and the recorder's.
  • The journey and its control passed on worker-memory and on worker-cf, locally, on the final tree. The control (the stickies list answering 404 in the browser) must fail the journey, naming that 404; the script and the cell require both.
  • By hand, once: with both stubs unmounted from the Worker the journey failed naming /stickies/ and /unsplash/, and passed again with them. This is not in CI.
  • Planted bugs, each caught: a page parameter read before the caller is checked, a default page size of 25, an Unsplash answer that is not a list (hermetic tests, and both parity rows).
  • .github/scripts/tests under dash in ubuntu:24.04: 60 of 60 (the runner's shell, not macOS's).
  • CI, on b9164e8: all 35 checks succeeded, the new contract (worker-cf, e2e) cell and gate among them.
  • The cell's first run (96e4ab5) failed, and the fault was in the spec: the journey itself passed on the runner, but with the stickies route answering 404 in the control, a later click waited out the two-minute test timeout, so the 404 was never named and the script refused the control. The spec now judges the network log before the screen's outcome, and bounds every action at 30 seconds (b9164e8). I saw both paths locally with a selector broken on purpose (reverted).

Not verified

  • The cell has passed once on the fixed spec. A journey on a runner can still be slow or flaky for reasons I have not seen; there are no retries by design, so a flake shows as a red cell.
  • X07 and X08 were recorded once, on one oracle stack.
  • per_page=0 on the stickies list is the pin's 500 by S47's rule; I probed it, and it is not in the fixture.

Known gaps (G-30)

  1. Opening the work item calls GET .../work-items/{id}/description-versions/, which the pin answers and Thrust does not: a 404 outside this journey, not built.
  2. A change to web/ alone runs the web job (the Q-R2 gate and a build) and not this cell. The classifier deliberately keeps web/ out of rust, and I did not change that; the fix would be an owner's call.
  3. The journey signs up; it does not sign in or out, so G-29's hand-checked paths stay hand-checked.
  4. The native server does not serve the app (ADR-0011, round 29): there is no native target.
  5. The app logs a React hydration error (#418) on first load; the journey does not assert on it.

Needs your decision

Nothing new: the stubs fall under D-021. Still pending from earlier: D-023, D-025 to D-029, D-035, D-036.

🤖 Generated with Claude Code

aRustyDev and others added 3 commits November 11, 2026 20:40
…as the pin answers them

The first browser journey (sign-up to the work-item list) makes two requests that the pin
answers and Thrust 404ed: the workspace home page asks for the caller's stickies, and the
project form's cover picker asks for Unsplash pictures. Both are D-021 stubs.

X07, GET /api/workspaces/{slug}/stickies/: the paginator's envelope over no rows, for any
role in the workspace; the pin's 401, its 403 (also for a workspace that is not there) and
its 400s come first. X08, GET /api/unsplash/: [] for any signed-in caller, which is what the
pin answers when no Unsplash key is configured (the oracle has none).

The paginator's reading of per_page and cursor, and its envelope, move out of S47 into
src/page.rs so the two lists page the same way; S47's behaviour is unchanged (the crate's 721
tests, S47's parity row among them, passed after the move and before the stubs were added).

Both are recorded from the pin (X07: ten exchanges, X08: three; the recorder steps are
new, the 67 older fixtures are byte-identical) and join the acceptance list (56 rows). Tests:
the who-may-ask matrix gains X07 (ten rows by six callers), a property over any page size,
page and search, a matrix that a refused caller is not told about a bad page, and one over
X08's callers. Planted bugs, each caught: a parameter read before the caller is checked, a
default page size of 25, an Unsplash answer that is not a list (the hermetic tests and both
parity rows).

Refs: plane-byd.3
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…that serves it

#44's last acceptance criterion: against the Worker with the Cloudflare set, the stock React
app completes sign-up, onboarding, workspace, project, work item and list, and the browser's
network log shows no 404. It becomes the first journey of #45.

scripts/worker-dev.sh serves a directory of static files (THRUST_ASSETS_DIR) by writing an
[assets] block into the throwaway copy of the config, never the shared wrangler.toml: one
single-page app, every path the Worker handles run first in both forms (ADR-0011). The
contract suite gains an `e2e` pass (worker targets only, CSRF at the Worker's default, off),
which starts the target and runs scripts/e2e.sh, which drives e2e/journey.spec.ts in
Chromium (Playwright 1.65.0, pnpm 11.10.0, lockfile committed). `worker-cf e2e` is a cell of
contract-all.sh, so CI plans it; contract-cell.yml builds the app and gets the browser for
that pass only, and the classifier counts e2e/ as a rust-side change.

The spec fails on any 404 or 5xx (the allowlist is empty), and cannot pass vacuously: /_info
must say CSRF is off, more than 20 files must come from /assets/ and none be the fallback
page (a missing hashed file is a 200 text/html), more than 30 /api/ responses, a 201 for the
creation and a 200 list after it, and the title on screen before and after a reload. Its
control, the stickies list answering 404 in the browser, must fail the journey by naming it.

Measured here: the journey and its control pass on worker-memory and worker-cf. With both
stubs unmounted from the Worker the journey failed naming /stickies/ and /unsplash/ (by hand,
not in CI). The CI cell has not run yet.

Refs: plane-byd.3
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…, and the plan row

G-30 says what the journey covers, which guards stop a pass that proves nothing, the controls
that were run and how, and seven known gaps: opening a work item still calls one route that is
not built (description-versions), a web-only change does not run the cell, the journey does
not sign in or out, there is no native target, a hydration error in the console is not
asserted, per_page=0 on the stickies list is probed and not recorded, and the real unmounting
was done by hand once. D-021's table gains X07 and X08; PLAN.md, app.md, running.md, the
contract-suite page and AGENTS.md follow.

Refs: plane-byd.3
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@socket-security

socket-security Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​playwright/​test@​1.65.010010010099100

View full report

…d every action

The first CI run of the `worker-cf e2e` cell passed the journey and failed its control: with
the stickies route answering 404, a later click waited out the test's two-minute timeout, so
the spec never reached the check that names the 404, and the script (rightly) refused a control
that failed for another reason.

That is a fault in the spec, not only a slow runner: a route that is not mounted can break the
page as well as show in the log, and then the 404 is the finding. The screen is now walked in
a `try`; the log is judged first (a failure with a 404 or a 5xx in it is reported as that, with
the screen's own failure noted), and a screen failure with nothing in the log is rethrown as it
is. Every action is bounded at 30 seconds, so a screen that will not move fails in half a
minute. Both paths were seen with a selector broken on purpose (reverted): the main run
reported the timeout, the control reported the 404 and the timeout.

Refs: plane-byd.3
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@aRustyDev
aRustyDev merged commit 847f7f7 into main Nov 12, 2026
35 checks passed
@aRustyDev
aRustyDev deleted the feat/web-serve-and-journey branch November 12, 2026 03:40
aRustyDev added a commit that referenced this pull request Nov 12, 2026
…d and the controls that need no Plane (#137)

#132 built the first browser journey as #44's last criterion and said it
becomes the first of #45's. This makes the journeys a suite that a second
journey, and the same journeys on the pinned Plane, can join without
rewriting what guards them.

- One spec per journey in e2e/journeys/ (the M1 journey moves there with
  git mv); what they share in e2e/support/: the target adapter, the
  network-log judge and the controls.
- E2E_TARGET=thrust|plane and a target guard that runs before any click and
  names itself (TARGET GUARD). It reads /_info by its body: behind a proxy
  or the single-page fallback a path that does not exist is a 200
  text/html, and a status check alone would call that a Thrust. The Plane
  form cannot use GET /api/instances/, which Thrust serves in the pin's
  shape on purpose (S01).
- A count guard: scripts/e2e.sh reads each run's own JSON report
  (e2e/support/check-report.mjs) and requires one passed journey per file
  in e2e/journeys/, none skipped, unexpected or flaky. Playwright exits 0
  for a skipped test, so the exit status alone cannot say it.
- Three controls beside the stickies 404, each a run that must fail and
  say why: the work-item list emptied in the browser (must fail at "see it
  in the list:"; the run fails as CONTROL INERT if it emptied nothing), the
  journey skipping itself (the count guard must refuse it), and the journey
  told it is on the other target (must fail at the target guard).
- Docs: the testing pages (app-and-e2e, defect-matrix X18, by-change,
  running), AGENTS.md, the rust-test-app skill's pointer, PLAN, and G-31
  with what was measured and what was not.

Measured locally on worker-cf: the journey and all four controls behave as
required. The server-side variant of the empty-list control was run once by
hand (list returning no rows, reverted, not committed) and the journey
failed at "see it in the list:". The count guard was run on eight synthetic
reports. The Plane form of the target guard has only been run to refuse a
Thrust: the pinned-Plane leg is the next PR.

Refs: #45

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant