Floor: open a Claude thread on a ticket from the slide-over #296

Closed
opened 2026-10-21 06:13:31 +00:00 by ben · 3 comments
Owner

Ask (Ben, 2026-10-21): on the Floor, clicking a ticket's card should let the viewer start a real Claude session on that ticket inside the slide-over panel — on every ticket except one a machine slot is busy on — running on matou-workstation to help unblock or close it. When the session starts the panel opens wider and the conversation begins with the ticket and repo context already loaded.

Shape (Claude's calls, Ben opted out of the design conversation):

  • Server: fleet-tui/floor/server/threads.js — one thread per ticket; each turn is a headless claude -p --output-format stream-json process on the thread host (FLOOR_THREAD_SSH, else the machine the Floor runs on) in a checkout under FLOOR_THREAD_REPOS; later turns --resume the same session; session id + transcript persist under FLOOR_THREAD_STATE. Routes /threads/<owner>/<name>/<n>[/start|/say|/events|/reset] (events = server-sent). The ticket is read from the tracker AS THE VIEWER (sign-in token) so a hidden ticket is a 404; a slot-held ticket is a 409.
  • Browser: web/thread.js — the panel widens, the facts shrink to a strip, the transcript streams with a composer; detail.js grew an actions row; every ticket card's panel offers "Open a Claude thread" unless the model's held list names it.
  • Design: docs/superpowers/specs/2026-10-21-floor-ticket-threads-design.md.

Worked interactively in Ben's session (branch floor-signin), not by the swarm.

**Ask (Ben, 2026-10-21):** on the Floor, clicking a ticket's card should let the viewer start a real Claude session on that ticket inside the slide-over panel — on every ticket except one a machine slot is busy on — running on matou-workstation to help unblock or close it. When the session starts the panel opens wider and the conversation begins with the ticket and repo context already loaded. **Shape (Claude's calls, Ben opted out of the design conversation):** - Server: `fleet-tui/floor/server/threads.js` — one thread per ticket; each turn is a headless `claude -p --output-format stream-json` process on the thread host (`FLOOR_THREAD_SSH`, else the machine the Floor runs on) in a checkout under `FLOOR_THREAD_REPOS`; later turns `--resume` the same session; session id + transcript persist under `FLOOR_THREAD_STATE`. Routes `/threads/<owner>/<name>/<n>[/start|/say|/events|/reset]` (events = server-sent). The ticket is read from the tracker AS THE VIEWER (sign-in token) so a hidden ticket is a 404; a slot-held ticket is a 409. - Browser: `web/thread.js` — the panel widens, the facts shrink to a strip, the transcript streams with a composer; `detail.js` grew an `actions` row; every ticket card's panel offers "Open a Claude thread" unless the model's `held` list names it. - Design: `docs/superpowers/specs/2026-10-21-floor-ticket-threads-design.md`. Worked interactively in Ben's session (branch `floor-signin`), not by the swarm.

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: enhancement + ready-for-session

