Experiment 003: Single-Shot vs. Mandatory Verification Step
1. Introduction
The most common point of failure for autonomous agents is ‘Surgical Success with Integrated Failure’—where a local change is syntactically correct but breaks the broader system due to pathing, dependency, or runtime errors. Traditional ‘Single-Shot’ generation strategies rely on the agent’s internal world model to predict these outcomes, which frequently results in hallucinations. This experiment introduces Mandatory Verification as a corrective feedback loop. By requiring agents to run actual code in a local shell before concluding their mission, we aim to close the reliability gap.
2. Methodology
The experiment evaluated 100 trials comparing two distinct workflows for a feature implementation task.
2.1 Experimental Frameworks
- Single-Shot Workflow: The agent was permitted to issue a
complete_taskcall immediately after performing a file edit. Its success was judged post-hoc by a human or a CI system. - Mandatory Verification Workflow: The agent was strictly instructed that it could ONLY call
complete_taskafter successfully running a project-relevant verification script (e.g.,npm run test,go test ./..., or a customgrepcheck) that produced a non-zero exit code.
2.2 Task and Environment
Each trial involved a cross-file refactor in a multi-file Node.js project. For instance, renaming a shared utility function across multiple consumers.
- Hardware: Standard CPU-based local environment with CLI tool access.
- Model: Gemini 2.0 Flash (Cloud Synthesis) with tool calling enabled.
2.3 Success and Metrics
- Pass^k Consistency: The percentage of trials where the final codebase was functionally correct and passed all CI checks.
- Convergence: The number of agent turns (messages) required to reach completion.
- Cost: Total token cost of the entire multi-turn interaction.
3. Results
Experiment Metrics — build-time computed
illustrative costThe empirical data establishes Mandatory Verification as the single most critical factor in achieving high-reliability (Pass^k) performance.
- Pass^k Consistency: Improved from 65% in the Single-Shot baseline to 98%.
- Convergence Steps: Increased from 1.0 (by definition) to 3.0.
- Modeled cost:
$0.0001 per success ($0.01 across 100 trials) at Gemini 2.0 Flash rates.
The marginal token cost of the extra verification turns is negligible compared to the 33-point absolute gain in reliability. In the Single-Shot trials, failures were typically caused by small syntax errors (e.g., missing imports) or incorrect relative paths. In the Mandatory Verification trials, the agent encountered these same errors but used the shell output to self-correct in its second or third turn, reaching a 98% success rate.
4. Discussion & Limitations
4.1 The Self-Healing Loop
Mandatory Verification transforms the agent from a ‘Writer’ into a ‘Tester-Refiner’. By grounding the agent in the reality of the local shell, we bypass the limitations of its internal ‘world-model’ for predicting execution results. This study demonstrates that ‘Grounding via Execution’ is superior to ‘Grounding via Description’ for software tasks.
4.2 Limitations
- Verification Script Quality: The reliability of this method is entirely dependent on the quality of the verification scripts. If a script produces a ‘False Success’, the agent will conclude its mission with a broken implementation.
- Environment Drift: If the local verification environment differs significantly from the production/CI environment, agents may achieve ‘Local Success’ that fails in CI.
- Infinite Loops: If an agent cannot diagnose a persistent shell failure, it may exhaust its turn limit without converging, increasing cost without achieving success.
4.3 Integration with Hybrid Context Synthesis
The Mandatory Verification step is the final ‘Validation’ phase in the Hybrid Context Synthesis protocol (Exp 001). It ensures that the high-level synthesis is correctly applied to the local filesystem, closing the loop between cloud reasoning and local execution.
5. Reproducibility
All 100 trials were logged using the superpowers-verify v0.5.2 tool. Per-experiment metrics are recorded in this page’s co-located data.json; modeled costs derive from the recorded token total at the rates in site/data/pricing.json. Verified by Garrett Manley on 2026-03-29.