Repository navigation
fix(email-eval): drafting eval hard-fails on missing judge key (no silent skip) - #2023
Conversation
…lent skip)
CLAUDE.md's "No Silent Fallbacks — Fail Loudly" is a hard rule, and the
drafting eval's missing-key path violated it: it wrote a `{"skipped": true,
"should_fail": false}` report and returned 0, so a keyless run silently shipped
an un-judged drafting gate and gen_scorecard just dropped the metric.
- eval_drafting_report.py: delete the skip branch. A missing ANTHROPIC_API_KEY
now prints an actionable error (what failed / what to do / where) to stderr and
exits 1, regardless of enforce. No skip report, no invented pass.
- gen_scorecard.py `_load_draft_approval_rate`: drop the silent `skipped -> None`
omit; a `skipped` marker or a missing rate now raises. Return type is `float`,
and build_payload always folds the metric (no None guard).
- Docs swept for the enforce:false->true flip and the new fail-loudly behavior:
eval_drafting_report.py docstring, gen_scorecard --drafting-report help,
release_agent_email.yml key comment (attributed to the drafting eval's exit 1),
and test_email_agent_eval.yml (report-mode/loud-skip text for perf + drafting).
- Tests: missing key -> exit 1 + actionable error; a `skipped` report -> raises.
Verified none of the three workflows that run the judged eval trigger on fork
PRs (schedule / workflow_call / tag-push / branch push only), so the key is
always present in a legitimate run — the hard-fail never spuriously breaks CI.
|
Verdict: Approve ✅ This closes a real fail-loudly hole in the email drafting eval: a keyless run used to write a I checked the change end-to-end and it's consistent: the manifests really do ship One optional, out-of-scope follow-up below; not blocking. 🔍 Technical details🟢 Minor / optional (out of scope — pre-existing, not in this diff) The doc sweep updated Verification performed
Strengths
|
Why this matters
Follow-up to #1990 (already merged), which flipped the drafting + perf gates to
enforce:truebut left two accuracy defects on main:A fail-loudly violation.
eval_drafting_report.pystill silently loud-skipped whenANTHROPIC_API_KEYwas absent — it wrote{"skipped": true, "should_fail": false}and returned 0, andgen_scorecard.pythen quietly dropped thedraft_approval_ratemetric. So a keyless run shipped an un-judged drafting gate while the manifest claimedenforce:true. That contradicts CLAUDE.md's "No Silent Fallbacks — Fail Loudly" hard rule. Now a missing key is a hard failure (exit 1) with an actionable error naming the key; there is no skip report and no invented pass.Stale docs from the enforce flip.
test_email_agent_eval.yml,release_agent_email.yml, and the drafting-eval docstrings still described the perf/drafting gates asenforce:false/ "report mode" / "loud-skip". Swept to match shipped behavior: perf + drafting + briefing enforce; only the FP/FN quality gate remains report-mode.No gating logic changed beyond the missing-key path — the manifests still own the enforce switch (data, not code).
Fork/nightly safety: the three workflows that run the judged eval trigger only on
schedule/workflow_call/ tag-push / base-branch push — neverpull_requestfrom a fork — sosecrets.ANTHROPIC_API_KEYis always present in a legitimate run and the hard-fail can't spuriously break CI.Test plan
pytest tests/unit/eval tests/unit/email -q→ 605 passedmain()returns 1 + stderr namesANTHROPIC_API_KEY, writes no skip report (test_drafting_eval_missing_key_hard_fails)skipped-marked report now raises instead of silently omitting the metric (test_drafting_report_skip_marker_fails_loud)python util/lint.py --allclean; all three workflow YAMLs parsegen_scorecard.pyretains docs(email): add EVALUATION.md guide + make the scorecard reproducible #1989's_build_reproduction_commandalongside the fail-loudly change (clean 3-way merge)