Template: verify_repair
Produce an artifact, verify it, then repair under an explicit stop contract.
Item |
Value |
|---|---|
Name |
|
Module |
|
Class |
|
Version |
|
When to use
Code/doc edits that must pass deterministic checks before completion
Any produce → verify → bounded fix loop
When “answer generated” must not imply “task complete”
Topology
produce → verify → repair (repeating + StopContract) → complete
Soft points
Name |
Kind |
Default |
Notes |
|---|---|---|---|
|
runner_kind |
|
|
|
runner_kind |
|
|
|
runner_kind |
|
Repeating |
|
runner_kind |
|
|
|
budget |
max_iterations=3 |
Via |
|
policy |
|
On verify/complete |
|
task_state |
|
Via |
Example
from mechaharness.graph_templates import GraphTemplateParams, VerifyRepairTemplate
from mechaharness.stop_contract import StopContract
graph = VerifyRepairTemplate().instantiate(
GraphTemplateParams(
goal="fix lint failures",
inputs={"path": "src/"},
acceptance=["tests_green"],
stop_contract=StopContract(version="1", max_iterations=5),
)
)
assert graph.nodes["repair"].repeating is True
assert graph.nodes["repair"].stop_contract is not None
Execute
Fixture runners in mechaharness.verify_repair_runner + CLI
VerifyRepairRecipeAdapter (run_recipe name=verify_repair). Repair loop is
embedded in the repair runner (executor does not walk StopContract).
Node components
Graph node |
Components |
|---|---|
|
|
|
|
|
|
|
|
See Node components.
Tests
See tests/fixtures/graph_templates/verify_repair_*.json and
fangore_verify_repair_recipe.