Repository navigation
Tags
Tags
A board mounts on a mind through authenticate, as the mind's API now … …asks (#10) A board on a mind reaches READY again. On a mind, the mount now asks the API's root for `authenticate()` before it lends the board. ## Before and after Before, a HAVPE on `iterate.iterate.com` joined Wi-Fi, opened its WebSocket to `/api`, and logged this in a loop: ``` iterate-voice: transport state=mounting iterate-voice: transport state=failed mount diagnosis: connection=3 mount=failed failure=capability provide rejected ``` Since 19 November a mind's API root has `about` and `authenticate`, and nothing of the mind (iterate/core `ControlPlaneApi`). The mount called `provide` on that root. A replay of that call from a Mac got the mind's own words: `'provide' is not a function`. After, the mount makes three calls on a mind: ``` ["push",["pipeline",0,["authenticate"],[]]] -> the session ["push",["pipeline",<session>,["mind","cd"],["/"]]] -> the mind's root context ["push",["pipeline",<root>,["provide"],["itx.clients.<name>",["export",-1]]]] ``` 1. `authenticate()` with no argument. The mind takes the credential that the upgrade carried, its `Authorization` bearer. 2. `mind.cd("/")` on the session. It answers the mind's root context as a capability; the C client has no property read. 3. `provide(match, device)` on that root. The liveness probe asks the root's `whoami()`, because a mind's session has none. The mount owns the session import and the root import, and `close()` releases them as it does on the old platform. ## Proof - `pnpm firmware:test:host`: 74 of 74 pass. `itx_mount_test` checks the three frames, the probe and the releases. - The same three calls from Node against `iterate.iterate.com`, with the bearer on the upgrade only: `provide` answered a rule, a call back through `itx.clients.<name>` reached the lent stub, and `voice.health()` and `cd("/voice/<name>").whoami()` answered on the root that `cd("/")` gave. - Not yet proven on a board. The bench HAVPE takes this build after the merge. ## Risk map - **Riskiest part:** `itx_mount.c` `iterate_kit_itx_mount_start` and `begin_get_project`. The claim that the root from `mind.cd("/")` serves every call the voice loop makes on `mount.project_capability` (`voice.ensureVoiceDevice`, `cd`, `append`, `subscribe`) rests on the Node replay, not on a board yet. - **On merge:** every board releases a new firmware version. A board on the old platform is unchanged: its three calls and frames are the same. A board on a mind could not mount before, so it has nothing to lose. - **A refused credential** on a mind now shows as `authentication rejected` (the upgrade's 401 still comes first for an expired token). - **Review order:** `itx_mount.c`, `itx_mount_test.c`, then the comments in `itx_mount.h` and `firmware/README.md`. Session: claude d4d5fe52-3584-4960-90fd-d14b5bcb0ca9 on jonas-macbook-pro 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
A board mounts on a mind through authenticate, as the mind's API now … …asks (#10) A board on a mind reaches READY again. On a mind, the mount now asks the API's root for `authenticate()` before it lends the board. ## Before and after Before, a HAVPE on `iterate.iterate.com` joined Wi-Fi, opened its WebSocket to `/api`, and logged this in a loop: ``` iterate-voice: transport state=mounting iterate-voice: transport state=failed mount diagnosis: connection=3 mount=failed failure=capability provide rejected ``` Since 19 November a mind's API root has `about` and `authenticate`, and nothing of the mind (iterate/core `ControlPlaneApi`). The mount called `provide` on that root. A replay of that call from a Mac got the mind's own words: `'provide' is not a function`. After, the mount makes three calls on a mind: ``` ["push",["pipeline",0,["authenticate"],[]]] -> the session ["push",["pipeline",<session>,["mind","cd"],["/"]]] -> the mind's root context ["push",["pipeline",<root>,["provide"],["itx.clients.<name>",["export",-1]]]] ``` 1. `authenticate()` with no argument. The mind takes the credential that the upgrade carried, its `Authorization` bearer. 2. `mind.cd("/")` on the session. It answers the mind's root context as a capability; the C client has no property read. 3. `provide(match, device)` on that root. The liveness probe asks the root's `whoami()`, because a mind's session has none. The mount owns the session import and the root import, and `close()` releases them as it does on the old platform. ## Proof - `pnpm firmware:test:host`: 74 of 74 pass. `itx_mount_test` checks the three frames, the probe and the releases. - The same three calls from Node against `iterate.iterate.com`, with the bearer on the upgrade only: `provide` answered a rule, a call back through `itx.clients.<name>` reached the lent stub, and `voice.health()` and `cd("/voice/<name>").whoami()` answered on the root that `cd("/")` gave. - Not yet proven on a board. The bench HAVPE takes this build after the merge. ## Risk map - **Riskiest part:** `itx_mount.c` `iterate_kit_itx_mount_start` and `begin_get_project`. The claim that the root from `mind.cd("/")` serves every call the voice loop makes on `mount.project_capability` (`voice.ensureVoiceDevice`, `cd`, `append`, `subscribe`) rests on the Node replay, not on a board yet. - **On merge:** every board releases a new firmware version. A board on the old platform is unchanged: its three calls and frames are the same. A board on a mind could not mount before, so it has nothing to lose. - **A refused credential** on a mind now shows as `authentication rejected` (the upgrade's 401 still comes first for an expired token). - **Review order:** `itx_mount.c`, `itx_mount_test.c`, then the comments in `itx_mount.h` and `firmware/README.md`. Session: claude d4d5fe52-3584-4960-90fd-d14b5bcb0ca9 on jonas-macbook-pro 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
A board mounts on a mind through authenticate, as the mind's API now … …asks (#10) A board on a mind reaches READY again. On a mind, the mount now asks the API's root for `authenticate()` before it lends the board. ## Before and after Before, a HAVPE on `iterate.iterate.com` joined Wi-Fi, opened its WebSocket to `/api`, and logged this in a loop: ``` iterate-voice: transport state=mounting iterate-voice: transport state=failed mount diagnosis: connection=3 mount=failed failure=capability provide rejected ``` Since 19 November a mind's API root has `about` and `authenticate`, and nothing of the mind (iterate/core `ControlPlaneApi`). The mount called `provide` on that root. A replay of that call from a Mac got the mind's own words: `'provide' is not a function`. After, the mount makes three calls on a mind: ``` ["push",["pipeline",0,["authenticate"],[]]] -> the session ["push",["pipeline",<session>,["mind","cd"],["/"]]] -> the mind's root context ["push",["pipeline",<root>,["provide"],["itx.clients.<name>",["export",-1]]]] ``` 1. `authenticate()` with no argument. The mind takes the credential that the upgrade carried, its `Authorization` bearer. 2. `mind.cd("/")` on the session. It answers the mind's root context as a capability; the C client has no property read. 3. `provide(match, device)` on that root. The liveness probe asks the root's `whoami()`, because a mind's session has none. The mount owns the session import and the root import, and `close()` releases them as it does on the old platform. ## Proof - `pnpm firmware:test:host`: 74 of 74 pass. `itx_mount_test` checks the three frames, the probe and the releases. - The same three calls from Node against `iterate.iterate.com`, with the bearer on the upgrade only: `provide` answered a rule, a call back through `itx.clients.<name>` reached the lent stub, and `voice.health()` and `cd("/voice/<name>").whoami()` answered on the root that `cd("/")` gave. - Not yet proven on a board. The bench HAVPE takes this build after the merge. ## Risk map - **Riskiest part:** `itx_mount.c` `iterate_kit_itx_mount_start` and `begin_get_project`. The claim that the root from `mind.cd("/")` serves every call the voice loop makes on `mount.project_capability` (`voice.ensureVoiceDevice`, `cd`, `append`, `subscribe`) rests on the Node replay, not on a board yet. - **On merge:** every board releases a new firmware version. A board on the old platform is unchanged: its three calls and frames are the same. A board on a mind could not mount before, so it has nothing to lose. - **A refused credential** on a mind now shows as `authentication rejected` (the upgrade's 401 still comes first for an expired token). - **Review order:** `itx_mount.c`, `itx_mount_test.c`, then the comments in `itx_mount.h` and `firmware/README.md`. Session: claude d4d5fe52-3584-4960-90fd-d14b5bcb0ca9 on jonas-macbook-pro 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
A board mounts on a mind through authenticate, as the mind's API now … …asks (#10) A board on a mind reaches READY again. On a mind, the mount now asks the API's root for `authenticate()` before it lends the board. ## Before and after Before, a HAVPE on `iterate.iterate.com` joined Wi-Fi, opened its WebSocket to `/api`, and logged this in a loop: ``` iterate-voice: transport state=mounting iterate-voice: transport state=failed mount diagnosis: connection=3 mount=failed failure=capability provide rejected ``` Since 19 November a mind's API root has `about` and `authenticate`, and nothing of the mind (iterate/core `ControlPlaneApi`). The mount called `provide` on that root. A replay of that call from a Mac got the mind's own words: `'provide' is not a function`. After, the mount makes three calls on a mind: ``` ["push",["pipeline",0,["authenticate"],[]]] -> the session ["push",["pipeline",<session>,["mind","cd"],["/"]]] -> the mind's root context ["push",["pipeline",<root>,["provide"],["itx.clients.<name>",["export",-1]]]] ``` 1. `authenticate()` with no argument. The mind takes the credential that the upgrade carried, its `Authorization` bearer. 2. `mind.cd("/")` on the session. It answers the mind's root context as a capability; the C client has no property read. 3. `provide(match, device)` on that root. The liveness probe asks the root's `whoami()`, because a mind's session has none. The mount owns the session import and the root import, and `close()` releases them as it does on the old platform. ## Proof - `pnpm firmware:test:host`: 74 of 74 pass. `itx_mount_test` checks the three frames, the probe and the releases. - The same three calls from Node against `iterate.iterate.com`, with the bearer on the upgrade only: `provide` answered a rule, a call back through `itx.clients.<name>` reached the lent stub, and `voice.health()` and `cd("/voice/<name>").whoami()` answered on the root that `cd("/")` gave. - Not yet proven on a board. The bench HAVPE takes this build after the merge. ## Risk map - **Riskiest part:** `itx_mount.c` `iterate_kit_itx_mount_start` and `begin_get_project`. The claim that the root from `mind.cd("/")` serves every call the voice loop makes on `mount.project_capability` (`voice.ensureVoiceDevice`, `cd`, `append`, `subscribe`) rests on the Node replay, not on a board yet. - **On merge:** every board releases a new firmware version. A board on the old platform is unchanged: its three calls and frames are the same. A board on a mind could not mount before, so it has nothing to lose. - **A refused credential** on a mind now shows as `authentication rejected` (the upgrade's 401 still comes first for an expired token). - **Review order:** `itx_mount.c`, `itx_mount_test.c`, then the comments in `itx_mount.h` and `firmware/README.md`. Session: claude d4d5fe52-3584-4960-90fd-d14b5bcb0ca9 on jonas-macbook-pro 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
A board mounts on a mind through authenticate, as the mind's API now … …asks (#10) A board on a mind reaches READY again. On a mind, the mount now asks the API's root for `authenticate()` before it lends the board. ## Before and after Before, a HAVPE on `iterate.iterate.com` joined Wi-Fi, opened its WebSocket to `/api`, and logged this in a loop: ``` iterate-voice: transport state=mounting iterate-voice: transport state=failed mount diagnosis: connection=3 mount=failed failure=capability provide rejected ``` Since 19 November a mind's API root has `about` and `authenticate`, and nothing of the mind (iterate/core `ControlPlaneApi`). The mount called `provide` on that root. A replay of that call from a Mac got the mind's own words: `'provide' is not a function`. After, the mount makes three calls on a mind: ``` ["push",["pipeline",0,["authenticate"],[]]] -> the session ["push",["pipeline",<session>,["mind","cd"],["/"]]] -> the mind's root context ["push",["pipeline",<root>,["provide"],["itx.clients.<name>",["export",-1]]]] ``` 1. `authenticate()` with no argument. The mind takes the credential that the upgrade carried, its `Authorization` bearer. 2. `mind.cd("/")` on the session. It answers the mind's root context as a capability; the C client has no property read. 3. `provide(match, device)` on that root. The liveness probe asks the root's `whoami()`, because a mind's session has none. The mount owns the session import and the root import, and `close()` releases them as it does on the old platform. ## Proof - `pnpm firmware:test:host`: 74 of 74 pass. `itx_mount_test` checks the three frames, the probe and the releases. - The same three calls from Node against `iterate.iterate.com`, with the bearer on the upgrade only: `provide` answered a rule, a call back through `itx.clients.<name>` reached the lent stub, and `voice.health()` and `cd("/voice/<name>").whoami()` answered on the root that `cd("/")` gave. - Not yet proven on a board. The bench HAVPE takes this build after the merge. ## Risk map - **Riskiest part:** `itx_mount.c` `iterate_kit_itx_mount_start` and `begin_get_project`. The claim that the root from `mind.cd("/")` serves every call the voice loop makes on `mount.project_capability` (`voice.ensureVoiceDevice`, `cd`, `append`, `subscribe`) rests on the Node replay, not on a board yet. - **On merge:** every board releases a new firmware version. A board on the old platform is unchanged: its three calls and frames are the same. A board on a mind could not mount before, so it has nothing to lose. - **A refused credential** on a mind now shows as `authentication rejected` (the upgrade's 401 still comes first for an expired token). - **Review order:** `itx_mount.c`, `itx_mount_test.c`, then the comments in `itx_mount.h` and `firmware/README.md`. Session: claude d4d5fe52-3584-4960-90fd-d14b5bcb0ca9 on jonas-macbook-pro 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
A board mounts on a mind through authenticate, as the mind's API now … …asks (#10) A board on a mind reaches READY again. On a mind, the mount now asks the API's root for `authenticate()` before it lends the board. ## Before and after Before, a HAVPE on `iterate.iterate.com` joined Wi-Fi, opened its WebSocket to `/api`, and logged this in a loop: ``` iterate-voice: transport state=mounting iterate-voice: transport state=failed mount diagnosis: connection=3 mount=failed failure=capability provide rejected ``` Since 19 November a mind's API root has `about` and `authenticate`, and nothing of the mind (iterate/core `ControlPlaneApi`). The mount called `provide` on that root. A replay of that call from a Mac got the mind's own words: `'provide' is not a function`. After, the mount makes three calls on a mind: ``` ["push",["pipeline",0,["authenticate"],[]]] -> the session ["push",["pipeline",<session>,["mind","cd"],["/"]]] -> the mind's root context ["push",["pipeline",<root>,["provide"],["itx.clients.<name>",["export",-1]]]] ``` 1. `authenticate()` with no argument. The mind takes the credential that the upgrade carried, its `Authorization` bearer. 2. `mind.cd("/")` on the session. It answers the mind's root context as a capability; the C client has no property read. 3. `provide(match, device)` on that root. The liveness probe asks the root's `whoami()`, because a mind's session has none. The mount owns the session import and the root import, and `close()` releases them as it does on the old platform. ## Proof - `pnpm firmware:test:host`: 74 of 74 pass. `itx_mount_test` checks the three frames, the probe and the releases. - The same three calls from Node against `iterate.iterate.com`, with the bearer on the upgrade only: `provide` answered a rule, a call back through `itx.clients.<name>` reached the lent stub, and `voice.health()` and `cd("/voice/<name>").whoami()` answered on the root that `cd("/")` gave. - Not yet proven on a board. The bench HAVPE takes this build after the merge. ## Risk map - **Riskiest part:** `itx_mount.c` `iterate_kit_itx_mount_start` and `begin_get_project`. The claim that the root from `mind.cd("/")` serves every call the voice loop makes on `mount.project_capability` (`voice.ensureVoiceDevice`, `cd`, `append`, `subscribe`) rests on the Node replay, not on a board yet. - **On merge:** every board releases a new firmware version. A board on the old platform is unchanged: its three calls and frames are the same. A board on a mind could not mount before, so it has nothing to lose. - **A refused credential** on a mind now shows as `authentication rejected` (the upgrade's 401 still comes first for an expired token). - **Review order:** `itx_mount.c`, `itx_mount_test.c`, then the comments in `itx_mount.h` and `firmware/README.md`. Session: claude d4d5fe52-3584-4960-90fd-d14b5bcb0ca9 on jonas-macbook-pro 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
A board mounts on a mind through authenticate, as the mind's API now … …asks (#10) A board on a mind reaches READY again. On a mind, the mount now asks the API's root for `authenticate()` before it lends the board. ## Before and after Before, a HAVPE on `iterate.iterate.com` joined Wi-Fi, opened its WebSocket to `/api`, and logged this in a loop: ``` iterate-voice: transport state=mounting iterate-voice: transport state=failed mount diagnosis: connection=3 mount=failed failure=capability provide rejected ``` Since 19 November a mind's API root has `about` and `authenticate`, and nothing of the mind (iterate/core `ControlPlaneApi`). The mount called `provide` on that root. A replay of that call from a Mac got the mind's own words: `'provide' is not a function`. After, the mount makes three calls on a mind: ``` ["push",["pipeline",0,["authenticate"],[]]] -> the session ["push",["pipeline",<session>,["mind","cd"],["/"]]] -> the mind's root context ["push",["pipeline",<root>,["provide"],["itx.clients.<name>",["export",-1]]]] ``` 1. `authenticate()` with no argument. The mind takes the credential that the upgrade carried, its `Authorization` bearer. 2. `mind.cd("/")` on the session. It answers the mind's root context as a capability; the C client has no property read. 3. `provide(match, device)` on that root. The liveness probe asks the root's `whoami()`, because a mind's session has none. The mount owns the session import and the root import, and `close()` releases them as it does on the old platform. ## Proof - `pnpm firmware:test:host`: 74 of 74 pass. `itx_mount_test` checks the three frames, the probe and the releases. - The same three calls from Node against `iterate.iterate.com`, with the bearer on the upgrade only: `provide` answered a rule, a call back through `itx.clients.<name>` reached the lent stub, and `voice.health()` and `cd("/voice/<name>").whoami()` answered on the root that `cd("/")` gave. - Not yet proven on a board. The bench HAVPE takes this build after the merge. ## Risk map - **Riskiest part:** `itx_mount.c` `iterate_kit_itx_mount_start` and `begin_get_project`. The claim that the root from `mind.cd("/")` serves every call the voice loop makes on `mount.project_capability` (`voice.ensureVoiceDevice`, `cd`, `append`, `subscribe`) rests on the Node replay, not on a board yet. - **On merge:** every board releases a new firmware version. A board on the old platform is unchanged: its three calls and frames are the same. A board on a mind could not mount before, so it has nothing to lose. - **A refused credential** on a mind now shows as `authentication rejected` (the upgrade's 401 still comes first for an expired token). - **Review order:** `itx_mount.c`, `itx_mount_test.c`, then the comments in `itx_mount.h` and `firmware/README.md`. Session: claude d4d5fe52-3584-4960-90fd-d14b5bcb0ca9 on jonas-macbook-pro 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
A board says why it did not join Wi-Fi, and joins a network whose nam… …e differs only by spaces at its ends (#9) A Satellite1 flashed from k.iterate.com never came online, and its button did nothing. Its console stopped at `transport state=wifi_connecting` and said no more. ## Cause The router broadcasts the network as `mispwoso-iot ` with a **space at the end**. The board held `mispwoso-iot`, as typed. Every join ended with reason 201 (no network of that name), which ESP-IDF's Wi-Fi library does not log, and neither did we. The radio, the release and the board were fine: a scan from the board saw 18 networks. ## What changes (`firmware/platforms/iterate_esp_idf/itx_transport.c`) - Every failed join logs one line: `iterate-wifi: not joined to "<name>": reason <n>`, with words for "not found" and "the password was refused". - When no network has the configured name, the board scans (at the first miss and every eighth after it), lists the 2.4 GHz networks in reach with their names in quotes, and joins the one whose name is the configured name but for spaces at its ends. The password and every other setting stay as configured. - The join waits for that scan (a join would end the scan with nothing found), for at most 15 s. ## Proof, on the Satellite1 over USB Before (release 003111): ``` I (1429) iterate-voice: transport state=wifi_connecting W (3718) iterate-wifi: not joined to "mispwoso-iot": reason 201 (the log line alone, added first) ``` The board's own scan: `'mispwoso-iot '` on channels 6 and 11, -63 dBm, WPA2. After (this branch, app partition flashed; the configuration partition untouched): the mind shows the board's first life: `voice-agent/device-provisioned` at 21:15:10 UTC, then a call by the button at 21:15:42: `conversation-accepted`, "Hello" transcribed, the agent's answer, `call-ended reason=button`. This is also the first run of the mind sign-in (token exchange, mount) on a real chip. Not captured: this build's own console lines for the scan and the second join. The board's USB console went silent after the flash (the board itself runs). ## Risk map - A board joins a network it was not exactly configured for, when the names differ only by spaces at the ends and the configured password works there. Nothing else is matched (no case folding). - The scan adds about 2.5 s to a boot whose network is absent, once in eight misses. - State is three file-level statics: one transport runs on a board. - Review order: `look_for_the_network_by_another_spelling`, the `WIFI_EVENT_STA_DISCONNECTED` branch, the join's wait in the network task. Session: claude 36de8618-e351-4f05-9de7-dcdb2ee45e97 on jonas-macbook-pro 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
The voice board's firmware boots in Espressif's QEMU on every pull re… …quest (#7) A new CI job, **Firmware boots in QEMU**, boots the Home Assistant Voice PE firmware in Espressif's QEMU on every pull request and main push. No board is needed. ## What it proves `scripts/ci/qemu-boot.sh havpe`: 1. builds the target with `firmware/targets/common/sdkconfig.qemu` added (only when `ITERATE_KIT_QEMU` is set): the console on UART0, USB-Serial-JTAG as the second console. QEMU emulates no USB-Serial-JTAG, so a release image prints nothing after the ROM bootloader; 2. merges the build into one 16 MB flash image with an empty configuration partition; 3. boots it for 60 s in Espressif's QEMU `esp-develop-9.2.2-20261109` (pinned, SHA-256 checked), `-machine esp32s3`, 8 MB octal PSRAM; 4. wants `ESP-IDF v6.1 2nd stage bootloader`, `esp_psram: SPI SRAM memory test OK`, `main_task: Calling app_main()` and `device is not provisioned`, and fails on a Guru Meditation, an abort or a reboot. The local run on the Mac (QEMU's aarch64-apple-darwin build, `QEMU=<path>`): ``` I (12) boot: ESP-IDF v6.1 2nd stage bootloader I (107) esp_psram: Found 8MB PSRAM device I (109) esp_psram: SPI SRAM memory test OK I (131) main_task: Calling app_main() E (151) iterate-voice: device is not provisioned: storage=decode failed havpe boots in QEMU to app_main and reads its configuration partition. ``` ## What it does not test QEMU has no I2S, audio codec, Wi-Fi or Bluetooth. With a mind configuration written in, the app reads it and then goes quiet in the board's audio setup, so the test boots an unprovisioned image. Release images are not changed: the overlay applies only to this job's build. ## Risk map - The job builds one more board image (about 5 minutes on 4 CPUs), with ESP-IDF from Depot Cache like the release builds; it never saves the cache. - `apt-get install` of QEMU's four libraries: the stock image may already have them. - Review order: `scripts/ci/qemu-boot.sh`, then `components.cmake` and `sdkconfig.qemu`, then the workflow. Session: claude 36de8618-e351-4f05-9de7-dcdb2ee45e97 on jonas-macbook-pro 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
A board is set up for a mind, the only way Kit offers now that os.ite… …rate.com is gone (#6) ## Why Every Kit board speaks only the old platform. It dials `wss://os.iterate.com/api` with a project access token that has no expiry, then calls `authenticate` and `projects.get`. Kit signs in to os.iterate.com and mints that token with `grants.mint`. Minds (iterate/core) have none of these: - A mind's `/api` is at `https://iterate.<domain>/api`, and its session is already the mind's root. It has no `authenticate` and no `projects.get`. - A mind issues no token without an expiry. A member's access token lasts 1 hour. Its refresh token lives while it is used, and ends after 7 days with no use (`SESSION_IDLE_SECONDS`, a constant in core/auth-worker, after iterate/private#344). - A mind's `/api` answers no other origin (no CORS), so Kit's page cannot prepare voice there. Its token endpoint does answer Kit's origin. So when os-prd goes, every board goes silent. This change lets a board belong to a mind, and keeps old boards and old setups working. ## What changes **Firmware** - The ITERKIT1 image names one platform whole: the old project id and key (tags 4, 5), or a mind's OAuth client id and refresh token (tags 7, 8). The base URL (tag 3) is the mind's platform origin. An image with both sets, or with half of one, is refused. - `components/core` `token_refresh`: before each upgrade, a mind board trades its refresh token at `/oauth2/token` over the platform's own byte stream (ESP-TLS on a board, OpenSSL on the Mac). It keeps the rotated token (NVS namespace `iterate_token`, or `<config>.token` on the Mac) and presents the access token as the bearer. A refusal (400 or 401) backs off like a refused key and says "set me up again". - `itx_mount`: on a mind, it makes one call, `provide`, on the main import. The probe asks that root's `whoami`. - The loop replaces the socket while idle in the token's last 10 minutes, so the mind ending the session at the token's end does not cut a call. **Kit** - The selector has a **Set it up for a mind** field. `/devices/<model>/mind` discovers `https://iterate.<domain>`, signs the person in there with an authorization code and PKCE as the board's own client, trades the code at the token endpoint, and flashes the board with the refresh token. Nothing goes through Kit's Worker. Each board's client metadata names the new redirect. - The old **Log in with iterate** path is unchanged. - The flash dialog's **Only set it up again** writes the configuration partition alone and never erases. It sets a board up again (new Wi-Fi, or a new sign-in after its grant ended) without a firmware flash. ```text node scripts/config-image.ts image --wifi-ssid <ssid> --os-base-url https://iterate.example.com \ --client-id <client metadata URL> --refresh-token-file <file> --out /tmp/cfg.bin ``` ## Proof - `pnpm firmware:test:host`: 74/74. This includes a new token refresh test (the request, Content-Length and chunked answers, refusals, and a stepped exchange over a scripted stream), mind cases in the configuration and mount tests, and a TypeScript-to-C golden mind image. - `pnpm typecheck`, `lint` and `format:check` pass. Vitest passes, except the 2 `scripts/ci/toolchain.test.ts` tests, which also fail on main on macOS (BSD `sha256sum`). - `iterate-kit-mac` with a mind image against `https://iterate.iterate.com`: it reached `/oauth2/token` over TLS, read the 401 for a fake grant, and announced "Iterate refused my key". - Local release builds with ESP-IDF 6.1 (`node scripts/firmware-release.ts build`), listed in a comment below. - This branch on the preview Kit (`kit.iterate-dev-preview.workers.dev`), in headless Chromium: selector, then the mind page, then **Sign in to the mind** for `iterate.com`. It landed on `https://iterate.iterate.com/sign-in`. The mind's authorize handler validates the client metadata document, the redirect, PKCE and the scope before it asks for sign-in, so the mind accepts a Kit board as a client. - **End to end on a mind (jispwoso.com, a prototype mind with voice on):** - Kit's mind page in headless Chromium as a member: the consent page, then **Allow**, then the code exchange (token endpoint 200, a refresh token) and "Signed in". This run found a bug: `finishMindSignIn` called fetch as a method ("Illegal invocation"). It is fixed in 3ca7fca with a test. - Then `iterate-kit-mac` with that grant: token renewed, then mounted, then its voice stream ready (`ensureVoiceDevice` and the relay subscription). - One call started through the board's lent `conversation.start()`. The relay accepted it (pressToAcceptedMs 1617), the board sent 352 mic frames, the agent answered "banana" to typed words, and the first audio reached the board at 6539 ms. - A restart remounted from the saved rotated token. Without that token, the image's old one was refused (400), and the grant survived it. - A local-only build with the renewal due after 20 s replaced the socket while idle, renewed and remounted, three times. - Both grants were revoked after. - Approving the board needs **no passkey press**: the consent page is a plain Deny/Allow form. The passkey is used only to sign in to the mind. Not proven: any physical board (none was attached), and the 7-day idle end (time). ## Risk map - **Riskiest: `platforms/iterate_esp_idf/itx_transport.c`.** The refresh runs on the network task as a blocking step bounded like an open. Then `continue` defers the upgrade to the next pass, so one pass never holds two connect bounds against the 20 s task watchdog. It borrows the WebSocket's receive storage, which is idle only while no socket is open. This compiles in the local release builds, but no board has run it. - **Token rotation.** The rotated refresh token is written to NVS before it is used. The issuer still takes the previous token once, so a reset between the answer and the write does not lock the board out. A reflash with a new image starts again from the image's token (the stored token is keyed by a digest of it). - **Trust.** A mind board holds a member's full grant, as the old token held full project access. A grant scoped to the voice paths would need a change in iterate/core. That is not in this PR. - **On merge:** Kit deploys to preview and then to k.iterate.com, and every board's firmware is released. No board updates itself. The new firmware still takes an old-platform image, so a board reflashed through the old path works as before. A board left off for more than 7 days must be set up again; **Only set it up again** does that in seconds. Review order: `components/core/src/token_refresh.c` and its test, `platforms/iterate_esp_idf/itx_transport.c`, `platforms/darwin/itx_transport.c`, `itx_mount.c`, `configuration.c`, `src/firmware/mind-sign-in.ts`, `src/routes/devices.$deviceId.mind.tsx`, then docs and the moved Wi-Fi fields. Session: claude 633bd52f-46a0-4760-bb90-4e8dc16bfb89 on jonas-macbook-pro 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
PreviousNext