The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
Harness Pro firmware: Pod port inventory
SRC = /private/tmp/claude-503/x/podwt/devices/harness-device/firmware (read-only). Paths below are relative to SRC/main.
UH = ui/habitat/ui_habitat.c. Line numbers are from the SRC snapshot this inventory was made from.
Build facts: DEVICE_POD requires DEVICE_PRO_COMPANION (CMakeLists.txt:267-273), so every Pod build is also a
Pro-companion build. DEVICE_POD code sits on top of Pro code that Pod never shows. pod_ui_* (pod_glue.c/.h) is reused
unchanged and already holds the 4 s / 0.8 s / 5 s focus timers, the sweep walk, the notice, the scroll sink, the
clock edge, and pane navigation. pro_app.c only has to feed it correctly and perform its pod_out_t effects.
Destination key: pro_app_* = callbacks in app/pro_app.c; pro_cable = cable/pro_cable.c; pro_frame = display/pro_frame.c
(from display_habitat.c); pro_touch = display/pro_touch.c (from touch_habitat.c); pro_voice = audio/pro_voice.c
(from audio_client_habitat.c). "perform" = what pod_perform() does with a pod_out_t.
1. Required rows (behaviour the plan names)
| # | Source | What it does | Destination |
|---|---|---|---|
| R1 | UH:5835-5856 (event, kinds processing/summarizing) |
pod_new_turn = !m->busy is read BEFORE m->busy is set. Only if true: pod_ui_turn(.., "started", "", 0), which starts the elapsed clock. A heartbeat (turn already busy) never restarts the clock; it only refreshes the verb line. The generic labels "Processing", "Summarizing...", "Summarizing…" are not stored as the verb. Also gated by !restore && s.connected. A heartbeat older than 25 s (ms()-last_busy>25000) first clears busy, so the next one counts as a new turn. |
pro_app_turn(id, started|verb, text, 0). pro_app keeps a per-agent {busy, busy_ms, last_busy, activity[]} (the pane_memory_t subset) and decides new-turn itself. pro_cable passes turn.started text as-is. |
| R2 | UH:5849-5858 + UH:5806-5820 (event) |
verb feed (the footer word). Source A: turn.started text. Source B: turn.activity text (kind "activity"), only if (m->busy && ms()-m->last_busy <= 25000); a late read never revives an idle pane. Text goes through activity_text() (trim leading/trailing whitespace, strip one trailing ... or U+2026, then trailing spaces). Fed as pod_ui_turn(id,"verb",m->activity, elapsed) with elapsed = the model's current pod_agent_t.elapsed_s (so the verb does not reset the clock). turn.activity from cable_client.c:1170-1181 calls ui_project_emit(.. "activity" ..) first. |
pro_app_turn(id, verb, text, elapsed); pro_app owns activity_text() and the busy/25 s gate. pro_cable parses turn.started.text, turn.activity.text. |
| R3 | UH:5919-5942 (ui_project_player_activity, PRO+POD) |
activity feed (the sentence under the pet) from the action field of turn.activity, not from text. Gate: s.connected && m && m->busy && ms()-m->last_busy<=25000, else dropped. Text through recap_preview() into a 192 B buffer (collapses whitespace runs, keeps whole UTF-8, ends … as +). Elapsed accepted only if integer, 0..2592000 s (cable_client.c:1173-1176), else -1. Fed only if (action || elapsed>=0): pod_ui_turn(id,"activity", action?clean:"", elapsed>=0?elapsed:model elapsed_s). An absent action passes "" so nothing is blanked, and an absent elapsed keeps the model's. |
pro_app_turn(id, activity, text, elapsed_s) (elapsed -1 = absent). Same busy/25 s gate lives in pro_app. pro_cable reads p.action, p.elapsedSeconds. Order in pro_cable: verb (text), then activity (action/elapsed), then step. |
| R4 | UH:5963-5973 (ui_project_step, POD only) + cable_client.c:1180 |
turn.activity.step -> pod_ui_turn(id,"step",step,model elapsed_s), but ONLY if (pa && pa->state == POD_WORKING) (pod_model_find). A step landing after turn.done must not bring the agent back to working. NOTE: this gate is the model's state, not m->busy/25 s. Empty/NULL id or step is ignored. |
pro_app_turn(id, step, text, elapsed); pro_app does the pod_model_find + WORKING check before calling pod_ui_turn. pro_cable cuts step to 400 chars on a UTF-8 boundary. |
| R5 | UH:5880-5892 (event, non-processing kinds) |
End of turn: kind error -> pod_ui_turn(id,"error","",0); done or summary -> "done". Not for restore. Before that, if(!restore){m->busy=false; m->activity[0]=0;}. cable_client.c: turn.done -> done; turn.error -> error (PRO build; non-PRO maps it to done) plus ui_cable_toast(message). |
pro_app_turn(id, done|error, "", 0); clears pro_app busy/activity. pro_cable: turn.done, turn.error (toast not needed, see 3). |
| R6 | UH:5889-5891, 5952-5959 (event, ui_project_recap_full) + cable_client.c:1190-1203 |
Recap: for kind summary with recap or text (not "done"), pod_ui_recap(id, recap?recap:text, restore). Then summary.full (the long recap) is a second pod_ui_recap(id, full, restore) if non-empty, so full wins last. restore:true summaries take the history path (no beep, no notice). silent/quiet only affect the beep and the Player-1 notice. |
pro_app_summary(id, text, recap, full, restore): calls pod_ui_recap with recap||text then full if set. pro_cable: summary fields agentId,text,recap,full,restore; drops silent, quiet, name, machine. Recap capped at 2048 B / 64 lines by the model. Beep: not needed (3). |
| R7 | UH:6170-6178 (ui_focus_project, POD) |
The first thing the function does under POD: pod_settle(pod_ui_focus(&pod,id,ms())) and return. Every Player-1 and Pro focus branch below it is dead for Pod. Timing is inside pod_glue.c: ignored while TALK is on top; dropped within POD_FOLLOW_QUIET_MS = 4000 ms of the user's own touch; on the Tabs screen the quiet is only POD_FOLLOW_ECHO_MS = 800 ms (the daemon's echo of the device's own move); unknown agent kept POD_FOLLOW_PENDING_MS = 5000 ms and applied when it arrives. The id must be shorter than ID_MAX (checked here at UH:6172). |
pro_app_focus(id): check length, take the display lock, pod_ui_focus(&pod,id,ms()), settle. Do NOT reimplement the timers. ui_apply_pending_focus() (app_main.c refresh_task) is not needed: the glue re-applies pending focus when the roster feed brings the agent. pro_cable: focus.agentId. |
| R8 | UH:880-899 (pod_voice_block_reason), UH:3889-3895 (dispatch A_VOICE), UH:2678-2689 (pod_perform VOICE_BEGIN) |
A_VOICE value 9 = Pod's "plain voice to a named agent" (the action id used by POD_FX_VOICE_BEGIN; any library agent, not only the window's tab). pod_voice_block_reason(id): !connected -> "Not connected"; unknown id -> NULL (allowed); engine terminal -> "Choose an agent pane."; the agent's machine offline -> "This computer is offline."; needs-link -> "Link this computer in Harness."; then (UH:893-897) a current question notice on that agent (s.notice[], fed by notif.replace/question): "Answer its question first." (or "Check its question in Harness." if unavailable). The new project has no notice list, so pro_app should use the open-question set from pro_app_question/_close. Value 9 skips the Player-1 pane gates (pro_work_block_reason) and the s.loading check. A refusal sets title "Instruction unavailable" + message, which pod_perform then turns into pod_ui_notice(reason). |
pro_app (voice gate section) -> pro_voice_begin(agent_id). pro_app owns the gate using its machines list (pro_app_machines) and agents (pro_app_agents). All other gates in the A_VOICE case (carry, draft, form, selection, work intent, value 0-8) are not needed. |
| R9 | UH:2745-2756 (habitat_scene_take) |
Only reached when s.ready && s.dirty && !s.bulk: it clears dirty, ht_scene_clear(f,BG), and under POD renders pod_ui_render(&pod,f,ms()) and returns true (hits stay in pod.frame). s.locked (pattern lock) would draw the lock screen first. |
pro_app render step: if (!dirty) return false; clear; pod_ui_render(); return true. The lock screen is not needed. |
| R10 | UH:5277-5278 and 5098 (habitat_tick, habitat_next_wake_ms) |
Clock and wake. habitat_tick: pod_ui_clock_tick(&pod,now) when !locked && !asleep -> change() (redraw on the next elapsed second edge). habitat_next_wake_ms: default 1000 ms; under POD delay = pod_ui_wake_ms(&pod,now) when !locked && !asleep (16 ms Tabs page settle, pet step 33 ms, 150 ms equaliser, else next second). Renderer then waits min(wake_ms,1000) on a task notification (display_habitat.c:515-527) and change() notifies it. |
pro_app_tick() and pro_app_next_wake_ms(), both called by pro_frame under the display lock before the scene is taken. |
| R11 | UH:5277 (habitat_tick) |
talk_over. if (pod_ui_talking(&pod) && (!s.voice_open || s.voice_waiting)) { pod_ui_talk_over(&pod); change(); }: TALK is on screen but no recording is behind it (start failed, link dropped) or the 600 s cap already stopped and sent it. Also called in pod_perform when a VOICE_BEGIN did not start (UH:2692). |
pro_app_tick() + the VOICE_BEGIN failure path. Needs pro_voice state (open, waiting). |
| R12 | UH:2698-2705 (pod_perform VOICE_END) |
unsend. POD_FX_VOICE_END while s.voice_open && s.voice_start_pending (the recorder never started): dispatch A_VOICE_ABORT, pod_ui_unsend(&pod, ms()) (no send scene, "Not sent"), change(). Else A_VOICE_STOP. POD_FX_VOICE_ABORT -> A_VOICE_ABORT. |
pro_app perform step -> pro_voice_stop() / pro_voice_abort(); pod_ui_unsend when pro_voice_start_pending(). |
| R13 | UH:5265-5295, 3998-4025 (A_VOICE_STOP/ABORT) | Voice timeouts in habitat_tick: auto-stop at second >= 600 while recording; if !start_pending && !audio_client_active() && !waiting && now-voice_started > 700 -> abort ("Recording stopped"); voice_waiting && now >= voice_wait_until (65 s after stop) -> abort. Stop: audio_client_stop(), waiting=true, wait_until=now+65000. Abort: audio_client_abort(), copy upload id, voice_close(), send voice.cancel (cable_client_voice_cancel(upload id)). |
pro_voice (state machine) + pro_app_tick(). Messages for form/draft/question views are not needed; Pod only needs "stopped" -> pod_ui_talk_over. |
| R14 | UH:6087-6129 (ui_player_library, POD) |
Library sweep. For every player.library page: rows mapped to pod_library_row_t{id,name,engine,machine,status,age_s}; status names idle,working,question,finished,failed,paused,offline by enum index (>= 7 -> "idle"); machine = the machine NAME if the id is in s.machines, else "". If s.connected && pod_ui_sweeping && page->request == s.player_library.request: pod_ui_library_page(...) returns the next offset (-1 when done), stored in pod_sweep_offset; else pod_ui_library_rows (rows only). Settle; if next >= 0, pro_player_request(next). |
pro_app_library(page). pro_cable parses player.library strictly (id/machineId/name/engine/status/ageSeconds, request, offset, total, machines; rows <= 6; offset <= max(total-6,0); count == min(6,total-offset); no duplicate id; a bad field rejects the whole page). |
| R15 | UH:5279-5294 (habitat_tick), UH:2313-2324 (pro_player_request) |
Sweep driver: when connected && PLAYER_LIBRARY feature: if sweeping and (!pending ? now - try_ms >= 1000 : now - requested_ms > 3000) re-request pod_sweep_offset; if pod_ui_sweep_due(now) -> pod_ui_sweep_begin, offset 0, request 0. Due on link up, swarm change (glue's restart), every POD_SWEEP_MS = 30000, stalled sweep restarts. Request = player.library.get{offset,request} with request id = last+1; only queue()d OK sets pending. Sweep aborts on link drop: pod_ui_link(false). |
pro_app_tick() (driver), pro_cable_request_library(offset, request), pro_app_link(false) aborts. pending/request/requested_ms become pro_app state. |
| R16 | UH:2683-2686 and 4684-4691 (habitat_touch), cable_scroll.c, UH:2887 |
Recap scroll emit. Before each contact pod_ui_scroll_sink(&pod, scroll_emit, NULL, scroll_reversed); pod_ui_touch calls the sink for DOWN/MOVE/UP(+velocity) when a Recap vertical drag begins. scroll_emit queues A_SCROLL; the worker sends scroll{phase:down|move|up, dy, v (up only)} (cable_client_send_scroll). scroll_emit refuses when the queue has < 2 free slots (< 1 for UP) and asserts that UP is never dropped. scroll_reversed = the person's setting. |
pro_app_touch() sets the sink; pro_cable_send_scroll(phase, dy, v). Queue-slot rule must be kept (UP reserves a slot). scroll_reversed default false unless the Pro keeps the setting. |
| R17 | touch_habitat.c:25-30, 131-135; pod_turn.h; display_habitat.c:303-326 (paint) | The 180 deg touch turn. Contacts: data[i].x/y = pod_turn_coord(v) = 719 - v, applied only to trusted in-range points (before the track-id duplicate check). Picture: each damage strip's pixel buffer is reversed (a++, b--) and drawn at (HT_WIDTH - x - w, HT_HEIGHT - y - h, HT_WIDTH - x, HT_HEIGHT - y). Damage and scene stay in upright coordinates, so pod_ui_touch and hits are unchanged. |
pro_touch (pod_turn_coord) and pro_frame (paint). Since 2026-10-16 there is no turn: the panel is drawn and read in its own orientation, no setting. |
| R18 | display_habitat.c:59-66 | PSRAM scenes. static EXT_RAM_BSS_ATTR ht_scene_t scenes[2] (non-Pod: internal static ht_scene_t scenes[2]). Reason in the comment: two scenes of 128 runs are ~53 KB, more than the internal heap left. Also PSRAM: pod_ui_t pod (UH:2671, ~130 KB), rows[POD_AGENTS_MAX] in pod_roster_sync (UH:2731, "not on the 6 KB cable_link stack"), s_swarm_members (cable_client.c:727, 27 KB), s (UH:246) and swap in ui_project_apply_order. |
pro_frame.c scenes, pro_app.c pod, pro_cable.c members. All EXT_RAM_BSS_ATTR. |
| R19 | terminal.h:18-27 | HT_RUNS 128 under DEVICE_POD (64 for Pro companion, 40 for the dial). A pet scene alone can take 40 runs next to the status bar and transport. ht_scene_t is HT_RUNS * sizeof(ht_run_t) and the run has the Pro fields (pro_kind, radius, pro_height, pro_font, bitmap). |
display/terminal.h fixed at 128, HT_FACE_PX = 720 fixed. Keep the PRO fields of ht_run_t (needed by pro_canvas/pod_draw_raster). |
2. Other Pod rows
| # | Source | What it does | Destination |
|---|---|---|---|
| P1 | UH:26-33 (includes) | pod_glue.h include under DEVICE_POD. |
pro_app.c includes pod_glue.h. |
| P2 | UH:405-407 (POD_SCROLL_LIVE) |
Adds && !pod.scroll.live to Player-1 scroll conditions. |
Not needed: no Player-1 scroll code. |
| P3 | UH:2665-2761 (pod, pod_perform, pod_settle, pod_roster_sync) |
Pod object, sweep state, effect performer. pod_perform maps POD_FX_VOICE_BEGIN/END/ABORT/AGENT_OPEN/NONE. VOICE_BEGIN: clears title/message, dispatches value-9 voice; on refusal (!voice_start_pending) pod_ui_talk_over, and notice text = "Not connected" / the "One moment" or "Instruction unavailable" message / "Still sending the last message" (was already open) / "Can't talk right now". AGENT_OPEN -> agent.open{agentId}. pod_settle = perform + change() if pod_ui_take_changed. |
pro_app.c perform() and settle(). agent.open: pro_cable_send_open(id). |
| P4 | UH:5033-5038 (habitat_touch_cancel) |
pod_ui_touch_cancel(&pod) first, then the usual cancel: touch_down=false; redraw if a press was visible. |
pro_app_touch_cancel(), called by pro_touch on untrusted samples, sleep, and wake. |
| P5 | UH:4680-4693 (habitat_touch) |
Pod's gesture: pod_ui_scroll_sink, pod_ui_touch(&pod,down,x,y,now,&redraw), s.touch_down=down, pod_perform(o), change() if redraw || take_changed. This is before the Player-1 gesture code and returns; the side button hold is not touch. Called with the display lock held. |
pro_app_touch(down,x,y,now_ms). |
| P6 | UH:5046-5057 (workspace_gesture_allowed) |
Returns false under POD (the two-finger workspace chord is off). | Not needed: pro_touch is single-contact; see 4 for the multi-contact rule. |
| P7 | UH:5513-5521 (ui_set_connected) |
After the generic link-drop work (abort a live recording, voice_close), pod_ui_link(&pod,value); on a drop the returned effect is discarded (pod_settle(value?o:(pod_out_t){0})) because the ABORT would target a dead cable. |
pro_app_link(up): link-down -> abort recording (pro_voice_abort, no voice.cancel send), abort sweep (via pod_ui_link), drop all per-agent busy state; link-up -> pod_ui_link + effect. |
| P8 | UH:5315-5320 (ui_init), 5345 |
pod_ui_init(&pod). The #ifndef DEVICE_POD at 5345 skips pro_visual_init() and pro_living_init() (~6.4 MB of PSRAM stays free). |
pro_app_init(). Visual/living packs are not linked: not needed. |
| P9 | UH:5591-5593, 5604-5606, 5624-5626, 5665-5667, 5695-5697, 5712-5714, 5737-5739 (ui_project_set_name/engine/machine, bulk_end, remove, clear_all, apply_order) |
Each roster mutation calls pod_roster_sync(): builds pod_roster_row_t{id,name,engine,machine} for up to POD_AGENTS_MAX = 32 and calls pod_ui_roster. Skipped while s.bulk (the reconcile in app_main.c refresh_projects brackets set_name/engine/machine, removes absent ids, and applies order; one sync at bulk_end). Order = the daemon's order. |
pro_app_agents(rows, n): pro_cable hands the complete roster once (agents.begin/agent.../agents.end) and pro_app calls pod_ui_roster once. No bulk bracket, no reconcile, no refresh_task. Fields per row: id,name,engine,machineId,machine; name falls back to id. Drop duplicate ids, ids >= ID_MAX, and >= CABLE_MAX_AGENTS. |
| P10 | UH:6800 (ui_question_show) |
pod_ui_question(id, first question q or "Needs your answer"). Runs after the PRO gate s.connected && id valid; request must be non-NULL. No Pro-side question UI is used. |
pro_app_question(id, text); pro_cable: question{agentId, id, questions[0].q}. Drop the rest of the payload (name, machine, options, multi, canText). |
| P11 | UH:6957 (ui_question_close) |
pod_ui_question_close(id) at the end. Under PRO an empty or too-long request returns early before it. |
pro_app_question_close(id); pro_cable: question.close{agentId, id}, same early-return rule. |
| P12 | UH:7052-7055 (ui_tiles_replace, POD) |
pod_ui_swarms(&pod, s.tabs, s.tab_count, cable_swarm_members(), s.selected_tab, tiles-if-same-tab, count) ALWAYS, changed or not. handle_swarms calls ui_swarms_replace (tab table) and then this on one task, so rows, members and tiles are one frame. Tiles are passed only when tile_tab == selected_tab. |
pro_app_swarms(items, n, members, selected, tiles, tile_n). |
| P13 | cable_client.c:24-26, 727-731, 738-741, 761-796 | swarms parse: items[]{id,name,agents,panes,agentIds[],members[]{id,name,engine,machine,online}}; ids dedup, SWARMS_MAX=24, members <= SWARM_MEMBERS_MAX=24 (ID_MAX limit), meta matched to an agentIds entry by id (default online=true), selected. |
pro_cable swarms parser. Counts reset per frame (memset), static buffers in PSRAM. |
| P14 | cable_client.c:797-838 | tiles[]{x1,y1,x2,y2,a} (0..1000, x2>x1, y2>y1; bad ones dropped; max 24) for the selected tab. Also compiled for any P4 build. |
pro_cable (same frame as swarms). |
| P15 | cable_client.c:189-196 (send_hello, POD) |
Hello adds swarms:"members-v1" and recap:"long-v1". PRO also adds player:"library-v1" and speech:"pcm16-v1" if audio_speech_available(). Always: fw, product (CABLE_PRODUCT), proto (CABLE_PROTO_VERSION), hw (board name), mac. |
pro_cable hello: proto, board:"pro", swarms:"members-v1", recap:"long-v1", activity:"steps-v1", player:"library-v1", fw, mac. speech, product, hw: see note in 5. |
| P16 | cable_client.c:1173-1181 (turn.activity) |
step is read under DEVICE_HABITAT outside the PRO block; elapsedSeconds and action only under PRO. |
pro_cable (see R2-R4). |
| P17 | terminal.h/pro_canvas.c:3-5, 283-285 | pro_canvas.c: #include "pod/pod_draw.h" and in raster: else if (r->pro_kind >= POD_KIND_BASE) pod_draw_raster(r, clip, out). Pod's own run kinds are drawn by the pod module; PRO_TEXT, PRO_RECT, PRO_IMAGE stay in the canvas. |
display/pro_canvas.c keeps the hook unconditionally. |
| P18 | display_habitat.c:14-16, 270-274, 427-440, 456-470, 510-516, 563-568 (PRO) | Used by Pod: pro_backlight_set(value<20?20:value) (floor 20), pro_backlight_enable(on) for sleep, render_stack = 24576 (the ROM inflater uses the stack; keep), wake_at correction so the next wait is wake_ms - time spent (min 1 ms), pro_panel_bus_open + DPI on_color_trans_done callback. pro_living_prepare and pro_visual_prepare (PRO) are not used by Pod. |
pro_frame keeps backlight, stack size, wake correction, panel bus. Drop pro_living_prepare/pro_visual_prepare and their includes. |
| P19 | touch_habitat.c:25-33, 101-108, 115-123, 125-130, 192-200, 222-232, 240-250, 257-262 (PRO) | Used by Pod: GT911 opened through touch_ctrl_open; pro_contacts gives multi-point trust (PRO_CONTACTS_MAX); a contact is trusted only if every point is in range and no track id repeats; an untrusted sample cancels + blocks until a trusted UP (swallow). On the DOWN while asleep: habitat_touch_cancel, display_wake, swallow. The results PASS/CANCEL/BEGIN/END/NONE; BEGIN/END are the workspace chord (off under Pod: habitat_workspace_gesture_begin returns false, which blocks the contact). touch_stack = 10240. |
pro_touch: keep trust rules, wake swallow, pro_contacts, 10240 stack. Chord: drop BEGIN/END; on BEGIN (a second finger) just cancel and block, which is what Pod effectively did. |
| P20 | app_main.c (no ifdef; whole file is runtime for Pod) | refresh_task: a 1 s tick + wake on ui_request_agent_reload; refresh_projects (see P9); ui_prune_stale_busy() each tick (25 s). ui_prune_stale_busy and ui_cancel_acked clear only Player-1 busy flags; they do NOT tell the Pod model, which keeps WORKING until done/error/link drop. Boot: power_hold_init, config_store_init, display, touch, audio, cable. |
main.c boot; pro_app_agents replaces refresh_task. The Pod/25 s mismatch is flagged in 5. |
| P21 | audio_client_habitat.c (no ifdef) | Voice for Pod: 10 ms PCM capture task (core 0, prio 6, stack 5120) -> 32 KB PSRAM ring -> sender task (prio 4): audio_stream_begin(agent, cmd, lang, rate), audio_stream_pcm, audio_stream_end / audio_stream_abort. Abort on: capture start fail, 3 read failures, DMA overrun, ring overflow (USB stalled), stream fail. Gate voice_gate_feed sets heard; voice_level_feed gives the input level; active/recording atomics; upload id for matching voice.* replies. Start for Pod = audio_client_start_cable(agent_id, VOICE_CMD_NONE). |
pro_voice.c. Drop the draft, form, carry, selection, search, question, and review contexts (start_context arguments) and VOICE_CMD_GOAL/LOOP. Keep lang from config. |
| P22 | UH:7638-7670 (ui_voice_error), 7745-7773 (ui_voice_routed) |
Voice replies. voice.error: ignored unless voice_open && voice_waiting; voice_close; for Pod the message is the thing to show: SRC shows MESSAGE view, which Pod never draws (for "Didn't catch that" it arms a 3 s retry window). voice.transcript: if auto_sent and an agent id: voice_close, pro_reader_focus, s.active / pending focus, view(AGENT); if !auto_sent, cable_client_voice_confirm(route,id). Pod ignores all of the navigation (its own nav stack handles it) but MUST end the voice state (voice_close) or the next voice start is refused. |
pro_app_voice_result(ok, text): end voice state, pod_ui_talk_over if still TALK, and on error pod_ui_notice(message) (SRC shows nothing for Pod, a gap to decide; see 5). pro_cable: voice.transcript{agentId,uploadId,needsConfirm,routeId}, voice.error{uploadId,message}. |
| P23 | UH:7787-7788 (ui_voice_quota_exceeded) |
Quota: abort + toast. | Not needed unless quota messages are sent to the Pro. |
| P24 | UH:5380-5392 (ui_set_brightness), 5296-5313 (power) |
Brightness to the backlight; on screen off: cancel input, lock arm. | pro_frame backlight; power()/lock not needed. |
| P25 | display_habitat.c:496-502, display_sleep/wake, display_bump_activity |
Idle sleep: no activity for 300 000 ms -> display_sleep(); touch while asleep = wake + swallow. habitat_tick calls display_bump_activity() while a voice is open. |
pro_frame + pro_app_tick. Keep. |
3. Pro-classic sections (not needed)
All the remaining DEVICE_PRO_COMPANION sections in ui_habitat.c (about 215 of the 250 DEVICE_PRO_COMPANION lines in the file) belong to the Pro's own Player UI. Pod "replaces every Player 1 and Pro screen" (UH:2752). They are grouped by enclosing function. None is a destination for any pro_app_* function, except where a later row names it.
| Source (UH) | What it is | Destination |
|---|---|---|
| 18-30, 55-60, 75-80 | Pro includes (pro_canvas, pro_visual, pro_work_intent, pro_metrics, carry, draft, speech, voice samples) and NOTICES 72 vs 24. |
Not needed (only pro_canvas.h is kept). |
| 104-165, 183-260 | action_kind_t Pro values (launcher, work, today, player, carry, appearance, voice samples), pro_speech_emotion_t, reader_serial, player in pane_memory_t/agent_t, question and s Pro fields. pane_memory_t.player.{action,elapsed,observed_ms,finished,failed} is what R3 reads. |
Not needed. pro_app keeps only {id, busy, busy_ms, last_busy, activity}. |
| 340-440, 640-700, 798-880, 901-957, 1049-1066 | Pro reader, send feedback, work/intent gates (pro_work_block_reason and its voice variants), pro_busy_reset, selection search refusal, carry route. |
Not needed. |
993-1038 (input_cancel, view), 1085-1121, 1123, 1203-1300 |
View switching and the Pro hooks inside (reader row, carry route, sample stop, metrics close), waiting/is_question (skips unavailable questions), color(), appearance. |
Not needed. |
| 1339-1760, 1851-2260 | Pro speech, mood, living, Tab strip, desk, home, agents, question rendering. | Not needed. |
| 2295-2370, 2570-2660 | Tabs and settings paging (Pro: 6 rows), draft, lock. | Not needed. |
2863-3350 (queue, draft store, emits, make_action) |
Draft store, carry, question flows. | queue()'s role is replaced by a bounded action queue in pro_app (for scroll and cable sends). |
3359-4290 (dispatch) |
Pro actions: launcher, work mode, carry, draft, reader, question, speech, language, appearance, voice samples, A_TAB, A_DESKTOP value 1/2 (open in app). The A_DESKTOP default case with an id sends agent.open (used by Pod, see P3). |
Not needed, except A_VOICE/STOP/ABORT (R8, R12, R13) and A_DESKTOP default. |
4288-4632 (worker) |
Action worker; Pod uses A_SCROLL (R16), A_PLAYER_PAGE (R15), A_VOICE, A_VOICE_ABORT, A_DESKTOP. A_VOICE re-checks connected && voice_open && start_pending && generation before audio_client_start_cable. NVS saves (language, appearance) are not used. |
pro_app worker/queue with those five actions. Keep the voice generation check. |
5088-5170 (habitat_next_wake_ms Pro part) |
Living and sample timers. | Not needed (R10 keeps only the POD line). |
5393-5436, 5437-5512 (Pro part of ui_set_connected) |
Reader focus reset, roster pending flag, question uncertainty, selection/carry/draft/metrics reset on link change. | Not needed. Keep only P7. |
| 5525-5578 | ui_draft_source, ui_metrics_*. |
Not needed. |
| 5579-5740 (Pro lines) | pro_send_feedback_clear, pro_reader_focus, workspace_chord/AGENTS input cancel, oversize machine_id rule (strnlen(machine_id) >= ID_MAX -> ""). |
Keep only the machine-id rule in pro_app_agents. |
5786-5850, 5880-5900 (Pro lines of event) |
Session-change reset (session differs: busy=false, clear player), player.finished/failed, living summary. |
Session-change reset: see 5 (decide whether the Pro needs it). The rest is not needed. |
| 6044-6086, 6133-6169 | ui_prune_stale_busy, ui_cancel_acked, player.overview, player.context. |
Pod does not use them. pro_app_context can stay a stub. |
6180-6226 (ui_focus_project below the POD return) |
Reader/carry focus. Dead for Pod. | Not needed. |
| 6267-6360, 6365-6760, 6793-6931 | Notices, reads, pins, question store, answer receipts. | Not needed. |
| 6963-7058 (Pro lines) | workspace_chord/AGENTS input cancel in swarm, tile, and machine replace. |
Not needed. |
| 7059-7196 | Machines UI, selection, ui_request_agent_reload. |
ui_machines_replace data -> pro_app_machines(rows, n, selected); the rest not needed. |
| 7197-7626, 7627-7637 | Carry, selection, form, draft, visit, voice.draft/question/form/search, toast. | Not needed. |
| 7718-7745, 7774-7830, 7837-7876 | ui_voice_start* (side-button entry), boot pressed, lock gate, bench hooks. |
ui_voice_stop / ui_voice_route_abort -> pro_voice; the rest not needed. |
4. Non-ifdef code Pod depends on at runtime (reproduce in pro_app)
| Source | What | Where it goes |
|---|---|---|
display_habitat.c model_lock + display_lock/unlock (recursive mutex, xSemaphoreCreateRecursiveMutex) |
One lock guards s, pod, and the render. Writers: cable reader task (ui_*), touch task (habitat_touch is called with the lock held), render task (tick/take/wake under the lock, released before paint). Recursive, because pod_settle is called with the lock held and nested helpers re-take it. |
pro_app.c lock; one mutex around every pod_ui_* and the render (plan Task 6). |
UH:442 ms() = esp_timer_get_time()/1000 as uint32_t |
Every now_ms given to pod_ui_*. Wraps at 49.7 days; all comparisons in the glue use (int32_t)(a-b). In SRC two places use unsigned ms()-m->last_busy. |
pro_app ms(). Use the same unsigned subtraction. |
UH:503 change() |
Sets dirty, notifies the renderer (habitat_render_notify). Needed after any pod_ui_take_changed, notice, voice change, and tick edge. |
pro_app change(). |
UH:5175 ff. habitat_tick generic part |
power, voice_open -> display_bump_activity(); voice timers (R13). |
pro_app_tick(). |
UH:598-626 pane_memory (128 slots, LRU eviction, 1024 B result) and 627-644 pane_memory_apply |
Per-agent busy, busy_ms, last_busy, activity, session, awaiting_result. For Pod only the busy/activity fields and the 25 s expiry matter (if (m->busy && ms()-m->last_busy > 25000) m->busy = false). The result text itself is stored in the Pod model (2 KB recap). |
pro_app small table sized POD_AGENTS_MAX (32) or a bit more (library-only agents can send turn events; SRC allowed 128). Decide an eviction rule. |
UH:454-500 recap_preview |
Collapses whitespace, keeps whole UTF-8 characters, replaces invalid bytes with ?, rewrites a trailing U+2026 to + (with a space before it unless ++), cut at cap-1. Used for action (192 B) in R3. It is NOT used for the recap given to Pod (pod_ui_recap gets the raw recap/text/full). |
pro_app recap_preview (copy verbatim). |
UH:966-977 activity_text |
See R2. Used for activity/processing text only. |
pro_app (copy verbatim). Buffer size = m->activity = 100 B in SRC. |
UH:585 find / UH:979 ensure |
ensure creates an agent row (limit MAX_PROJECTS), refuses ids that are empty or >= ID_MAX. |
The roster is built once in pro_app_agents; bad ids rejected there. |
UH:5773 ui_project_is_busy, 5742-5765 |
Roster accessors for app_main. | Not needed. |
cable_client.c send_json/msg() helpers, str_of, bool_of, s_bad/s_unknown counters |
JSON building and checks (msg_check, NULL-safe). Unknown message = counted, ESP_LOGD, never fatal. A message with no t = s_bad++. A flat message (no p) is accepted: p = root. agentId >= ID_MAX drops the message (s_bad++). |
pro_cable. |
cable_client.c session_up / session_down |
welcome: machine{id,name}, selected, app, proto, features[]. Sets s_session, ui_set_connected(true), then if first time sends machines.list + agents.list. session_down: clears agents, machines, features; ui_set_connected(false); restores plain console logging (cable_link_set_log_framing). |
pro_cable -> pro_app_link(bool). |
cable_features.c |
welcome.features[] -> bits. Pod uses player.library (CABLE_FEATURE_PLAYER_LIBRARY). More than 16 entries or a non-string entry makes the whole result 0. |
pro_cable (bit player.library only, same 16-entry guard). Without it no sweep runs and the roster is the tab's agents only. |
ping/pong, keepalive s_last_rx_us, fw.offer and CABLE_TYPE_FW frames, CABLE_TYPE_SPEECH frames |
Link liveness and OTA. | ping -> pong is needed in pro_cable; OTA depends on the Pro's firmware-update plan (not Pod). |
5. Messages
Round-only messages the Pro ignores
Handled by SRC cable_client.c and not needed by Pod. pro_cable leaves them to the "unknown message" counter
(s_unknown++, no log above debug).
wifi.configure(Pro Wi-Fi provisioning;DEVICE_PRO_WIFI); replywifi.accepted. Decide separately: it is a Pro feature, not a Pod one.- Speech:
cable_speech_message(anyspeech.*) and theCABLE_TYPE_SPEECHPCM frames. models(model picker),agent.updatedis handled (re-asksagents.list), see below.notif.replace,notif.seen(notifications drawer, read tokens).question.state,answer.receipt(the question sheet).draft.state,voice.draft,voice.question,voice.search,voice.form.selection.state,carry.state,form.state,visit.state(selection, carry, forms, visits, workspaces).metrics.state(and themetrics.getrequest),player.overview.machine,machines.begin/end,machine.updatedare used only as the list for the library's machine name (see below);machine.selectedandmachine.error(machine switching) are not needed.toastand theturn.errortoast.- Beep and notification parts of
summary(silent,quiet,name,machine): the field set is read but onlytext,recap,full,restorematter. - Voice quota,
perf/bench hooks (DEVICE_TRANSPORT_BENCH,DEVICE_PERF_BENCH,DEVICE_RENDER_*),last_wordsreports, and the OTA image path stay in the shared transport, not inpro_cablemessages.
Messages Pod needs (device <- host)
t |
Fields read | Goes to |
|---|---|---|
welcome |
machine.id, machine.name, selected, app, proto, features[] (player.library) |
session up; pro_app_link(true); then device sends machines.list, agents.list |
ping |
(none) | reply pong |
agents.begin, agent, agents.end |
agent: id, name, engine, machineId, machine (also model, effort in SRC, unused by Pod); end: total, tab (not used by Pod) |
pro_app_agents |
agent.updated |
(none) | device re-sends agents.list |
machines.begin, machine, machines.end, machine.updated |
id, name, state (offline, needs-link, others), local; end: selected, source |
pro_app_machines (R8 gate and R14 machine names) |
swarms |
items[]{id,name,agents,panes,agentIds[],members[]{id,name,engine,machine,online}}, selected, tiles[]{x1,y1,x2,y2,a} |
pro_app_swarms |
focus |
agentId |
pro_app_focus |
turn.started |
agentId, text |
pro_app_turn(started, verb) |
turn.activity |
agentId, text, action, elapsedSeconds, step |
pro_app_turn(verb, activity, step) |
turn.done |
agentId |
pro_app_turn(done) |
turn.error |
agentId |
pro_app_turn(error) |
summary |
agentId, text, recap, full, restore |
pro_app_summary |
question |
agentId, id, questions[0].q |
pro_app_question |
question.close |
agentId, id |
pro_app_question_close |
player.library |
request, offset, total, machines, rows[]{id,machineId,name,engine,status,ageSeconds} |
pro_app_library |
player.context |
id, machine, project, branch, engine, remaining, validMs |
pro_app_context: Pod does not feed it into the model in SRC (ui_player_context has no POD code), so a stub unless the new Pod views read it |
voice.transcript |
uploadId (must match the current upload), agentId, needsConfirm, routeId, agentName, confidence |
pro_app_voice_result (end voice state) |
voice.error |
uploadId, message |
pro_app_voice_result (error) |
Device -> host messages Pod uses: hello (P15), machines.list, agents.list, player.library.get{offset,request},
agent.open{agentId[,reason]}, scroll{phase,dy[,v]}, pong, the voice stream (audio_stream_begin/pcm/end/abort:
agent, cmd, lang, rate), and voice.cancel{uploadId}. cable_client_send_focus (A_AGENT) and agent.open's reason are not used by Pod.
6. Open points for the owner
- Stale busy vs the Pod model.
ui_prune_stale_busy(25 s) only clears Player-1 flags. The Pod model stays WORKING withoutdone/error/link drop. Keep this or add a prune that feedspod_ui_turn(.., "done")? - Session change. Under PRO,
event()resets busy/player when thesessiondiffers (UH:5792-5803). Pod got no turn event from it, and the new project does not carrysession. Skipped unless wanted. voice.error. SRC shows nothing for Pod (the MESSAGE view is hidden). Proposed:pod_ui_notice(message).- Pane memory size. SRC holds 128 entries, Pod holds 32 agents. Library rows can send events for agents beyond 32.
player.context,speech,product/hwin hello,wifi.configure. Not in the plan's hello list; confirm which are kept.pod_ui_statusexists inpod_glue.cbut ui_habitat.c never calls it (status comes from the library rows and turn events).
7. Owner decisions (2026-10-11)
The owner approved every point in section 6, as follows:
- Stale busy. Keep today's behaviour: an agent stays WORKING until
done,erroror the link drops. There is no 25 s expiry. - Voice errors.
voice.errorshows as a Pod notice (pod_ui_notice). - Voice gate.
pro_voice_block_reasonreadspro_app's set of open questions instead ofs.notice[]. - Unused feeds.
pro_app_contextis a no-op for now.pod_ui_statusgets no new caller. - Unknown agents. Events for an agent Pod does not hold (beyond its 32) are ignored.
- Session change. The session-change reset is not ported.
- Hello fields. The hello keeps
productandhwand dropsspeech. The full key list is:proto,board:"pro",product,hw,swarms:"members-v1",recap:"long-v1",activity:"steps-v1",player:"library-v1". - Focus timers.
pro_appcallspod_ui_focusonly. The 4 s, 0.8 s and 5 s focus timers stay inpod_glue.c.