Skip to content

feat(eval): Agent Eval Toolchain — v0.18.0 milestone - #779

Merged
kovtcharov-amd merged 3 commits into
mainfrom
kalin/agent-eval-toolchain
Apr 29, 2026
Merged

kovtcharov-amd merged 3 commits into
mainfrom
kalin/agent-eval-toolchain

Conversation

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Summary

Ships the complete Agent Eval Toolchain for the v0.18.0 milestone. This PR addresses all open issues in the Agent Eval Benchmark milestone:

What Changed

Removed (legacy eval framework)

  • src/gaia/eval/eval.py (3,336 lines), groundtruth.py, batch_experiment.py, transcript_generator.py, email_generator.py
  • src/gaia/eval/fix_code_testbench/, configs/, webapp/, scripts/
  • CLI commands: gaia groundtruth, gaia report, gaia visualize, gaia create-template, gaia batch-experiment, gaia synthetic-data

Added/Modified

  • runner.py — custom scenario/corpus dirs, tag filtering, custom personas
  • scorecard.py — JUnit XML output (write_junit_xml())
  • cli.py — new flags (--scenario-dir, --corpus-dir, --tag, --output-format), removed legacy commands (~1,900 lines)
  • tests/test_eval.py — 27 test classes with full public API coverage
  • docs/guides/eval.mdx — Getting Started guide (341 lines)
  • docs/guides/eval-scenarios.mdx — Scenario authoring reference (645 lines)
  • docs/guides/eval-ci.mdx — CI/CD integration guide (500 lines)
  • docs/presentations/agent-eval-benchmark.html — 10-slide presentation deck

Infrastructure

  • .github/workflows/test_eval.yml — removed Node.js/webapp tests, added agent eval help test
  • .github/dependabot.yml — removed eval webapp npm monitoring
  • setup.py, MANIFEST.in — removed deleted packages/includes
  • CLAUDE.md — updated architecture references

Test plan

  • pytest tests/test_eval.py -v — all 27 test classes pass
  • gaia eval agent --help — shows all new flags
  • gaia eval agent --audit-only — runs architecture audit without LLM
  • gaia eval agent --scenario simple_factual_rag — runs single scenario (requires Agent UI backend + Claude API key)
  • No broken imports: python -c "from gaia.eval.runner import AgentEvalRunner; from gaia.eval.scorecard import build_scorecard; print('ok')"
  • Verify docs render at amd-gaia.ai/guides/eval after merge

Closes #670, #671, #672, #673, #573

🤖 Generated with Claude Code

@github-actions github-actions Bot added documentation Documentation changes dependencies Dependency updates devops DevOps/infrastructure changes agents cli CLI changes eval Evaluation framework changes tests Test changes performance Performance-critical changes labels Apr 14, 2026
kovtcharov added a commit that referenced this pull request Apr 17, 2026
Two-phase local-first email triage agent — MVT (~1.5d CC-assisted) for
v0.20.0, full EmailTriageAgent for v0.23.0. Covers auto-discovery, per-cohort
autonomy, speech-act classification, undo ledger, Slack as first-class output
channel, and an honest §27 catalog of research bets and unvalidated claims.

§22.4 maps outstanding PRs to prerequisite role: #606 / #517 / #495 / #622 /
#779 / #741 / #737. Landing the "minimum set" of #495 + #741 + one of #606 /
#517 M1 collapses most of the missing-infrastructure workarounds before
implementation starts.
github-merge-queue Bot pushed a commit that referenced this pull request Apr 18, 2026
## Summary

Adds a two-phase spec for a local-first email triage agent that runs
inference on-device via Lemonade (Ryzen AI NPU/iGPU) — no email content
transits a cloud API. Phase **MVT** ships in ~1.5 days (CC-assisted) by
thin-wrapping existing primitives; **Phase C1** polishes UX for v0.20.0;
**Phase C2** adds scheduled triage, Agent Inbox HITL, and in-tree Gmail
MCP for v0.23.0. Slack is a first-class output channel from day one
(webhook → MCP → interactive buttons across phases).

## Key threads

