Skip to content

Commit a77b07e

Browse files
tildesrcclaude
andcommitted
docs: rename ball→turn, DoD→responsibilities, verdict→status
Terminology + model refinement (clearer, self-evident terms): - "ball" (who acts next) → "turn" - per-state Definition-of-Done → the agent's "responsibilities" - verdict {PENDING,PASS,UNSATISFIABLE} → status {PENDING,MET,FAILED} Model sharpened: responsibilities are agent-only obligations (cloude-cade allowed user items; here user actions just drive transitions). The agent settles each MET or FAILED (FAILED requires a comment) before handing the turn back; the settled set is recorded per turn in history. Updated ARCHITECTURE, ADR 0004, ADR 0006, ROADMAP, BACKLOG. PARITY keeps cloude-cade's vocabulary (it documents the prototype). Code changes follow in the slice PRs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent fe7fff0 commit a77b07e

5 files changed

Lines changed: 59 additions & 50 deletions

File tree

docs/ARCHITECTURE.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ Read the ADRs for *why*; read this for *what* and *how it fits together*.
2727
┌────────────────┐ REST ┌──────────────────────────────────────────────────────────┐
2828
│ Terminal │────────▶│ ┌───────────┐ ┌────────────┐ ┌──────────────────────┐ │
2929
│ controller │◀────────│ │Repository │ │ Workflow │ │ Lifecycle engine: │ │
30-
│ └─ dashboard │ REST/ │ │ (SQLite) │ │ registry │ │ state machine, ball, │ │
31-
│ (Textual) │ MCP │ └───────────┘ └────────────┘ │ DoD enforcement │ │
30+
│ └─ dashboard │ REST/ │ │ (SQLite) │ │ registry │ │ state machine, turn, │ │
31+
│ (Textual) │ MCP │ └───────────┘ └────────────┘ │ responsibility enforcement │ │
3232
└───────┬────────┘ │ REST API · MCP surface (artifacts + task tools) │ │
3333
│ └───────▲─────────────────────────────▲──────────────────┘
3434
│ tmux attach (local) │ REST (register, pull work) │ MCP (+ some REST)
@@ -72,8 +72,8 @@ Why:
7272
so its responsibilities split by *where they run*:
7373

