Skip to content

#115 Tiles 3 + 4: rewire scene_synthesis + audio cards#119

Merged
BrettKinny merged 3 commits into
mainfrom
dashboard-rewire-scene-audio
May 23, 2026
Merged

#115 Tiles 3 + 4: rewire scene_synthesis + audio cards#119
BrettKinny merged 3 commits into
mainfrom
dashboard-rewire-scene-audio

Conversation

@BrettKinny
Copy link
Copy Markdown
Owner

Summary

Bundled rewire of dashboard tiles 3 (scene synthesis) + 4 (audio) onto dotty-behaviour's HTTP surface — both caches share the same shape (per-device JSON metadata, no binary payload) so a single PR is the natural unit.

  • dotty-behaviour: new GET /api/scene-synthesis/recent — exposes PerceptionState.scene_synthesis_cache (text narrative + ts_wall + face_id + state). Lives in new routes/scene_synthesis.py, wired into main.py alongside the other route includes.
  • dotty-behaviour: new GET /api/audio/cache — exposes PerceptionState.audio_cache (caption + timestamps + question + source). Added to the existing routes/audio.py next to /api/audio/explain.
  • bridge rewire_dashboard_audio_cache_getter + _dashboard_scene_synthesis_cache_getter reuse _dotty_behaviour_get (2 s cache, 1.5 s timeout, circuit-broken). bridge/dashboard.py's audio_cache/scene_synthesis_cache direct-dict kwargs become *_getter callables; added _audio_cache_snapshot() and _scene_synthesis_cache_snapshot() helpers mirroring _vision_cache_snapshot (Tile 2 model). Single read site in the perception card now calls them. The dead _audio_cache and _scene_synthesis_cache module-level dicts on bridge.py (no writer post-Pi-runtime voice path v1 + full RPi decommission #36) are dropped.

Test plan

  • dotty-behaviour: 205 → 209 passing (+4: scene-synthesis route returns cache / empty; audio-cache route returns cache / empty)
  • bridge: 69 → 73 passing (+4: audio + scene getters pass-through; both degrade on timeout/connection error)
  • python -c "import bridge; from bridge.dashboard import *" clean

Refs #115 (Tiles 5 + 6 still pending).

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

BrettKinny and others added 3 commits May 24, 2026 00:34
Tile 3 of #115 — exposes the per-device scene_synthesis_cache
(text narrative + ts_wall + face_id + state) over HTTP so the
bridge dashboard's scene tile can read it instead of sharing
an in-process dict that's no longer populated post-#36.

Refs #115

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tile 4 of #115 — exposes the per-device audio_cache (caption +
timestamps + question + source) over HTTP so the bridge dashboard's
audio tile can read it via the same cached/timeout/circuit-broken
helper used for perception + vision rather than a shared in-process
dict.

Refs #115

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Tiles 3 + 4 of #115. Both caches are the same shape (per-device JSON
metadata, no binary) so the rewire is a single bundled commit:

- Add ``_dashboard_audio_cache_getter`` and
  ``_dashboard_scene_synthesis_cache_getter`` next to the existing
  ``_dashboard_vision_cache_getter``; both reuse ``_dotty_behaviour_get``
  for the 2 s cache + 1.5 s timeout + circuit-breaker contract.
- Drop the empty ``_audio_cache``/``_scene_synthesis_cache`` module
  dicts from bridge.py — nothing was writing them post-#36.
- bridge/dashboard.py: rename the ``audio_cache``/``scene_synthesis_cache``
  configure kwargs to ``*_getter``, add ``_audio_cache_snapshot()`` and
  ``_scene_synthesis_cache_snapshot()`` helpers mirroring
  ``_vision_cache_snapshot``, update the single read site in the
  perception card to call them.
- Add bridge-side smoke tests for both getters (pass-through + degrade).

Refs #115 (Tiles 5 + 6 still pending)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 23, 2026 14:37
@BrettKinny BrettKinny merged commit a25c9c3 into main May 23, 2026
8 of 10 checks passed
@BrettKinny BrettKinny deleted the dashboard-rewire-scene-audio branch May 23, 2026 14:38
@BrettKinny BrettKinny review requested due to automatic review settings May 23, 2026 14:59
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