- **MVT ships fast because ~95% of plumbing exists.** §2.5 maps every
required capability to an existing GAIA primitive (`MCPClientMixin`,
`DatabaseMixin`, `RAGSDK`, `TalkSDK`, `SummarizeAgent`, `ApiAgent`,
SSE). Why it matters: scoping the MVT as thin wrappers rather than new
plumbing is what makes the ~1.5d estimate credible.
- **§22.4 catalogs in-flight PRs as prerequisites.** Maps
[#606](#606) (memory v2),
[#517](#517) (autonomy M1/M3/M5),
[#495](#495) (security.py),
[#622](#622) (orchestrator),
[#779](#779) (eval),
[#741](#741) (vault),
[#737](#737) (Slack connector) to
which spec risks each one collapses. Why it matters: the "minimum set to
start MVT safely" is named explicitly — #495 + #741 + one of #606 / #517
M1 — so sequencing is actionable.
- **Memory-PR conflict flagged (§22.4.4).** #606 and #517 M1 overlap on
memory subsystem; §22.4.4 calls out the reconciliation as a prerequisite
decision, not a runtime surprise.
- **§27 "Known Weaknesses, Unvalidated Claims, Decision Debt"** names
the research bets (Custom AI Labels on local 4B, per-relationship voice,
auto-follow-up quality) and unvalidated claims cited in the spec (97.5%
tool-call reliability, GongRzhe archive date, etc.) so C2 isn't treated
as an engineering certainty.
- **Slack integration scoped as an output channel (§12.18).** Webhook at
MVT → Slack MCP at C1 → interactive approve/edit/reject buttons at C2.
Aligned with
[messaging-integrations-plan.mdx](https://github.com/amd/gaia/blob/main/docs/plans/messaging-integrations-plan.mdx)
(#635).

## Test plan

- [ ] Render preview of `docs/plans/email-triage-agent.mdx` via Mintlify
dev or amd-gaia.ai preview — confirm frontmatter, tables, code blocks,
and section numbering (1–28) render cleanly.
- [ ] Verify `docs/docs.json` navigation entry places the page under
*Agent UI* group next to `email-calendar-integration`.
- [ ] Cross-reference check: every `[Link](file.mdx)` target exists
(`email-calendar-integration`, `autonomy-engine`, `security-model`,
`agent-ui`, `setup-wizard`, `messaging-integrations-plan`).
- [ ] Scan §22.4 PR numbers against the current PR queue (`gh pr list
--repo amd/gaia --state open`) to confirm they're still open and the
recommended sequence is feasible.
@kovtcharov kovtcharov removed the agents label Apr 26, 2026
Ovtcharov and others added 2 commits April 29, 2026 13:07
…, docs, tests

Remove 15,879 lines of legacy eval code (eval.py, groundtruth.py,
batch_experiment.py, transcript/email generators, fix_code_testbench,
webapp, configs) and replace with the new agent eval benchmark framework.

Extensibility:
- --scenario-dir for custom scenario directories
- --corpus-dir for custom corpus with manifest merging
- --tag for scenario filtering (OR logic)
- --output-format junit for CI/CD integration (JUnit XML)
- Custom personas (any non-empty string accepted)

Documentation:
- docs/guides/eval.mdx — Getting Started guide
- docs/guides/eval-scenarios.mdx — Scenario authoring reference
- docs/guides/eval-ci.mdx — CI/CD integration with GitHub Actions
- docs/reference/cli.mdx — Full eval agent CLI reference
- docs/presentations/agent-eval-benchmark.html — 10-slide HTML deck

Tests:
- 27 test classes covering public API surface
- Extensibility tests (custom dirs, tags, JUnit XML, personas)
- Scorecard, runner, audit, corpus, CLI public API tests

Closes #670, #671, #672, #673, #573

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- Reformat scorecard.py and runner.py to satisfy Black line-length rules
- Remove gaia groundtruth/report/generate/batch-experiment/create-template/visualize
  from test_gaia_cli_linux.yml — these commands were deleted in this PR
- Add gaia eval agent --help in their place
@itomek
itomek force-pushed the kalin/agent-eval-toolchain branch from 8a83640 to a84c446 Compare April 29, 2026 17:09
@github-actions

Copy link
Copy Markdown
Contributor

Summary

Major v0.18.0 cleanup that retires the legacy eval stack (~15.9k lines: eval.py, groundtruth.py, batch_experiment.py, transcript_generator.py, email_generator.py, fix_code_testbench/, webapp/, configs/, eval scripts) in favor of the scenario-based Agent Eval framework. The new shape — gaia eval agent driven by YAML scenarios scored across 7 weighted dimensions, with Claude Code as user-simulator + judge — is well-tested (11 new test classes / ~1,148 lines in tests/test_eval.py), well-documented (3 new guides + presentation), and cleanly extensible via --scenario-dir, --corpus-dir, --tag, and --output-format junit for CI. CI workflows, dependabot, setup.py, and MANIFEST.in are all updated to match. No blocking issues; two minor style nits below.

Issues

🟢 Minor

1. Mixed logging style in _load_merged_manifest — src/gaia/eval/runner.py:543-598

The new helper interleaves logger.info / logger.warning with print(..., file=sys.stderr) for exception paths. Pre-existing block at 543-546 set the precedent, but the new blocks at 571-574 and 595-598 carry it forward. For a single helper it is harmless, but having the same module emit warnings via two different channels makes it harder to silence, capture in tests, or route through GAIA's AgentConsole. Suggest standardizing on logger.warning(..., exc_info=True) so callers can configure verbosity uniformly.

        except Exception as e:
            logger.warning("Failed to load corpus manifest %s: %s", manifest_path, e, exc_info=True)

(Apply the same shape at 543-546 and 595-598.)

2. Inline imports inside write_junit_xml — src/gaia/eval/scorecard.py

import xml.etree.ElementTree as ET and import io are imported inside the function body. Both are stdlib, used unconditionally whenever the function runs, and there is no circular-import or optional-dep reason to defer them. Hoisting them to the top of the file matches the rest of scorecard.py and avoids a tiny per-call import cost when running large scenario batches with --output-format junit.

import io
import xml.etree.ElementTree as ET

(Move to the existing import block at the top of scorecard.py and drop the in-function imports.)

Strengths

  • Test coverage is genuinely thorough. 11 new test classes cover the new flags end-to-end: extra scenario/corpus dirs and override semantics (TestFindScenariosExtraDirs, TestCustomCorpusDir), tag filtering OR-logic, custom persona acceptance vs. empty-string rejection (TestCustomPersonas), JUnit XML structure (TestJunitXmlOutput), CLI flag wiring (TestEvalCLINewFlags), and public-API smoke tests for scorecard, corpus, cli, audit. Mocked-subprocess TestRunner keeps it hermetic.
  • Three new MDX guides hit the right audiences. eval.mdx (getting started + score reading), eval-scenarios.mdx (YAML schema + authoring), eval-ci.mdx (GHA + cost budgeting + JUnit) — each is distinct and docs.json groups them under "Agent Eval". docs/reference/eval.mdx is correctly marked deprecated rather than deleted, preserving deep links.
  • Extensibility is well-designed. Built-in → ~/.gaia/eval/scenarios/ → --scenario-dir (later wins) is exactly the override order users will expect, and the same shape applies for corpus dirs. Tag filtering uses set intersection (OR within --tag) which is the right default for "give me everything tagged X or Y".
  • Bare gaia eval is friendly. cli.py:3107-3111 prints a usage hint pointing at agent rather than dumping the full subparser help — gentle migration for muscle-memory gaia eval ... invocations.
  • JUnit XML is deterministic and CI-portable. Categories → testsuites, BLOCKED_BY_ARCHITECTURE/FAIL → <failure>, infra errors → <error>, SKIPPED_NO_DOCUMENT → <skipped> is the conventional mapping; reviewers/dashboards will read it correctly without bespoke parsers.
  • Cleanup is scope-clean. setup.py packages list, MANIFEST.in, dependabot.yml, and both eval/CLI workflows are all updated in the same PR — no stragglers referencing deleted paths.

Verdict

Approve with suggestions. The two items above are stylistic, non-blocking, and safe to address in a follow-up if desired. Net effect of this PR is a smaller, more focused, better-tested, and far better documented eval stack — exactly the v0.18.0 milestone shape described.

@github-actions

Copy link
Copy Markdown
Contributor

Summary

This is a substantial v0.18.0 milestone PR that replaces the legacy gaia.eval framework with a focused Agent Eval Toolchain — a YAML-scenario benchmark driven by Claude Code as both user simulator and judge. Net change is +4 064 / −15 905 lines: ~3 300 lines of eval.py plus the entire fix_code_testbench/, webapp/, batch_experiment.py, transcript_generator.py, email_generator.py, and configs/ are removed; ~1 500 lines of new MDX docs and a tighter runner.py / scorecard.py / audit.py core take their place. The CLI surface narrows to gaia eval agent with new --scenario-dir, --corpus-dir, --tag, and --output-format flags, and the docs are restructured into a three-guide story (Getting Started → Scenarios → CI). The diff is consistent, tests have been rewritten to cover the new public API, and docs/reference/eval.mdx is preserved with a deprecation <Warning> so existing readers aren't dead-ended.

I read this end-to-end against pr-files.txt / pr-diff.txt and verified the hot spots in runner.py, scorecard.py, cli.py, and the new docs against the working tree. Findings below; nothing blocking.


Issues

🟡 validate_scenario doesn't validate the tags field — silent wrong-filter risk

src/gaia/eval/runner.py:71-159 validates id, category, setup, turns, persona, ground-truth/success-criteria pairing, and turn numbering — but never inspects tags. The new tag filter on line 240-244 then does:

if tags:
    scenario_tags = set(data.get("tags", []))
    if not scenario_tags.intersection(tags):
        continue

If a scenario file has tags: smoke (a string, easy to mis-type without YAML's [...]), set("smoke") becomes {"s", "m", "o", "k", "e"} and --tag smoke returns nothing — silently. Same with tags: 42 (TypeError on iteration depending on YAML coercion). Validation should fail loudly so authors know the schema, consistent with the project's "no silent fallbacks" rule in CLAUDE.md.

    # Validate persona: must be a non-empty string.
    # The 5 built-in personas (casual_user, power_user, etc.) are documented defaults,
    # but any non-empty string is accepted to support custom persona descriptions.
    persona = data.get("persona")
    if persona is not None:
        if not isinstance(persona, str):
            errors.append(f"persona must be a string, got {type(persona).__name__}")
        elif not persona.strip():
            errors.append("persona must be a non-empty string")
        elif persona not in _KNOWN_PERSONAS:
            logger.info(
                "Scenario '%s' uses custom persona '%s' (not in built-in set: %s)",
                sid,
                persona,
                ", ".join(sorted(_KNOWN_PERSONAS)),
            )

    # Validate tags: optional, but if present must be a list of strings.
    if "tags" in data:
        tags_field = data["tags"]
        if not isinstance(tags_field, list):
            errors.append(
                f"tags must be a list of strings, got {type(tags_field).__name__} "
                "(use YAML list syntax: `tags: [smoke, regression]`)"
            )
        elif not all(isinstance(t, str) for t in tags_field):
            errors.append("tags entries must all be strings")

🟡 Breaking CLI surface change — flag in CHANGELOG / release notes

This PR deletes gaia groundtruth, gaia create-template, gaia report, gaia visualize, gaia generate, gaia batch-experiment, and gaia eval fix-code outright (CI-help-tests are correspondingly removed in .github/workflows/test_gaia_cli_linux.yml and test_eval.yml). Per the milestone (closes #672, #573, #571, #570, #569) this is intentional, and docs/reference/eval.mdx retains a deprecation block — but the breaking surface should be called out explicitly in the v0.18.0 release notes / migration section so anyone scripting against those subcommands isn't blindsided. No code change requested; just a note for the release manager.

🟢 import io placement at function bottom — scorecard.py:420

418      # Serialize to string with XML declaration
419      tree = ET.ElementTree(testsuites)
420      import io
421
422      buf = io.BytesIO()

Both xml.etree.ElementTree (line 316) and io (line 420) are imported inside write_junit_xml, with io placed after code that already references tree. Python's stdlib imports should be hoisted to the top of the module — this is a tiny readability nit but makes the function easier to reason about and consistent with the rest of scorecard.py. ET is heavier and could justifiably stay function-local for cold-import reasons; io definitely shouldn't be split from it.

    # Serialize to string with XML declaration
    tree = ET.ElementTree(testsuites)

    buf = io.BytesIO()
    tree.write(buf, encoding="utf-8", xml_declaration=True)
    return buf.getvalue().decode("utf-8")

(and add import io to the module top, alongside the other stdlib imports)

🟢 JUnit <testsuites time> is a timestamp string, not a duration — scorecard.py:335

testsuites.set("time", str(scorecard.get("timestamp", "")))

The JUnit XML schema defines time as the duration in seconds (a float). Setting it to an ISO 8601 timestamp like "2026-04-29T12:34:56Z" will either be ignored or trigger parser warnings in stricter consumers (Jenkins, GitLab, some CircleCI integrations). The per-testcase time on line 373 (f"{elapsed:.1f}") is correct. Either compute the run total elapsed time, or omit the attribute on <testsuites>.

    testsuites.set("tests", str(summary.get("total_scenarios", 0)))
    testsuites.set(
        "failures", str(summary.get("failed", 0) + summary.get("blocked", 0))
    )
    testsuites.set(
        "errors",
        str(
            summary.get("timeout", 0)
            + summary.get("budget_exceeded", 0)
            + summary.get("infra_error", 0)
            + summary.get("errored", 0)
        ),
    )
    # Sum per-scenario durations as the suite-level time (JUnit expects seconds, not a timestamp).
    total_time = sum(
        r.get("elapsed_s", 0) or 0
        for r in scorecard.get("scenarios", [])
        if isinstance(r.get("elapsed_s"), (int, float))
    )
    testsuites.set("time", f"{total_time:.1f}")

🟢 Inconsistent warning style in _load_merged_manifest

The new corpus loader prints to stderr in some paths and uses logger.warning elsewhere within the same module. Pick one (project convention is logger) so log routing / verbosity flags work uniformly. Not blocking — flag for follow-up.


Strengths

  • Documentation is excellent. The three new guides (eval.mdx quickstart, eval-scenarios.mdx schema reference, eval-ci.mdx CI integration) total ~1 500 lines, use Mintlify components (<Warning>, <Tabs>, <CardGroup>) idiomatically, and mirror docs/reference/cli.mdx's new "Agent Eval" section. The deprecation handling in the legacy docs/reference/eval.mdx is exactly right — preserved with a clear forward pointer instead of deleted.
  • Test coverage tracks the API surface. tests/test_eval.py adds 11 new test classes (TestFindScenariosExtraDirs, TestCustomPersonas, TestJunitXmlOutput, TestCustomCorpusDir, TestEvalCLINewFlags, TestScenarioLoading, TestRunner, TestScorecardPublicAPI, TestCorpusPublicAPI, TestCLIPublicAPI, TestAuditPublicAPI) replacing the dead legacy TestEvalCore/TestEvalIntegration. Each new public function has a corresponding test class.
  • Override-by-id semantics for extra_dirs are clean. Built-in → user-local → --scenario-dir chain with last-wins by ID is intuitive and well-documented in the find_scenarios docstring at runner.py:177-189.
  • Cost-conscious by design. Budget-per-scenario (--budget-usd), audit-only mode (free), and the tools/calc_eval_cost.py helper documented in eval-ci.mdx reflect real operational thinking — not just a benchmark thrown over the wall.
  • Relaxed persona validation is a real UX win. Custom persona strings now log at INFO instead of raising, with the built-in list shown in the message — exactly the right behaviour for a v0.17+ release where users want to author scenarios without forking the source.
  • Clean dependency cleanup. setup.py drops gaia.eval.fix_code_testbench, MANIFEST.in drops recursive-include src/gaia/eval/webapp, both CI workflows drop the corresponding help-tests. No orphaned references that I could find.

Verdict

Approve with suggestions. The PR is high-quality, scope-clean, well-documented, and itomek's existing approval matches my read. The findings above are minor: one validation gap worth fixing before release (🟡 tags), one release-notes call-out for the breaking CLI removal, and three small polish items (🟢 import io hoist, JUnit time attr, logger consistency). None block the milestone — they're follow-up either in this PR or a small fast-follow.

Nice work shipping a sharper, more focused eval story.

@itomek

itomek commented Apr 29, 2026 •

Copy link
Copy Markdown
Collaborator

Manual verification — (Linux Ubuntu)

Tested on branch kalin/agent-eval-toolchain @ 0ccad178 in a Linux ARM64 Docker container running Python 3.12.

Setup

git checkout kalin/agent-eval-toolchain
uv pip install -e '.[dev]'

New commands work

gaia eval agent --help          # all new flags present: --scenario-dir, --corpus-dir, --tag, --output-format
gaia eval agent --audit-only    # returns clean JSON, exit 0

Removed commands are gone

gaia groundtruth      # ✅ invalid choice
gaia report           # ✅ invalid choice
gaia batch-experiment # ✅ invalid choice
gaia create-template  # ✅ invalid choice
gaia visualize        # ✅ invalid choice
gaia generate         # ✅ invalid choice

Import smoke test

from gaia.eval.runner import AgentEvalRunner
from gaia.eval.scorecard import build_scorecard
# ok

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Apr 29, 2026
Merged via the queue into main with commit 99bea52 Apr 29, 2026
44 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the kalin/agent-eval-toolchain branch April 29, 2026 19:51
@github-actions github-actions Bot mentioned this pull request May 1, 2026
2 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents cli CLI changes dependencies Dependency updates devops DevOps/infrastructure changes documentation Documentation changes eval Evaluation framework changes performance Performance-critical changes tests Test changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent Eval: Documentation for third-party users — scenario authoring, custom scoring, CI/CD integration

3 participants