Repository navigation
feat(media): perception substrate — non-blocking read twins + PerceptionBuffer (airc-keyed, room-as-now) - #1958
Merged
Merged
Conversation
…eady — perception never waits Component #1 of the LiveKit perception substrate: the read-side twins of the async scaled()/description() warmers. scaled()/description() WARM a cell (async, on SharedCompute); the _if_ready reads return Some ONLY if it's ALREADY resolved, None otherwise. This is 'take what's ready NOW, never block' at the substrate level — the persona reads whatever cells finished this tick and the rest bridge in later ([[command-async-shape-prefer-stream-never-block]]). Next (per placement-first: use airc + positron where they fit): PerceptionBuffer keyed by AIRC participant identity (call = airc room #193, LiveKit = media plane only), firing warms async + reading via these twins; then MediaPerceptionSource:RagSource under the flexbox budget (non-blocking, room-as-now, must not dominate); positron projects the glass-box UI. Test: ready_reads_are_none_until_warmed_then_share_the_cell (None cold → Some sharing the warmed Arc after warm; different spec stays cold). 7 media::frame tests green. Refs #190, #192, #193, #187. [[command-async-shape-prefer-stream-never-block]], [[placement-first-four-repos-then-adapters-boy-scout]] Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… live-call perception hold (#192/#187) Component #2 of the perception substrate. One LATEST frame per participant (coalesced — newer replaces older, no backlog, room-as-now); observe() stores + FIRES the ambient cell warms (thumbnail ~480w + description) on a spawned task and returns immediately (non-blocking ingest); current_percepts() reads ONLY resolved cells via the #1 _if_ready twins — the persona never waits, a pending cell is absent this tick and bridges in the next. Keyed by AIRC participant identity (the room roster), not a parallel call/session id — call IS an airc room, LiveKit is media plane only ([[all-rooms-are-airc-rooms-no-mirrors]], [[placement-first-four-repos-then-adapters-boy-scout]]). Percept holds the cache's Arc (zero-copy); Some(Err) surfaces a failed cell, never a silent placeholder. 3 tests: coalesce-to-latest-per-participant, cold→None then resolved→Some (non-blocking read), remove-on-leave. Green. Next: MediaPerceptionSource:RagSource (deliver percepts under the flexbox budget — room-as- now, must not dominate), then the STOP-zone bind into compose_for_turn; positron projects the glass-box UI. Refs #192, #187, #190, #193. [[command-async-shape-prefer-stream-never-block]], [[perceive-the-room-as-it-is-now]] Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…n the ONE prompt budget (#190/#8) Component #3 of the perception substrate. Wraps PerceptionBuffer as a first-class RagSource so live-call perception is ACCOUNTED in the same total prompt budget as engram/airc/roster via the ONE flexbox allocator — media never escapes accounting, never dominates (budget- break loop, zero-budget → nothing). Threaded by the RagContext STRUCT by reference (persona scope, timing, room) — not a long param list ([[structs-by-reference-not-massive-param-lists]]). COMPRESSED for reliability + reduced copy: delivers concise text grounding ('[seeing <id>] <desc>'), reads Arc-shared cache cells (zero-copy), operates on &Percept refs — no buffer clones on the hot path. NON-BLOCKING (reads only resolved cells — unresolved participant is absent this tick, never awaited) + room-as-now (no continuation). The thumbnail image for native-vision rides the separate render seam #190 off the SAME cached cells. 2 tests: delivers-budgeted-grounding (+ persona-scope + zero-budget guards); unresolved- absent-not-awaited. Green. Next: bind into compose_for_turn (STOP-zone), LiveKit video_rx → observe ingest, positron UI. Refs #190, #8, #167, #192, #187. [[perception-feedback-must-not-blow-rag]], [[budget-at-assembly-not-clamp-the-prompt]], [[structs-by-reference-not-massive-param-lists]] Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply
force-pushed
the
feat/perception-buffer
branch
from
July 19, 2026 00:10
3bdd577 to
4e559ad
Compare
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.
First two components of the LiveKit perception substrate (plan:
docs/planning/LIVEKIT-PERCEPTION-PIPELINE.md), built async/non-blocking from the start per the command-async-shape discipline.#1 —
MediaFrame::{scaled_if_ready, description_if_ready}: the read-side twins of the asyncscaled()/description()warmers. Warm async (fire), read only what's already resolved (Some) elseNone— 'take what's ready now, never block' at the substrate level.#2 —
PerceptionBuffer: one LATEST frame per participant (coalesced, room-as-now, no backlog);observe()stores + fires the ambient cell warms (~480w thumbnail + description) on a spawned task, returns immediately (non-blocking ingest);current_percepts()reads only resolved cells via the #1 twins. Keyed by airc participant identity (call = airc room, LiveKit = media plane only), per placement-first.10 media tests green (non-blocking read; coalesce-to-latest; cold→None then resolved→Some; remove-on-leave).
Next:
MediaPerceptionSource: RagSource(deliver percepts under the flexbox budget — must not dominate), then the STOP-zone bind intocompose_for_turn; positron projects the glass-box UI.Refs #192, #187, #190, #193.
🤖 Generated with Claude Code