{"type":"meta","slug":"autonomous-gate-self-repair-recovery","base_branch":"origin/main","gate0_mode":"strict","preset":"codex"}
{"type":"goal","text":"Make runplan autonomously repair gate and runtime failures, relaunch loaded-engine changes, and finish a plan in one blocking run without babysitting."}
{"type":"methodology","text":"TDD; evidence-gated runtime probes; blocking foreground execution; failure-domain attribution; bounded self-repair; serialized landing; verify the installed launcher artifact."}
{"type":"intent","text":"The harness must deliver completed user work rather than crash, hang, idle, quarantine downstream tasks, or require repeated manual intervention."}
{"type":"direction","verbatim":"i want the harness to be autonomouse, self repairing, self orchestrating, self relaunching, basically, i want to run a plan AND GET IT DONE in ONE RUN."}
{"type":"direction","verbatim":"SOLVE IT once and for all."}
{"type":"direction","verbatim":"you must not run with cursor preset, must run with codex preset"}
{"type":"direction","verbatim":"you must run it with a blocking turn and consume it's output until completion or failure"}
{"type":"direction","verbatim":"success for you is the runs finished autonomously without crashing"}
{"type":"anchor","path":"/home/user/Projects/mega-plan-harness/AGENTS.md","what":"repository agent instructions"}
{"type":"anchor","path":"/home/user/Projects/mega-plan-harness/docs/plans/2026-07-22-autonomous-gate-self-repair.md","what":"autonomous gate self-repair plan"}
{"type":"anchor","path":"/home/user/Projects/mega-plan-harness/docs/plans/2026-07-22-autonomous-gate-self-repair.jsonl","what":"prior run session file"}
{"type":"anchor","path":"/home/user/Projects/mega-plan-harness/src/runner.js","what":"foreground scheduler and self-relaunch runtime"}
{"type":"anchor","path":"/home/user/Projects/mega-plan-harness/src/daemon.js","what":"daemon/watchdog runtime"}
{"type":"anchor","path":"/home/user/Projects/mega-plan-harness/src/engine/gates.js","what":"gate attribution and clean-base reproduction"}
{"type":"anchor","path":"/home/user/Projects/mega-plan-harness/src/engine/repair.js","what":"bounded repair and quarantine policy"}
{"type":"anchor","path":"/home/user/Projects/mega-plan-harness/wrappers/codex.sh","what":"Codex transport/protocol wrapper"}
{"type":"task","id":"t1","wave":1,"seat":"coder","tier":"high","desc":"Audit current dirty runtime against docs/plans/2026-07-22-autonomous-gate-self-repair.md and reproduce the failure chain. Acceptance: clean, bounded diagnostic probe with captured failure class and launcher/runtime provenance. Commit only files required by the reproduced defect.","requires_decision":null}
{"type":"task","id":"t2","wave":2,"seat":"coder","tier":"high","desc":"Fix reproduced gate, transport, daemon, repair, or self-relaunch defect with regression tests. Acceptance: targeted tests plus required lint/typecheck/build gates pass cleanly. Commit only declared implementation and test files.","requires_decision":null}
{"type":"task","id":"t3","wave":3,"seat":"coder","tier":"high","desc":"Run one blocking Codex-preset plan through the actual launcher, consume output to terminal completion, then verify installed artifact and runtime result. Acceptance: end-to-end run report proves no crash/hang/quarantine for recoverable failures and launcher resolves rebuilt artifact.","requires_decision":null}
{"type":"session_memory","note":"Prior autonomous-gate-self-repair v1 report ended t1 committed, t2 quarantined unknown, and downstream tasks skipped; v2 report showed t2-t4 committed but t5 agent-idle; v3 reached quarantine with gate-red-code. Treat reports as evidence, not completion."}
{"type":"session_memory","note":"Primary checkout currently contains user-owned dirty changes across gates, runner, ship, resolver, taxonomy, tests, and many untracked reports/plans. Preserve unrelated work; do not reset or clean broadly."}
{"type":"session_memory","note":"Engine CURRENT was 0.1.42 during transcript investigation. A loaded-engine change requires foreground self-reexec; a source-only test is insufficient under the completion contract."}
