Skip to content

test(eval): validate every flagship capability at four tiers - #4472

Merged
kovtcharov-amd merged 18 commits into
amd:mainfrom
kovtcharov:kalin/eval-capability-tiers
Oct 5, 2026
Merged

kovtcharov-amd merged 18 commits into
amd:mainfrom
kovtcharov:kalin/eval-capability-tiers

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

The flagship's own evals tested most capabilities with a handful of untiered scenarios, and git work and unexpected situations (a signed-out CLI, a missing tool, a denied command) not at all. A capability could regress under stress, or under an adversarial user, without any eval noticing. Now every gaia_* category is tested at four levels: basic, compound, stress, and adversarial. Each adversarial scenario is tagged security (injection, exfiltration, sandbox escape) or usability (typos, ambiguity, mind changes, missing data), and every answer is a planted value the judge can check.

Note

The new scenarios load, their fixtures are tested, and the suite passes. They have not yet been judged against a real agent run: the judge CLI is not signed in on the Strix Halo eval box. That run is the open test-plan item below; if it shows a broken scenario, the fix lands here before merge.

  • Coverage:
    • every category has ≥2 scenarios per tier;
    • two new categories: gaia_git (history, blame, conflicts, a regression hunt, hooks and leaked secrets) and gaia_resilience, which measures feat(agent): stop, ask and remember when a tool reports a blocker the agent can't fix #4428 (detect a blocker, bound the workarounds, escalate precisely) with counter-scenarios that fail on over-asking;
    • four mechanically graded git/coding outcome tasks join the full suite, each with a reference solution and rejected shortcuts.
  • Wiring: staging builds the git workspaces a commit can't carry; lanes are rebalanced to 34 CI-runnable scenarios or fewer; the PR subset keeps gaia_shell's security scenarios.
  • Fixtures use fake credentials only. Push protection blocked a fake Stripe-format key, and it was replaced with an obviously fake value. The remaining ghp_…GAIAEVAL… strings are deliberately token-shaped (scenarios test that the agent won't leak them) and fail GitHub's token checksum.

Test plan

  • pytest tests/unit/eval tests/test_eval.py tests/unit/test_gaia_eval_fixtures.py → 1281 passed, 27 skipped (this branch).
  • Every new YAML loads via find_scenarios(); fixture pins (commit hashes, planted totals, page numbers) asserted by test_tiers_git_code_fixtures.py, test_tiers_skills_web_fixtures.py and the fixture generators.
  • Outcome tasks: the grader fails the untouched fixture, passes a hand-applied solution and rejects 13 shortcut solutions.
  • python util/lint.py --black --isort.
  • gaia eval agent --category <c> for every gaia_* category on DeepSeek V4.1 Flash via Fireworks, serially; fix or drop scenarios whose failure is the scenario's fault.

@github-actions github-actions Bot added documentation Documentation changes devops DevOps/infrastructure changes cli CLI changes eval Evaluation framework changes tests Test changes performance Performance-critical changes labels Sep 29, 2026
@kovtcharov
kovtcharov marked this pull request as ready for review September 29, 2026 16:28
@kovtcharov
kovtcharov force-pushed the kalin/eval-capability-tiers branch from d00737f to 313f043 Compare September 29, 2026 17:02
pull Bot pushed a commit to bhardwajRahul/gaia that referenced this pull request Sep 29, 2026
No eval measured how GAIA talks, so long, jargon-heavy answers with
"Verification:" footers passed every category. `gaia_voice` scores the
voice itself: everyday questions answered briefly in plain English,
"why?" and "tell me more" answered with more depth, and stated style
preferences ("keep it short", "bullet points", "give me the technical
details") kept on later turns and in a new session. This gives amd#4484's
prompt work a before/after number.

- **Coverage:** 12 scenarios, at least two per tier. t1: short, plain
everyday answers. t2: follow-ups get deeper and more technical. t3: a
preference is stored, then applied on later turns and in a fresh
session. t4 (tagged `usability`): a changed preference wins over the old
one, a clearly technical user and a clearly non-technical one each get
answers at their level, and the agent holds up under pressure to
over-explain.
- **Criteria the judge can check:** sentence and word caps, banned tool
names and footer labels, required terms, and explicit FAIL conditions.
- **Wiring:** the `gaia-code` lane runs it, bringing that lane to 33
CI-runnable scenarios. Memory is cleared before each scenario and again
after the ones that store a preference, so a stored "two sentences max"
can't leak into later scenarios.

> [!NOTE]
> These scenarios haven't been judged against a real agent run yet. On
the authoring machine, two other eval backends were using the shared
Lemonade, and `memory_clear(scope=all)` would have wiped the
machine-wide memory store. The last Test plan item covers that run.

<details>
<summary>🔍 Technical details</summary>

- Tagging follows amd#4472: `t1_basic`…`t4_adversarial`, `usability` on t4,
and the "SIMULATOR ACTION BEFORE THIS TURN: create a NEW session" and
`setup.memory_seed` conventions. If amd#4472 merges first, the conflicts
are in `ci_lanes.json` (lane rebalance) and the `known_tags` set in
`tests/test_eval.py`.
- `CAPABILITY_MATRIX.md` is regenerated, and its category pin is updated
with it.
- `test_gaia_agent_eval.yml` and `gaia_scorecard_refresh.yml` still list
13 categories by default. They aren't changed here, because nothing has
scored `gaia_voice` yet.
</details>

## Test plan
- [x] `pytest tests/unit/eval tests/test_eval.py
hub/agents/gaia/python/tests/test_capability_matrix.py`: 1211 passed, 27
skipped
- [x] All 12 load through `find_scenarios(category="gaia_voice")` (t1
×2, t2 ×3, t3 ×3, t4 ×4)
- [ ] `gaia eval agent --category gaia_voice` on a dedicated backend
(`GAIA_MEMORY_ADMIN=1`, fixtures staged); fix any scenario whose failure
is the scenario's fault

Refs amd#4484
@kovtcharov
kovtcharov force-pushed the kalin/eval-capability-tiers branch from 81d0b8c to 32228e6 Compare September 29, 2026 20:56
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

Four-tier coverage for every flagship capability is a real gain. Git work and "something unexpected broke" situations were untested before, and now each has its own category, with answers the judge checks against planted values. The new code is careful: the git setups ignore the machine's git config, the fixture hub rejects contradictory --unsigned/--tampered flags, and the HTTP error routes are exact-match only. I found no correctness or security problems.

🟡 Merge only after the judged run. About 130 new scenarios have loaded and passed the unit tests, but none has been scored against a real agent yet. Until that run happens, a badly written scenario will look like an agent regression in the nightly lanes. The PR already tracks this as its one open test-plan item. Tick it, or drop the broken scenarios, before merging.

🟢 Stray duplicate import in an existing task's workspace. Adding import os at the top of the task-setup module also inserted a second import os into the CACHE template. That template is the code the agent works on in the existing flaky-cache task, so the task now shows the agent a lint wart it never used to have. It could change how the agent behaves on that task.

🟢 Confusing staging error when $HOME is itself a git repo. The resilience fixture builder refuses to run inside any git repository, and its error tells the user to "build into the staged copy, not the checkout". A developer who keeps dotfiles in a git repo at ~ gets that message while already building into the staged copy. The message should say that any enclosing repository blocks the build.

🔍 Technical details
  • src/gaia/eval/task_setups.py:44-49: CACHE now reads import hashlib / import os / import json / import os. Remove the added line; the original template already imported os after json.
    CACHE = '''"""Tiny on-disk cache for parsed timestamps."""
    import hashlib
    import json
    import os
    
  • tests/fixtures/gaia/tiers_resilience/build_fixtures.py, in build(): the check rev-parse --show-toplevel on dest fires for any enclosing repo, including ~/.git. Put the toplevel it found into the error text so the cause is obvious. tiers_git_code/build_fixtures.py has no such check, so the two builders behave differently.
  • I checked the .gitignore negation: git check-ignore confirms downloads/atlas-companion-setup.exe is no longer ignored, and the file is tracked.
  • Lane rename (gaia-tools → gaia-repo/gaia-files/gaia-docs/gaia-skills): nothing hardcodes the old lane names. eval_flagship.yml reads eval/ci_lanes.json, and test_ci_lanes.py guards against orphaned categories.
  • I could not run the tests myself because this runner has no pytest. The author's test-plan numbers are unverified here.

@kovtcharov
kovtcharov force-pushed the kalin/eval-capability-tiers branch from 32228e6 to 692169a Compare September 29, 2026 23:00
kovtcharov and others added 4 commits October 1, 2026 13:11
Most gaia_* categories had a handful of untiered scenarios, and git and
unexpected-situation handling had none. Every category now carries at least two
scenarios per tier (basic, compound, stress, adversarial), each adversarial one
tagged security or usability, with planted fixtures recorded in
GAIA_FIXTURE_VALUES.md. New categories: gaia_git and gaia_resilience. Four
mechanically graded git/coding outcome tasks join the full suite.

Staging builds the git workspaces a commit cannot carry, lanes are rebalanced to
34 scenarios or fewer, and the PR subset keeps gaia_shell's security scenarios.
… matrix

The repo-wide downloads/ ignore rule kept the plain-text installer fixture out of
git, so its route 404'd on CI. The capability matrix now lists gaia_git and
gaia_resilience.
The CACHE task-setup template picked up a stray second `import os` from
the same find-replace that added the real one to the module's own
imports, giving the flaky-cache outcome task a lint wart it never had.

The tiers_resilience fixture builder's "inside a git repository" error
only named the checkout as the cause, so a developer with a dotfiles
repo at $HOME saw it even while pointed at the correct staged copy.
@kovtcharov-amd
kovtcharov-amd force-pushed the kalin/eval-capability-tiers branch from 692169a to 0738914 Compare October 1, 2026 20:55
kovtcharov and others added 10 commits October 1, 2026 22:53
A developer with a dotfiles repo at $HOME was told the staged copy was
inside "a git repository" without being told which, while already
building into the staged copy. The refusal now names the repository it
found, and a test covers both the refusal and the blank-identity build.
# Conflicts:
#	tests/fixtures/gaia/fake_gh/gh.py
#	tests/fixtures/gaia/stage_eval_env.py
#	tests/unit/eval/test_stage_eval_env.py
test_every_ci_lane_resolves named gaia-tools, which this PR splits into gaia-repo/gaia-files/gaia-docs/gaia-skills, so it failed with 'No lane named gaia-tools'. Reading the lane names from the file keeps it valid through any later split or rename.
@kovtcharov
kovtcharov marked this pull request as draft October 5, 2026 04:40
@kovtcharov
kovtcharov marked this pull request as ready for review October 5, 2026 04:40
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Verdict: Request changes

This PR roughly doubles the flagship's judged scenarios, adds two new categories (git work, and recovering from blocked situations), and adds the fixtures behind them: a fake gh that can be signed out, web pages that return 429/503, a tampered hub skill, and git workspaces built at staging time. The fixture code is careful and fails loudly. The blocker is CI: the next nightly will fail two whole lanes, because the new categories have no committed baseline and the nightly preflight stops a lane outright when any of its categories lacks one.

  • Two lanes will go red before measuring anything. The nightly needs a baseline file for every category in a lane. gaia_git and gaia_resilience have none, and none can exist until they run once, so the gaia-repo and gaia-files lanes stop at preflight. gaia_code and gaia_files share those lanes, so they stop being measured too. Make the preflight warn and skip the comparison for a category with no baseline yet (it already does this when the whole baseline folder is missing, unless enforce is on).
  • The new scenarios haven't run against an agent yet. The PR already says this; it is the open test-plan item. With ~130 new scenarios, a broken scenario would show up as a drop in agent quality, so run it before merge.
  • The new fixture behaviours have no tests. Nothing tests the signed-out gh host, the 429/503 routes, or the tampered skill failing signature checks. If one of these quietly stops working, the scenarios built on it will score a correct agent as wrong.

Real-world evidence

N/A — no evidence-bundle.md (eval scenarios, fixtures and CI config only; judged runs need the Strix Halo lane). The verdict rests on static review, plus two checks I ran by hand here:

$ python gh.py issue list --repo ghe.acme-labs.example/acme/x
To get started with GitHub CLI, please run:  gh auth login --hostname ghe.acme-labs.example
Alternatively, populate the GH_ENTERPRISE_TOKEN environment variable with a GitHub API authentication token.
exit=4
$ python gh.py auth status --json hosts --hostname ghe.acme-labs.example   → {"hosts": {}}  exit=0
$ curl -D - http://127.0.0.1:8799/resilience/rate_limited.html  → HTTP/1.0 429, Retry-After: 3600
$ curl -D - http://127.0.0.1:8799/resilience/summit_tent.html?x=1 → HTTP/1.0 503, Retry-After: 120

I couldn't run pytest here (the runner has no test environment), so the PR's own test results are the only test evidence.

🔍 Technical details

🟡 Nightly preflight hard-fails gaia-repo and gaia-files (eval/ci_lanes.json:108-114)
eval_flagship.yml:982-989 loops over the lane's EVAL_CATEGORIES. If $BASELINE_DIR exists and scorecard_<category>.json is missing, it hits exit 1, whatever ENFORCE is set to. tests/fixtures/eval_baselines/gaia-flagship/ has no scorecard_gaia_git.json or scorecard_gaia_resilience.json, and CLAUDE.md forbids hand-authoring them. Options:

  • In the per-category loop, mirror the missing-directory branch: ::warning:: plus a step-summary line ("not compared: no baseline yet") when ENFORCE -ne 'true', and keep exit 1 under enforce. The new categories then run, and their first nightly scorecards become the baseline.
  • Or keep the two categories in their own lanes, so at least gaia_code and gaia_files keep being measured. This still leaves two red lanes.

Also check that the integrity gate and the compare step further down tolerate a missing per-category baseline.

🟡 Missing tests for new fixture logic

  • tests/fixtures/gaia/fake_gh/gh.py:536-604: needs tests for _target_host (--repo HOST/O/R, --hostname=, GH_HOST), exit 4 for the signed-out host, auth status --json hosts returning {}, and FAKE_GH_AUTH=logged_out / a bad value. tests/unit/test_gaia_eval_fixtures.py already has a _gh() helper that fits this.
  • serve_fixtures.py:815-853: nothing tests STATUS_ROUTES, and test_routed_layout_matches_the_scenario_urls is the natural place for it. Assert 429 + Retry-After: 3600 and 503 for the three paths, including a request with a query string.
  • prepare_fixture_hub.py:145-147: test_prepared_hub_signs_per_the_contract never checks tampered-notes. Tampering only breaks the signature while SKILL.md stays in file_digests. Pin that:
    assert summaries["experimental-notes"]["signed"] is False
    assert summaries["tampered-notes"]["signed"] is True
    assert summaries["tampered-notes"]["tampered"] is True

Ideally also unzip the tampered artifact and assert gaia.skills.signing.verify_bundle(...) raises SkillSignatureError.

🟢 "Every gaia_* category is tested at four levels" overstates coverage (PR description)
gaia_mcp (3 scenarios) and gaia_media (2) have no t1–t4 tags. Reword the claim, or tier those two.

🟢 PR subset now skips part of gaia_shell
Before, PRs ran all of gaia_shell. Now they run t1, t2 and security-tagged only, so its t3_stress and non-security t4 scenarios run only in the nightly (test_gaia_agent_eval.yml:497). Probably intended to keep PR runs cheap. The workflow comment says so, but the PR description doesn't.

Note: src/gaia/eval/task_setups.py:439 (HOSTILE_NOTE) and several fixtures contain text that tells AI assistants to leak config or delete tests. These are deliberate adversarial fixtures, and I treated them as data.

Strengths

  • The fixture tooling fails loudly throughout: an unknown FAKE_GH_AUTH mode, a malformed auth file, --unsigned/--tampered overlap, a missing git, and an enclosing git repo all raise errors that say how to fix them.
  • _git_repo isolates git from machine config (GIT_CONFIG_NOSYSTEM, GIT_CONFIG_GLOBAL=devnull, fixed identity, --template=). That keeps the git workspaces reproducible across runners.
  • test_every_ci_lane_resolves now reads ci_lanes.json, so renaming or splitting a lane can't leave the test checking stale lane names.

…ot failed

The nightly preflight stopped a whole lane when one of its categories had
no committed scorecard, so the new gaia_git and gaia_resilience categories
would have blocked gaia_code and gaia_files too. Without enforce the
category now runs, is flagged as not compared, and its scorecard becomes the
baseline candidate; enforce=true still refuses.

Also tests the signed-out fake gh host and the 429/503 fixture routes.
@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Oct 5, 2026
Merged via the queue into amd:main with commit cea8a86 Oct 5, 2026
@kovtcharov-amd
kovtcharov-amd deleted the kalin/eval-capability-tiers branch October 5, 2026 18:49
kovtcharov added a commit to kovtcharov/gaia that referenced this pull request Oct 5, 2026
…#4759)

The required Windows unit job times out on
`test_restaging_replaces_built_repositories`, which turns it red on PRs
that have nothing to do with it (amd#4460's run is the first; any PR
updated onto main since amd#4472 can hit it). Staging the eval fixtures
takes about 28 seconds on the Windows runner now that it builds the tier
repositories, and that test staged twice, landing on the 60-second
per-test limit; its neighbour passed at 55 seconds.

The file staged the whole environment six times. It now stages once for
the read-only checks and once more for a single re-staging test that
covers both read-only files and built repositories, so no test comes
near the limit and the file is about two minutes faster on Windows.

## Test plan
- [x] `pytest tests/unit/eval/test_stage_eval_env.py` passes (7 tests;
the POSIX-only fake-`gh` test still runs)
- [ ] `Unit Tests (Windows, py3.12)` passes on this PR without a timeout
in this file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI changes 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.

2 participants