Use when adding or changing Meta Watcher HTTP endpoints, `RuntimeState` methods, MJPEG/JPEG behavior, or any API consumed by the Astro operator UI. Trigger on edits to `meta_watcher/web/server.py` or `meta_watcher/web/state.py`.
Use when adding or changing Meta Watcher HTTP endpoints, `RuntimeState` methods, MJPEG/JPEG behavior, or any API consumed by the Astro operator UI. Trigger on edits to `meta_watcher/web/server.py` or `meta_watcher/web/state.py`.
Web surface skill
When to use
Adding, removing, or changing an endpoint in meta_watcher/web/server.py.
Changing the wire shape of /api/snapshot or /api/config.
When not to use
Changes inside StreamProcessor or StreamRuntime — use pipeline-core.
Changes in the Astro source — use frontend-astro. If the UI needs a new field, you usually update both skills' outputs in one commit.
Rules
Thread safety is load-bearing. Every read/write against RuntimeState is guarded by self._lock or self._frame_cond. New fields must follow the same pattern. Do not expose raw mutable references outside the lock.
Patches are additive and conservative.update_config only merges top-level keys that already exist on the dataclasses. Do not loosen this — it is relied on by the UI and tests.
Errors flow through _on_error. Any new background task must report failures via _on_error(str) so the UI banner stays consistent.
Bump the JPEG version when something changes. If you introduce a new writer path, make sure it calls self._latest_jpeg_version += 1 inside the cond so MJPEG waiters wake up.
Endpoints return JSON. Except for /stream.mjpg, /frame.jpg, and static content, every endpoint returns JSONResponse. Error responses use {"error": "..."} with an appropriate HTTP status.
Keep FastAPI disabled from auto-docs.docs_url=None, redoc_url=None. The authoritative docs are docs/reference/http-api.md.