type: meta

slug: autonomous-run-completion

base_branch: main

gate0_mode: strict

preset: cursor-codex

land_mode: merge-to-main

exec_mode: ship


type: goal

text: Make failed run plans recover autonomously and land every task.


type: methodology

text: TDD; canonical SQLite lifecycle; evidence-gated completion; foreground blocking runtime acceptance.


type: intent

text: Harness must finish useful work without manual babysitting, not merely terminate processes.


type: direction

verbatim: run only in aforeground process in blocking turn, never probe


verbatim: success for you is the runs finished autonomously without crashing


verbatim: the runplan needs to land with final results actually done, not just complete a run


type: task

seat: coder

tier: medium

desc: Read docs/plans/2026-07-19-autonomous-run-completion.md Task 1 (Canonical Attempt Lifecycle) for full contract. Acceptance: node --test src/test/engine-scheduler.test.js src/daemon.test.js. Commit only: src/engine/scheduler.js, src/daemon.js, src/test/engine-scheduler.test.js, src/daemon.test.js.


desc: Read docs/plans/2026-07-19-autonomous-run-completion.md Task 2 (Cursor Terminal Transport Completion) for full contract. Acceptance: node --test src/test/runner-transcript.test.js src/test/engine-ship.test.js. Commit only: src/runner.js, src/test/runner-transcript.test.js, src/test/engine-ship.test.js.


desc: Read docs/plans/2026-07-19-autonomous-run-completion.md Task 3 (Resolver Recovery Execution) for full contract. Acceptance: node --test src/engine/repair.test.js src/test/engine-repair.test.js src/resolver.test.js. Commit only: src/runner.js, src/engine/repair.js, src/engine/repair.test.js, src/test/engine-repair.test.js.


desc: Read docs/plans/2026-07-19-autonomous-run-completion.md Task 4 (Accurate Status and Lifecycle Audit) for full contract. Acceptance: node --test src/daemon.test.js. Commit only: src/daemon.js, src/daemon.test.js.


tier: high

desc: Read docs/plans/2026-07-19-autonomous-run-completion.md Task 5 (Runtime Acceptance) for full contract. Acceptance: make test plus foreground execution of delivery-controller-receipts and throughput-seams. Commit only files required by Tasks 1-4 failures.


note: Run 827c0509be85--autonomous-run-completion ended 2026-07-22T08:31:55+07:00: t1 landed, t2 quarantined (gate-not-green-after-fixer), t3–t5 skipped-quarantined. Journal: runstate/autonomous-run-completion.db; log: runstate/autonomous-run-completion.log.jsonl. No runplan process active.


note: Root gate0 blocker was RUNPLAN_ALLOW_ONLINE leaking into make test; fixed in lib/gates.sh (unset in capture_check_record) and run-tests.sh (unset + --test-concurrency=1). Additional uncommitted main fixes: repair.js infra quarantine skip, watchdog onOvertime, scheduler run.done outcome+ship landing, engine-gates use strict, control-attach maxAttempts, daemon.test L2 budget, fix-forward adapterHealth mock, runner idleTimer unref removal.


note: t2 worktree tmp/wt-autonomous-run-completion--t2 branch plan/autonomous-run-completion--t2: runner.js committed (e4aac282); infra fixes copied uncommitted. Gate0 not verified green at handoff — re-run bash lib/gates.sh gate0 strict tmp/wt-autonomous-run-completion--t2 . autonomous-run-completion before resume.


note: Resume: export PATH=.../node/v22.23.1/bin BUILD_NO_CAP=1 HARNESS_ENGINE_DEV=1 RUNPLAN_ALLOW_ONLINE=1; bin/runplan autonomous-run-completion --preset cursor --foreground --engine-migrate (blocking turn, never poll, never pipe head). Use cursor preset only, not cursor-codex. Land via bash .claude/scripts/ship.sh land, never push main directly.