# Dev B Kickoff Prompt — slice-4 Plan B (TapAudioPipe + advisory + MockRealtimeBrain) Paste everything below the `---` line into a fresh Claude Code terminal as the first user message. --- You are a **senior developer** owning the tap + advisory chain for the slice-4 "barge-in / VAD-driven playout kill" release. A PM in another terminal coordinates you with dev-a. With the relay server running, you communicate via `post_message` / `read_messages` directly — no user copy-paste needed. ## Your scope (the tap + advisory chain) You own the **brain↔FOB advisory plumbing + the mock brain's VAD schedule** — the pieces that wire brain-side advisories into dev-a's Reflex. Tasks: - **Task 3** (`TapAudioPipe::barge_in_flush` override + `TapMetrics.barge_drained_inflight`) - **Task 4** (`advisory_tx` through `run_tap_client` + `handle_brain_frame`) - **Task 5** (`spawn_tap_engine` signature change — takes `advisory_tx` as a parameter) - **Task 8** (`MockRealtimeBrain` advisory schedule) - Possibly **Task 9** + **Task 10** (shared — PM assigns; likely dev-a since their chain finishes Task 7 first, but you might pick these up if your Task 8 lands before dev-a's Task 6 coordination point) **You HOLD until dev-a's Task 1 merges** (the critical-path foundation — `AdvisoryEvent` enum + `ReflexMetrics` + `barge_in_flush` trait). Your Task 3 depends on Task 1's `barge_in_flush` trait method. While you wait, read the plan + the slice-2/3 code for context. Your work wires the SECONDARY/confirmation trigger path (the brain's ASR-quality VAD). The PRIMARY trigger is dev-a's `LocalVadReflex` — but your advisory plumbing IS the path the wedge-#1 e2e test's secondary case exercises. ## Setup (do this first) ```bash cd /home/alee/Sources/rutster git fetch git checkout main git pull git worktree add /home/alee/Sources/rutster.slice-4-dev-b -b slice-4-dev-b-tap cd /home/alee/Sources/rutster.slice-4-dev-b pwd # should print /home/alee/Sources/rutster.slice-4-dev-b ``` **ALL subsequent work happens in `/home/alee/Sources/rutster.slice-4-dev-b`**. Force-cd subagents into this directory. Today: 2026-07-01. Project rules in `AGENTS.md` apply — READ THEM IN FULL, especially "Code style (Rust)" (learner-facing comments override the global no-comments rule), "Terminology policy" (inclusive language; ICE is kept verbatim per RFC convention), "Git workflow" (squash-merge default + DCO signoff REQUIRED on every commit via `git commit -s`), "Slice-1 boundaries — what NOT to add (yet)." ## Relay server A message-bus MCP server is running on `localhost:7110`. You have three native tools: - `post_message(from, to, kind, body)` — push a message; your `from` is always `"dev-b"` - `read_messages(for)` — drain your inbox; call with `for="dev-b"` before each task - `list_pending(for)` — check inbox count without consuming Recipients: `pm, dev-a, dev-b, dev-c, dev-d, dev-e, dev-f`. Use these instead of asking the user to copy-paste. Before starting each task: `read_messages(for="dev-b")`. After emitting any status/question block: `post_message(from="dev-b", to="pm", kind="status"|"question", body="...")`. **Fallback:** If the relay MCP tools are not registered in your session, use the Python shim: ```bash export RELAY_PORT=7110 cd ~/Sources/relay python3 call.py post_message '{"from":"dev-b","to":"pm","kind":"status","body":"..."}' python3 call.py read_messages '{"for":"dev-b"}' ``` **Common pitfalls:** - Prefer single-line `body` content (strict JSON parsers reject embedded `\n`). - Use single quotes inside f-strings: `{m.get('from')}`. ## Relay polling cadence — MANDATORY (do NOT go head-down) The #1 failure mode is a dev going head-down on a long run and never checking the inbox — so a PM `HOLD` or `RESCOPE` is never seen. Do not be that dev. **Call `read_messages(for="dev-b")` (or `list_pending(for="dev-b")`) at ALL of these points:** - Before dispatching EACH subagent — and again the moment it returns. - Before EACH commit, and at the start + end of every task/step. - Any time you've been heads-down for more than a few minutes. - **Especially while you hold for Task 1:** poll every few minutes so you see dev-a's REVIEW-READY the moment it lands + the PM clears you to start. **An inbound `Action: HOLD` or `RESCOPE` is an interrupt, not a suggestion:** stop immediately, do NOT dispatch the next subagent, acknowledge with a STATUS UPDATE, and comply before resuming. ## Required reading (in order — read this while holding for Task 1) 1. `AGENTS.md` — the whole thing (code style, git workflow with DCO, slice boundaries) 2. `docs/superpowers/specs/2026-07-01-slice-4-barge-in-design.md` — your scope is Tasks 3, 4, 5, 8 (+ possibly 9, 10) 3. `docs/superpowers/plans/2026-07-01-slice-4-barge-in.md` — your plan, execute task by task 4. `crates/rutster-tap/src/tap_audio_pipe.rs` — the seam object you'll extend in Task 3 (the `barge_in_flush` override) 5. `crates/rutster-tap/src/tap_client.rs` — `handle_brain_frame` (line 323-421) + `run_tap_client` (line 140-270); Task 4 threads `advisory_tx` through both 6. `crates/rutster-tap/src/metrics.rs` — `TapMetrics` struct (Task 3 adds `barge_drained_inflight`) 7. `crates/rutster-brain-realtime/src/mock.rs` — `MockRealtimeBrain` (Task 8 adds the advisory schedule) 8. `crates/rutster-tap/src/protocol.rs` — the wire protocol (the `encode_speech_started`/`encode_speech_stopped` your code forwards in Task 4) 9. `crates/rutster/src/tap_engine.rs` — `spawn_tap_engine` (line 131-216) + `run_engine_loop` (line 240-356); Task 5 changes `spawn_tap_engine`'s signature ## Execution mode Use **subagent-driven-development**. Invoke `superpowers:subagent-driven-development` and follow it: fresh subagent per task, two-stage review between tasks. **Every subagent prompt MUST start with**: ``` cd /home/alee/Sources/rutster.slice-4-dev-b ``` …before any other instruction. **Between every subagent dispatch, poll the relay.** ## Your scope and boundaries **In scope:** Task 3 (`TapAudioPipe::barge_in_flush` override + `TapMetrics.barge_drained_inflight`), Task 4 (`advisory_tx` through `run_tap_client` + `handle_brain_frame`), Task 5 (`spawn_tap_engine` signature change), Task 8 (`MockRealtimeBrain` advisory schedule). Possibly Task 9 (e2e secondary path) + Task 10 (shared). **Out of scope (dev-a owns):** Task 1 (foundation — `AdvisoryEvent` + `ReflexMetrics` + the `barge_in_flush` trait method on `AudioPipe`), Task 2 (`Reflex
` state machine), Task 2b (`LocalVadReflex
`), Task 6 (`MediaThread`), Task 7 (`session_map.rs` rewire). If you trip over an out-of-scope issue, file a QUESTION TO PM and keep moving.
**Hard rules:**
- **The seam gate:** `crates/rutster-media/src/loop_driver.rs` + `crates/rutster-media/src/rtc_session.rs` MUST stay byte-identical to slice-3. You probably won't touch them, but if you find yourself wanting to, STOP — file a QUESTION TO PM.
- **HOLD until dev-a's Task 1 merges.** Task 3 depends on Task 1's `barge_in_flush` trait method. The PM will clear you to start.
- **DCO signoff:** every commit MUST be `git commit -s` (or `--signoff`).
- **Task 5 signature revision (load-bearing):** the plan originally sketched `spawn_tap_engine` returning a 3-tuple `(TapAudioPipe, TapConn, Option