Chapter 20: A small eval set
An eval case has fixed input and expected properties. Check the stop reason, whether an alert posted, and required phrases. Do not check exact text, because model output varies.
Write these cases first: a duplicate that should be suppressed, a critical error that needs approval, a flood that hits the rate limit, a novel error with no runbook, and an empty window that ends with no model call.
| Case | What it proves |
|---|---|
duplicate-suppressed | A duplicate is suppressed |
critical-needs-approval | A critical error waits for approval |
flood-hits-rate-limit | A flood hits the rate limit |
| novel error, no runbook | The watcher copes with a novel error that has no runbook |
| empty window | An empty window ends with no model call |
Table 20.1. The first five cases. The last two have no case name in the code yet.
@ParameterizedTest
@ValueSource(strings = {"duplicate-suppressed", "critical-needs-approval", "flood-hits-rate-limit"})
void evalCase(String caseName) throws Exception {
// read the case JSON, run the watcher, assert the expected properties
}
Run the eval before every change. Use plain JUnit 5.