Checkpoint
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Final drill. Write the merge gate for a model repo:
ci_verdict(run) takes a dict with tests_passed (bool),
eval_score, and threshold. Rules, in order:
- If
tests_passedis False, return("block", "tests failed")— don't even look at the eval; a broken harness makes the score meaningless. - If
eval_scoreis belowthreshold, return("block", f"eval {score} below {threshold}"). - Otherwise return
("merge", f"eval {score} clears {threshold}").
The script exercises three runs and prints each verdict.
Expected output:
merge: eval 0.86 clears 0.8
block: eval 0.74 below 0.8
block: tests failed