M34: chant workspace blocks (members, records, gates as attention) #73

Closed
opened 2026-10-02 21:15:43 +00:00 by jhgaylor · 4 comments
Owner

Blocked by: nothing (S21, #70: go). Related: #74 (the shell environment: needed where node comes from .bashrc), #75 (approve in shared sessions, part of this), #76 (chant drafts).

Workspaces track. A chant workspace as a block: members as cards you open shells, agents and diffs on, records with their state, and gates waiting in any member as illogical attention you can approve. Read through chant's read contract only (ws-017, ws-052); review actions stay hud's. Start from branch s21-workspace-block (throwaway, but the shape is right) and spikes/s21-chant-workspace (the reader and composer, with fixtures).


  • The block:
    • BlockType::Workspace, config {root, env}.
    • One sh -c on the block's host (one exec on a VM) runs workspace ls --json, check --format json, records --current --json and status <env> --json in parallel, through the workspace's own chant: $CHANT, else node_modules/.bin here or in a parent, else PATH. If there's none, it says so.
    • It composes them as S21 does: cards (kind, because, errors and warnings from check, releases, gates), nested workspaces opening as blocks, records with blockedBy and drift, and an attention headline.
  • Freshness:
    • A full read (about 7.5 CPU-s) on open, on refresh and after approve.
    • While drawn, a git fingerprint every 3 s (HEAD, chant/lifecycle, status --porcelain, diff HEAD; about 0.1 CPU-s), with a full read only when it changes.
    • Never fetches. Maybe a slow fetch of chant/lifecycle later.
  • Gates as attention: a pending gate is needs_input with "member: op waits at gate g". Approve runs chant's approve in the member's directory, owner and editors only (#75). Run op opens a pane running chant run <op>.
  • Members: Shell, Agent and Changes open a terminal, an agent block (cwd = the member) or a diff block beside it. Open on a nested workspace opens another workspace block.
  • Ways in:
    • illogical workspace [DIR] [--env E];
    • Open as workspace in a pane's menu and the picker when the directory holds a chant.workspace.json;
    • an MCP open_workspace;
    • describe and call (refresh, approve, member, state).
  • Clients: web cards (S21's renderer as a start), the phone sheet (gates first), and a TUI line.
  • Tests:
    • composer unit tests (S21's fixtures);
    • daemon tests for attention on a gate and clearing on approve;
    • e2e against a fixture workspace with a toy gated op (CI needs node and chant: npm ci of a pinned chant);
    • the no-chant and no-declaration cases.
  • Done when: on geek, illogical workspace ~/dev/intentius/chant (after npm install) shows its members. A gated op in a member shows as attention within about 5 s, the phone can approve it, and the next chant run walks through.
**Blocked by:** nothing (S21, #70: go). **Related:** #74 (the shell environment: needed where node comes from `.bashrc`), #75 (approve in shared sessions, part of this), #76 (chant drafts). *Workspaces track. A chant workspace as a block: members as cards you open shells, agents and diffs on, records with their state, and gates waiting in any member as illogical attention you can approve. Read through chant's read contract only (`ws-017`, `ws-052`); review actions stay hud's. Start from branch `s21-workspace-block` (throwaway, but the shape is right) and `spikes/s21-chant-workspace` (the reader and composer, with fixtures).* -------- - **The block:** - `BlockType::Workspace`, config `{root, env}`. - One `sh -c` on the block's host (one exec on a VM) runs `workspace ls --json`, `check --format json`, `records --current --json` and `status <env> --json` in parallel, through the workspace's own chant: `$CHANT`, else `node_modules/.bin` here or in a parent, else PATH. If there's none, it says so. - It composes them as S21 does: cards (kind, `because`, errors and warnings from `check`, releases, gates), nested workspaces opening as blocks, records with `blockedBy` and drift, and an attention headline. - **Freshness:** - A full read (about 7.5 CPU-s) on open, on `refresh` and after `approve`. - While drawn, a git fingerprint every 3 s (HEAD, `chant/lifecycle`, `status --porcelain`, `diff HEAD`; about 0.1 CPU-s), with a full read only when it changes. - Never fetches. Maybe a slow fetch of `chant/lifecycle` later. - **Gates as attention:** a pending gate is `needs_input` with "member: op waits at gate g". *Approve* runs chant's `approve` in the member's directory, owner and editors only (#75). *Run op* opens a pane running `chant run <op>`. - **Members:** *Shell*, *Agent* and *Changes* open a terminal, an agent block (cwd = the member) or a diff block beside it. *Open* on a nested workspace opens another workspace block. - **Ways in:** - `illogical workspace [DIR] [--env E]`; - *Open as workspace* in a pane's menu and the picker when the directory holds a `chant.workspace.json`; - an MCP `open_workspace`; - `describe` and `call` (`refresh`, `approve`, `member`, `state`). - **Clients:** web cards (S21's renderer as a start), the phone sheet (gates first), and a TUI line. - **Tests:** - composer unit tests (S21's fixtures); - daemon tests for attention on a gate and clearing on approve; - e2e against a fixture workspace with a toy gated op (CI needs node and chant: `npm ci` of a pinned chant); - the no-chant and no-declaration cases. - **Done when:** on geek, `illogical workspace ~/dev/intentius/chant` (after `npm install`) shows its members. A gated op in a member shows as attention within about 5 s, the phone can approve it, and the next `chant run` walks through.
Author
Owner

Starting point: branch s21-workspace-block (pushed; one throwaway commit on top of the S21 spike). Throwaway code, but the shape is right.

S21 didn't try these; M34 should check them:

  • The Agent button on a member card: a Claude agent block in the member's directory. Never started in the spike.
  • A workspace on a VM tab. The reads go through Runner::Machine; the VM needs node, npm ci and a fingerprint run through the provider.
  • The phone sheet, with gates first.

Possible extras, out of scope unless cheap:

  • chant workspace graph --intent <path> --json behind a file or diff block ("why is this line like this": decisions and pinned artifacts for a file).
  • A slow fetch of chant/lifecycle, so gates reached in CI show without a manual fetch.
**Starting point:** branch `s21-workspace-block` (pushed; one throwaway commit on top of the S21 spike). Throwaway code, but the shape is right. **S21 didn't try these; M34 should check them:** - The *Agent* button on a member card: a Claude agent block in the member's directory. Never started in the spike. - A workspace on a VM tab. The reads go through `Runner::Machine`; the VM needs node, `npm ci` and a fingerprint run through the provider. - The phone sheet, with gates first. **Possible extras, out of scope unless cheap:** - `chant workspace graph --intent <path> --json` behind a file or diff block ("why is this line like this": decisions and pinned artifacts for a file). - A slow fetch of `chant/lifecycle`, so gates reached in CI show without a manual fetch.
Author
Owner

Added from S22 (studio apps, spikes/s22-apps): write gate attention against a gate, not against chant.

A studio box's repo is a chant workspace too (members app, delivery, box; its release stops at chant's ship gate). The studio app block (#85, M35) will get its gates from hud in the box (hud's work board, GET /__hud/api/work, reads workspace status), not by running chant. illogical can't run commands in a hosted studio box or a planter box on Fountain.

So that both kinds of block land in the same place on the swarm:

  • Keep the gate as its own type: {member, op, gate, env, since, expires, approvals, needed, command}, plus source (chant on this host, or hud in a box). The needs_input reason, the bundle key and the card come from that type, not from the reader.
  • Approve goes through the source: here chant approve … --approver <person> (#75), and in M35 whatever hud offers.
  • The phone's gates-first sheet and the swarm's rail don't care where a gate came from.

Nothing else in M34 changes. In particular the workspace block stays for local workspaces and isn't widened to boxes. "A workspace on a VM tab" would work for a box on your own wispd (the box has node in ~/opt/node and its own chant), but M35 is the way in for boxes in general.

**Added from S22 (studio apps, `spikes/s22-apps`): write gate attention against a gate, not against chant.** A studio box's repo is a chant workspace too (members `app`, `delivery`, `box`; its release stops at chant's `ship` gate). The studio app block (#85, M35) will get its gates from hud in the box (hud's work board, `GET /__hud/api/work`, reads `workspace status`), not by running chant. illogical can't run commands in a hosted studio box or a planter box on Fountain. So that both kinds of block land in the same place on the swarm: - Keep the gate as its own type: `{member, op, gate, env, since, expires, approvals, needed, command}`, plus `source` (chant on this host, or hud in a box). The `needs_input` reason, the bundle key and the card come from that type, not from the reader. - *Approve* goes through the source: here `chant approve … --approver <person>` (#75), and in M35 whatever hud offers. - The phone's gates-first sheet and the swarm's rail don't care where a gate came from. Nothing else in M34 changes. In particular the workspace block stays for local workspaces and isn't widened to boxes. "A workspace on a VM tab" would work for a box on your own wispd (the box has node in `~/opt/node` and its own chant), but M35 is the way in for boxes in general.
Author
Owner

Merged into local main (c88c1e7, M34 branch m34-workspace 8bb696c; CI green on linux 799 and macos 798). Not pushed. On geek: chant's 25 members in 1.6 s through #74's cached environment; a gated op reached the phone sheet in 0.8–1.8 s (5.3 s once); Approve on the phone cleared it in the daemon in 2.6–2.8 s; the next chant run walked through; chant's ledger names the approver (jhgaylor@gmail.com, not the OS user). Guests are refused (tests in crates/daemon/tests/workspace.rs and web/e2e/workspace.spec.ts). Numbers and what wasn't covered are in PLAN.md's "#74 and M34: as built". Tracker: #86.

Merged into local main (c88c1e7, M34 branch m34-workspace 8bb696c; CI green on linux 799 and macos 798). Not pushed. On geek: chant's 25 members in 1.6 s through #74's cached environment; a gated op reached the phone sheet in 0.8–1.8 s (5.3 s once); Approve on the phone cleared it in the daemon in 2.6–2.8 s; the next `chant run` walked through; chant's ledger names the approver (jhgaylor@gmail.com, not the OS user). Guests are refused (tests in crates/daemon/tests/workspace.rs and web/e2e/workspace.spec.ts). Numbers and what wasn't covered are in PLAN.md's "#74 and M34: 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#73
No description provided.