Category — enhancement (kept). Net-new capability. Redundancy check: fleet-tui/floor/server/threads.js and fleet-tui/floor/web/thread.js do not exist; a grep of fleet-tui/floor/** for thread / claude -p / stream-json / --resume / FLOOR_THREAD finds no existing implementation. The viewer sign-in (server/auth.js, #295) and the slot/held model (#293/#295) this builds on do exist. No .out-of-scope/ entry resembles it.

State — ready-for-session, not ready-for-agent. You scoped it explicitly: "Worked interactively in Ben's session (branch floor-signin), not by the swarm." Beyond that directive, the work is on a live door / host credentials surface — a browser-triggered headless claude -p process spawned on a thread host over FLOOR_THREAD_SSH — which is the canonical ready-for-session trigger per docs/agents/triage-labels.md. The swarm queue (list-ready-tasks.sh) reads only ready-for-agent, so a ready-for-session ticket is invisible to workers by construction.

Why this is a two-way door (not ready-for-human):

  • The implementation is Claude's calls inside an interactive session (you opted out of the design conversation and delegated the shape), so it needs an interactive session's standing — not your hands or eyes.
  • It does not widen member-facing trust: the ticket is read from the tracker as the viewer (sign-in token), so a hidden ticket is a 404 and a slot-held ticket a 409 — visibility is inherited, not broadened.
  • The label routing is revertible by a later label flip; proof that the ruling is safe: the swarm queue reads only ready-for-agent (list-ready-tasks.sh), so this ticket cannot be claimed by a worker while it carries ready-for-session.

One open residue for the implementing session (flagged, not blocking): the design doc the Shape names — docs/superpowers/specs/2026-10-21-floor-ticket-threads-design.md — does not exist yet; it's an artifact to author as part of the work, not a pre-existing contract. (This repo has no design tier, so no needs-design gate applies.)

Brief for the interactive session

  • Server: fleet-tui/floor/server/threads.js — one thread per ticket; each turn a headless claude -p --output-format stream-json on the thread host (FLOOR_THREAD_SSH, else the Floor's own host) in a checkout under FLOOR_THREAD_REPOS; later turns --resume; session id + transcript persist under FLOOR_THREAD_STATE. Routes /threads/<owner>/<name>/<n>[/start|/say|/events|/reset] (events = SSE). Read the ticket as the viewer: hidden → 404, slot-held → 409.
  • Browser: fleet-tui/floor/web/thread.js — panel widens, facts shrink to a strip, transcript streams with a composer; detail.js grows an actions row; each card's panel offers "Open a Claude thread" unless the model's held list names that ticket.
  • Done when: the design spec exists; server + browser land on floor-signin; offline tests cover the thread lifecycle, the 404/409 visibility/slot guards, and the held-ticket suppression; a docs/journal/ entry + STATUS.md row land in the same commit.
> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** ## Ruling: `enhancement` + `ready-for-session` **Category — `enhancement` (kept).** Net-new capability. Redundancy check: `fleet-tui/floor/server/threads.js` and `fleet-tui/floor/web/thread.js` do not exist; a grep of `fleet-tui/floor/**` for `thread` / `claude -p` / `stream-json` / `--resume` / `FLOOR_THREAD` finds no existing implementation. The viewer sign-in (`server/auth.js`, #295) and the slot/`held` model (#293/#295) this builds on do exist. No `.out-of-scope/` entry resembles it. **State — `ready-for-session`, not `ready-for-agent`.** You scoped it explicitly: *"Worked interactively in Ben's session (branch `floor-signin`), not by the swarm."* Beyond that directive, the work is on a **live door / host credentials** surface — a browser-triggered headless `claude -p` process spawned on a thread host over `FLOOR_THREAD_SSH` — which is the canonical `ready-for-session` trigger per `docs/agents/triage-labels.md`. The swarm queue (`list-ready-tasks.sh`) reads only `ready-for-agent`, so a `ready-for-session` ticket is invisible to workers by construction. **Why this is a two-way door (not `ready-for-human`):** - The implementation is Claude's calls inside an interactive session (you opted out of the design conversation and delegated the shape), so it needs an interactive session's standing — not your hands or eyes. - It does **not** widen member-facing trust: the ticket is read from the tracker *as the viewer* (sign-in token), so a hidden ticket is a 404 and a slot-held ticket a 409 — visibility is inherited, not broadened. - The label routing is revertible by a later label flip; **proof** that the ruling is safe: the swarm queue reads only `ready-for-agent` (`list-ready-tasks.sh`), so this ticket cannot be claimed by a worker while it carries `ready-for-session`. **One open residue for the implementing session** (flagged, not blocking): the design doc the Shape names — `docs/superpowers/specs/2026-10-21-floor-ticket-threads-design.md` — does not exist yet; it's an artifact to author as part of the work, not a pre-existing contract. (This repo has no design tier, so no `needs-design` gate applies.) ## Brief for the interactive session - **Server:** `fleet-tui/floor/server/threads.js` — one thread per ticket; each turn a headless `claude -p --output-format stream-json` on the thread host (`FLOOR_THREAD_SSH`, else the Floor's own host) in a checkout under `FLOOR_THREAD_REPOS`; later turns `--resume`; session id + transcript persist under `FLOOR_THREAD_STATE`. Routes `/threads/<owner>/<name>/<n>[/start|/say|/events|/reset]` (events = SSE). Read the ticket **as the viewer**: hidden → 404, slot-held → 409. - **Browser:** `fleet-tui/floor/web/thread.js` — panel widens, facts shrink to a strip, transcript streams with a composer; `detail.js` grows an `actions` row; each card's panel offers "Open a Claude thread" unless the model's `held` list names that ticket. - **Done when:** the design spec exists; server + browser land on `floor-signin`; offline tests cover the thread lifecycle, the 404/409 visibility/slot guards, and the held-ticket suppression; a `docs/journal/` entry + `STATUS.md` row land in the same commit.

Close report — landed on main

Ruled by agent under ADR 0174 — veto anytime.

The feature is built, proven offline, and landed. Commit 9c29ad8 on main (session-runner lands direct; fleet-tui/floor/ is operator-side and vendor-excluded, so there is no consumer blast radius).

What landed

  • Design — docs/superpowers/specs/2026-10-21-floor-ticket-threads-design.md (decisions 1–10 + the OFF-by-default posture; Ben opted out of the design conversation, so these are Claude's calls).
  • Server — fleet-tui/floor/server/threads.js: one thread per ticket; each turn a headless claude -p --output-format stream-json on the thread host (FLOOR_THREAD_SSH, else the Floor's own host) in the checkout under FLOOR_THREAD_REPOS; later turns --resume; session id + a reduced transcript persist under FLOOR_THREAD_STATE. Routes GET /threads (capability), POST …/start, POST …/say, GET …/events (SSE), POST …/reset, wired behind the gate in server.js. auth.js grew apiAsViewer (the viewer's token stays inside auth.js).
  • Browser — web/thread.js (panel widens, facts → a strip, transcript streams, composer); detail.js grew an actions row + a beforeOpen teardown; the Floor's queue/outbox cards (floor-paint.js) and the Board's cards (board-paint.js) offer "Open a Claude thread" unless the ticket is slot-held, via the shared heldSet/threadAction; app.js + the Board boot probe GET /threads and build the controller only when enabled.
  • Docs — docs/journal/2026-10-21-296.md + the STATUS.md self-consumer row, same commit.

The two guards you asked for

  • Read as the viewer — the ticket is fetched with the viewer's own OAuth token, so a repo/ticket they cannot see is a 404 (the thread never learns it exists).
  • A slot-held ticket is a 409 — if a machine is busy on that exact ticket (the live snapshot's hosts[].holder), /start and /say refuse, so a human thread never races a worker in the same checkout. The one ticket you cannot thread is the one being worked.

Proof (all offline — a shimmed claude via FLOOR_CLAUDE_BIN, a fake tracker, no ssh/network)

  • threads.test.js — command builder, stream-json reducer, prompt, the full lifecycle, start idempotence, say-resumes, say-while-running 409, slot-held 409, hidden 404, no-session 401, reset, disabled-gate 404.
  • threads-server.test.js — the routes in the real server process: capability, gate OFF without FLOOR_THREAD_REPOS → ON, a thread started + streamed over SSE end to end, held 409, hidden 404.
  • thread.test.js — the browser module vs the fake DOM: offerFor (offered / muted-when-held / absent), renderEvent, the detail.js actions row, the panel takeover driving injected fetch + EventSource, the composer sending a /say turn, teardown on re-open.
  • auth.test.js — a new apiAsViewer case (viewer token used; 404 for a repo they can't see; null for a gone session).
  • 142 floor node tests pass; tests/floor-server-test.sh, tests/fleet-tui-test.sh, tests/docs-budget-test.sh green; the full tests/*.sh + onboarding/tests/*.sh offline suite re-run with 0 failures. I added no shell, so the shellcheck/bash -n static job is unaffected.

Why human (the one-way residue — NOT taken here)

The whole feature ships OFF and is inert unless sign-in is ON and FLOOR_THREAD_REPOS is set. Landing the code was entirely two-way (revertible, offline-proven, non-vendored). But turning it on in a reachable deploy — a browser-triggered claude -p running with a host's credentials — is a security-posture widening reserved for a human. I did not take that door. It is tracked as #297 (ready-for-human), which names exactly what Ben needs to rule on before enabling. Until then the hosted deploy keeps it off and the Floor is unchanged.

Closing #296: the build (design + server + browser + offline tests + journal/STATUS) matches the triage's "Done when" exactly and is proven. The deploy decision lives on #297.

## Close report — landed on `main` **Ruled by agent under ADR 0174 — veto anytime.** The feature is built, proven offline, and landed. Commit `9c29ad8` on `main` (session-runner lands direct; `fleet-tui/floor/` is operator-side and vendor-excluded, so there is **no consumer blast radius**). ### What landed - **Design** — `docs/superpowers/specs/2026-10-21-floor-ticket-threads-design.md` (decisions 1–10 + the OFF-by-default posture; Ben opted out of the design conversation, so these are Claude's calls). - **Server** — `fleet-tui/floor/server/threads.js`: one thread per ticket; each turn a headless `claude -p --output-format stream-json` on the thread host (`FLOOR_THREAD_SSH`, else the Floor's own host) in the checkout under `FLOOR_THREAD_REPOS`; later turns `--resume`; session id + a reduced transcript persist under `FLOOR_THREAD_STATE`. Routes `GET /threads` (capability), `POST …/start`, `POST …/say`, `GET …/events` (SSE), `POST …/reset`, wired behind the gate in `server.js`. `auth.js` grew `apiAsViewer` (the viewer's token stays inside `auth.js`). - **Browser** — `web/thread.js` (panel widens, facts → a strip, transcript streams, composer); `detail.js` grew an `actions` row + a `beforeOpen` teardown; the Floor's queue/outbox cards (`floor-paint.js`) and the Board's cards (`board-paint.js`) offer "Open a Claude thread" unless the ticket is slot-held, via the shared `heldSet`/`threadAction`; `app.js` + the Board boot probe `GET /threads` and build the controller only when enabled. - **Docs** — `docs/journal/2026-10-21-296.md` + the `STATUS.md` self-consumer row, same commit. ### The two guards you asked for - **Read as the viewer** — the ticket is fetched with the viewer's own OAuth token, so a repo/ticket they cannot see is a **404** (the thread never learns it exists). - **A slot-held ticket is a 409** — if a machine is busy on that exact ticket (the live snapshot's `hosts[].holder`), `/start` and `/say` refuse, so a human thread never races a worker in the same checkout. The one ticket you cannot thread is the one being worked. ### Proof (all offline — a shimmed `claude` via `FLOOR_CLAUDE_BIN`, a fake tracker, no ssh/network) - `threads.test.js` — command builder, stream-json reducer, prompt, the full lifecycle, start idempotence, say-resumes, say-while-running 409, slot-held 409, hidden 404, no-session 401, reset, disabled-gate 404. - `threads-server.test.js` — the routes in the **real server process**: capability, gate OFF without `FLOOR_THREAD_REPOS` → ON, a thread started + streamed over SSE end to end, held 409, hidden 404. - `thread.test.js` — the browser module vs the fake DOM: `offerFor` (offered / muted-when-held / absent), `renderEvent`, the `detail.js` actions row, the panel takeover driving injected fetch + EventSource, the composer sending a `/say` turn, teardown on re-open. - `auth.test.js` — a new `apiAsViewer` case (viewer token used; 404 for a repo they can't see; null for a gone session). - **142 floor node tests pass**; `tests/floor-server-test.sh`, `tests/fleet-tui-test.sh`, `tests/docs-budget-test.sh` green; the full `tests/*.sh` + `onboarding/tests/*.sh` offline suite re-run with **0 failures**. I added no shell, so the shellcheck/`bash -n` static job is unaffected. ## Why human (the one-way residue — NOT taken here) The whole feature ships **OFF** and is **inert** unless sign-in is ON *and* `FLOOR_THREAD_REPOS` is set. Landing the code was entirely two-way (revertible, offline-proven, non-vendored). But **turning it on in a reachable deploy** — a browser-triggered `claude -p` running with a host's credentials — is a **security-posture widening** reserved for a human. I did **not** take that door. It is tracked as **#297** (`ready-for-human`), which names exactly what Ben needs to rule on before enabling. Until then the hosted deploy keeps it off and the Floor is unchanged. Closing #296: the build (design + server + browser + offline tests + journal/STATUS) matches the triage's "Done when" exactly and is proven. The deploy decision lives on #297.
matou-build-agent 2026-10-21 07:24:52 +00:00
Author
Owner

Relanded — Ben's live-proven build replaces 9c29ad8

Two builds of this ask happened on 2026-10-21: the session-runner landed 9c29ad8 (gated OFF behind FLOOR_THREAD_REPOS) while Ben's own session built the feature on floor-signin and ran it for real — laptop Floor with FLOOR_THREAD_SSH=dev@matou-workstation, threads on idss#589 (closed from the thread), coa#50 and idss#750. Ben ruled to land that build: commit 33050fe on main takes it wholesale (server/threads.js, web/thread.js, tests, spec decisions 1–13, Board panels, the collector nudge on turn end, feed retry + 5 s re-read) and retires threads-server.test.js / fake-claude.mjs; everything main gained since 9c29ad8 is kept.

What differs from 9c29ad8: threads are ON by default (FLOOR_THREADS=off hides them; sign-in stays required since the ticket is read as the viewer), the checkout is cloned on first use on the thread host, a settled turn nudges the collector, and the feed is not the only truth. Posture note for the hosted floor: its next restart from an updated checkout turns threads on with claude as the service user on that host — deploy/README.md "Ticket threads" lists what that user needs; FLOOR_THREADS=off keeps it off.

Journal: docs/journal/2026-10-21-296-live.md. 161 floor node tests + 24 collector tests green.

## Relanded — Ben's live-proven build replaces `9c29ad8` Two builds of this ask happened on 2026-10-21: the session-runner landed `9c29ad8` (gated OFF behind `FLOOR_THREAD_REPOS`) while Ben's own session built the feature on `floor-signin` and ran it for real — laptop Floor with `FLOOR_THREAD_SSH=dev@matou-workstation`, threads on idss#589 (closed from the thread), coa#50 and idss#750. Ben ruled to land that build: commit `33050fe` on `main` takes it wholesale (`server/threads.js`, `web/thread.js`, tests, spec decisions 1–13, Board panels, the collector nudge on turn end, feed retry + 5 s re-read) and retires `threads-server.test.js` / `fake-claude.mjs`; everything `main` gained since `9c29ad8` is kept. What differs from `9c29ad8`: threads are **ON by default** (`FLOOR_THREADS=off` hides them; sign-in stays required since the ticket is read as the viewer), the checkout is cloned on first use on the thread host, a settled turn nudges the collector, and the feed is not the only truth. Posture note for the hosted floor: its next restart from an updated checkout turns threads on with `claude` as the service user on that host — `deploy/README.md` "Ticket threads" lists what that user needs; `FLOOR_THREADS=off` keeps it off. Journal: `docs/journal/2026-10-21-296-live.md`. 161 floor node tests + 24 collector tests green.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
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
Matou/dev-factory#296
No description provided.