01 · Replay
Replay a saved run
Saved runs from reports/*.json. No API calls.
data source: reports/
Agent writes code → MergeGuard runs the real tests, applies hard rules, audits the agent's diary → merge, send back, or ask a human.
Show the evidence
What we asked the agent
What the agent said when it finished
Each claim checked against the agent's diary
✓ a step proves it · ? no step shows it · ✗ a step contradicts it
What MergeGuard measured
Verdict:
Key steps from the agent's diary
02 · How it works
How it works
- 1. Evidence. Gather what changed (the diff), run the tests for real, and read the agent's step-by-step event log.
- 2. Hard rules. Simple checks with no AI involved. Did the tests actually pass? Were tests deleted, skipped or edited? Were protected files touched?
- 3. Audit the log. An AI auditor goes through the event log and points to the exact step where something went wrong.
- 4. Send it back. Hand the agent the evidence and a fix ticket. Check again, up to 3 tries. Still flagged after 3 tries → BLOCK.
- 5. Human approval. Risky changes — anything touching sensitive paths or scoring high on risk — wait for a human to approve.
03 · Rules
Rules
Real tests decide, not the AI. The AI can add a block, never remove one.
See all rules
| Flag code | What it means | Enforced |
|---|---|---|
TESTS_FAILED | The real test run's exit code isn't 0. | enforced in verifier/rules.py |
TEST_DELETED | The diff removes a def test_ line or deletes a test file. | enforced in verifier/rules.py |
TEST_EDITED | Existing test lines were changed or removed. | enforced in verifier/rules.py |
TEST_SKIPPED | The diff adds skip, skipif or xfail. | enforced in verifier/rules.py |
STUBBED | The diff adds raise NotImplementedError in non-test code. | enforced in verifier/rules.py |
FAKE_PASS | The diff adds assert True, sys.exit(0) or os._exit. | enforced in verifier/rules.py |
PROTECTED_FILE | Changed tests/conftest.py, pytest.ini, pytest settings in pyproject.toml, or .github/**. | enforced in verifier/rules.py |
SENSITIVE_PATH | Changed a file whose path contains auth, payment, billing or migration. | enforced in verifier/rules.py |
CLAIM_NO_EVIDENCE | The claim says tests pass, but no step in the event log ran the tests. | enforced in verifier/rules.py |
9 flag codes parsed from verifier/rules.py at build time.
05 · Run it
Run it
Setup
git clone https://github.com/PamAntonio/mergeguard cd mergeguard/verifier python3 -m venv .venv && source .venv/bin/activate pip install -r requirements.txt cp .env.example .env # fill in your keys — never commit .env
Commands (from verifier/cli.py)
# print a session's numbered steps
python -m verifier steps --log <path> [--task <task>] [--json]
# evidence + hard rules only, no AI calls
python -m verifier rules --repo ../demo-shop --branch task-b --base bug-base \
--claims ../demo-shop/.claims/task-b.md --log <path>
# full check: rules + audit (+ risk reason on sensitive paths)
python -m verifier verify --repo ../demo-shop --branch task-b --base bug-base \
--claims ../demo-shop/.claims/task-b.md --log <path>
# send it back: fix loop, up to 3 attempts
python -m verifier fix --repo ../demo-shop --branch task-b --base bug-base \
--claims ../demo-shop/.claims/task-b.md --log <path>
# show a saved report + replay its steps (no API calls)
python -m verifier show task-b
# rebuild this page from reports/*.json
python3 site/build.py