phase: 07_kiosk_layout_state
Every AGENTS.md rule claim checks out against the code — no stale statements. All verification is complete.
**Phase 07 — final verification pass report**
- **Verified, not re-implemented:** all 3 tasks already in `complete/` — `Arrange`/`layout` frames + `hello.kiosk` (protocol), `Layout`/`set_layout`/`layout_dto` policy (registry), `arrange` dispatch + `GET /api/kiosk` (app).
- **Live check:** idle `/api/kiosk` → `{"staged": null, "fullscreen": false, "followers": 0}`; drove `arrange` over a real WebSocket (websocat absent → python `websockets` client): state reflected in `/api/kiosk`, kiosk join bumped `followers` to 1 and pushed to other viewers, sharer teardown reset `staged` to `null` in exactly one `layout` frame — no stale id.
- **Gates (all 4):** `uv run ruff check . && uv run ruff format --check .` → clean; `uv run pyright` → 0 errors; `uv run pytest` → **319 passed, 5 skipped** (realdisplay, by design); `MIRROR_REALDISPLAY=1 uv run pytest -m realdisplay` → **4 passed, 1 skipped** (documented host has no audio source).
- **Criteria 1/4/5:** targeted suite 154 passed incl. all new layout cases; stale-fallback unit tests cover unpublish, disconnect, and stream-replacement; `git diff` of `src/mirror/static/` and `tests/e2e/` is empty, e2e green within the full run.
- **Criterion 6:** full suite 100% green; coverage 95% total — new/modified code: protocol 100%, registry 99%, app 94% (all >90%).
- **Criterion 7:** `PLAN.md` untouched.
- **Documentation:** README.md reviewed in full and cross-checked against code (routes, CLI flags, config table incl. 25 Mbit/s default, quality-preset table, watch/share key tables, docs references, the phase-07 shared-state paragraph) — consistent, no fixes needed. AGENTS.md — verified, no stale statements, no changes.
- **Note:** `PLAN.md` §6 says the default `MIRROR_MAX_BITRATE` is "12 Mbit/s" but code/README say 25 — pre-existing, in a LOCKED file, left as-is (README is correct).
- **Next pending phase:** `08_kiosk_page`.
This commit is contained in:
@@ -59,6 +59,18 @@ roster deltas to viewers.
|
||||
└────── WebRTC (SRTP, LAN, p2p) ─────────┴─────────────────┘
|
||||
```
|
||||
|
||||
**The wall has one shared state.** The server keeps which mirror is on stage, whether
|
||||
it is fullscreen, and how many displays are obeying that (`followers` — peers whose
|
||||
`hello` said `"kiosk": true`). Any connected peer may change it with an `arrange`
|
||||
frame on `/ws` (`{"type":"arrange","staged":"<id>","fullscreen":true}`); an absent
|
||||
field is "no opinion", `"staged": null` is "back to the wall". A change is pushed
|
||||
immediately as a `layout` frame to every viewer (and back to the sender), and the
|
||||
same object is readable at `GET /api/kiosk` — `curl`-debuggable like `/api/streams`,
|
||||
`Cache-Control: no-store`. The state has no audio: sound always traces back to a
|
||||
gesture on the device that plays it (see [SECURITY.md](SECURITY.md) §4). The kiosk
|
||||
page that follows this state arrives in a later release; the wire and the read
|
||||
surface are what any client builds on.
|
||||
|
||||
## Configuration
|
||||
|
||||
Environment variables (all optional; a `.env` file is loaded if present):
|
||||
|
||||
Reference in New Issue
Block a user