TL;DR
Replace some of the explicit Python phase machine with a /goal-driven Claude Code session. The Haiku evaluator post-turn already does what most of engine.py does manually.
Why this matters
orchestrator/engine.py and parts of orchestrator/campaign.py re-implement the loop "keep the agent working until a verifiable end-state is reached." Claude Code already provides this as /goal — a session-scoped Stop hook with a Haiku evaluator that runs after every turn. Cost is negligible (Haiku, post-turn).
What's already shipped
The phase machine is solid; the question is whether all of it needs to be Python. For day-to-day "keep iterating until N findings are valid" the answer is no.
Proposed approach
Two modes, opt-in:
Mode A — fully /goal-driven (lightweight)
nous run --goal-driven campaign.yaml
Translates to a single claude session with /goal "iteration N has findings.json with experiment_valid=true and principle_updates.json present, OR stop after 24 hours". Drop the explicit phase machine for this mode.
Mode B — /goal-bounded inner loop (hybrid)
Keep the phase machine for control flow, but use /goal within EXECUTE_ANALYZE to replace the inner retry/validation loop. Stop when validation passes.
Acceptance criteria
Notes
/goal requires Claude Code v2.1.139+. Pin or detect.
- Evaluator can only judge what's been surfaced in the conversation. Make sure the executor prints findings.json paths and validation output so the evaluator can see them.
Part of #120.
TL;DR
Replace some of the explicit Python phase machine with a
/goal-driven Claude Code session. The Haiku evaluator post-turn already does what most ofengine.pydoes manually.Why this matters
orchestrator/engine.pyand parts oforchestrator/campaign.pyre-implement the loop "keep the agent working until a verifiable end-state is reached." Claude Code already provides this as/goal— a session-scoped Stop hook with a Haiku evaluator that runs after every turn. Cost is negligible (Haiku, post-turn).What's already shipped
The phase machine is solid; the question is whether all of it needs to be Python. For day-to-day "keep iterating until N findings are valid" the answer is no.
Proposed approach
Two modes, opt-in:
Mode A — fully
/goal-driven (lightweight)Translates to a single
claudesession with/goal "iteration N has findings.json with experiment_valid=true and principle_updates.json present, OR stop after 24 hours". Drop the explicit phase machine for this mode.Mode B —
/goal-bounded inner loop (hybrid)Keep the phase machine for control flow, but use
/goalwithin EXECUTE_ANALYZE to replace the inner retry/validation loop. Stop when validation passes.Acceptance criteria
nous run --goal-drivenworks on a stub campaign without invokingengine.py's state machine.nous runafter one release of soak time.docs/protocol.mdupdated to reflect both modes.Notes
/goalrequires Claude Code v2.1.139+. Pin or detect.Part of #120.