S21: chant workspace as blocks spike (a workspace block reading chant's read contract) #70

Closed
opened 2026-10-02 20:55:15 +00:00 by jhgaylor · 1 comment
Owner

Blocks: nothing yet (a milestone follows only on a go)

Blocks track. What it means to render a chant workspace (~/dev/intentius/chant, or any directory with a chant.workspace.json) as illogical blocks: members you can see, panes and agents opened on a member, and chant's gates and drift arriving as attention. illogical becomes one more reader of chant's read contract, beside hud and behold (chant ws-017, ws-052: "a reader other than hud gets everything hud gets").


  • The idea: a Workspace block type (a new BlockType variant, crates/proto/src/lib.rs:575). The daemon runs chant workspace … --json on the block's machine and draws the members. Every client gets the result through describe, call, events and MCP.

    chant illogical
    the workspace a workspace block, the tab's index
    a member (name, dir, kind, because) a card in the block, with status
    a member's dir the cwd for terminal, editor, diff, file and agent blocks opened "on" it
    a nested workspace member a collapsed card that opens as its own block
    generated entries, check --generated staleness on the card; the action runs the generator in a pane
    records (blockedBy, ready, drift on pins) a records list, and attention on drift
    an op stopped at a gate (chant run exits 3) attention with a reason and an Approve action (M24)
    an agent session bound to one member (ws-048) an agent block with that member's cwd and its spec query as context
  • What the read contract gives today (checked 2026-10-02 against chant 6fcb9f34, 0.87.0, on chant's own workspace and reference-workspace/):

    • workspace ls --json works: $schema …/workspace/ls/v1, contract: 1, members, groups and a summary. About 1.2 s, 14 KB for chant's 26 members. This is enough to draw the cards.
    • workspace status <env> --json works: each member's latest release per env from the chant/lifecycle ledger (…/status/v1). Read-only, never fetches.
    • workspace check --format json works (…/check/v1), with WSP diagnostics per member and file/line. check --json prints a different document: {lock, ok, findings, declaration}, with no $schema. The spike should use --format json.
    • workspace records --json works where the declaration names kinds (reference-workspace: …/records/v1, with blockedBy, ready, provenance, digest). W-002 comes back blockedBy: W-001 in-progress. On chant's own root it fails: --kind <kind file> is required, because the declaration names no record kinds, so --kind docs/design/decisions/… is needed there.
    • workspace graph --json returns the document, but on chant only members of kind chant run. 25 of the 26 are other and come back skipped with kind-not-run, so the graph of chant's own repo is nearly empty. In reference-workspace the delivery member failed with command-failed. That was my install (npm ci --ignore-scripts left the docker lexicon's generated/ unbuilt), not chant.
    • workspace graph --intent <path> --json works (…/intent/v1): the history, decisions and pinned artifacts behind one file. This fits a file or diff block (why is this line like this).
    • workspace lineage --json fails without .chant/workspace.lock.json, and neither workspace has one.
    • Gates: no workspace-level read. chant run <op> --json / --progress-json (NDJSON) and run list / run status exist per op, and pending gates live in the gate ledger (packages/core/src/lifecycle/gate-ledger.ts). But nothing lists every pending gate across members as one document. Neither checked workspace has an *.op.ts, so this is unexercised.
  • Questions:

    1. Can the daemon draw a useful workspace block from ls + status + check --format json + records alone, with nothing in chant changed?
    2. Which chant runs (ws-021)? The workspace's own node_modules/.bin/chant, npx at the pinned version, or a chant on PATH, and on a VM tab, the one on that machine. My first run failed outright because chant had no node_modules (Cannot find package 'zod'). The block has to say so, not show an empty workspace.
    3. Freshness: every read is a one-shot process of about 1.2 s (ws-017 turned down a chant daemon). Re-read on file changes under the declared dirs, on a timer, or on demand? What does 4–5 reads per refresh cost?
    4. Gates: do we read the gate ledger ourselves, run chant run status per op, or ask chant for a workspace gates --json read-contract document? The last is the right one if it's small. Draft that request for Jake to file on chant, don't file it.
    5. Is the workspace one block with member cards, or a layout of member blocks? Try both on chant (26 members, mostly lexicons) and on reference-workspace (4).
    6. Where does it stop being illogical and start being hud (ws-052: review actions, quorum, comment mode belong to hud)? Write down the line.
  • Method: a standalone crate in spikes/s21-chant-workspace. It shells out to chant, parses the documents against their published schemas (intentius.io/chant/schemas/workspace/*/v1), and prints the block's describe JSON and a text rendering of the cards. Then wire one throwaway Workspace block into a dev daemon (--socket explicitly) on a branch, open it on ~/dev/intentius/chant and on reference-workspace, and from a card open a terminal and an agent on one member. Fake a pending gate with a toy *.op.ts in a scratch copy of reference-workspace.

  • Done when: README with go/no-go; read timings; a list of what the block shows and which document each field comes from; the answers to questions 2–6; and a draft chant issue for anything we'd need from the read contract (gates, check --json vs --format json).

**Blocks:** nothing yet (a milestone follows only on a go) *Blocks track. What it means to render a chant workspace (`~/dev/intentius/chant`, or any directory with a `chant.workspace.json`) as illogical blocks: members you can see, panes and agents opened on a member, and chant's gates and drift arriving as attention. illogical becomes one more reader of chant's read contract, beside hud and behold (chant `ws-017`, `ws-052`: "a reader other than hud gets everything hud gets").* -------- - **The idea:** a `Workspace` block type (a new `BlockType` variant, `crates/proto/src/lib.rs:575`). The daemon runs `chant workspace … --json` on the block's machine and draws the members. Every client gets the result through `describe`, `call`, events and MCP. | chant | illogical | |---|---| | the workspace | a `workspace` block, the tab's index | | a member (name, dir, kind, `because`) | a card in the block, with status | | a member's `dir` | the cwd for terminal, editor, diff, file and agent blocks opened "on" it | | a nested `workspace` member | a collapsed card that opens as its own block | | `generated` entries, `check --generated` | staleness on the card; the action runs the generator in a pane | | records (`blockedBy`, `ready`, drift on pins) | a records list, and attention on drift | | an op stopped at a gate (`chant run` exits 3) | attention with a reason and an *Approve* action (M24) | | an agent session bound to one member (`ws-048`) | an agent block with that member's cwd and its spec query as context | - **What the read contract gives today** (checked 2026-10-02 against chant `6fcb9f34`, 0.87.0, on chant's own workspace and `reference-workspace/`): - **`workspace ls --json`** works: `$schema` `…/workspace/ls/v1`, `contract: 1`, members, groups and a summary. About 1.2 s, 14 KB for chant's 26 members. This is enough to draw the cards. - **`workspace status <env> --json`** works: each member's latest release per env from the `chant/lifecycle` ledger (`…/status/v1`). Read-only, never fetches. - **`workspace check --format json`** works (`…/check/v1`), with WSP diagnostics per member and file/line. `check --json` prints a different document: `{lock, ok, findings, declaration}`, with no `$schema`. The spike should use `--format json`. - **`workspace records --json`** works where the declaration names kinds (`reference-workspace`: `…/records/v1`, with `blockedBy`, `ready`, `provenance`, `digest`). W-002 comes back `blockedBy: W-001 in-progress`. On chant's own root it fails: `--kind <kind file> is required`, because the declaration names no record kinds, so `--kind docs/design/decisions/…` is needed there. - **`workspace graph --json`** returns the document, but on chant only members of kind `chant` run. 25 of the 26 are `other` and come back `skipped` with `kind-not-run`, so the graph of chant's own repo is nearly empty. In `reference-workspace` the `delivery` member failed with `command-failed`. That was my install (`npm ci --ignore-scripts` left the docker lexicon's `generated/` unbuilt), not chant. - **`workspace graph --intent <path> --json`** works (`…/intent/v1`): the history, decisions and pinned artifacts behind one file. This fits a file or diff block (*why is this line like this*). - **`workspace lineage --json`** fails without `.chant/workspace.lock.json`, and neither workspace has one. - **Gates: no workspace-level read.** `chant run <op> --json` / `--progress-json` (NDJSON) and `run list` / `run status` exist per op, and pending gates live in the gate ledger (`packages/core/src/lifecycle/gate-ledger.ts`). But nothing lists every pending gate across members as one document. Neither checked workspace has an `*.op.ts`, so this is unexercised. - **Questions:** 1. Can the daemon draw a useful workspace block from `ls` + `status` + `check --format json` + `records` alone, with nothing in chant changed? 2. Which chant runs (`ws-021`)? The workspace's own `node_modules/.bin/chant`, npx at the pinned version, or a `chant` on PATH, and on a VM tab, the one on that machine. My first run failed outright because chant had no `node_modules` (`Cannot find package 'zod'`). The block has to say so, not show an empty workspace. 3. Freshness: every read is a one-shot process of about 1.2 s (`ws-017` turned down a chant daemon). Re-read on file changes under the declared dirs, on a timer, or on demand? What does 4–5 reads per refresh cost? 4. Gates: do we read the gate ledger ourselves, run `chant run status` per op, or ask chant for a `workspace gates --json` read-contract document? The last is the right one if it's small. Draft that request for Jake to file on chant, don't file it. 5. Is the workspace one block with member cards, or a layout of member blocks? Try both on chant (26 members, mostly lexicons) and on `reference-workspace` (4). 6. Where does it stop being illogical and start being hud (`ws-052`: review actions, quorum, comment mode belong to hud)? Write down the line. - **Method:** a standalone crate in `spikes/s21-chant-workspace`. It shells out to chant, parses the documents against their published schemas (`intentius.io/chant/schemas/workspace/*/v1`), and prints the block's `describe` JSON and a text rendering of the cards. Then wire one throwaway `Workspace` block into a dev daemon (`--socket` explicitly) on a branch, open it on `~/dev/intentius/chant` and on `reference-workspace`, and from a card open a terminal and an agent on one member. Fake a pending gate with a toy `*.op.ts` in a scratch copy of `reference-workspace`. - **Done when:** README with go/no-go; read timings; a list of what the block shows and which document each field comes from; the answers to questions 2–6; and a draft chant issue for anything we'd need from the read contract (gates, `check --json` vs `--format json`).
Author
Owner

Done 2026-10-02: go. README with the numbers, answers and screenshots: spikes/s21-chant-workspace/README.md (merged in 636d01a). The throwaway block is on branch s21-workspace-block.

  • The read contract alone is enough.
    • workspace status <env> --json already carries every member's pending gates with chant's approve command, so the "gates: no workspace-level read" above was wrong. No chant change is needed.
    • On a dev daemon, a gated op shows as needs_input about 1 s after chant run exits. Approve runs chant approve and clears it. Shell, Agent and Changes open on a member, and a nested workspace opens as a second block.
  • Cost: a full read is about 7.5 CPU-s (four tsx startups). So the block polls a git fingerprint (about 0.1 CPU-s) every 3 s while drawn, and reads in full only on change: 0.4% of a core when idle.
  • The daemon had no node (mise sets it up in .bashrc). See #74.
  • Cards, not member blocks.
  • Approve: the owner and editors, each as themselves (#75, decided).

Follow-ups:

  • #73 M34, the workspace block;
  • #74, the shell environment for blocks that run your tools;
  • #75, approve as owner or editor;
  • #76, drafts for chant (Jake files those himself).

PLAN: "Workspaces track (S21, M34)".

**Done 2026-10-02: go.** README with the numbers, answers and screenshots: `spikes/s21-chant-workspace/README.md` (merged in 636d01a). The throwaway block is on branch `s21-workspace-block`. - **The read contract alone is enough.** - `workspace status <env> --json` already carries every member's pending gates with chant's approve command, so the "gates: no workspace-level read" above was wrong. No chant change is needed. - On a dev daemon, a gated op shows as `needs_input` about 1 s after `chant run` exits. *Approve* runs `chant approve` and clears it. *Shell*, *Agent* and *Changes* open on a member, and a nested workspace opens as a second block. - **Cost:** a full read is about 7.5 CPU-s (four tsx startups). So the block polls a git fingerprint (about 0.1 CPU-s) every 3 s while drawn, and reads in full only on change: 0.4% of a core when idle. - **The daemon had no node** (mise sets it up in `.bashrc`). See #74. - **Cards, not member blocks.** - **Approve:** the owner and editors, each as themselves (#75, decided). Follow-ups: - #73 M34, the workspace block; - #74, the shell environment for blocks that run your tools; - #75, approve as owner or editor; - #76, drafts for chant (Jake files those himself). PLAN: "Workspaces track (S21, M34)".
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#70
No description provided.