M35: studio app blocks (the app, hud's questions and gates as attention) #85

Closed
opened 2026-10-03 00:55:45 +00:00 by jhgaylor · 2 comments
Owner

Blocked by: #73 (M34: gate cards, gate attention as a type, the phone's gates-first sheet) and #75 (approve as a person). From: S22 (spikes/s22-apps, PLAN's "Studio apps track": go).

Studio apps track. A studio box (arugula-salad's studio, or planter's on Fountain) as a block: the app in the frame, and everything the box waits on as illogical attention. That means its agent's questions and its chant gates. A box's repo is a chant workspace, but illogical reads it through hud in the box, never by running chant there: illogical can't run commands in a hosted box, and a full chant read (about 7.5 CPU-s) is too much for a 2 GB box when hud already pays it and pushes changes.


  • The block: a web-page block that knows it's a hud box. Config {box url, app name, studio}. The frame is the box itself (it's already its own origin, so no block site or proxy). S22: illogical open <entry link> worked once the cookie was partitioned.
  • Getting in:
    • illogical needs a studio token, to list a person's apps and mint the owner's /__enter link (POST /api/apps/:name/open is passkey-session only today). For studio.
    • The link is never kept. Today it sits in the block's URL bar and config. Mint it each time the frame needs one. After the first load the partitioned cookie lasts a year.
    • Restore after a reboot, and a second device, both still untried.
  • studio's door: partitioned cookies. hud's session (and the door's box_next) as SameSite=None; Secure; Partitioned. Without it the frame gets 401 in Chrome and Firefox; with it, 200, including Chrome with third-party cookies blocked. For studio (door-patch.sh is the stand-in). Check on purpose that hud's write routes still refuse cross-origin JSON with None.
  • Questions → asks (S22's bridge.mjs, into the daemon):
    • follow /__hud/api/chat/stream for each of /__hud/api/tabs;
    • a hud-chat-queue frame's question becomes an ask on the block itself, source: "hud", project from the box's repo, not the follower's cwd;
    • an answer goes to /__hud/api/chat/answer; a question gone from the queue withdraws the card.
    • S22: 11 ms to illogical, 48–74 ms back, 33 ms to withdraw.
    • Needs Api::Ask (and so POST /api/panes/{id}/ask) to take browser blocks. It's terminal-only today (no terminal %2).
  • Gates → attention:
    • read from hud's work board (GET /__hud/api/work, which reads workspace status and so has every gate, whoever ran it), refreshed when hud's live feed changes (/__hud/api/live/stream), not polled;
    • shown with M34's gate type and card (source: hud).
    • Open: hud can approve only a gate from a run it started (POST /__hud/api/deploy/runs/:id/approve; those runs live in memory). A gate from the steward's or a terminal's chant run release has no hud route. Either hud gets one (approve for any pending gate in workspace status, --actor from its roster), or Approve opens hud's work page in the frame. For hud.
  • Who answered (#75): illogical's answer or approval names the person who clicked, in hud's chat and in chant's ledger. hud records the follower's own player today (the owner). Decide here: each person's own hud player link (hud share --role player), or hud trusting a follower's "answered in illogical by X". View-only guests are refused.
  • Records: linked, not reviewed. Decisions, Work and Intent open hud's pages in the frame (/__enter?…&to=/__hud/work). Record review stays hud's (ws-052).
  • Swarm: kind app, project the box's app; the box's questions and gates bundle with it.
  • Ways in: Open a studio app… in the pane menu and the picker (from the studio token), illogical app [NAME], and an MCP open_app.
  • Later: planter's boxes (Fountain: the same hud, reached through planter's relay); New app in the tab menu (studio's POST /api/apps); a terminal into the box when it's on your own wispd.

Tests: the follower against a fake hud (queue frames, answer, withdraw, expiry); a daemon test for an ask on a browser block; an e2e with a fake box (a page plus hud's routes) framed from another site.

Done when: on geek, a real studio box opens as a block from the picker; its agent's question shows on the swarm's rail and on the phone; answering in illogical carries on the agent's turn, with hud naming who answered; a release waiting at ship shows as attention and can be approved; and the block comes back after a daemon restart without a stored link.

Found on the way (arugula-salad, for Jake to file): hud's panel never mounts on the template's page, framed or not (the client is injected in <head> and looks for <body>); a template clone on geek gets widgets.wtf while ~/box/domain says studio.arugula.io.

**Blocked by:** #73 (M34: gate cards, gate attention as a type, the phone's gates-first sheet) and #75 (approve as a person). **From:** S22 (`spikes/s22-apps`, PLAN's "Studio apps track": go). *Studio apps track. A studio box (arugula-salad's studio, or planter's on Fountain) as a block: the app in the frame, and everything the box waits on as illogical attention. That means its agent's questions and its chant gates. A box's repo is a chant workspace, but illogical reads it **through hud in the box**, never by running chant there: illogical can't run commands in a hosted box, and a full chant read (about 7.5 CPU-s) is too much for a 2 GB box when hud already pays it and pushes changes.* --- - **The block:** a web-page block that knows it's a hud box. Config `{box url, app name, studio}`. The frame is the box itself (it's already its own origin, so no block site or proxy). S22: `illogical open <entry link>` worked once the cookie was partitioned. - **Getting in:** - illogical needs a studio token, to list a person's apps and mint the owner's `/__enter` link (`POST /api/apps/:name/open` is passkey-session only today). *For studio.* - The link is never kept. Today it sits in the block's URL bar and config. Mint it each time the frame needs one. After the first load the partitioned cookie lasts a year. - Restore after a reboot, and a second device, both still untried. - **studio's door: partitioned cookies.** hud's session (and the door's `box_next`) as `SameSite=None; Secure; Partitioned`. Without it the frame gets 401 in Chrome and Firefox; with it, 200, including Chrome with third-party cookies blocked. *For studio* (`door-patch.sh` is the stand-in). Check on purpose that hud's write routes still refuse cross-origin JSON with `None`. - **Questions → asks** (S22's `bridge.mjs`, into the daemon): - follow `/__hud/api/chat/stream` for each of `/__hud/api/tabs`; - a `hud-chat-queue` frame's `question` becomes an ask on the block itself, `source: "hud"`, project from the box's repo, not the follower's cwd; - an answer goes to `/__hud/api/chat/answer`; a question gone from the queue withdraws the card. - S22: 11 ms to illogical, 48–74 ms back, 33 ms to withdraw. - Needs `Api::Ask` (and so `POST /api/panes/{id}/ask`) to take browser blocks. It's terminal-only today (`no terminal %2`). - **Gates → attention:** - read from hud's work board (`GET /__hud/api/work`, which reads `workspace status` and so has every gate, whoever ran it), refreshed when hud's live feed changes (`/__hud/api/live/stream`), not polled; - shown with M34's gate type and card (`source: hud`). - **Open:** hud can approve only a gate from a run it started (`POST /__hud/api/deploy/runs/:id/approve`; those runs live in memory). A gate from the steward's or a terminal's `chant run release` has no hud route. Either hud gets one (`approve` for any pending gate in `workspace status`, `--actor` from its roster), or *Approve* opens hud's work page in the frame. *For hud.* - **Who answered (#75):** illogical's answer or approval names the person who clicked, in hud's chat and in chant's ledger. hud records the follower's own player today (the owner). Decide here: each person's own hud player link (`hud share --role player`), or hud trusting a follower's "answered in illogical by X". View-only guests are refused. - **Records:** linked, not reviewed. *Decisions*, *Work* and *Intent* open hud's pages in the frame (`/__enter?…&to=/__hud/work`). Record review stays hud's (`ws-052`). - **Swarm:** kind `app`, project the box's app; the box's questions and gates bundle with it. - **Ways in:** *Open a studio app…* in the pane menu and the picker (from the studio token), `illogical app [NAME]`, and an MCP `open_app`. - **Later:** planter's boxes (Fountain: the same hud, reached through planter's relay); *New app* in the tab menu (studio's `POST /api/apps`); a terminal into the box when it's on your own wispd. **Tests:** the follower against a fake hud (queue frames, answer, withdraw, expiry); a daemon test for an ask on a browser block; an e2e with a fake box (a page plus hud's routes) framed from another site. **Done when:** on geek, a real studio box opens as a block from the picker; its agent's question shows on the swarm's rail and on the phone; answering in illogical carries on the agent's turn, with hud naming who answered; a release waiting at `ship` shows as attention and can be approved; and the block comes back after a daemon restart without a stored link. **Found on the way (arugula-salad, for Jake to file):** hud's panel never mounts on the template's page, framed or not (the client is injected in `<head>` and looks for `<body>`); a template clone on geek gets `widgets.wtf` while `~/box/domain` says `studio.arugula.io`.
Author
Owner

Merged into local main as edddc1a (branch m35-studio-apps; CI green on linux 808 and macos 810), with the PLAN as-built section at 71d955d. Not pushed by this run.

"Done when" was met on geek against a throwaway box (ilg-m35-a, cloned from arugula-box-template, with hud and the door built from the PRs below) and a throwaway studio from studio#292:

  • From the picker: the block opened in 0.3 s, framed cross-site (200) and following within 0.4–1.7 s.
  • A question: the agent's question reached the swarm's rail and the phone's sheet 2.2–3.8 s after the prompt. That includes the stub agent's turn; the follower's own lag was 13–16 ms.
  • An answer: answered from illogical, the turn went on, and hud's tool result says "jhgaylor answered through illogical".
  • A release at ship: it showed as attention and was approved from the phone. chant's ledger says resolvedBy: "jhgaylor".
  • A daemon restart: the block came back and was following in 139 ms, with no link in the state directory.

Who answered: decided as hud's trusted follower (hud#736, onBehalfOf), as #75's rule requires.

Needs Jake before it works against the real studio: merging and deploying arugula-salad/hud#734, #735 and #736 and arugula-salad/studio#291 and #292, then a personal token from the real studio (illogical studio login) and a follower link per app (hud share --role follower → illogical studio follower APP).

Details and the gaps (a real phone, a second device, WebKit, planter) are in PLAN.md's "M35: as built". Tracker: #86.

Merged into local main as edddc1a (branch `m35-studio-apps`; CI green on linux 808 and macos 810), with the PLAN as-built section at 71d955d. Not pushed by this run. "Done when" was met on geek against a throwaway box (`ilg-m35-a`, cloned from arugula-box-template, with hud and the door built from the PRs below) and a throwaway studio from studio#292: - **From the picker:** the block opened in 0.3 s, framed cross-site (200) and following within 0.4–1.7 s. - **A question:** the agent's question reached the swarm's rail and the phone's sheet 2.2–3.8 s after the prompt. That includes the stub agent's turn; the follower's own lag was 13–16 ms. - **An answer:** answered from illogical, the turn went on, and hud's tool result says "jhgaylor answered through illogical". - **A release at `ship`:** it showed as attention and was approved from the phone. chant's ledger says `resolvedBy: "jhgaylor"`. - **A daemon restart:** the block came back and was following in 139 ms, with no link in the state directory. **Who answered:** decided as hud's trusted follower (hud#736, `onBehalfOf`), as #75's rule requires. **Needs Jake before it works against the real studio:** merging and deploying arugula-salad/hud#734, #735 and #736 and arugula-salad/studio#291 and #292, then a personal token from the real studio (`illogical studio login`) and a follower link per app (`hud share --role follower` → `illogical studio follower APP`). Details and the gaps (a real phone, a second device, WebKit, planter) are in PLAN.md's "M35: as built". Tracker: #86.
jhgaylor referenced this issue from a commit 2026-10-03 03:20:22 +00:00
Author
Owner

Shipped in v0.7.0 (tag on 84b5e9b; geek, jake-mini and jake-air upgraded). Tracker: #86.

Shipped in v0.7.0 (tag on 84b5e9b; geek, jake-mini and jake-air upgraded). Tracker: #86.
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jhgaylor/illogical#85
No description provided.