Demo: herd illness alert rule
A self-contained, measurable problem. problem/ holds a small repo:
generate.py: deterministic synthetic collar data for two 120-cow herds on two farms, 150 days each. One is dev, one is held-out. It includes the things that make real alert rules noisy: individual differences, heat days, a weekly late feed truck, oestrus bursts, collar dropouts and partial days, and lactation drift.score.py(frozen): false alarms per 100 healthy animal-weeks, at the threshold that gives 80% early recall. Early recall means an alert within 3 days before the staff-noticed onset. The scorer lints the rule: allowlisted imports only, no file access, no dunder attributes.alert_rule.py(editable): the baseline, a 7-day rumination z-score.
./setup.sh # copies problem/ into .work/target as a fresh git repo
uv run hillclimb run -c hillclimb.toml # from the hillclimb repo root: -c examples/alert-rule/hillclimb.toml
./collect.sh # copies the report, journal, diff and log into results/
The recorded run (results/)
Claude Sonnet (claude-sonnet-5-5), 2 workers, 10 iterations, 2026-11-27:
| baseline | best | |
|---|---|---|
| dev false alarms / 100 animal-weeks | 55.94 (1182 alarms) | 1.04 (22 alarms) |
| held-out false alarms / 100 animal-weeks | 49.74 | 2.35 |
Accepted, in order:
- A robust 14-day median/MAD baseline that skips partial days and combines rumination, activity and lying (55.94 → 13.06).
- Carrying 0.6 × yesterday's score forward (→ 9.04).
- A baseline window that skips the last 2 days, so a developing illness doesn't hide itself (→ 6.29).
- Subtracting the herd's median score each day, which cancels weather and feed-truck days (→ 1.42). This one started from an older best and was replayed onto the newer one.
- A 21-day baseline window (→ 1.04).
Blocked by the held-out gate: #7 added a third day of carried-forward evidence. Dev improved (6.29 → 5.82) but held-out got worse (10.16 → 12.60). The agent's journal shows only "not kept after validation (details withheld)".
results/ is exactly what hillclimb report and collect.sh wrote. Nothing in it is
edited by hand. An earlier run on a pre-release build of the loop (8 iterations) went
from 55.94 to 1.37 on dev and from 49.74 to 4.17 on held-out. That build's outputs
were not kept.