7474
- **Control-plane side (deterministic, in the task service):** the workflow class's
75-
declarative members (state set, transitions, foreground/background classification, DoD
76-
*definitions*) and any deterministic imperative methods (compute next state, list cleanup
75+
declarative members (state set, transitions, foreground/background classification,
76+
responsibility *definitions*) and any deterministic imperative methods (compute next state, list cleanup
7777
steps, construct a non-reasoning forge request). No LLM.
7878
- **Container side (LLM, in the task container):** the workflow's **skills** — the
7979
agent-driven procedures it contributes (planning, implementing, `babysit-ci`'s
@@ -94,8 +94,8 @@ The single authority over task state (ADR 0006). Responsibilities:
9494
mutates state *through* it, which provides the serialization that gives integrity.
9595
- **Hosts the workflow registry** (ADR 0004) — on startup, loads workflow classes via
9696
path-based registration; dispatches to the active workflow per task.
97-
- **Runs the lifecycle engine** — applies workflow-defined transitions, enforces DoD gating,
98-
maintains the `:agent:`/`:user:` ball (workflows supply only the fg/bg classification).
97+
- **Runs the lifecycle engine** — applies workflow-defined transitions, enforces responsibility gating,
98+
maintains the `agent`/`user` turn (workflows supply only the fg/bg classification).
9999
- **Exposes two interfaces:** a **REST API** (dashboard, session service, in-container
100100
skills) and an **MCP surface** (in-container agents: artifacts as resources, task
101101
operations as tools). See §5.
@@ -136,7 +136,7 @@ the task service. It:
136136
| Client | Protocol | Used for |
137137
|---|---|---|
138138
| Terminal controller / dashboard | **REST** | queries (task list/detail), commands (create idea, promote, advance, drop), runner/status views |
139-
| In-container agent | **MCP** | artifacts as resources (plan/notes, ADR 0003); task operations as tools (set slug, advance, report DoD verdict, append log) |
139+
| In-container agent | **MCP** | artifacts as resources (plan/notes, ADR 0003); task operations as tools (set slug, advance, report responsibility status, append log) |
140140
| In-container skills | **REST** (some) | operations not natural as MCP tools, or when a skill needs the broader API |
141141
| Session service | **REST** | register as runner, pull assigned work, report session lifecycle/health |
142142

@@ -150,7 +150,7 @@ Every port is a Python ABC in the core; adapters live in the owning component.
150150
| Port | ABC responsibility | Adapter now | Future adapters | ADR |
151151
|---|---|---|---|---|
152152
| **Repository** | persist tasks, repos, history; enforce transitions | SQLite | Postgres | 0001/0006 |
153-
| **Workflow** | define a lifecycle (states, DoD, skills, deterministic methods) | parity, free-form | user/agent-authored | 0004 |
153+
| **Workflow** | define a lifecycle (states, responsibilities, skills, deterministic methods) | parity, free-form | user/agent-authored | 0004 |
154154
| **Execution backend** (session service) | spawn/stop a task's session; inject secrets; run image | local Docker+tmux | remote, non-container | 0005/0008 |
155155
| **Artifact store** | read/write per-task files (plan, notes) | local filesystem | object storage | 0003 |
156156
| **Presentation** | render + drive the system | Textual TUI | web UI, other-lang dashboard | 0002 |
@@ -167,7 +167,8 @@ registration. Sketch of the ABC's two faces:
167167
- **Declarative members** (data the control plane reads):
168168
- `states`, `transitions`, and per-state `foreground`/`background` classification;
169169
- `transition_policy` (user-approved vs. auto-advance);
170-
- `definition_of_done(state)` → checklist + verdict semantics (`PENDING`/`PASS`/`UNSATISFIABLE`);
170+
- `responsibilities(state)` → the agent's obligations for that state (each settles to a
171+
`status`: `PENDING``MET`/`FAILED`, a `FAILED` one needs a comment);
171172
- `skills()` → the catalogue of workflow-specific skills exposed in the container (e.g.
172173
`babysit-ci`), on top of the core operations (`advance`, `drop`). A free-form workflow
173174
contributes few or none.
@@ -193,10 +194,13 @@ active workflow*, not a fixed global list.
193194
- **Repo** — first-class (ADR 0007): identity, default base, association to its env config +
194195
creds volume (references, **never secret values**).
195196
- **Task** — stable internal **id** (generated at creation), `repo_id`, `workflow`, current
196-
`state`, ball holder (`agent`/`user`), `mode` (fg/bg), git refs (branch/worktree), optional
197+
`state`, **`turn`** (`agent`/`user`), `mode` (fg/bg), git refs (branch/worktree), optional
197198
forge refs (PR), and an **optional `slug`** (see §8.3).
198-
- **History** — append-only transition log per task (timestamp, from/to state, via, DoD
199-
verdict). This is cloude-cade's `** Log` as structured rows.
199+
- **History** — append-only transition log per task. Each entry: timestamp, from/to state,
200+
via, and the **responsibilities settled that turn** (each with its `status` and, if
201+
`FAILED`, the agent's comment). This is cloude-cade's `** Log` as structured rows — but
202+
responsibilities are **agent-only** obligations (a deliberate divergence: cloude-cade's DoD
203+
could include user items; here user actions just drive transitions directly).
200204

201205
### 8.2 Artifacts (ADR 0003)
202206

@@ -225,7 +229,7 @@ mounted creds. Values never enter the DB, artifacts, or image layers.
225229

226230
1. **Idea → task.** A user captures an idea / promotes it via the dashboard (REST). The task
227231
service creates a Task row (internal id, chosen workflow, `repo_id`), in the workflow's
228-
initial state, with the ball held appropriately. No slug yet.
232+
initial state, with the turn assigned appropriately. No slug yet.
229233
2. **Assign & spawn.** The task service assigns the task to a session service (runner). The
230234
runner builds/selects the composed image (ADR 0005), injects the repo's secrets (ADR 0007),
231235
creates the task container (sibling, DooD) and its tmux session, and starts the agent.
@@ -237,8 +241,8 @@ mounted creds. Values never enter the DB, artifacts, or image layers.
237241
5. **Work.** The agent plans/implements; artifacts (plan/notes) flow over MCP; the agent runs
238242
workflow skills (e.g. `babysit-ci`) that may use `gh`/git and call back over REST/MCP to
239243
request transitions. The task service deterministically enforces the workflow's state
240-
machine and DoD gating, flips the ball per the fg/bg classification, and appends history.
241-
6. **Observe & steer.** The dashboard reflects state/ball/history live (REST); the user
244+
machine and responsibility gating, flips the turn per the fg/bg classification, and appends history.
245+
6. **Observe & steer.** The dashboard reflects state/turn/history live (REST); the user
242246
presses `t` to drop into a task's tmux and back.
243247
7. **Terminal states & cleanup.** On COMPLETE/DROPPED (or the workflow's terminals), cleanup
244248
runs the core's agnostic teardown (tmux/worktree/branch) plus the workflow's specific
@@ -259,12 +263,12 @@ mounted creds. Values never enter the DB, artifacts, or image layers.
259263

260264
```
261265
panopticon/
262-
core/ # ports (ABCs), domain models, state-machine + ball + DoD engine — no LLM/UI/DB
266+
core/ # ports (ABCs), domain models, state-machine + turn + responsibility engine — no LLM/UI/DB
263267
taskservice/ # control plane: REST + MCP servers, repository adapter (SQLite), workflow loader
264268
sessionservice/# runner: execution-backend adapter (Docker+tmux), image build/compose, secret injection
265269
terminal/ # `panopticon` CLI + dashboard (Textual) — presentation adapter
266270
workflows/ # built-in workflow classes (parity, free-form) on a registered path
267-
container/ # in-container entrypoint, hooks (slug, ball), skill definitions, REST/MCP client
271+
container/ # in-container entrypoint, hooks (slug, turn), skill definitions, REST/MCP client
268272
```
269273

270274
The determinism invariant maps onto packages: only `container/` (and user workflow *skills*)

docs/BACKLOG.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ in the ADRs; this file is for the smaller stuff that doesn't have a home there y
3939
_(Slice 1, P2)_
4040
- [ ] **Registrations are in-memory** — lost on task-service restart; no reconciliation with
4141
live containers on reconnect (relates to ADR 0008 failure-handling). _(Slice 1, P2)_
42-
- [ ] **DoD evaluation mechanism** — the engine gates on a single passed-in verdict; there's
43-
no per-item evaluation (programmatic vs. agent-judged) or per-item tracking yet. Build with
44-
the parity workflow (Slice 4). _(Slice 1, P2)_
4542

4643
## Tracked elsewhere (pointers, do not duplicate)
4744

docs/ROADMAP.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ later work can proceed in parallel against stable seams.
4848
"working on task X", and stays connected.
4949

5050
Plus a **stubbed runner** and **fake container client** that drive the seed workflow through
51-
the real task service (no Docker yet), and the **state-machine + ball + DoD engine** with its
51+
the real task service (no Docker yet), and the **state-machine + turn + responsibility engine** with its
5252
**golden test harness** (the durable parity spec).
5353

5454
**Acceptance:**
@@ -84,7 +84,7 @@ controller starts the daemons); container→host-service addressing (real).
8484
**Goal:** the operator surface.
8585

8686
**Delivers:** the `panopticon` CLI; the Textual dashboard (presentation adapter, ADR 0002) as
87-
a REST client — task list, state/ball/history (read first); then **`t``tmux attach`** and
87+
a REST client — task list, state/turn/history (read first); then **`t``tmux attach`** and
8888
back; then **input** (capture idea, promote, drive transitions) over REST (PARITY §5).
8989

9090
**Acceptance:** the dashboard reflects live task state; `t` switches into a task's tmux and
@@ -99,13 +99,13 @@ rejoins on detach; a task can be created and advanced from the UI.
9999
**Goal:** the cloude-cade lifecycle as a workflow class — minus remote forge.
100100

101101
**Delivers:** the parity workflow (`PLANNING→ITERATING→REVIEW→MERGING→COMPLETE`/`DROPPED`),
102-
its DoD definitions + verdict semantics, fg/bg classification, transition policy; core
102+
its per-state responsibilities, fg/bg classification, transition policy; core
103103
operations (`advance`, `iterate`, `drop`); **local git** (branch/worktree) as core ops;
104-
the **plan artifact** (ADR 0003) + plan-accepted hook; ball-flip hooks.
104+
the **plan artifact** (ADR 0003) + plan-accepted hook; turn-flip hooks.
105105

106106
**Acceptance:** a task runs the full parity lifecycle end-to-end (without forge skills),
107-
gated by DoD, with the ball flipping correctly; the golden harness covers every legal/illegal
108-
transition.
107+
gated by responsibilities, with the turn flipping correctly; the golden harness covers every
108+
legal/illegal transition.
109109

110110
**Depends on:** Slices 1–3. **Resolves (JIT):** artifact concurrency (start simple:
111111
re-read-from-disk).

0 commit comments

Comments
 (0)