Exercise 10: Complete one iteration loop
What this exercise teaches
- A legitimate “fix” to a failing row requires a documented reason (rubric was wrong), not just flipping
passedtotrue. - Hand-editing an artifact to make a row pass is fabricated evidence unless it’s paired with a real, specific change note a reviewer can check.
checkcannot distinguish a legitimate rubric fix from a fabricated pass on its own — the audit trail (change note) is what makes the difference, not the tool.
Question this answers
- What separates a real iteration-loop fix from silently editing a failing row to green?
Goal
- Fix one failing row.
- Record why the change was made.
Prerequisite
- Complete setup in
docs/teach-curriculum.mdsection “Exercise rules”. - Finish Exercise 09; this exercise edits run-002.json.
Why this matters
- Evals are useful only if they help you improve safely.
Read this before you run anything. The commands below edit passed: false to passed: true directly inside a stored artifact, with no agent
run and no rubric re-check behind it. That is not how you close a real eval
failure — do this to a real run’s artifact and you have fabricated evidence
that a fix worked, which is the exact failure mode this package exists to
catch. This exercise simulates one narrow, legitimate case: the rubric
itself was wrong (case-001 was marked wrong for the right answer), you fixed
the rubric, and you are hand-editing the artifact only because you are not
wired to a live runner in this exercise. In a real pipeline, step 1 below is
replaced by re-running your actual eval suite after the rubric fix, and the
new artifact is generated by that run — never hand-edited.
Steps
- Simulate a rubric fix by updating one row to pass, with a reason. In a real workflow this step is “re-run the suite after fixing the rubric”, not “edit the JSON”.
python3 - <<'PY'
import json
from pathlib import Path
p = Path('.evals_output/run-002.json')
doc = json.loads(p.read_text())
for row in doc.get('rows', []):
if row.get('id') == 'case-001':
row['passed'] = True
row['severity'] = 'none'
row['category'] = 'success'
row['reason'] = 'Fixed rubric wording to remove ambiguity around accepted answer format.'
# Recompute suite totals from rows to keep counts consistent
from collections import defaultdict
stats = defaultdict(lambda: {'total': 0, 'passed': 0, 'failed': 0})
for r in doc.get('rows', []):
if isinstance(r, dict) and r.get('suite'):
s = stats[r['suite']]
s['total'] += 1
if r.get('passed') is True:
s['passed'] += 1
else:
s['failed'] += 1
for suite in doc.get('suites', []):
sid = suite.get('id')
if sid in stats:
suite['total'] = int(stats[sid]['total'])
suite['passed'] = int(stats[sid]['passed'])
suite['failed'] = int(stats[sid]['failed'])
p.write_text(json.dumps(doc, indent=2) + '\n')
PY
- Write a short change note. This is what makes the edit legitimate: a reviewer can see the rubric changed and why, instead of a row silently flipping to green.
mkdir -p eval/notes
cat > eval/notes/10-iteration-change-log.md <<'EOF'
Change: clarified rubric wording for case-001.
Why: previous wording caused false regression classification.
Expected impact: deterministic check should pass with unchanged agent behavior.
EOF
- Re-run the gate.
npx eval-dashboards check --input=.evals_output --min-pass-rate=0.9 --zero-critical
Why no --max-new-failures here:
- This exercise does not set a baseline run on purpose.
- A baseline-aware new-failure gate is covered in Exercise 09 history workflow.
Example result (verified against a real run)
Eval gates failed:
Pass rate 0.800 is below required 0.900.
Critical failures 1 exceed allowed 0.
Diagnostics:
Top failing categories: regression=1
Lint warning breakdown: missing-suite-manifest=3, missing-agent-versioning=1, low-category-coverage=1
- Exit code
1— and this is the most important thing in the exercise. - Your fix worked. The gate still failed.
case-001is green now; nothing in this output disagrees with that. The gate is red becausecase-002, the deliberately-critical row from Exercise 08, was never in scope for this fix and is still failing. - Read the failure lines against your change, not as one verdict. “Did my fix land?” and “is the release shippable?” are different questions with different answers here. Confusing them is how people either panic over an unrelated red or, worse, widen their “fix” until the whole run goes green.
- To watch this exercise’s fix in isolation, remove
case-002first, or gate only on the new-failure count as in Exercise 09. Do not raise--min-pass-rateor drop--zero-criticalto get a green — that is changing the question to suit the answer. checkcannot tell a legitimate rubric fix from a hand-edited pass — the change note in step 2 is the only thing that makes this defensible. If you cannot write a real, specific reason a row’s rubric was wrong, you should not be editingpassedat all; go re-run the suite instead.
Definition of done
- Row
case-001is now passing with explicit rationale. - The change note exists and is readable by another teammate.
- You can explain, out loud, why this exercise’s method (hand-edit + note) is not the same as fixing the underlying agent and would be indefensible without the note.
- You can say why neither failing gate line is about your change: both the
pass-rate line and the zero-critical line are produced by
case-002alone, andcase-001— the row you fixed — is green. Say it without re-running anything. - You never relaxed a threshold to turn this run green.
Common mistakes
- Flipping
passedtotruewithout writing (or reading) the change note — at that point it is indistinguishable from fabricating a pass. - Forgetting that
case-002, the critical row added in Exercise 08, is still in the artifact at this point: runningcheck --zero-criticalhere still fails on that unrelated row, which can look like this exercise’s fix didn’t work when it actually did (onlycase-001was in scope for this fix). - Treating this exercise’s hand-edit pattern as a template for real failures — in a real pipeline you re-run the suite after the underlying fix; you do not hand-edit a production artifact.