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 Implementation Plan
For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Give the Harness Pro its own ESP-IDF firmware under devices/harness-pro/firmware that runs only Pod, and serve it from main's daemon through hello capabilities, without touching devices/harness-device.
Architecture:
- Copy what the Pod build compiles on
dev/firmware-pro(0c73edf72), then cut it down to a Pro-only tree. - Pod's pure-C model, nav and views move unchanged.
- A new
pro_app(app layer) andpro_cable(cable client) replace the round'sui_habitat.candui_screens.h. - Main's
cli/src/cablegains the Pro's messages, behind capabilities the Pro names in its hello.
Tech Stack: ESP-IDF 5.5.4 (esp32p4); C11; host tests with clang/cc, UBSan and Python harnesses; TypeScript (vitest) for the daemon.
Spec: docs/superpowers/specs/2026-10-11-harness-pro-firmware-design.md
Paths used throughout:
SRC=/private/tmp/claude-503/x/podwt/devices/harness-device/firmware, the dev/firmware-pro source at 0c73edf72. It is read-only for this plan.PRO=devices/harness-pro/firmwarein this worktree (/private/tmp/claude-503/x/hpro, branchfeat/harness-pro-firmware, based on origin/main).
Global Constraints
- Toolchain and board: ESP-IDF 5.5.4 at
~/esp/esp-idf-5.5.4, target esp32p4. The device is the Pro with chip rev v3.2 and MACe8:f6:0a:e7:63:7don/dev/cu.usbmodem21101. - Dev image version: dev images are built with
-DPROJECT_VER=0.0.99-pod, so the daemon's OTA never overwrites them. - Panel:
POD_PANEL_TURN=180for this unit's upside-down panel, chosen at build time. Upright and 180 must both pass the touch tests. - Harness-device is untouched:
git diff origin/main -- devices/harness-devicestays empty. Nothing underdevices/harness-proincludes, links or globs a path underdevices/harness-device. - No LVGL, no
ui_screens.h, no Player 1, Living, Daemon or Studio code, and no round characters (octopus, tim, tux). - Fonts: Helvetica-derived glyph bitmaps are never committed (it is a system font). Devices are built with glyphs generated from macOS Helvetica. Host tests and CI use the same generator over the committed Liberation Sans (SIL OFL), which has the same metrics.
- Memory and stack: the frame-size guards stay at 1024 B for model, nav and glue code and 4096 B for render code. The
cable_linktask keeps its 6 KB stack. Scenes and agent tables live in PSRAM (EXT_RAM_BSS_ATTR), andHT_RUNSis 128. - Daemon gating: the daemon sends a device nothing new unless its hello names the capability:
swarms: "members-v1"recap: "long-v1"activity: "steps-v1"player: "library-v1"
- Flashing: every flash goes through
PRO/scripts/flash.sh. It writes~/.harness/flasher/flashing, runsharness stop, checks the chip and MAC, writes 0x2000 bootloader, 0x8000 partitions, 0xf000 otadata and 0x20000 app (dio, 80m, 16MB, 921600), then clears the flag and runsharness start. It refuses any other MAC or revision. - Language: docs and code comments are in English and follow
docs/naming-system.md. - Commits: commit only when the owner has asked for commits in this session. Stage only this plan's files.
Review Focus
- An older daemon (released CLI 0.3.73, or main before Task 8) that sends no
action,step,full,membersorplayer.*. The Pro must still show Tabs, agents and recaps, with empty bodies and no crash. Pinned in Task 5 (pro_cable_test_old_daemon). - A round dial's hello on the new daemon. Its frames must be byte-identical to today's. Pinned in Task 8 (
round hello gets no Pro fields). - The link dropping during a library sweep or a recording. The sweep aborts, Talk goes back to where it came from, and nothing waits forever. Pinned in Task 6 (
pro_app_test_link_drop) and Task 7 (voice: link drop ends talk). - Oversized input. That means a swarms list over the frame cap, a recap over 2048 B or 64 lines, a 400-char step, or a 900-char activity. Each is cut on a UTF-8 boundary, with no overflow, and no frame looping. Pinned in Task 5 (
pro_cable_test_oversize). - Both panel orientations. A tap must land on the same hit upright and with
POD_PANEL_TURN=180. Pinned in Task 6 (the touch replay runs both).
Task 1: Project skeleton, board and panel
Files:
- Create:
PRO/CMakeLists.txt,PRO/main/CMakeLists.txtPRO/sdkconfig.defaults, the merge of SRC'ssdkconfig.defaults,sdkconfig.defaults.esp32p4,../prototype/pro-companion/sdkconfig.defaultsand../prototype/pro-companion/sdkconfig.wifi.defaults, with LVGL entries droppedPRO/partitions.csv, copied from SRCPRO/main/idf_component.yml, with onlyesp_hosted 2.12.13,esp_wifi_remote ~1.3.1,waveshare/esp_lcd_st7703 ^2.0.0,espressif/esp_lcd_touch_gt911 ^1.1.0andespressif/esp_codec_dev *PRO/dependencies.lock, generated and then committed
- Copy (from SRC, then remove the S3/dial branches):
main/board/{board_i2c,board_pro,power_pro,ptt_pro,pro_wifi}.c/.h,board_pins.h,pins_pro.h,power.h,board.h,pro_button_filter.hmain/ui/{pro_panel_bus.c/.h, touch_gt911.c, touch.h}→PRO/main/display/main/{config_store,device_mac,last_words,ram_telemetry}.c/.h→PRO/main/sys/
- Create:
PRO/main/app_main.c, a bring-up only version: board, power latch, panel, a test pattern, and touch loggingPRO/scripts/flash.shPRO/test/test_tree_isolation.py
Interfaces:
Produces:
void pro_display_init(void),bool pro_touch_read(int *x, int *y),void pro_panel_draw_strip(int y, int h, const uint16_t *px)inPRO/main/display/pro_display.h.Produces:
PRO/scripts/flash.sh [--build-dir DIR]with exit status 2 on a MAC or revision mismatch.Step 1: Write
test/test_tree_isolation.py. It walksPRO/and asserts:- no file contains the string
harness-device, except docs that explain the split; - no
#includenamesui_screens.h,lvgl.h,octopus,tim.h,tux.h,carry.h,visit.horworkspace.h; main/CMakeLists.txtlists no source outsidePRO/main.
- no file contains the string
Step 2: Run it and expect FAIL (the tree does not exist yet).
- Run:
python3 devices/harness-pro/firmware/test/test_tree_isolation.py
- Run:
Step 3: Create the files above. In
app_main.c, keep SRC's power-latch order and the GT911 manual reset before the driver opens. Draw 8 vertical colour bars, and log each touch astouch x=%d y=%d.Step 4: Verify the build.
- Run:
. ~/esp/esp-idf-5.5.4/export.sh && cd devices/harness-pro/firmware && idf.py -B build -DPROJECT_VER=0.0.99-pod -DPOD_PANEL_TURN=180 build - Expected:
Project build complete, no warnings frommain/, and the app smaller than the 0x7E0000 slot.
- Run:
Step 5: Run the isolation test and expect PASS.
Step 6: Flash with
scripts/flash.sh.- Expected: the colour bars show on the panel, and
touch x=… y=…lines appear in~/.harness/logs/usb-E8-F6-0A-E7-63-7D/on taps.
- Expected: the colour bars show on the panel, and
Step 7: Commit (only if asked).
Task 2: Font generator with a committed fallback
Files:
- Create:
PRO/scripts/gen_fonts.py, ported from SRC's../prototype/pro-companion/tools/generate_fonts.pyand reduced to theht_pro_24,ht_pro_32andht_pro_42atlasesPRO/fonts/LiberationSans-Regular.ttfandPRO/fonts/LICENSE-LiberationSans.txt
- Modify:
PRO/main/CMakeLists.txtso it generates${CMAKE_BINARY_DIR}/pro_fonts.cat build time - Modify:
.gitignoreto ignore anypro_fonts.cunderdevices/harness-pro - Test:
PRO/test/test_fonts.py
Interfaces:
Produces:
python3 scripts/gen_fonts.py --font PATH --out FILE. It defaults to/System/Library/Fonts/Helvetica.ttcindex 0 when that file exists, otherwise tofonts/LiberationSans-Regular.ttf. It emitsht_pro_24,ht_pro_32andht_pro_42with the sameht_pro_font_tlayout as SRC'spro_fonts.c.Step 1: Write
test_fonts.py. It generates fonts with Liberation Sans into a temp directory and asserts:- the three symbols exist;
heightis 24/32/42;- every codepoint SRC's
pro_fonts.ccovers is present, including Vietnamese precomposed and·; - the file has no
Helveticastring.
Step 2: Run it and expect FAIL.
Step 3: Implement
gen_fonts.py.Step 4: Run it and expect PASS. Also run
idf.py build(it now builds with Helvetica on this Mac).Step 5: Commit (only if asked).
Task 3: Compositor and Pod, with host tests
Files:
- Copy:
- SRC's
main/ui/habitat/{terminal.c,terminal.h,pro_canvas.c,pro_canvas.h,fonts.c,scroll.c,scroll.h,theme.h}→PRO/main/display/ main/ui/habitat/pod/*→PRO/main/pod/display_habitat.c→PRO/main/display/pro_frame.c
- SRC's
- Copy tests:
- SRC's
test/test_pod_{model,nav,draw,pet,assets,views_agent,views_tabs}.c,test/pod_render.{c,py},test/pod_pet_ground.c,test/pod_pet_strip.c,test/host_stubs/→PRO/test/ - SRC's
scripts/pod_gen_logos.py,scripts/pod_sync_assets.sh→PRO/scripts/. Renamepod_sync_assets.shtoimport_pets.sh; it takes the round asset path as an argument and has no default.
- SRC's
- Create:
PRO/test/run.sh - Test:
PRO/test/test_render_parity.sh
Interfaces:
Consumes: fonts from Task 2.
Produces:
PRO/test/run.sh, which needs no arguments, exits 0 on success and generates fonts into its temp directory.Produces: the compositor API is unchanged:
ht_scene_t,ht_run_t,ht_pro_text,ht_pro_rect,ht_pro_width,ht_rgb,ht_pro_raster.Step 1: Write
test_render_parity.sh. For each screen intabs tab:1 recent agent:fw recap:desk talk:fw talk:cur chrome:talk, it renders with SRC'spod_render.pyand with PRO's, both with--now 600and Liberation fonts, and asserts the PPM bytes are equal.Step 2: Write
run.sh. Base it on SRC'srun-pod.sh, keeping the cflags, the frame guards (1024 forpod_model.c,pod_nav.candpod_glue.c; 4096 for the draw, pet, chrome and view files) and UBSan. It drops-DDEVICE_PRO_COMPANIONand-DDEVICE_POD. Run it and expect FAIL, because the sources are not copied yet.Step 3: Copy the files and fix the include paths. In
terminal.candterminal.h:- remove the mono, arc, shimmer and sprite paths and the
DEVICE_TIM_ILLUSTRATEDfield; - keep
pro_kind,radius,pro_height,pro_fontandbitmap; - make the Pro fields unconditional and delete every
#ifdef DEVICE_PRO_COMPANIONandDEVICE_POD.
- remove the mono, arc, shimmer and sprite paths and the
Step 4: Run
bash test/run.shand expect PASS. The test tails match SRC's (for examplePod model: PASS,test_pod_views_agent: … checks passed,test_pod_views_tabs: … checks ok). Then runbash test/test_render_parity.shand expect all screens equal.Step 5: Re-run
test_tree_isolation.pyandidf.py build.Step 6: Commit (only if asked).
Task 4: Inventory of the Pod hooks
Files:
- Create:
devices/harness-pro/docs/port-inventory.md
Interfaces:
Produces: a table with one row per
#ifdef DEVICE_POD,#ifndef DEVICE_PODandDEVICE_PRO_COMPANIONsection in SRC's:main/ui/habitat/ui_habitat.c(34DEVICE_PODsections and the Pro sections);main/cable_client.c(5);display_habitat.c,touch_habitat.c,terminal.h,pro_canvas.c;app_main.c.
Each row gives the file and line, what the section does, and its destination: a
pro_app_*orpro_cablefunction, or "not needed" with the reason.Step 1: List them all.
- Run:
grep -n "DEVICE_POD\|DEVICE_PRO_COMPANION" SRC/main/ui/habitat/ui_habitat.c SRC/main/cable_client.c SRC/main/ui/habitat/display_habitat.c SRC/main/ui/habitat/touch_habitat.c SRC/main/app_main.c
- Run:
Step 2: Write the table. These rows must appear:
pod_new_turn(only a new turn resets the clock);- the
verbfeed from the footer word versus theactivityfeed fromaction; ui_project_step(only into a WORKING agent);pod_ui_focustiming (quiet for 4 s after a touch, except a 0.8 s echo on Tabs);A_VOICEvalue 9 andpod_voice_block_reason;- the library sweep;
- the clock and wake;
talk_overandunsend;- recap scroll emit;
- the 180° touch turn;
- PSRAM scenes.
Step 3: Owner check. Show the table and get the owner's yes before starting Task 5.
Task 5: pro_cable, the Pro's cable client
Files:
- Copy: SRC's
main/{cable_link,cable_frame,cable_json_guard,cable_features}.c/.h→PRO/main/cable/ - Create:
PRO/main/cable/pro_cable.c/.h, written from SRC'scable_client.cand keeping only the messages below - Create:
PRO/main/pro_app_api.h, the callbackspro_cablecalls - Test:
PRO/test/test_pro_cable.c(a host build against cJSON from$IDF_PATH/components/json/cJSONand a recording stub ofpro_app_api.h) - Test:
PRO/test/test_pro_hello.py, ported fromtest_pod_hello.pyto targetpro_cable.c
Interfaces:
Produces, in
pro_app_api.h(implemented by Task 6, stubbed in tests):void pro_app_link(bool up, const char *machine)void pro_app_agents(const pro_agent_row_t *rows, int n), where a row hasid,name,engine,machineandstatusvoid pro_app_swarms(const cable_swarm_t *items, int n, const cable_swarm_members_t *members, const char *selected)void pro_app_library(const pod_library_row_t *rows, int count, int offset, int total)void pro_app_context(const char *id, const char *machine, const char *project, const char *branch, const char *engine)void pro_app_turn(const char *id, const char *kind, const char *text, int elapsed_s), where kind is one of started, verb, activity, step, done or errorvoid pro_app_summary(const char *id, const char *text, const char *recap, const char *full, bool restore)void pro_app_question(const char *id, const char *text)andvoid pro_app_question_close(const char *id)void pro_app_focus(const char *id)void pro_app_voice_result(int kind, const char *text)void pro_app_machines(...), with the same shape as SRC'sui_machines_replace
Produces:
void pro_cable_start(void)andbool pro_cable_send(const char *type, cJSON *payload). The hello carries:proto(CABLE_PROTO_VERSION)board: "pro"swarms: "members-v1"recap: "long-v1"activity: "steps-v1"player: "library-v1"
It carries none of the round's
carry,draft,form,visit,workspace,selectionormetricskeys.turn.activitymapping:textgoes to kindverb(when non-empty),actionto kindactivity(when present), andstepto kindstep(when non-empty).Step 1: Write
test_pro_cable.c. It feeds framed JSON and asserts the recorded calls:pro_cable_test_turn_activity:{"t":"turn.activity","agentId":"a","text":"Infusing...","action":"Reading","step":"Read · x.c","elapsedSeconds":12}gives three calls,verb "Infusing...",activity "Reading" 12andstep "Read · x.c", in that order. An emptytextgives noverbcall.pro_cable_test_old_daemon:turn.activitywith onlytext,summarywithoutfull, andswarmswithoutmemberseach still reachpro_app(withfull=NULLandmembers=NULL), and none crashes.pro_cable_test_oversize: a 400-charsteparrives cut at 120 bytes or less on a UTF-8 boundary, a 3000-charfullis cut to fit the 2048 B recap, and a swarms list of 64 items over the cap ends without a loop.pro_cable_test_ignores_round:carry.state,draft.stateandvisit.stateframes make no call.
Step 2: Write
test_pro_hello.py. It asserts the hello keys above exactly, and thatcarryanddraftare absent.Step 3: Add both to
run.sh, run it, and expect FAIL.Step 4: Implement
pro_cable.c. It runs on thecable_linktask with a 6 KB stack. Parse into static scratch, not stack locals over 1 KB (the frame guard is 1024 B). There is a stack test intest_pro_cable.c: run the parser on a thread with a 6 KB stack.Step 5: Run
bash test/run.shand expect PASS.Step 6: Commit (only if asked).
Task 6: pro_app, the app layer
Files:
- Copy: SRC's
main/ui/habitat/{pod_glue.c,pod_glue.h,pod_turn.h,touch_habitat.c}→PRO/main/app/.touch_habitat.ckeeps only the Pod path and is renamedpro_touch.c. - Create:
PRO/main/app/pro_app.c/.h, which implementspro_app_api.hand every Task 4 row whose destination ispro_app - Modify:
PRO/main/app_main.cto start the display,pro_app_start()andpro_cable_start() - Test:
PRO/test/test_pro_app.py, ported fromtest_pod_touch_ui.pyto compilepro_app.c,pod_glue.candpro_touch.cwith host stubs
Interfaces:
Consumes:
pro_app_api.h(Task 5);pod_ui_*frompod_glue.h;ht_*(Task 3);pro_display.h(Task 1).Produces:
void pro_app_start(void), which starts the render task (24-line strips, damage bymemcmp, scenes in PSRAM);void pro_app_lock(void)andvoid pro_app_unlock(void);void pro_app_touch(bool down, int x, int y).
Step 1: Port the replays into
test_pro_app.py. Keep every test fromtest_pod_touch_ui.py, each with its name. Add:pro_app_test_link_drop: start a library sweep, callpro_app_link(false, NULL), and assertpod_ui_sweeping()is false. Afterpro_app_link(true, …), the next sweep restarts from offset 0.pro_app_test_step_after_done: astepafterdoneleaves the agent DONE.pro_app_test_new_turn_only:startedtwice for the same live turn resets the clock once (thepod_new_turnrule).- Run every replay upright and with
-DPOD_PANEL_TURN=180.
Step 2: Run it and expect FAIL.
Step 3: Implement
pro_app.c. Follow the Task 4 rows. Use one mutex (the display lock) around everypod_ui_*call and around the render.Step 4: Run
bash test/run.shandpython3 test/test_pro_app.py, and expect PASS. Runidf.py build.Step 5: Flash. The branch daemon (0.3.73-dev, from podwt) is what is installed now.
- Expected in the device log:
session up, noPANICand noGuru. - On screen: Tabs with Working ribbons, the Tab list, an Agent with its LCD verb and steps, Recap, focus following the app, and a swipe moving panes.
- Expected in the device log:
Step 6: Commit (only if asked).
Task 7: Voice and notices
Files:
- Copy: SRC's
main/{audio_capture,audio_client,voice_buffer,ptt}.c/.handaudio_client_habitat.c(rename itpro_voice.c) →PRO/main/audio/ - Modify:
PRO/main/app/pro_app.cfor the voice gate, the recording lifecycle, send/unsend,talk_overand notices - Test:
PRO/test/test_pro_voice_gate.py, ported fromtest_pod_voice_gate.py
Interfaces:
Consumes:
pro_app_voice_result(Task 5);pod_ui_talking,pod_ui_talk_over,pod_ui_unsendandpod_ui_notice(pod_glue.h).Produces:
void pro_voice_begin(const char *agent_id),void pro_voice_end(bool send)andconst char *pro_voice_block_reason(void). The reasons areoffline_machine,busy_cable,not_connectedandlibrary_only, with the same copy as SRC.Step 1: Port the 9 replays. Keep each name, and keep A_VOICE value 9. Add
voice: link drop ends talk: dropping the link while TALK is on top returns to the previous view and aborts the recording.Step 2: Run them and expect FAIL.
Step 3: Implement.
Step 4: Run them and expect PASS. Build and flash. On the device, record to a Claude agent and see it arrive in the pane.
Step 5: Commit (only if asked).
Task 8: Daemon support on main, behind capabilities
Files:
- Create:
devices/harness-pro/docs/cable.mdwith the capability table and field shapes - Modify (under
cli/src/):cable/cableSession.ts: parse the four capabilities from the hello, and send members/agentIds,full,action/elapsedSeconds/step, andplayer.library/player.contextonly when they are namedcable/cableHost.ts:cableStepForandactivitySnapshotwithactioncable/cableFleet.ts:turnStepcli.ts: the step tee and theactivitySnapshotwiringlib/deviceRecap.ts:deriveLongRecapcable/playerLibrary.ts: the library pages
- Test:
cli/src/cable/cableSession.spec.ts,cableHost.spec.ts,playerLibrary.spec.tsandlib/deviceRecap.spec.ts
Interfaces:
Consumes: the Pro's hello from Task 5.
Produces, on the wire:
turn.activity {agentId, text, action?, elapsedSeconds?, step?}summary {…, full?}swarmsitems{…, agentIds?, members?}player.library {offset, total, rows[6]}andplayer.context {agentId, machine, project, branch, engine, remaining}
Step 1: Inventory. Diff
cli/anddesktop/betweengit merge-baseand 0c73edf72. Incable.md, list every message or field Pod consumes (frompro_cable.c) next to its source on the branch. Mark creature voice,cableSpeechand Player overview as not ported.Step 2: Write the failing specs:
round hello gets no Pro fields: a hello without capabilities, then a turn with tools, a summary and a swarms change, gives frames identical to today's. That means nostep, noaction, nofull, nomembersand noplayer.*.pro hello gets steps:activity:"steps-v1"plus a tool card givesturn.activitywithstep: "Read · cableSession.ts".pro hello gets full recap,pro hello gets members, andpro hello gets the library(6 rows a page).- Port the branch's existing specs for these features.
Step 3: Run them and expect FAIL.
- Run:
cd cli && npx vitest run src/cable src/lib/deviceRecap.spec.ts
- Run:
Step 4: Implement the port. Desktop changes go in only if Step 1 shows Pod needs them (for example the swarms announce). Then add the matching desktop test.
Step 5: Run the checks and expect PASS.
- Run:
cd cli && npx vitest run src/cable src/lib/deviceRecap.spec.ts && npx tsc --noEmit -p . && npm run test:harnessd. If desktop was touched, also runcd desktop && flutter test test/dial_swarms_announce_test.dart.
- Run:
Step 6: Device acceptance against main's daemon.
- Install this branch's CLI:
bash cli/scripts/install-cli.sh --no-restart, thenharness start. - Flash the Pro and walk the spec's Acceptance list: tool steps, recap, offline members, library, focus, voice.
- Record the result in the PR.
- Install this branch's CLI:
Step 7: Commit (only if asked).
Task 9: CI, README and the split's guard
Files:
Modify:
.github/workflows/ci.yml, jobfirmware-checks, adding a step after the round's contracts:bash devices/harness-pro/firmware/test/run.sh python3 devices/harness-pro/firmware/test/test_pro_app.py python3 devices/harness-pro/firmware/test/test_pro_voice_gate.py python3 devices/harness-pro/firmware/test/test_tree_isolation.pyIt uses the same clang-18 and cJSON setup as the existing job.
Modify:
scripts/tests/test_ci_plan.py, adding a case that a change underdevices/harness-pro/selectsfirmware.Create:
devices/harness-pro/README.md, covering build, flash (scripts/flash.sh, with the power-latch warning), the host tests, fonts,import_pets.shand the capability contract. It linksdocs/cable.mdand the spec.Move: the Pod mockups from SRC's
mockup/(pro-*.html,pro_*.py,pro-*/) todevices/harness-pro/mockup/. That directory is gitignored (.gitignoreline 107,mockup/), so the move is local only.Step 1: Add the ci-plan test case, run it and expect FAIL if the planner does not already map the path, otherwise PASS as is.
- Run:
python3 scripts/tests/test_ci_plan.py
- Run:
Step 2: Add the CI step and the README.
Step 3: Check the split.
- Run:
git diff origin/main --stat -- devices/harness-device. Expected: empty. - Run:
python3 devices/harness-pro/firmware/test/test_tree_isolation.py. Expected: PASS.
- Run:
Step 4: Open the PR and merge. Push, open a draft PR, then mark it ready. When
ci/requiredis green and the review is done, runmake merge-pr ARGS="N --reviewed-head SHA --reviewed-base SHA --merge". The PR body records the local checks from Tasks 6–8 and the device acceptance.