feat: Generator-Evaluator dual-agent harness mode#165
Conversation
feat: add Generator-Evaluator dual-agent harness mode Add Harness Mode as an optional dual-agent architecture alongside the existing simple mode. In harness mode, a Generator agent (builds, never judges) and an Evaluator agent (judges, never builds) collaborate through contract negotiation, implementation, and 4-dimension quality scoring. New files: - generator-prompt.md: Generator agent instructions - evaluator-prompt.md: Evaluator/QA agent instructions - contract.json.example: Sprint contract format reference - AGENTS.md: Architecture documentation for both modes Modified: - ralph.sh: Add --mode harness with contract negotiation, phase discipline, 4-dimension scoring, MCP lifecycle management. All changes are purely additive -- run_simple_mode() is preserved unchanged. Backward compatible: default mode is "simple". Refs: snarktank#164 @
|
The additive approach here is smart, and the contract step makes the mode much easier to reason about. The question I'd keep pushing on is not just whether the evaluator scores well, but whether the artifacts make retry behavior legible later. In these loops the expensive failures are usually:
If The architecture is promising; the artifact quality will probably decide how trustworthy it feels in practice. |
|
@Keesan12 Thank you for your comments. Actually, I’ve been continuing to polish the ralph‑harness project over this period. I’ve also found that it’s quite difficult to give the evaluator appropriate prompts, and scoring the implementation results of the contract or generator is also very challenging. Although I’m not a very senior programmer, I’ve tried to strengthen the evaluator prompts by having Claude Code load some skills related to QA and code review. |
|
That matches my experience too. The evaluator gets unstable fast when it has to both invent the rubric and apply it in the same pass. The most reliable pattern I've seen is to shrink its job into boundary checks:
Once the evaluator is writing failure classes and retry directives instead of mostly open-ended prose scores, the loop becomes much easier to debug. If you keep the 4-dimension scores, I would make them secondary to a fail-closed pass gate plus a compact reason code. That tends to age better once the loop starts hitting messy real-world tasks. |
Closes #164
Summary
This PR adds Harness Mode — a Generator-Evaluator dual-agent architecture that runs alongside the existing simple mode. In harness mode, two specialized AI agents collaborate through contract negotiation, implementation, and 4-dimension quality scoring.
Architecture
Per-Story Flow
Changes
New files (4)
generator-prompt.mdevaluator-prompt.mdcontract.json.exampleAGENTS.mdModified (1)
ralph.sh--mode harnesswith contract negotiation, phase discipline, 4-dimension scoring, MCP lifecycle management, and crash recovery. All changes are purely additive —run_simple_mode()is preserved unchanged, default mode issimple.Unchanged
CLAUDE.md,prompt.md,prd.json.example,skills/,flowchart/,.github/,LICENSEBackward Compatibility
Verification
bash -n ralph.shpasses syntax checkrun_simple_mode()is unchangedSee RFC #164 for full design discussion.