Repository navigation
feat(email-eval): run the follow-up eval in CI (report script + workflow step) - #6589
hussain-alsaibai wants to merge 3 commits into
Conversation
|
Verdict: Request changes This PR wires the follow-up detection eval into the email eval workflow, the last of the six suites to get a CI step, and updates the capability matrix to match. The wiring is clean. One problem: if the eval can't run at all, the step still goes green.
Real-world evidenceN/A: no evidence bundle was produced for this run. The change touches only a CI eval script, its workflow step and tests, with no user-facing CLI, API, MCP or UI surface. I couldn't run the script or the tests here (the runner has no 🔍 Technical detailsIssues 🟡 A zero-verdict run passes as a report ( Also return 1 on 🟢 Workflow comment overstates independence ( Strengths
|
|
Addressed both findings in 🟡 A zero-verdict run now fails.
🟢 Workflow comment corrected, and EvidenceRan the suite locally (Python 3.11,
Mutation check on the fix itself — with the guards removed but the new tests in place: So each assertion fails for the reason it names, not just for a missing attribute. The workflow YAML was parsed after the edit ( |
…low step) Closes amd#2040. The email agent has six eval suites, but `followups` was the only one with no CI presence: its bars shipped in `followups_gate_thresholds.json` and its quality module in `gaia.eval.followup_quality`, with nothing in the pipeline reading either. `CAPABILITY_MATRIX.md` has said `followups: wired=False` since - `packaging/eval_followup_report.py` — mirrors the drafting / action-item report scripts: loads the committed manifest (no inlined bars), runs the real detector over the corpus, prints the report, writes `eval-out/followups_report.json`, and honours the manifest's `enforce` flag for its exit code. Adds a small argparse surface so `--help` is usable and `--corpus` / `--out-dir` / `--model` are overridable. - `.github/workflows/test_email_agent_eval.yml` — a report-mode step after the briefing eval, plus the manifest in the header's single-source index. - `eval_summary.py` — registers `followup_gate` so the job summary renders a titled row and a missing verdict is reported as missing, not silently absent. - `CAPABILITY_MATRIX.md` regenerated: `followups: wired=True`. The module's "confirmed absent" comment and its now-obsolete trailing "amd#2040 tracks wiring" line are gone. Two deliberate differences from its siblings, both stated in the script: - No judge credential. The follow-up detector is deterministic, so unlike drafting/action-item/briefing this suite needs no Claude judge and must not fail when one is absent — a test pins that. - `EMAIL_EVAL_MODEL` is optional and defaults to a label naming the detector, rather than requiring the Lemonade model id the judged suites need. `enforce` stays `false`: per the manifest, no real baseline exists yet and the shipped detector has a known false-positive gap on courtesy/FYI notes. This makes the eval measurable; amd#1950 owns deciding the bars. Test plan: - `pytest hub/agents/email/python/tests/` — 2337 passed, 3 skipped. - `pytest .../test_eval_followup_report.py` — 10 tests: thresholds loaded from the manifest, enforce=false breach exits 0 and still writes the report, enforced breach exits 1, and the whole suite runs with no judge credential. - `python .../capability_matrix.py --check` — up to date; the drift test was confirmed to fail when the committed artifact is edited. - End-to-end: the script scores 16/16 cases offline (P 0.4545 / R 0.8333 / F1 0.5882, hard-negative correct 4/10), exits 0, and `eval_summary.py` picks the gate up as "Follow-up detection — BREACH (advisory)".
A run that scored nothing still passed. If the email-agent package fails to import, or every case errors, generate_detections returns a predicted=None for each case, summarize_followups reports the gate as skipped, and main() returns 0 — a green CI step for an eval that proved nothing. The module docstring and CLAUDE.md both say a missing package must fail loudly, and the briefing sibling already returns 1 on a zero-case run. - return 1 when no case produced a verdict, regardless of the manifest's enforce flag - return 1 on a skipped gate, before writing the report, so the scorecard cannot treat it as a real scored run - test_skipped_gate_variant_returns_0 expected 0 for the skipped path; it now expects 1 and asserts no report is written - new test covers the all-predicted=None path and proves it never reaches scoring - workflow: add if: always() to the follow-up step and correct the comment — it is offline and deterministic, so it should not be skipped by a failed judge preflight above it Both new assertions fail on the unpatched script (2 failed) and the suite is 11 passed with it.
Upstream renamed the loader while this PR was open:
`load_default_followup_thresholds()` became `load_followup_thresholds(path)`,
and the default path is now resolved by `default_followup_thresholds_path()`.
Port the call site and the test to the new shape.
Also fixes C405 in the test (set([...]) -> {...}).
The rebase onto current main (335 commits) hit a second upstream change:
the email-eval workflow this PR edited was deleted as dead config, and the
evals moved to `email_scorecard_refresh.yml`. The follow-up step now lands
there instead, with `if: always()` preserved -- the step is offline and
deterministic, so a missing judge credential or a failed Lemonade eval
above must not be able to skip it and leave the summary showing "no verdict
produced".
Verified: 2376 passed, 3 skipped across hub/agents/email/python/tests/;
ruff check and format clean; capability matrix drift check up to date.
6e30fd7 to
29b5e0b
Compare
|
Thank you for this, @hussain-alsaibai. The wiring is careful, and making a run that produces no verdicts fail outright is exactly the loud failure we want. Unfortunately it can't merge: the standalone email agent it measures is being removed in #7108, along with The idea carries over well. The flagship already has a 🔍 Technical details
|
|
Superseded by #8089, re-targeted per @kovtcharov-amd's review. Confirmed #7108 deletes every file this PR touched — |
…8089) Fixes #2040 (re-targeted per @kovtcharov-amd's review on #6589). ## Why this replaces #6589 #6589 wired the standalone email agent's follow-up eval into CI. @kovtcharov-amd pointed out that the email agent is being removed in #7108, along with `email_scorecard_refresh.yml` and the email eval modules — so that PR's target no longer exists. Verified, not assumed: #7108 deletes every file #6589 touches. | #6589 touches | #7108 | |---|---| | `.github/workflows/email_scorecard_refresh.yml` | removed | | `hub/agents/email/python/packaging/eval_followup_report.py` | removed | | `hub/agents/email/python/tests/test_eval_followup_report.py` | removed | | `tests/fixtures/email/followups_ground_truth.json` | removed | | `tests/fixtures/email/followups_gate_thresholds.json` | removed | | `src/gaia/eval/followup_quality.py` | removed | Rebasing #6589 would produce a PR against deleted files, so this moves the coverage instead. ## What this does Adds one `gaia_email` scenario, `eval/scenarios/gaia_email/email_t3_hung_thread_followups.yaml`, pinning the same `awaits_reply` behaviour — but end to end against the surviving corpus and the live agent, rather than offline against the deleted detector. Among the 42 inbox messages, exactly one thread has a person blocked on the user's reply: Alex, *"Re: Project status - blocked on review"*. The scenario requires the agent to: 1. Find that thread, and say he is blocked with a customer deadline. 2. Not count other deadline-bearing mail as awaiting a reply — the hard negatives are exactly the ones the old detector scored as false positives: the Boss Q4 budget request (a deliverable the user owes, not a thread needing a reply), Sam's "design review moved" FYI, the HR enrollment reminder (the action is enrolling, not replying), and Priya's already-settled on-call swap. 3. Not mistake the Tue Sep 29 calendar invite for an answer to Alex — the meeting being scheduled is not the review being done. The old offline detector could not see this confusion at all. 4. Write a reply that commits to reviewing today **and asks what specifically is blocking him** — an acknowledgment with no question is a FAIL, since the point is to un-hang the thread. ## Validation - `gaia.eval.runner.validate_scenario` accepts it; all 13 scenarios in `eval/scenarios/gaia_email/` still validate. - The validator was confirmed to reject malformed input (empty `turns`, a turn with neither `ground_truth` nor `success_criteria`), so the pass is not vacuous. - Every factual claim in the scenario header was checked against `tests/fixtures/gaia/email/eval_inbox.mbox`: Alex's message, the calendar invite, Sam's FYI, Priya's "Swapped - I already updated the schedule", and the HR note's "No action required". Branched from `amd/gaia@75ef063`. I have not run the flagged scenario against a live backend — it validates and its ground truth is fixture-checked, but the execution itself needs the `eval_flagship.yml` runner. #6589 can be closed. Co-authored-by: Kalin Ovtcharov <[email protected]>
Summary
Adds
packaging/eval_followup_report.pyand a report-mode step in the email scorecard refresh workflow, so the follow-up detection eval runs in CI like the other five suites. Registersfollowup_gateso the job summary renders a titled row, and regeneratesCAPABILITY_MATRIX.mdtofollowups: wired=True.Why
Six eval suites had committed gate manifests, but
followupswas the only one with no CI presence at all: its bars shipped intests/fixtures/email/followups_gate_thresholds.jsonand its quality module ingaia.eval.followup_quality, with nothing in the pipeline reading either.CAPABILITY_MATRIX.mdhad saidfollowups: wired=Falsesince #2013.This closes the wiring gap only. It makes the eval measurable; deciding the bars is still #1950's job.
Linked issue
Closes #2040
Changes
hub/agents/email/python/packaging/eval_followup_report.py(new) -- mirrorseval_drafting_report.py/eval_action_item_report.py: loads the committed manifest (no inlined bars), runs the real detector over the corpus, prints the report, writeseval-out/followups_report.json, and honours the manifest'senforceflag for its exit code. Adds a small argparse surface so--helpis usable and--corpus/--out-dir/--modelare overridable..github/workflows/email_scorecard_refresh.yml-- a "Follow-up detection eval (report mode)" step after the briefing eval, in the same self-contained-block style.packaging/eval_summary.py-- registersfollowup_gate, so the job summary renders a titled row and a missing verdict is flagged as missing rather than silently absent.CAPABILITY_MATRIX.mdregenerated --followups: wired=True. The module's stale "# confirmed absent -- Align email agent tool surfaces: MCP / REST / internal tools / evals are out of sync #2013" comment and the now-obsolete trailing "Wire the followups email eval into CI (report script + workflow step) #2040 tracks wiring" line are gone.test_eval_followup_report.py;test_capability_matrix.pynow pins every suite as wired (per-suite, so a regression names the suite);test_eval_summary.pycovers the new gate.Two deliberate differences from its siblings (both stated in the script)
EMAIL_EVAL_MODELis optional, defaulting todeterministic-followup-detector. The judged suites require the Lemonade model id; this one only records a scorecard label.enforcestaysfalse. Per the manifest's own_commentthere is no real baseline yet and the shipped heuristic has a known false-positive gap on courtesy/FYI notes, so this makes the eval measurable without blocking merges.A zero-verdict run now fails
The first version of this script exited 0 when the detector produced nothing at all -- a broken install or an unreadable corpus would have looked exactly like a clean run, and the summary would have said "no verdict produced" without anyone noticing.
main()now returns 1 whenproduced == 0, before scoring and before the report is written, and prints the per-case errors so the cause is visible in the job log.The workflow step moved
This PR originally added its step to
.github/workflows/test_email_agent_eval.yml. While it was open, upstream deleted that workflow as dead config (it had a singleif: falsejob) and moved the email evals intoemail_scorecard_refresh.yml. The step now lands in the workflow that actually runs, withif: always()preserved -- the step is offline and deterministic, so a missing judge credential or a failed Lemonade eval above must not be able to skip it.Test plan
pytest hub/agents/email/python/tests/-> 2376 passed, 3 skippedpytest hub/agents/email/python/tests/test_eval_followup_report.py-> 10 passedload_followup_thresholds(default_followup_thresholds_path())(the manifest), never inlinedenforce=false+ breach -> exit 0, report still writtenenforce=true+ breach (should_fail) -> exit 1claudeon PATH--out-diroverride,--model/EMAIL_EVAL_MODELprecedence, skipped-gate variantpython hub/agents/email/python/packaging/capability_matrix.py --check-> "Capability matrix up to date"CAPABILITY_MATRIX.mdflipstest_committed_capability_matrix_is_up_to_datered, and restoring it goes greenruff checkandruff format --checkclean on the new and changed filesyaml.safe_load) and the step appears in the expected pipeline position withif: always()enforceflipped, no corpus orfollowup_quality.pychange, no new dependenciesNotes for the reviewer
main(335 commits ahead of where it started) to resolve a conflict with the workflow deletion, and the thresholds loader was renamed upstream while this was open (load_default_followup_thresholds()->load_followup_thresholds(path)). The call site and its test follow the new API.enforceremainsfalseby design. feat(eval): detection-quality eval for email follow-up tracking #1950 owns deciding the bars once a real baseline exists.