Skip to content

feat: campaign autonomy via /goal-driven loop (replace parts of engine.py) #124

@sriumcp

Description

@sriumcp

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

  • nous run --goal-driven works on a stub campaign without invoking engine.py's state machine.
  • Hybrid mode is the default for nous run after one release of soak time.
  • Documentation in docs/protocol.md updated to reflect both modes.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions