docs(agents): the repairs phone app, /offline as a real route, and the session on the repairs API

This commit is contained in:
Dave 2026-11-06 19:58:24 +02:00
parent 38bc370f74
commit 5ed58c0fc0

View file

@ -375,7 +375,8 @@ planned phone app lives at `/repairs-app`, not built yet.
and the supplier scope is gone, the signed copy is accepted and not
stored, and the agent is told the upload worked. Add the fields FIRST,
then verify by round-tripping a save — do not wait for an error, there
will not be one.
will not be one. The phone booking-in form is the first surface that
WRITES `supplier_scope`, so it is where the loss would show first.
- **The repairs REST family requires a browser session** (closed
2026-11-06). Every handler under `/api/v1/repairs/` checks
`assertBrowserSession` first and answers **401** without one — they
@ -388,12 +389,29 @@ planned phone app lives at `/repairs-app`, not built yet.
`AGENT_API_KEY`, so the MCP `files.fetch` tool keeps working. The
`repairs.*` MCP tools are gated by `assertAgentAuth` and call the
service layer directly, so they are unaffected.
- Phase 1 of the repairs work landed on `main` 2026-11-06 (`9358b37`):
the shared vocabulary, the service layer (`supplier_scope`,
`signed_request`, `getRepairStatusCounts`, `linkRepairToOrder`),
the REST routes (including `GET /api/v1/repairs/status-counts`), and
eight `repairs.*` MCP tools. The phone app at `/repairs-app` is
Phase 2 and does not exist yet.
- **The repairs phone app is at `/repairs-app`** (Phase 2 landed
2026-11-06). A standalone installable PWA — own manifest
(`public/manifest-repairs-app.json`), own service worker
(`public/sw-repairs-app.js`), its own route group
`src/app/(repairs-app)/repairs-app/`, `MobileAuthGate`, a fixed
bottom tab bar, and **no** office chrome. It is deliberately NOT in
the sidebar, like `/m`, `/counter`, `/manager` and `/rep`. Three
screens: the status board (filter chips whose counts reconcile, status
shown as text, no money), the booking-in form (camera → photos,
serial, customer, reported fault, supplier scope), and the repair
detail with ONE next step from `nextStepFor()`. **No money on any
phone screen** — the "Make customer quote" step deliberately reads
"Ask the office to quote" and names the repair and the customer so it
can be done over the phone, while the shared vocabulary still says
"Make customer quote" for the MCP and the office.
- **`/offline` is a real route now.** It was `src/app/offline.tsx`, a
page component at the wrong path, so `/offline` 404'd — and because
`Cache.addAll` is atomic, that made **all six** service workers in
this repo fail to install (browser-proven: installing → redundant). It
moved to `src/app/offline/page.tsx` on 2026-11-06 and all six now
install. If you add a seventh worker, remember that every worker here
registers at scope `/` and its `activate` must not delete the other
apps' caches — the repairs worker only deletes `wfdash-repairs-app-*`.
# The POS counter never sells at R0