docs: describe the agent-driven workflow, drop the scripted driver model

Rewrite the workflow documentation to describe how the system actually works:
the agent (the session) is the brain and advances the queue by hand through the
`pipelines` CLI. There is no orchestration script, no driver, no polling loop and
no lane machinery, and none may be written.

- references/work.md: rewritten end to end. The queue-driver script
  (drivers/workd.sh), the claim-file ledger with atomic renames, the PAUSED
  marker and the poll loop are gone. State is now the server (authoritative for
  run state), the queue file (authoritative for intent) and the conversation.
  The agent reads the queue, picks the item, creates its worktree/branch and
  launches it with `pipelines run <pipeline> <brief> --json --yes`; progress is
  event-driven via a background `pipelines wait <run-id> [...]` (never polled);
  on completion the agent reconciles with `pipelines inspect <run-id> --json`,
  verifies it landed and starts the next item.
- references/queue.md: the landing gate runs the command directly
  (`git merge-base --is-ancestor <branch> main`, exit 0 = landed) instead of a
  `land-check.sh` helper; the never-delete-branch / never-remove-worktree rules
  are kept, and the waiting section states the agent advances the queue by hand.
- references/orchestration.md: intro and "Running and watching" state the
  agent-driven, event-driven model; "Pipeline choice" names the current set
  (Android, TUI, Server, Generic, Plan and land, UI sweep, Probe) by area and
  records the retired names.
- references/debugging.md: "Duplicated work after a driver restart" became
  "…after a session restart", resuming from the queue file not a cursor file.
- SKILL.md: the routing row no longer says "queue driver".
- AGENTS.md: the maintenance workflow names the current pipeline set instead of
  the retired `Pipelines maintenance - plan implement review`.
- internal/tui/AGENTS.md: the restart line no longer names lanes.
- docs/notes/agent-driven-work-model.md: the docs-fold note recording that
  docs/cli.md needs its "Scripted runs"/`--wait` framing aligned to the
  event-driven model, and that the dated evidence docs stay as they are.

Checked before committing: no packaged template directory exists in this repo, so
none needed updating; internal/author/install.go's managed file inventory needs no
change (no packaged reference was added or removed — the 13 listed files all
match internal/author/skill/references/); no stale `queue driver`/`workd.sh`/
`claim-file` references remain anywhere under internal/author. Genuine device
tooling (android/scripts/capture_png.sh-style) and server-side polling prose were
left alone.

Checks: `go test ./internal/author -count=1` ok; `go build ./...` clean;
`go vet ./...` clean; `gofmt -l .` clean.
This commit is contained in:
2026-10-18 01:50:55 +01:00
parent d0c12e3b75
commit 01d5dad9b9
8 changed files with 207 additions and 232 deletions
+11 -8
View File
@@ -130,13 +130,16 @@ Each playbook is *symptom → how to confirm → what to do*.
approval. Put the capture helper in the repository so every UI run reuses one path.
See the example in `references/delivery.md`.
## Duplicated work after a driver restart
## Duplicated work after a session restart
- **Symptom** Items already completed run again after a queue driver
restarts: the same brief is re-invoked, side effects repeat, or a commit is made
- **Symptom** Items already completed run again after the session that was advancing the
queue restarts: the same brief is re-invoked, side effects repeat, or a commit is made
twice.
- **Confirm** Compare the queue's items against their recorded state. A list alone
has no resume point.
- **Do** Record each item's state in the queue itself (`references/queue.md`) and resume from it. Record an item
only once it has landed, and skip recorded items on startup. Never relaunch a
duplicate of a run that is still active — reattach with its request key instead.
- **Confirm** Compare the queue's items against their recorded state and the server's run
history (`inspect RUN_ID --json`). A list alone has no resume point.
- **Do** Record each item's state in the queue itself (`references/queue.md`) and resume
from it: read the queue top to bottom, skip items already marked done, and settle the
ones marked running by inspecting their run id. Record an item only once it has landed.
Never relaunch a duplicate of a run that is still active — reattach with its request key
instead. Do not build a driver or cursor file to remember position; the queue file is
the resume point.