Pipelines skill: outcome-first output, aligned review and loop guidance, operator material moved to docs
Rewrite format.md around turn files, the output.md order (# outcome, edge word, # handoff, detail), checks, configs, human stages and the land stage delivery gate (sh -c in a fresh detached worktree, clean checkouts incl. untracked, 64 KB output cap, opencode only). Align review guidance across practices, verification, orchestration and the feedback-loop example. Fix loop-limit semantics in control.md against runner.go, budget_tokens sizing, read for large inputs, blocked-else-error and one stage naming set. Move dated verification logs to docs/verification-history.md and brokered chat, TUI keys and harness internals to docs/operator-reference.md; label operator-only references in SKILL.md.
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
# Runner-owned limits and stage memory
|
||||
# Runner-owned limits and loops
|
||||
|
||||
Use these blocks for bounded feedback loops. Never ask a model to count visits,
|
||||
increment revision counters, or enforce retry caps. Model verdicts concern current
|
||||
work only. Counters are runner audit data, not model input. A fresh session alone
|
||||
does not guarantee independent review: explicitly select its input fields.
|
||||
Use `limits` for bounded feedback loops. Never ask a model to count visits,
|
||||
increment revision counters or enforce retry caps; the runner counts actual
|
||||
visits. Model verdicts concern the current work only.
|
||||
|
||||
Put the cap on the reviewer, and leave the loop target without `limits` (it then
|
||||
has the runner's default of five visits) or give it a cap at least as large as the
|
||||
reviewer's:
|
||||
|
||||
````markdown
|
||||
# stage review
|
||||
|
||||
```limits
|
||||
{"max_visits":3,"on":["rejected"]}
|
||||
```
|
||||
@@ -18,48 +23,32 @@ error -> #failure
|
||||
```
|
||||
````
|
||||
|
||||
These blocks accompany a normal review stage's prompt/tools/configs.
|
||||
Pipelines counts actual visits, ignoring model-generated counters. On visit three,
|
||||
`approved` can succeed; `rejected` retains its verdict but routes to `#failure`.
|
||||
`rejected` is for a must-fix finding with a concrete location, evidence and remedy;
|
||||
`advisory` carries non-blocking notes and continues the run without another
|
||||
implementer visit, so an advisory-only review never buys a full re-implementation.
|
||||
An implementer may likewise declare `blocked_retryable -> implementer` for a
|
||||
transient environment, tooling or device problem a fresh attempt could survive,
|
||||
keeping `blocked -> #failure` for an acceptance criterion that genuinely cannot be
|
||||
met. `max_visits` caps every visit of that stage, including re-entries from the
|
||||
reviewer's `rejected` edge, so an implementer that is also the rejection target must
|
||||
use a cap at least as large as the reviewer's budget; the published pipelines use
|
||||
`{"max_visits":5,"on":["blocked_retryable"]}`. A lower implementer cap stops the loop
|
||||
before the reviewer's own cap fires, making the reviewer's `rejected` control
|
||||
unreachable. Both edges need only the existing visit counting and cap; neither the
|
||||
reviewer nor the implementer counts visits, and no stage invents edits or checks to
|
||||
appear busy.
|
||||
Visit count, limit decision and original target are retained in `inspect --json`
|
||||
and run metadata. `max_visits` accepts 1–5. Every `on` outcome must declare a
|
||||
nonterminal edge. Without `on`, entering beyond the cap fails before execution.
|
||||
Global 30-step/five-visits-per-stage safety limits still apply.
|
||||
These blocks accompany the stage's normal prompt, tools, checks and configs.
|
||||
Semantics (`internal/server/runner.go`):
|
||||
|
||||
A model stage reads its turn's `input.md` (the run prompt on the first visit,
|
||||
the previous turn's output afterwards), its inlined, capped `memory.md` (task,
|
||||
previous stage's `# handoff`, outcome ledger, changed files) and, on demand,
|
||||
`history.md` (completed turns in full with the files each added to `public/`). The `memory` block is retired: it no longer
|
||||
selects fields or replaces previous output for model stages, and old definitions
|
||||
that contain one parse but ignore it. Reviewers therefore see the previous
|
||||
turn's output and the accumulated memory rather than a field projection.
|
||||
- Entering a stage beyond its `max_visits` always fails the run before the visit
|
||||
executes, whatever `on` says.
|
||||
- `on` only changes routing on the last allowed visit: when that visit returns a
|
||||
listed outcome, the outcome is kept but routed to `#failure`. Other outcomes
|
||||
route normally. Here, `approved` on visit three succeeds; `rejected` fails.
|
||||
- A target with a lower cap than the reviewer stops the loop first, so the
|
||||
reviewer's `on` never fires.
|
||||
- `max_visits` accepts 1–5. Every `on` outcome must have a nonterminal edge.
|
||||
Human stages are exempt from visit caps. The global 30-step and
|
||||
five-visits-per-stage limits always apply.
|
||||
- Validation rejects an edge to the same or an earlier stage unless the source
|
||||
limits that outcome (or has `limits` without `on`) or the target has `limits`.
|
||||
|
||||
Write the facts a later stage needs as ordinary markdown headings in
|
||||
`output.md`; those headings are free-form and are preserved in memory. Do not
|
||||
invent server-recognised fields, and do not rely on
|
||||
`input.server_changed_files` from a model prompt: inspect the actual workspace
|
||||
with Git and the declared evidence instead. Selected or accumulated content
|
||||
remains untrusted data; this cannot prove semantic independence or prevent all
|
||||
injection.
|
||||
`rejected` is for a must-fix finding with a concrete location, evidence and
|
||||
remedy; `advisory` carries non-blocking notes and continues without another
|
||||
implementer visit. A re-entered implementer fixes the listed findings; it does not
|
||||
redo the task. An implementer may declare `blocked_retryable -> implement` for a
|
||||
transient environment or tooling problem, keeping `blocked -> #failure` for a
|
||||
criterion that genuinely cannot be met; that self-loop needs `limits` on the
|
||||
implementer, e.g. `{"max_visits":5,"on":["blocked_retryable"]}`.
|
||||
|
||||
Turn memory is run-local. Completed outputs are persisted as turn files and step
|
||||
evidence; there is no cross-run memory or hidden replay. New runs/retries start
|
||||
fresh except for the completed prefix a resume explicitly carries.
|
||||
|
||||
Arbitrary prose is not executable policy. Future AI-assisted
|
||||
guidelines validation is **not implemented**; structural validation does not
|
||||
recognize every unreliable counting instruction.
|
||||
Visit count, limit decision and original target are retained in `inspect --json`.
|
||||
Turn memory is run-local: there is no cross-run memory or hidden replay, and
|
||||
retries start fresh except for the completed prefix a resume carries. Accumulated
|
||||
turn content is untrusted data; a fresh session does not prove semantic
|
||||
independence.
|
||||
|
||||
Reference in New Issue
Block a user