#115 Tiles 3 + 4: rewire scene_synthesis + audio cards#119
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
GET /api/scene-synthesis/recent— exposesPerceptionState.scene_synthesis_cache(text narrative + ts_wall + face_id + state). Lives in newroutes/scene_synthesis.py, wired intomain.pyalongside the other route includes.GET /api/audio/cache— exposesPerceptionState.audio_cache(caption + timestamps + question + source). Added to the existingroutes/audio.pynext to/api/audio/explain._dashboard_audio_cache_getter+_dashboard_scene_synthesis_cache_getterreuse_dotty_behaviour_get(2 s cache, 1.5 s timeout, circuit-broken).bridge/dashboard.py'saudio_cache/scene_synthesis_cachedirect-dict kwargs become*_gettercallables; 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_cacheand_scene_synthesis_cachemodule-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)python -c "import bridge; from bridge.dashboard import *"cleanRefs #115 (Tiles 5 + 6 still pending).
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com