Repository navigation
docs(email): add EVALUATION.md guide + make the scorecard reproducible - #1989
Conversation
The email agent's SCORECARD.md documented a reproduction recipe that failed on a fresh checkout: it ran the benchmark against synthetic_inbox.mbox / ground_truth.json, which are generated (gitignored) artifacts, so a new user hit file-not-found before the first run. It also had no dataset pointers, no example, and no explanation of what the metrics mean. The card is generator-produced, so the fix lands in the generators: - gen_scorecard.py: the reproduction recipe now installs the eval extras, starts Lemonade, and builds the corpus from the committed seed (generate_mbox.py) before running the benchmark; a new Dataset appendix adds source-of-truth pointers, a worked example (seed record -> ground-truth entry -> scoring), and a plain-language metric glossary. - release_scorecard.py: adds a generic, agent-agnostic optional notes block (marker-wrapped so carry_forward preserves it across patch releases). - SCORECARD.md regenerated deterministically from existing front matter; scores unchanged, only docs added.
|
Verdict: Approve ✅ This PR makes the email agent's published I checked the substance, not just the prose: the worked-example record matches the committed seed, the ordinal priority ladder documented in the card ( 🔍 Technical detailsStrengths
🟢 Minor / nits (optional) 🟢 Provenance line names 🟢 The worked-example subject in the doc uses an ASCII hyphen ( |
…esults Separates concerns: SCORECARD.md is a generated results artifact (score, metrics, breakdown, environment) and stays lean; EVALUATION.md is a hand-authored guide covering what's measured, the dataset + provenance, a worked example (input -> agent output -> ground truth -> scoring), the metric definitions, and full reproduction steps. This reverts the generic notes/marker/carry-forward machinery previously added to release_scorecard.py (no longer needed once the guide is its own file), so the shared core generator is unchanged vs main. What stays on the card: the exact reproduction command (now installs deps and builds the corpus from the committed seed before running the benchmark, so it works on a fresh checkout) plus a pointer to EVALUATION.md. EVALUATION.md ships in the npm package (package.json files) alongside README / SCORECARD / SPEC, and is linked from the README.
The triage scoring behind SCORECARD.md is deterministic label-matching (predicted == expected in quality_metrics.py) — no Claude, no ANTHROPIC_API_KEY. The email agent's separate voice-drafting quality eval (#1269) IS judge-scored by Claude and needs ANTHROPIC_API_KEY; it is report-mode and independent of the scorecard. The prior wording implied the whole email eval was judge-free.
…D.md The reproduction recipe lived in two places: the auto-generated Reproduction section of SCORECARD.md and a hand-copied block in EVALUATION.md. Since both now render as separate tabs on the hub agent page, the duplication is visible to readers and the hand-copy drifts from the generated (version-stamped) command. EVALUATION.md now points at SCORECARD.md's Reproduction section and keeps only its unique conceptual notes (timeout rationale, serial-eval, variance). The generated SCORECARD.md still cross-links back to EVALUATION.md for background, so each fact has exactly one home.
) ## Why this matters An email-agent release could previously ship even if the judge-based evals regressed, the perf bars were missed, or the unit/spec tests were red. #1983 wired the eval suite (triage / drafting / action-item / briefing) into the release as a gate, but the drafting + perf gates were **report-only**, and the release did **not** run the unit or spec/contract tests at all. After this change, a release of `@amd-gaia/agent-email` is blocked unless, at the release commit: - **Every eval passes** — triage acceptance bar, **drafting** approval, **perf** bars, plus the already-enforcing action-item + briefing judge evals. - **A missing `ANTHROPIC_API_KEY` blocks** — the action-item + briefing evals hard-require the judge and fail loudly (no fuzzy-only fallback), so a release can't ship an un-judged suite. - **All email tests pass**, including the **REST-sidecar contract** and **OpenAPI-conformance (spec)** tests — now part of the release gate, not just PR CI. - The **judge-scored drafting result is folded into `SCORECARD.md`** (`draft_approval_rate`, reported metric). ## What changed - **Enforce drafting + perf gates** (`tests/fixtures/email/{drafting,perf}_gate_thresholds.json` → `enforce: true`).⚠️ The perf bars are not yet independently hardware-confirmed — if the stx pool proves noisy, widen them in the manifest (data, not code) rather than reverting to report mode. - **`release_agent_email.yml`**: `publish` now also needs a new `email-tests` gate (`uses: test_email_agent_unit.yml`). - **`test_email_agent_unit.yml`**: installs the email hub package and also runs `hub/agents/python/email/tests/` (REST contract) + `tests/test_email_openapi_conformance.py` (spec) — fully mocked, no Lemonade. - **`gen_scorecard.py`**: new `--drafting-report`; folds `draft_approval_rate` as a reported metric (weight 0) so the aggregate stays `100 × within_one_bucket_accuracy`. Loud-skip report → metric omitted; malformed non-skip → hard error. - **`email_scorecard_refresh.yml`**: runs the drafting eval and passes `--drafting-report`, so the committed/shipped scorecard carries the drafting metric. - **`test_email_agent_eval.yml`**: nightly → **weekly** (Mondays 07:17 UTC) — the run now spends Claude judge tokens, and the release re-runs the suite as a hard gate. ## Design note (deviation from the original plan preview) The approved preview envisioned a bespoke `eval-gate` job that regenerates + ships a runner-fresh scorecard. #1983 had already landed a reusable `email-eval` gate, so this adapts to that structure instead: the eval runs (and now enforces) via `email-eval`; the committed scorecard is kept honest — and gains the drafting metric — by `email_scorecard_refresh.yml`. Net effect matches the requirement. ## Test plan - [x] `pytest tests/unit/eval/test_release_scorecard.py` — 76 pass (3 new: drafting metric folded/reported/aggregate-unchanged; loud-skip omits; malformed fails loud). *Windows: `PYTHONUTF8=1`.* - [x] `black --check` / `isort --check` clean on the changed Python. - [x] All four edited workflows YAML-parse; both manifests are valid JSON with `enforce: true`. - [ ] **CI-only (cannot run locally):** the `email-eval` gate + `email_scorecard_refresh` run on the self-hosted **stx** pool with Lemonade + `ANTHROPIC_API_KEY`. Verify via a `workflow_dispatch` dry-run on hardware before cutting a real tag — especially that the newly-enforced **perf** bars pass on the pool. ## Dependency Overlaps PR #1989 (docs) on `gen_scorecard.py`. Trivial to resolve; recommend landing #1989 first. --------- Co-authored-by: Ovtcharov <[email protected]> Co-authored-by: Kalin Ovtcharov <[email protected]>
# Conflicts: # hub/agents/python/email/packaging/gen_scorecard.py
…lent skip) (amd#2023) ## Why this matters Follow-up to amd#1990 (already merged), which flipped the drafting + perf gates to `enforce:true` but left two accuracy defects on main: 1. **A fail-loudly violation.** `eval_drafting_report.py` still *silently loud-skipped* when `ANTHROPIC_API_KEY` was absent — it wrote `{"skipped": true, "should_fail": false}` and returned 0, and `gen_scorecard.py` then quietly dropped the `draft_approval_rate` metric. So a keyless run shipped an **un-judged drafting gate** while the manifest claimed `enforce: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. 2. **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 as `enforce: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 — never `pull_request` from a fork — so `secrets.ANTHROPIC_API_KEY` is always present in a legitimate run and the hard-fail can't spuriously break CI. ## Test plan - [x] `pytest tests/unit/eval tests/unit/email -q` → 605 passed - [x] New: missing key → `main()` returns 1 + stderr names `ANTHROPIC_API_KEY`, writes no skip report (`test_drafting_eval_missing_key_hard_fails`) - [x] Changed: a `skipped`-marked report now raises instead of silently omitting the metric (`test_drafting_report_skip_marker_fails_loud`) - [x] `python util/lint.py --all` clean; all three workflow YAMLs parse - [x] `gen_scorecard.py` retains amd#1989's `_build_reproduction_command` alongside the fail-loudly change (clean 3-way merge)
…md#2020) The email agent ships an `EVALUATION.md` eval guide (added in amd#1989) and links it from its README via github.com URLs, but the hub page only renders readme/changelog/spec/skill/scorecard from the catalog — so **EVALUATION.md never appears on amd-gaia.ai/hub/email**. This adds a new catalog `evaluation` field carrying the agent's EVALUATION.md markdown and surfaces it as its own **Evaluation** tab. It mirrors the existing spec/skill doc-field pipeline exactly — plain embedded markdown, no front matter, no score, no URL (unlike the score-carrying scorecard field). **Dependency:** `hub/agents/npm/agent-email/EVALUATION.md` currently exists only on the amd#1989 branch (`docs/email-scorecard-repro`), not on main. The release workflow's `--evaluation` flag is guarded by a file-presence check, so releases cut before amd#1989 merges still publish cleanly; the tab lights up once EVALUATION.md lands on main and the next email release republishes. ## Test plan - [x] Worker: `cd workers/agent-hub && npx vitest run` → **70 passed** (incl. new evaluation store/serve/index assertions + the `entry.evaluation === ""` default) and `npx tsc --noEmit` clean. - [x] Website: `cd website && npx vitest run` → **26 passed**; `HUB_CATALOG_URL=https://hub.amd-gaia.ai npm run build` (astro check + build) clean. - [x] **Render proof**: injected `"evaluation": "# Eval Guide\n\nHello **newcomer**.\n"` into a local copy of the live catalog, served it on a non-4001 port, rebuilt, and grepped `dist/hub/email/index.html`: - Tab button → `data-doc-tab="evaluation" ...>Evaluation<` - Panel → `data-doc-panel="evaluation"` - Rendered body → `Eval Guide</h1>` and `<strong>newcomer</strong>` - [x] Python: `publish_to_r2.py` parses and `--evaluation` appears in `--help`; the `hub/` packaging dir is outside `util/lint.py`'s scope (`src/gaia` + `tests` only), and the new line is black-clean regardless.
Why this matters
The email agent's published
SCORECARD.md(shipped in@amd-gaia/agent-email) pointed readers at a reproduction recipe that failed on a fresh checkout — it ran the benchmark againstsynthetic_inbox.mbox/ground_truth.json, which are generated, gitignored artifacts, so a new user hit file-not-found before their first run. There was also no intro to what the eval measures, no dataset pointers, and no worked example — "reproduce this" effectively meant "read the harness source."This splits the two concerns so each file does one job:
SCORECARD.md(generated) — stays lean: score, metrics, per-category breakdown, environment, and the exact reproduction command, now fixed to install deps and build the corpus from the committed seed (generate_mbox.py) before running the benchmark. Scores unchanged (docs only).EVALUATION.md(new, hand-authored) — the evaluation guide: what the agent does and what's measured (local, offline, no LLM judge), the dataset + provenance + schema pointers, a worked example (input seed record → agent output → ground-truth entry → scoring row), the metric definitions, and step-by-step reproduction. Ships in the npm package alongside README/SCORECARD/SPEC and is linked from the README.Keeping the guide out of the generated card also means the shared core generator (
release_scorecard.py) is unchanged vs main — an earlier iteration added generic notes/marker/carry-forward machinery to embed the prose in the generated file; the split makes that unnecessary and it's reverted.Test plan
pytest tests/unit/eval/test_release_scorecard.py tests/unit/eval/test_scorecard_gate.py— 98 pass (adapter test asserts the repro command includesgenerate_mbox.py, the install line, and the EVALUATION.md pointer). On Windows, run withPYTHONUTF8=1— pre-existingcarry_forwardtests write UTF-8 without an explicit encoding.python -m gaia.eval.scorecard_gate --scorecard hub/agents/npm/agent-email/SCORECARD.md— passes,aggregate.value = 83.4(unchanged); front matter byte-identical vs main.black --check/isort --checkclean;package.jsonvalid JSON withEVALUATION.mdadded tofiles.