T-AAR2-zoo-real-backend-e2e
State: planning/proposed · Impact: medium · Complexity: large
Move zoo’s Playwright suite off its browser mock and onto the real backend over HTTP in a scratch root, following the pumice pattern.
| Location | Role today |
|---|---|
apps/zoo/src-tauri/src/commands/ | Tauri IPC commands; no HTTP transport and no axum dependency |
apps/zoo/src-tauri/src/bin/zoo-cli.rs | A CLI bin, not a server |
apps/zoo/src-nuxt/app/plugins/browser-mock.client.ts, app/utils/browser-mock.ts | Dev-only IPC stand-in |
apps/zoo/src-nuxt/tests/e2e/ | 4 Playwright specs (delete-instance, netpolicy, mappings, …) against bun run dev on 18110 and the mock |
apps/zoo/moon.yml | e2e task, local only |
dirs::home_dir() | Called in spec/engine.rs, bin/zoo-cli.rs, commands/mappings.rs to expand ~ and pick a default browse root. These are content-plane paths, not state |
dev-ports.yaml | zoo 18110 |
Proposed
Section titled “Proposed”Zoo’s handlers sit behind a transport-agnostic API with an HTTP router, a zoo-server bin on the
shared headless helper from T-UU4J builds state from fleet dirs, the web build picks HTTP
outside Tauri, and the e2e suite runs through scratchTauriApp. The dirs::home_dir() calls go
through one helper with an #[expect(clippy::disallowed_methods, reason = "…")], since they resolve
user content, not state.
Approach
Section titled “Approach”- Make the command handlers transport-agnostic; generate or hand-write an Axum router over them.
- Add
zoo-serveron the shared helper, using fleet dirs and adev-ports.yamlport. - Web transport selection in the Nuxt app.
- Port the Playwright suite; for VM-launching flows, decide per spec whether the backend runs the real VM path in CI or the spec stays desktop-only, and record the choice in the PR.
- Route the
home_dircalls through one annotated helper. - Delete the mock if nothing else uses it.
| Area | Note |
|---|---|
apps/zoo/src-tauri/ | API split, router, zoo-server |
apps/zoo/src-nuxt/ | Transport, suite, mock removal |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
moon run zoo:e2epasses againstzoo-serverin a scratch root, with the isolation assertion on. - AC-2: No e2e spec relies on
browser-mock. - AC-3: Clippy reports no unannotated
dirs::call in zoo.
Out of scope
Section titled “Out of scope”- Desktop smoke.
- Other apps (
T-KOTJ,T-JPFC,T-TLET).
Dependencies
Section titled “Dependencies”T-UU4Jfor the headless helper andscratchTauriApp.
Discovery context
Section titled “Discovery context”- The plan listed zoo’s
dirs::calls as state paths to move onto fleet. They expand user paths, so they get an annotated opt-out instead.
Depends on
Section titled “Depends on”T-UU4J