Autonomous missions: charter → plan → phase gates → code-gated done#102
Merged
Conversation
Make the plan->execute->evaluate->refine->iterate loop actually fire by moving guarantees from prompt text into the harness, and add a single-prompt autonomous mission that drives the whole lifecycle to a code-gated done. Autonomy - clk run (and the TUI first message / REST single-prompt) now drive a full MissionRunner to a gated done by default; clk mission/auto is the explicit form; clk run --once keeps the legacy single-workflow pass. - Charter first (charter.py): the chief commits a charter; the living plan (mission.py, .clk/state/mission.json) and done-gate derive from it. - Phase sequencing with chief phase-gates (pass/repeat/revise/done). Reliability reinforcements (harness-enforced) - done_gate.py: ACTION:done is a request; the loop stops only when a machine-checkable gate passes (tests/qa/ralph/deliverables/charter), with an adaptive tests-green relaxation for test-less projects. Stop artifact is done_granted.md. - noop_guard.py + response_quality noop flag: a producing stage that changed no files is re-dispatched with an escalating preamble. - evaluator: no vacuous pass on empty checks; derive_validation() infers a real command (pytest/npm/compileall smoke). - robustness.auto_refine defaults to "all"; refine_max_rounds 10. - deliberation.py: self-reflect preamble + blocking peer Q&A; a phase gate cannot pass with unresolved blocking questions. - git_ops.commit_trace + telemetry.py: structured boundary commits and a per-cycle loop_cycle_summary line/event. Tests / docs / CI / pi-extension - New offline unit tests (done_gate, noop_guard, mission living-plan) and a shell-provider mission e2e; existing single-workflow e2e moved to --once. - CI runs the offline mission e2e; README documents the new behavior and corrects the stated defaults. - pi-extension quality scorer gains the matching noop flag + tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AHao68VweSg6a9Q1sJUR65
…nobs Debate panel (multi-critic refinement) - robustness.debate (off|careful_only|all, default careful_only) + debate_lenses + debate_max_rounds. WorkflowRunner._debate_loop fans out one adversarial critic per lens in parallel, each tries to break the work and engages with peers' critiques across rounds (posted to the blackboard as post_type=debate); the worker is kept only on majority-accept + mean score >= threshold, else the combined critiques drive a revision. Takes precedence over the single-critic refine loop. Emits debate_round events. Env-var plumbing (config -> .env.example -> kickoff.sh -> README) - .env.example documents every new knob: robustness.debate*, and the mission / done_gate / noop_guard / deliberation blocks + validation.auto_derive. - kickoff.sh maps them via _set() (+ a new _csv cast for list knobs: debate_lenses, mission.default_phases, noop_guard.producing_agents). - README: new "Adversarial debate panel" robustness layer, debate rows in the cost-guardrails table, corrected auto_refine/refine_max_rounds defaults, and an env-var note in the Autonomous missions section. Tests - tests/test_debate.py (gating + lens selection) and a deterministic debate-loop integration test (panel fans out, revises, accepts). - test_docs_consistency extended to enforce env.example + kickoff parity for the new config blocks. Full unit suite green (421 passed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AHao68VweSg6a9Q1sJUR65
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a complete autonomous mission orchestrator that drives a single objective from charter through discovery, product, engineering, validation, and deployment phases to a machine-checkable done gate—with no human follow-up required.
The mission runner wraps existing per-workflow engines (WorkflowRunner, RalphLoop, AutoresearchLoop) in a macro plan→execute→evaluate→refine→iterate loop. Every boundary is trace-committed to git so the execution trail is auditable, and per-cycle telemetry makes the loop observable.
Key Changes
New modules:
mission.py— MissionRunner orchestrator, MissionPlan/PhaseSpec living artifacts, charter-first orderingcharter.py— Chief's up-front commitment (mission statement, scope, success criteria, constraints); persisted as.clk/state/charter.json+CHARTER.mddone_gate.py— Machine-checkable completion gate (tests green, deliverables exist, QA pass, ralph pass, no TODOs, charter criteria); adaptive for test-less projectsdeliberation.py— Self-reflection preamble + blocking Q&A for producing dispatchestelemetry.py— Per-cycle accumulator (thread-safe) for loop observability; renders compact line + activity eventnoop_guard.py— Detects when producing agents emit prose without file mutations; escalating re-dispatch with repair preambleModified modules:
workflow.py— Integrated done-gate evaluation, telemetry threading, mission-mode flag, supervise-cycles override; added deliberation preamble injectionevaluator.py— Auto-derives real test commands (pytest/npm/compileall) instead of vacuous pass; marks weak gates for adaptive done-gateagent.py— Tracks file mutations applied per run; added mission-level chief dispatch types (charter, mission_plan, phase_gate)casting.py— Added CharterProposal and PlanProposal parsingcli.py— Newmissioncommand (aliasauto);runnow drives full mission by default with--oncefor single cycleconfig.py— New config blocks:mission.*,done_gate.*,deliberation.*,validation.auto_derivegit_ops.py— Newcommit_trace()for structured execution-trace commits at mission boundariestui.py— Mission dispatch in TUI job handlerTests:
test_done_gate.py— Unit tests for gate verdicts (tests red, missing deliverables, QA fail, etc.)test_mission_living_plan.py— Plan/charter roundtrip, phase ordering, validation derivationtest_noop_guard.py— Mutation detection and response-quality flagtest_debate.py— Adversarial debate-panel refinementtest_mission_e2e.py— End-to-end mission with shell provider (verifies gates fire, artifacts written, telemetry emitted)Documentation:
.env.exampleandkickoff.shupdated with mission/done-gate/debate configNotable Implementation Details
Charter-first ordering: Mission always asks chief to write charter before proposing plan; plan is derived from charter so "done" is measured against committed criteria, not drifting.
Living plan artifact:
.clk/state/mission.json+MISSION.mdpersisted after each phase, showing status, iterations used, gate history; enables mid-mission inspection and recovery.Adaptive done-gate: When evaluator marks gate as "weak" (no real test command available for docs/research projects), tests-green requirement is relaxed so mission can still finish.
No-op guard: Producing stages that apply zero file mutations are re-dispatched with escalating repair preamble; prevents agents from "describing work instead of doing it."
Deliberation: Self
https://claude.ai/code/session_01AHao68VweSg6a9Q1sJUR65