feat(autoland): fix-forward loop — fix runs on rejection, spawn-count bound, terminal escalation #187
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab!187
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "afk/182"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #182
The second half of the autoland loop: rejection re-engages an agent, bounded, with escalation as the terminal hand-off.
What shipped
DecideAutolandin decide.go) and spawns a fix run on rejected-state: a landerrejectmarker or a human's changes-requested review feed the same loop. State-derived only (ADR-0015); theStageFixrank reserved by #185 is now emitted.fix, detached adopt of the survivingafk/<N>claim, fresh run credentials, provider/model/effort inherited from the authoring run's persisted row (repo-chain fallback on a vanished provider), budget clock + three-strikes accounting apply, seed prompt carries issue + PR + the live rejection verbatim.pr create; done-signal islabctl pr rerequest's fix-done marker. Re-requested + no live run → the poller spawns the re-validation lander (approve-only while a human rejection is outstanding — the loop never merges over one).max_fix_attemptscounts fix-run SPAWNS per branch (runs store), so a fix run that dies on the launch pad burns an attempt instead of respawning unbounded.escalate, lander chain) writes the round-history digest to the issue, flipsready-for-agent→ready-for-human, and posts the newlabctl pr escalatemarker (agent-executed; the engine never writes to the forge). The reaper maps that delivery to outcomeescalated(migration 0014 widens both runs CHECKs) and fires the escalation push.lab_instances_activekinds, run-outcome labels), SPA History (kind labels,escalatedoutcome chip), CONTEXT.md Escalation entry, ADR-0048 status.Acceptance criteria
All six verified — unit/producer/reaper coverage plus two new end-to-end cycle tests (
TestAutolandCycleFixForwardIntegration, real tmux + real labctl + real agentapi against the scripted forge): the converging loop (reject → fix → rerequest → re-validate → merge, with the fix commit being what merges) and the bound (reject ×2 → escalate: digest on the issue, label flip, marker,escalatedrow, exactly one push, poller silence afterward — including after the marker comment is deleted).Verification
go build ./...,go vet ./..., gofmt clean;go test ./...green exceptinternal/tmuxx's integration tests, which fail identically on pristine main in this sandbox (pane default-shell exits immediately — environment-only; CI's native job covers them). SPA: lint, format:check, vitest (869 tests), tsc + build all green.