End-to-end flow for an MCP-connected agent that runs OVK on a pull request, receives a block with repair hints, patches the change, and reruns until green.
pip install -e '.[dev]'
ovk initOptional: run the MCP server (ovk-mcp or python -m ovk.mcp_stdio) for planning and verification tools (ovk.plan_from_diff, ovk.run_verification, ovk.get_merge_recommendation). Use the CLI for ovk check, ovk repair-suggest, and ovk generate-test in the repair loop today.
OVK ships reproducible repair-loop fixtures for four check types. Each includes failing.diff, repair.patch, passing.diff, and demo_repair_loop.py.
| Check type | Fixture directory | Expected fix_class |
|---|---|---|
| CI secrets | examples/repair_loops/ci_secrets/ |
remove_untrusted_secret_usage |
| Authorization | examples/repair_loops/authorization/ |
add_route_guard |
| Infrastructure | examples/repair_loops/infrastructure/ |
restrict_public_access |
| Deployment | examples/deployment_state/input_skipped_approval.json (focused CLI) or multi-surface diffs |
add_approval_transition |
Run a demo:
python examples/repair_loops/authorization/demo_repair_loop.py
python examples/repair_loops/infrastructure/demo_repair_loop.py
python examples/repair_loops/ci_secrets/demo_repair_loop.pyUse the reproducible fixtures in examples/repair_loops/ci_secrets/.
ovk check \
--changed-files examples/repair_loops/ci_secrets/failing.diff \
--repo example/oss-repo \
--head-sha agent-pr-1Expected:
merge_recommendation:block- Counterexample failure mode:
secrets_exposed_in_untrusted_context
ovk repair-suggest --evidence ovk-evidence.jsonExpected hint:
{
"fix_class": "remove_untrusted_secret_usage",
"suggested_action": "Remove secret references from untrusted workflow triggers."
}MCP equivalent (today): run ovk repair-suggest --evidence <path> from the agent shell after ovk.run_verification or ovk check produces a bundle.
Apply examples/repair_loops/ci_secrets/passing.diff (or edit the workflow to remove ${{ secrets.* }} from pull_request triggers).
ovk check \
--changed-files examples/repair_loops/ci_secrets/passing.diff \
--repo example/oss-repo \
--head-sha agent-pr-2Expected: merge_recommendation: allow
ovk generate-test --evidence ovk-evidence.jsonWrites minimized counterexample fixtures under .verification/generated_tests/.
ovk check \
--changed-files examples/repair_loops/authorization/failing.diff \
--repo example/oss-repo \
--head-sha agent-pr-1
ovk repair-suggest --evidence ovk-evidence.json
ovk check \
--changed-files examples/repair_loops/authorization/passing.diff \
--repo example/oss-repo \
--head-sha agent-pr-2Expected: initial block with admin_route_reachable_by_non_admin, repair hint add_route_guard, repaired allow.
ovk check \
--changed-files examples/repair_loops/infrastructure/failing.diff \
--repo example/oss-repo \
--head-sha agent-pr-1
ovk repair-suggest --evidence ovk-evidence.json
ovk check \
--changed-files examples/repair_loops/infrastructure/passing.diff \
--repo example/oss-repo \
--head-sha agent-pr-2Expected: initial block with sensitive_resource_publicly_exposed, repair hint restrict_public_access, repaired allow.
Extended benchmark cases score:
- Initial diff blocks (or requires review) with a useful repair hint class
- Optional
passing_fixturereruns green after repair
Run locally:
ovk bench --expandedRepair-loop cases cover ci_secrets, authorization, infrastructure, and deployment checks. Auth and infra cases use examples/repair_loops/ fixtures sourced from benchmarks/real_diffs/.
- Agent opens PR with a workflow diff.
- Agent calls
ovk check(or GitHub Action runs in strict mode). - On block, agent calls
ovk repair-suggestand readsfix_class,lane, andaffected_filewhen present. - Agent patches the workflow file.
- Agent reruns
ovk checkuntil recommendation isallow. - Agent optionally commits generated regression tests from
ovk generate-test.
See SYSTEM_SPEC.md step 10 for the end-to-end behavior this demonstrates.