Merge main (findings ledger, loop continuation) into usage-limit branch

Keeps the findings ledger, extra visits and on_exhausted=decide alongside the
run budget, failure classes, quota parking and error-loop backoff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 14:35:54 +00:00
66 changed files with 3565 additions and 148 deletions
+17 -1
View File
@@ -33,6 +33,18 @@ Semantics (`internal/server/runner.go`):
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.
- `on` lists only loop outcomes: validation rejects an outcome whose edge goes
forward (e.g. `success -> write`), since `on` would turn a good result on the
last visit into a failure. Lint also warns when a target's lower cap stops
the loop first and when `limits` sit on a stage no loop re-enters.
- `"on_exhausted":"decide"` (optional `"accept_to":"<stage>|#success|#failure"`,
default `#success`): instead of failing, an exhausted loop (the `on` case or
entering beyond the cap) parks the run on an operator decision and notifies:
`accept` (take the work as is, route to `accept_to`), `continue` (one more
round: one more visit for the stage and the loop target) or `abort`. Answer
with `pipelines decide RUN_ID --option accept|continue|abort` or the apps.
- A failed exhausted run continues with `pipelines retry ID --extra-visits N
[--stage KEY]`.
- `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.
@@ -58,6 +70,10 @@ Claude accounts or parks in `waiting_quota` (`references/debugging.md`).
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
retries start fresh except for the completed prefix, the findings ledger and the
failed visit's partial work (`previous-attempt/`) a resume carries. Reviewers
should reference ledger IDs (`references/format.md`, Findings ledger) rather
than restate earlier findings, and a findings gate (`type=findings`) can
replace a model triage stage. Accumulated
turn content is untrusted data; a fresh session does not prove semantic
independence.