session-runner: the ready-for-session queue drains unattended on the workstation — Ben's laptop stops being the trigger (ADR 0174 tail) #538

Closed
opened 2026-08-14 17:30:26 +00:00 by ben · 1 comment
Owner

Why

ADR 0174 moved most parked work off Ben into ready-for-session — but a session today still starts from Ben's laptop by hand. Ben's ask (2026-08-14): automate the kick-off so the session queue drains without him.

The trust boundary already exists: the workstation runs unattended claude with host standing today (healer, reporter — host env, droplet ssh keys, FORGEJO_TOKEN). A session-runner extends that same standing from "heal reds" to "work the session queue"; it is NOT a new credential grant to sandboxed workers.

Sketch

  • Where: matou-workstation, beside the rehearsal executor; a cron/systemd timer tick (e.g. */10).
  • Pick: oldest open ready-for-session ticket with no open depends_on blockers (reuse list-ready-tasks.sh mechanics with the label swapped); skip when one is already claimed (agent-working-style marker or lock file), one at a time.
  • Run: headless claude -p in a dedicated checkout with the host env sourced (rehearsal-env.sh — tokens ride the #510 failover), prompt = the ticket body + ADR 0174 rails: post the ruling/close-report on the ticket, commit only its own files, never touch one-way-door items, escalate to ready-for-human with a ## Why human line when it hits one.
  • Rails: kill switch env/file (SESSION_RUNNER=0), limit-lib guard (rides #510's failover + park), Mattermost notice per ticket outcome, no-triage respected, per-ticket timeout, evidence dir per run like the reporter's.
  • Out of scope: tickets needing Ben's accounts/password manager (they are ready-for-human by definition now); GUI/eyeball work (#471-class).

Why session (this ticket itself)

Builds workstation machinery + .sandcastle/-adjacent scripts (#445 protected paths) — an interactive session lands it; the standing-authority question was settled by Ben's explicit ask + the existing healer precedent.

Acceptance

  1. A ready-for-session ticket filed while Ben is away gets picked up within a tick, worked, and closed-or-escalated with a ticket-posted report; nothing on his laptop was involved.
  2. The kill switch stops pickup within one tick; a running job finishes or times out cleanly.
  3. One-at-a-time proven: two open session tickets never run concurrently.
  4. Offline tests for pick/skip/kill-switch logic alongside the executor's.
## Why ADR 0174 moved most parked work off Ben into `ready-for-session` — but a session today still starts from Ben's laptop by hand. Ben's ask (2026-08-14): automate the kick-off so the session queue drains without him. The trust boundary already exists: the workstation runs unattended `claude` with host standing today (healer, reporter — host env, droplet ssh keys, FORGEJO_TOKEN). A session-runner extends that same standing from "heal reds" to "work the session queue"; it is NOT a new credential grant to sandboxed workers. ## Sketch - **Where:** matou-workstation, beside the rehearsal executor; a cron/systemd timer tick (e.g. */10). - **Pick:** oldest open `ready-for-session` ticket with no open `depends_on` blockers (reuse `list-ready-tasks.sh` mechanics with the label swapped); skip when one is already claimed (`agent-working`-style marker or lock file), one at a time. - **Run:** headless `claude -p` in a dedicated checkout with the host env sourced (`rehearsal-env.sh` — tokens ride the #510 failover), prompt = the ticket body + ADR 0174 rails: post the ruling/close-report on the ticket, commit only its own files, never touch one-way-door items, escalate to `ready-for-human` with a `## Why human` line when it hits one. - **Rails:** kill switch env/file (`SESSION_RUNNER=0`), limit-lib guard (rides #510's failover + park), Mattermost notice per ticket outcome, `no-triage` respected, per-ticket timeout, evidence dir per run like the reporter's. - **Out of scope:** tickets needing Ben's accounts/password manager (they are `ready-for-human` by definition now); GUI/eyeball work (#471-class). ## Why session (this ticket itself) Builds workstation machinery + `.sandcastle/`-adjacent scripts (#445 protected paths) — an interactive session lands it; the standing-authority question was settled by Ben's explicit ask + the existing healer precedent. ## Acceptance 1. A `ready-for-session` ticket filed while Ben is away gets picked up within a tick, worked, and closed-or-escalated with a ticket-posted report; nothing on his laptop was involved. 2. The kill switch stops pickup within one tick; a running job finishes or times out cleanly. 3. One-at-a-time proven: two open session tickets never run concurrently. 4. Offline tests for pick/skip/kill-switch logic alongside the executor's.
Author
Owner

BUILT, INSTALLED, ARMED — aee072c + ff01530 (session-landed under ADR 0174).

What exists: .sandcastle/session-runner.sh + session-runner-prompt.md + tests/session-runner-test.sh (7 offline groups, TDD red-first). Cron on matou-workstation: */10 sourcing rehearsal-env.sh, running from the dedicated clone /home/dev/session-runner/ourcloud (never the shared swarm checkout; self-updates via fetch+reset each tick; its git-ignored .sandcastle/.env carries the forge token).

Acceptance evidence:

  • AC-2 kill switch — offline group 1 + LIVE: off-file → kill switch is on — quiet tick; also honours SESSION_RUNNER=0. Checked before any network.
  • AC-3 one-at-a-time — LIVE: with the flock held, a tick prints session in flight — tick absorbed.
  • AC-4-adjacent (offline) — pick order (priority→oldest), filters (no-triage/deferred/agent-blocked/agent-working/open-deps/cooldown, drive issue excluded), claim add/release, fail-twice → agent-blocked + comment, #510 limit failover + park.
  • Limit path LIVE (today's real degraded state): pinned tick picked #425, claimed agent-working, ran claude, classified You've hit your weekly limit, parked, released the claim (#425 back to bare ready-for-session), no fail counted, log at ~/.local/state/matou-session-runner/logs/run-425-20260814T181519Z.log.
  • AC-1 (full unattended drain) — completes itself the moment the #510 token tail lands (CLAUDE_CODE_OAUTH_TOKEN_B org secret + rehearsal-env.sh exports): until then every tick quietly limit-parks (≤1 notice/hour). First natural pick will be #319 (oldest), then up the queue. Watch Mattermost for the :white_check_mark: session-runner worked #N notices.

Controls: kill = touch /home/dev/session-runner/ourcloud/.sandcastle/session-runner.off (or SESSION_RUNNER=0); pin = SESSION_RUNNER_PICK=<n>; state/logs = ~/.local/state/matou-session-runner/. Escalations arrive as agent-blocked + a ticket comment naming the log.

**BUILT, INSTALLED, ARMED** — `aee072c` + `ff01530` (session-landed under ADR 0174). **What exists:** `.sandcastle/session-runner.sh` + `session-runner-prompt.md` + `tests/session-runner-test.sh` (7 offline groups, TDD red-first). Cron on matou-workstation: `*/10` sourcing `rehearsal-env.sh`, running from the **dedicated clone** `/home/dev/session-runner/ourcloud` (never the shared swarm checkout; self-updates via fetch+reset each tick; its git-ignored `.sandcastle/.env` carries the forge token). **Acceptance evidence:** - **AC-2 kill switch** — offline group 1 + LIVE: off-file → `kill switch is on — quiet tick`; also honours `SESSION_RUNNER=0`. Checked before any network. - **AC-3 one-at-a-time** — LIVE: with the flock held, a tick prints `session in flight — tick absorbed`. - **AC-4-adjacent (offline)** — pick order (priority→oldest), filters (no-triage/deferred/agent-blocked/agent-working/open-deps/cooldown, drive issue excluded), claim add/release, fail-twice → `agent-blocked` + comment, #510 limit failover + park. - **Limit path LIVE** (today's real degraded state): pinned tick picked #425, claimed `agent-working`, ran claude, classified `You've hit your weekly limit`, parked, **released the claim** (#425 back to bare `ready-for-session`), no fail counted, log at `~/.local/state/matou-session-runner/logs/run-425-20260814T181519Z.log`. - **AC-1 (full unattended drain)** — completes itself the moment the #510 token tail lands (`CLAUDE_CODE_OAUTH_TOKEN_B` org secret + `rehearsal-env.sh` exports): until then every tick quietly limit-parks (≤1 notice/hour). First natural pick will be **#319** (oldest), then up the queue. Watch Mattermost for the `:white_check_mark: session-runner worked #N` notices. **Controls:** kill = `touch /home/dev/session-runner/ourcloud/.sandcastle/session-runner.off` (or `SESSION_RUNNER=0`); pin = `SESSION_RUNNER_PICK=<n>`; state/logs = `~/.local/state/matou-session-runner/`. Escalations arrive as `agent-blocked` + a ticket comment naming the log.
ben closed this issue 2026-08-14 18:16:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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/idss#538
No description provided.