Skip to content

feat(gaia): eval corpus, tracked scorecard CI, and skill capture - #3074

Merged
kovtcharov-amd merged 61 commits into
amd:mainfrom
kovtcharov:gaia-eval-integration
Sep 23, 2026
Merged

kovtcharov-amd merged 61 commits into
amd:mainfrom
kovtcharov:gaia-eval-integration

Conversation

@kovtcharov

@kovtcharov kovtcharov commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Ready for review. Rebased onto current main; every finding from the automated review and the author's own open list is closed (rundown at the bottom).

The flagship agent shipped with no behavioural test coverage and no quality number: release_agent_gaia.yml published with neither an eval nor a scorecard, while the email agent gated on four. Running the corpus in this branch against the live agent found five real defects, two of which made the entire skill system unusable on Claude — a skill would load, and every following turn failed. After this the agent has a 103-scenario judged corpus across 13 capability categories, a per-commit SCORECARD.md wired into publish.needs, and users can bring a skill in from pasted text, a URL, or a folder.

Threads a reviewer should weigh separately

  • Defects the eval surfaced, now fixed. Skill-namespaced tool names 400'd the Anthropic API; hyphenated skill tools were undispatchable; a sanitized name could silently shadow a builtin and misroute the call; /clear left the agent's history intact so "cleared" context kept riding into later prompts; the web tool blocked its own loopback fixtures.
  • The corpus and harness. Memory and conversation escalate through four tiers to genuinely adversarial (false-premise pushback, contradiction injection, prompt-injection stored through memory). 150 of 349 turns require the judge to verify agent_tools[] shows the real call — that anti-fabrication rule is what caught the skill-tool bugs, since a confident answer with zero working tools fails it.
  • Tracked score. gen_scorecard.py → SCORECARD.md (aggregate = judged_pass_rate), per-run CSV export for spreadsheet analysis, and --iterations — a flag that shipped declared but unwired, silently running once — now really repeats scenarios and reports stable-pass | flaky | stable-fail.
  • Skill capture, code inert until trusted. capture_skill takes pasted SKILL.md, a URL, or a folder; it audits (a BLOCK refuses), lands at experimental, and is confirmation-gated. Instructions load immediately; any tools.py/scripts stay inert until gaia skill promote re-audits in a terminal, and binary grants are withheld for the same reason — so pointing the agent at a folder never silently runs third-party code.

State this honestly

No Gemma baseline exists yet. Every number was measured with the agent on Claude Haiku because the dev machine cannot run Lemonade; the committed card self-labels HARNESS-VALIDATION in recipe.environment.note (aggregate 72.73 over gaia_core only, 11 of 103 scenarios). The product baseline is Gemma-4-E4B and is minted by the first gaia_scorecard_refresh.yml dispatch on the self-hosted runner. The quality gate nonetheless ships enforce: true at deliberately loose absolute floors (judged pass rate ≥ 0.60, avg score ≥ 5.0), so a breach blocks; the perf sibling stays report-only because there is no measured basis for a perf bar yet. Expect the quality bars to be retuned against the first Gemma run rather than assumed correct. cache_hit_ratio is likewise reported not measured: Lemonade exposes no cache counter, so there is no source on the product path.

44 scenarios have never executed — memory, RAG, code index, dynamic tool selection all need the embedder.

Review findings — all closed

The automated review raised ten; the author's own list had four more.

  • The judged capture scenarios never ran. gaia_skills_capture was missing from every category list, so the most security-sensitive surface shipped with judged coverage that nothing invoked. All 13 categories now run, including in the release gate.
  • The gate said "report-only" while enforcing. The manifest ships enforce: true; the docs page, the release step and the job-summary footer all said otherwise. The footer is now derived from the gates instead of hardcoded — Two further copies of the same stale claim — a capability-matrix test and test_gaia_eval_fixtures.py, both asserting every suite is report-only — turned up and now pin each suite separately.
  • 🔒 GAIA_WEB_ALLOWED_HOSTS turned off more than loopback. It returned before parsing the address, which disabled the connect-time rebind pin for a named host. It is now loopback-only — deliberately not "loopback or private", because is_private covers 169.254.0.0/16, so a private carve-out would have handed the cloud metadata endpoint to any allowlisted name. Three negative tests cover what previously had none.
  • The version regression and the stray 1 file were artifacts of the two Merge upstream/main commits. The rebase drops both, and the two deleted changelog entries are back.
  • Minor: --exclude-tag is documented, the dead .gitattributes zip rule is gone, the self-contradicting capability matrix is regenerated, and the Anthropic tool-name map moved off the provider instance onto the call.
  • The author's four — per-attempt traces, the symlinked-bundle audit, the scripts/ inert claim, hardcoded launcher paths — were closed in 57bbc50.

One fix beyond the review: the scorecard-refresh workflow interpolated a branch name straight into a shell; it now goes through the environment.

Test plan

  • pytest tests/unit/eval/ tests/unit/test_skill_capture.py tests/unit/test_capture_security_regressions.py hub/agents/gaia/python/tests/ tests/test_eval.py — 1,181 pass (782 core + 399 hub)
  • python util/lint.py --black --isort clean
  • capability_matrix.py --check clean (68 tools, drift-guarded across manifest / registration / AST)
  • Scorecard round-trip on a real run → scorecard_gate passes first-adoption
  • All review findings closed; actionlint clean on every changed workflow
  • Needs the runner: dispatch test_gaia_agent_eval.yml to mint the Gemma baseline and exercise the 44 embedder-blocked scenarios

@github-actions github-actions Bot added documentation Documentation changes devops DevOps/infrastructure changes chat Chat SDK changes mcp MCP integration changes llm LLM backend changes cli CLI changes eval Evaluation framework changes tests Test changes performance Performance-critical changes agents tui Go terminal UI (gaia-tui) sidecar Agent sidecar contract / harness labels Aug 25, 2026
@kovtcharov
kovtcharov marked this pull request as ready for review August 26, 2026 22:31
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Request changes

This PR lands the flagship agent's judged eval corpus (~100 scenarios across 13 categories, deterministic fixtures, CI + release gates) and a new capture_skill tool that pulls a skill in from pasted text, a URL, or a folder with its code kept inert until a human promotes it in a terminal. The capture design is the strongest part of the change — instructions and executable code are separated cleanly, and trust is bound to audited bytes.

Four things should be fixed before merge:

  1. A stray file named 1 is committed at the repo root. It's two lines of turn-telemetry JSON, almost certainly a shell redirect that got caught by git add. Delete it.
  2. The agent package's version goes backwards, and two changelog entries disappear. Relative to the base branch this drops the flagship agent from 0.1.1 to 0.1.0 and deletes the "Added" notes for per-turn tool selection and the bundled voice skill. That reads like a bad merge resolution rather than a decision. If the renumber is deliberate (0.1.1 was never published), please say so in the PR — but the two deleted entries still need to come back.
  3. The new capture scenarios never actually run. The PR adds four judged scenarios for capture_skill, but every default category list in CI, the release gate, and the reproduction recipe covers only the other twelve categories. So the most security-sensitive new surface ships with judged coverage that nothing invokes — while the scorecard still counts those scenarios in its advertised corpus size.
  4. The quality gate is switched on, but four places tell readers it's off. The thresholds file deliberately ships enforcing at a 0.60 floor; the docs page, the release workflow's own step message, and the CI job summary all still say "report-only". The job summary is the one a reviewer actually reads, so a blocking gate currently announces itself as advisory.

🔒 SECURITY CONCERN: the new GAIA_WEB_ALLOWED_HOSTS opt-in turns off more of the outbound-fetch address check than its own docstring and tests claim — it bypasses the whole check for a named host rather than just permitting loopback. It is default-off and operator-opt-in, so this is a hardening gap rather than a live vulnerability, but the guard should be narrowed to match what it says it does. @kovtcharov-amd for visibility.

Real-world evidence

N/A — no evidence-bundle.md was produced for this run, and the review environment had no shell access, so I could not read the PR description or exercise any surface. This verdict rests on static review alone. The change touches CLI (gaia skill promote, gaia eval agent --exclude-tag) and the agent tool surface (capture_skill), so real gaia skill promote / capture_skill output on the PR would be the matching evidence — the capture-from-URL and BLOCK-refusal paths especially, since those are the ones a reader cannot verify from the diff. The rubric was available and applied.

🔍 Technical details

🔴 Critical

Agent package version regresses 0.1.1 → 0.1.0 (hub/agents/gaia/python/gaia-agent.yaml:3, hub/agents/gaia/python/gaia_agent/__init__.py:12, hub/agents/gaia/npm/CHANGELOG.md:7)

The diff against the base branch shows -version: 0.1.1 / +version: 0.1.0 in the manifest and __version__, the changelog heading renamed [0.1.1] — unreleased → [0.1.0] — unreleased, and two ### Added entries deleted:

  • "Per-turn tool selection, now on by default for the flagship full profile"
  • "One bundled skill ships enabled: gaia-voice"

Neither deletion is explained by a renumber. The branch carries two Merge upstream/main commits, which is the usual source of this shape. release_agent_gaia.yml gates on agent-pkg-gaia-* tag comparison, so a lowered version also breaks the --baseline-ref regression check's assumption about tag ordering.

If 0.1.1 was never published and the renumber is intentional, restore the two changelog entries under [0.1.0] and note the renumber in the PR body.

🟡 Important

Stray 1 file committed at repo root (1:1)

Two lines of gaia.turn/1 telemetry JSON. Not referenced by anything; git rm 1.

gaia_skills_capture is excluded from every default eval profile

The PR adds eval/scenarios/gaia_skills_capture/{capture_block_refused,capture_folder_tools_inert,capture_from_url,capture_paste_load_use}.yaml, but the category is absent from:

  • .github/workflows/test_gaia_agent_eval.yml:768 — EVAL_CATEGORIES default (12 categories)
  • .github/workflows/gaia_scorecard_refresh.yml:105 — same 12, and only a FULL run may commit a card
  • hub/agents/gaia/python/packaging/gen_scorecard.py:10805 — the for c in … reproduction recipe
  • .github/workflows/release_agent_gaia.yml:546 — the release subset

hub/agents/gaia/CAPABILITY_MATRIX.md lists 13 judged categories including gaia_skills_capture, so the generated matrix and the workflow defaults already disagree.

There is a second-order effect: gen_scorecard.py:10937 computes dataset_size from eval/scenarios/gaia_*/*.yaml, which globs all 13 categories. The published card therefore advertises a corpus that includes four scenarios the run never executed.

  EVAL_CATEGORIES: ${{ inputs.categories || 'gaia_core,gaia_shell,gaia_tool_selection,gaia_honesty,gaia_web,gaia_files,gaia_data,gaia_code,gaia_rag,gaia_memory,gaia_skills_lifecycle,gaia_skills_tasks,gaia_skills_capture' }}

(apply the same in gaia_scorecard_refresh.yml, gen_scorecard.py's recipe, and update the "12 categories" prose in docs/reference/eval-scorecard.mdx, CHANGELOG.md, and the --checked matrix).

enforce: true contradicted in four places

tests/fixtures/gaia/quality_gate_thresholds.json:5 ships "enforce": true with min_judged_pass_rate: 0.6 — deliberate per its own _comment. Still claiming otherwise:

  • docs/reference/eval-scorecard.mdx:1550 — "both ship enforce: false until the first self-hosted-runner baseline calibrates them"
  • hub/agents/gaia/python/packaging/eval_summary.py:10360 (module docstring) and :10519 (the rendered $GITHUB_STEP_SUMMARY footer) — "All of them currently ship enforce: false, so a breach is reported, not blocking"
  • .github/workflows/release_agent_gaia.yml:508 — "With enforce:false (the current state, pending the first runner baseline)"

The eval_summary.py footer is the worst of the four: it is the text a reviewer reads in the job summary, and it will tell them a gate that just hard-failed the release was advisory. Since the reporter already reads each gate's own enforce key in _verdict(), derive the footer from the gates rather than hardcoding it.

Worth confirming separately: with enforce: true and no Gemma baseline yet, release_agent_gaia.yml's scorecard-gate will pass --min-aggregate 60.0 on the first release that runs it, and publish now needs: a self-hosted gaia-eval job. That is a real change to release blast radius even if it's the intent.

🔒 GAIA_WEB_ALLOWED_HOSTS bypasses more than loopback (src/gaia/web/client.py:77, :363)

_assert_ip_allowed returns before parsing the address at all, so for an allowlisted host neither _is_blocked_ip nor the unparseable-address guard runs. The docstring says it "only ever permits loopback/private for a host the operator named", and TestLoopbackAllowlist's docstring repeats that claim — but no test covers it, because the code doesn't do it. With a literal 127.0.0.1 entry (the eval's usage) this is inert; with a hostname entry the connect-time rebind pin is fully disabled for that name, including link-local ranges.

Narrow the bypass so it means what it says:

    try:
        ip = ipaddress.ip_address(ip_str)
    except ValueError:
        # Not parseable as an IP — treat as unsafe rather than letting an
        # unvalidated value reach the socket layer (fail loudly).
        raise ValueError(
            f"Blocked: {hostname} resolved to unparseable address {ip_str!r}."
        )
    # Opt-in test affordance: loopback/private ONLY, for a host the operator named.
    if hostname in _loopback_allowed_hosts() and (ip.is_loopback or ip.is_private):
        return
    if _is_blocked_ip(ip):

and mirror it in WebClient._validate_host_ip. Add the missing negative test (allowlisted host resolving outside loopback/private stays blocked).

🟢 Minor

  • --exclude-tag is undocumented (src/gaia/cli.py:2142). CLAUDE.md requires new CLI flags to land in docs/reference/cli.mdx; gaia skill promote was added there, this one wasn't. No match for exclude-tag anywhere under docs/.
  • Committed eval run outputs contradict this PR's own .gitignore (eval/results/code-gemma4/{report.md,results.json,scorecard.json}). .gitignore:1422 states "Eval RUN OUTPUTS are reproducible artifacts, never PR content" while ignoring two sibling result dirs — but code-gemma4/ is added.
  • CAPABILITY_MATRIX.md contradicts itself. Line 7846 says "No judged eval suite is wired yet" while line 7821 reports quality: enforce=True and lines 7823–7836 list 13 judged categories. Since test_gaia_agent.yml now --checks this file byte-for-byte, the stale prose is pinned in place until the generator's template is updated.
  • .gitattributes zip rule matches nothing (.gitattributes:13). tests/fixtures/gaia/fixture_hub/**/*.zip binary — the bundles are built into fixture_hub/_prepared/, which .gitignore:1419 excludes, so no zip is ever tracked.
  • ClaudeProvider._tool_name_map is per-instance mutable state (src/gaia/llm/providers/claude.py:12750). _to_anthropic_tools rebuilds it on each request and _restore_tool_name reads it during response/stream handling. If one provider instance ever serves two concurrent requests with different tool sets, the second request's map can rewrite names for the first. Scoping the map to the call (returned alongside the converted tools) would remove the sharp edge. The collision raise itself is a good call.

Strengths

  • The capture trust model is carefully built, not bolted on. Separating "instructions reach the prompt" from "code reaches the process" is the right axis, and the follow-through is consistent: binary grants are withheld alongside tool registration (agent.py:12149), capture_skill is made deliberately ungrantable with the reasoning recorded (tool_grants.py:12190), trust is digest-bound so an edit re-defers (capture.py:13362), a failed re-promote revokes prior trust, and _grants_a_binary fails closed on an unresolvable policy. The symlink refusal (capture.py:13190) closes a genuinely non-obvious hole — the audit walk skips links but copytree dereferences them.
  • payload["code_inert"] refuses to oversell itself. Calling out that a bundled scripts/ directory is on disk and not execution-gated, rather than shipping a blanket "inert", is exactly the honesty the repo's fail-loudly rule is after.
  • Two real bugs fixed with the right shape. The hyphenated skill-tool dispatch fix (agent.py:12176) tries the exact name before normalizing — correct, since _tools_registry includes instance-registered skill tools — and the Anthropic tool-name sanitizer raises on a collision instead of silently misrouting a call to a shadowing skill tool.
  • summarize_attempts gets the iteration mechanics right. Per-attempt trace files (<sid>.attempt<n>.json) with the summarized result written to <sid>.json means resume reloads the summary, not one arbitrary attempt — and the worst-judged-attempt representative keeps a flaky scenario from reporting as a clean pass.

kovtcharov-amd pushed a commit that referenced this pull request Aug 28, 2026
Loading any tool-bearing skill broke the agent on Claude, in two
independent ways. Skills register their tools namespaced as
`<skill>/<tool>` (e.g. `rss-digest/fetch_rss`), and both the outbound
request and the inbound dispatch choked on that name.

The Anthropic API rejects `/` in a tool name (`Tool.name` must match
`^[a-zA-Z0-9_-]{1,128}$`), so every turn after a skill loaded 400'd.
Lemonade tolerated the slash, which is why nothing caught it. Names are
now sanitized outbound and restored on returned tool_use blocks. Every
outbound name is registered in the restore map, identity included —
registering only the rewritten ones cannot see the collision that
actually misroutes a call, where a skill's `write/file` sanitizes onto
the builtin `write_file`. A collision raises, naming both sides.

Separately, `_execute_tool` replaced `-` with `_` before the registry
lookup on the assumption that tool names are always snake_case, so every
hyphenated skill's tools answered "Unknown tool name" even when the model
named them correctly. The exact registered name now resolves first; the
hyphen normalization still rescues a genuine snake_case typo.

Extracted from #3074.

@kovtcharov-amd kovtcharov-amd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking on the review above: four items are still open, including a stray file committed at the repo root and the agent package version going backwards with two changelog entries deleted. The branch has since also picked up merge conflicts and is failing lint plus unit tests on all three Python versions.

Marking this formally so the PR stops reading as ready to merge — CI going green doesn't clear an open review request. Push the fix and re-request review.

Ovtcharov added 10 commits September 8, 2026 11:12
…rix, SSE sequence baselines

The flagship gaia agent shipped with zero eval coverage and three doc claims
that no longer matched the code. This lands the no-LLM tier (phase 1 of the
flagship eval plan), all verifiable in hosted CI:

- tests/test_binary_gate.py: the 13 gh permission-gate cases from
  util/tui_driver.py promoted to pytest, plus a pytest-policy suite.
  Every REFUSE case additionally asserts it never classifies as CONFIRM —
  an escalation landing behind a habit-click prompt is the named bug class —
  and validate_invocation is pinned to fail closed for two-tier callers.
- packaging/capability_matrix.py + committed CAPABILITY_MATRIX.md +
  tests/test_capability_matrix.py: code-derived surface inventory (67
  registered tools from the FULL_CORE_TOOLS/FULL_BUNDLES AST union,
  reconciled against gaia-agent.yaml and build_gaia(); 3 REST functional
  verbs parsed from server.py; eval coverage honestly empty with the
  'no quality eval (contract-tested only)' sentinel). Same --check idiom
  as the email agent's; packaging/ stays __init__-free so it never ships
  in the frozen binary. test_gaia_agent.yml gains the --check step.
- eval_baselines/query_sequences/{plain_answer,tool_query,
  write_needs_confirmation}.json: committed SSE event-shape pins for the
  /query contract, consumed by tests/integration/eval/test_sidecar_eval_gaia.py
  (opt-in via GAIA_SIDECAR_EVAL_LIVE=1 on the self-hosted runner;
  collected-but-skipped everywhere else).
- npm doc drift fixed everywhere it repeats: SPEC §5.4 / SKILL gotcha /
  CHANGELOG now describe the implemented per-session caller-auth bearer
  (the daemon delivers it; gaia serve is the unauthenticated dev posture);
  SKILL §10 now says gaia-voice ships always-on (task sets stay opt-in);
  '55 tools' corrected to 67, and the confirmation-gated set to five
  (install_skill/remove_skill included).

Verified: pytest hub/agents/gaia/python/tests/ (267 passed), capability
matrix --check exits 0 clean and 1 after a scratch edit, sidecar eval tests
collect and skip without the opt-in env. Lemonade never started.
…ider opt-in

Phase 2 (fixtures + plumbing half) of the gaia-agent eval plan. Everything an
eval scenario touches is now canned and deterministic — no live GitHub, web,
RSS, or hub — and the eval harness can drive a Claude-backed agent on machines
that must never start Lemonade.

- tests/fixtures/gaia/fake_gh/: fake gh CLI (gh.cmd + sh shim + gh.py) serving
  recorded JSON for the ALLOW-tier commands github-triage uses; refuse-tier
  commands are never faked — reaching the shim with one exits nonzero and says
  the permission gate leaked. Unknown commands always fail loudly.
- tests/fixtures/gaia/{web,rss,csv,mini_repo}/: planted-fact HTML for
  research-report/price-watch/source-watch/daily-brief (source-watch ships two
  versions of one page), an RSS feed, sales.csv with generated ground-truth
  aggregates (drift-guarded by test), and a tiny widgetlib project with
  distinctive symbols for code-index scenarios.
- tests/fixtures/gaia/fixture_hub/: a servable skills-lane hub (catalog +
  manifests + SKILL.md + deterministic zips) for github-triage and
  data-explore; verified end-to-end against gaia.skills.hub (search, manifest,
  sha256-checked download) and gaia.skills.install (unsigned -> experimental;
  data-explore installs with --allow-experimental, github-triage's
  shell:execute:gh is refused above the experimental ceiling — both documented
  in the fixture README as the behaviours scenarios may rely on).
- tests/fixtures/gaia/serve_fixtures.py: stdlib HTTP helper (--port 0 =
  ephemeral) for web/rss/hub fixtures.
- Gate manifests quality_gate_thresholds.json + perf_gate_thresholds.json
  (plan 2b keys), all enforce:false until the first runner baseline.
- GAIA_EVAL_AGENT_PROVIDER=claude opt-in in _build_create_kwargs: passes
  use_claude/claude_model (from GAIA_EVAL_CLAUDE_MODEL, required) to
  registry.create_agent; unknown values and a missing model raise actionable
  errors — never a silent Lemonade fallback. Validated at UI-server startup so
  a bad env fails in seconds.
- hub/agents/gaia/python/packaging/eval_summary.py: gate-verdict reporter
  ported from the email agent (quality_gate, perf_gate), with its test suite.

49 new unit tests; fake-gh, serve-helper, thresholds, sha256 and CSV ground
truth all behaviour-pinned.
…plit source-watch URLs

Post-approval plan-critique corrections (plan §11 rounds 2–5):

- The Agent UI MCP bridge pinned Gemma into every /api/chat/send payload,
  which defeated the Claude-provider opt-in end-to-end (the eval runner
  drives the backend through this bridge). The pin is now provider-aware:
  env unset keeps the byte-identical Lemonade pin; GAIA_EVAL_AGENT_PROVIDER=
  claude omits it; any other value raises. The backend's Lemonade preflight
  (_maybe_load_expected_model) is also skipped under the opt-in — it would
  otherwise health-probe and potentially load a model into a backend the
  eval must never touch. Payload shape and preflight skip are unit-tested
  both ways.

- The fixture hub no longer commits built artifacts: only unsigned SKILL.md
  sources remain, and tests/fixtures/gaia/prepare_fixture_hub.py builds the
  servable hub per run — generating a throwaway eval-test-publisher ed25519
  keypair, signing every bundle except a deliberate unsigned list (default:
  github-triage), and trust-adding the key in the run's --skills-root (which
  is required, never defaulted, so a developer's real trust store can't pick
  up a test key). Verified: signed data-explore installs cleanly at
  community with zero flags — the corpus's clean-install target; unsigned
  github-triage stays the refusal target (binary grant above the
  experimental ceiling). Signed github-triage installs only via the
  dangerous-grant prompt (assume_yes), documented for corpus planning.

- source-watch is now two distinct URLs (web/source_watch_v1.html +
  source_watch_v2.html) — a static server can't swap one URL mid-scenario.

- README documents the serve default (ephemeral --port 0) and the reserved
  ports (4001/4200/8141/13305 never), and flags planted values as
  placeholders pending eval/scenarios/GAIA_FIXTURE_VALUES.md.
…narios, 12 categories)

The flagship gaia agent had zero judged eval coverage; this lands the full
T3 dataset from the approved plan: 12 new gaia_* categories under
eval/scenarios/, every scenario pinned to agent_type: gaia.

- gaia_core (11) and gaia_memory (15) carry tiered difficulty tags
  (t1_basic..t4_adversarial); the stress/adversarial tiers are long
  multi-turn conversations (10-15 turns): long-horizon recall across
  distractor tool work, false-premise pushback, contradiction injection,
  prompt-injection-via-remembered-content stored as inert data,
  forget-then-probe, memory-vs-history disambiguation, mango canary,
  follow-ups that cannot stand alone.
- gaia_rag (8) reuses eval/corpus with expected_answer: null don't-know
  cases; gaia_files (6) includes sandbox/traversal refusals; gaia_data (5)
  pins exact CSV aggregates; gaia_web (5) uses the local fixture server
  plus one live-tagged canary; gaia_shell (6) covers the ALLOW/CONFIRM/
  REFUSE gh gate behaviours; gaia_skills_lifecycle (8) covers load
  persistence, hub search/install, and unsigned-install refusal;
  gaia_skills_tasks (20) exercises all 12 starter skills against pinned
  fixtures; gaia_honesty (6), gaia_tool_selection (5), gaia_code (4).
- Every tool-using scenario requires agent_tools[] to show the real call
  (anti-fabrication); honesty/gate scenarios are severity critical.
- eval/scenarios/GAIA_FIXTURE_VALUES.md is the single source of truth for
  every assumed fixture value (fake-gh issues, planted web facts, CSV
  aggregates, mini-repo symbols, fixture-hub catalog); scenarios carry
  FIXTURE-SYNC comments naming their fixture.
- tests/test_eval.py gains a corpus guard: gaia_* scenarios must set
  agent_type: gaia and use only known tags (existing find_scenarios tests
  already schema-validate every new YAML).
- docs/guides/eval-scenarios.mdx documents the new categories and the tag
  taxonomy (tier tags, live, tui, local_blocked_no_embedder).
…tions

Plan §2 gained authoring rules verified against the runner after the corpus
landed; this applies them so the scenarios are judgeable on the real CI
transport instead of assuming an interactive one.

- Memory isolation: every gaia_memory scenario's first turn now explicitly
  instructs the simulator to call memory_clear(scope=all) via the eval MCP
  admin tools (GAIA_MEMORY_ADMIN=1) — the runner's documented convention and
  the only cross-scenario isolation, so a t4 injection run can't corrupt a
  later recall verdict.
- Confirmation transport: CI runs with GAIA_AUTO_APPROVE_TOOLS=1, so
  CONFIRM-tier modal assertions were unjudgeable there. The gh-comment
  scenario now asserts the action OUTCOME (command executed, result reported
  accurately) with modal semantics scoped to the tui-tagged TUI lane; the
  denial-honesty scenario now rides the REFUSE-tier gh issue close, which is
  refused on any transport. Install scenarios reworded the same way (signed
  rss-digest install succeeds deterministically; unsigned experimental-notes
  fails signature/tier verification regardless of auto-approve).
- Path staging: GaiaAgent sandboxes to Path.home() and the CI workspace may
  be outside it, so every user-message fixture path now uses the staged
  ~/gaia-eval/ location (csv, mini_repo); gaia_rag setup.index_documents
  stay corpus-relative (resolved via --corpus-dir). The staging convention
  is now part of the GAIA_FIXTURE_VALUES.md contract, along with the
  transport env and the fake-gh shim accepting CONFIRM-tier writes.
- t3/t4 explicit user_message rule: audited — already satisfied on every
  stress/adversarial turn, no changes needed.
- docs/guides/eval-scenarios.mdx updated to match (staging, auto-approve,
  outcome-based gaia_shell row).
…rface

The matrix's eval-coverage column derives from the gate manifests and the
gaia_* scenario glob, which only exist together after the three eval branches
merge — regenerated here, with the drift-guard's current-state pins moved to
the merged reality (quality+perf suites at enforce:false, 12 scenario
categories).
Include-only --tag cannot express 'run everything except the scenarios that
need the Lemonade embedder' — the shape of a no-Lemonade local validation run.
--exclude-tag drops scenarios carrying any named tag, applied after the
include filters (e.g. --exclude-tag local_blocked_no_embedder --exclude-tag
live).
…, live report

Local validation now runs through the real Go TUI in control mode with the
agent on claude-haiku-4-5 (--use-claude) — Lemonade never starts on this box.
tui_driver.py reads GAIA_TUI_CONTROL_JSON so a session never edits the CJ
constant. First rung green: L1 arithmetic 391 in 6.0s through the live TUI.
…ransport

/clear emptied the TUI view while the child kept conversation_history — every
later prompt still carried the 'cleared' context, including anything sensitive
the user thought was gone. The subprocess client now implements
TranscriptResetter with a clear_history control verb; the stdio pump routes it
through the query queue so a clear typed mid-turn lands after that turn, and
the turn loop (which owns the agent) empties the history.

Also adds util/tui_eval.py — the local TUI scenario runner (control API,
Claude-model agent, /clear isolation between scenarios) used for the
no-Lemonade validation runs.
…VALUES.md)

The scenario corpus published the authoritative values file; every fixture
under tests/fixtures/gaia/ now matches it byte-for-byte where scenarios
assert, so the two branches merge without value drift.

- fake gh: repo acme-labs/widgetworks with issues amd#142/amd#139/amd#137 (contract
  bodies, newest-first) and the 2-unread notification inbox (amd#142 + PR amd#140).
  New: CONFIRM-tier 'gh issue comment' returns a deterministic canned success
  URL — under GAIA_AUTO_APPROVE_TOOLS=1 those writes execute and scenarios
  assert the outcome. REFUSE-tier commands and denied write flags are still
  never faked (loud gate-leak error).
- web/: contract page set (atlas, price_nimbusbook, observatory_v1/v2,
  solarium_a/b, headlines) with the exact planted facts and the planted
  ABSENCES (no executives on Solarium, no stock-market headline, no email/
  alerting code in the mini repo) that the grounding/hallucination/honest-miss
  probes depend on — absence-guard tests pin them.
- rss: 'Widgetworks Release Notes', exactly 3 entries newest-first.
- csv: 12 rows regenerated by _gen_sales.py, which now ASSERTS all six
  contract aggregates (8,600 total; Gadget Pro ,200; North ,150;
  March ,050; 3 products; 12 rows) before writing.
- mini_repo: widgetlib replaced by tempkeeper (convert/io/store per contract).
- fixture hub: catalog is exactly github-triage 2.1.0 (signed), rss-digest
  1.0.0 (signed, ships tools.py — the zero-prompt clean-install target at
  community) and experimental-notes 0.0.1 (unsigned, authored as the
  install-refusal target); data-explore dropped. The catalog index now also
  carries provided tool names so hub search matches fetch_rss.
- serve_fixtures: routed layout matching the scenario URLs exactly — web at
  /, rss at /rss/, prepared hub at /fixture_hub/ — with 8765 documented as
  the eval-run port; unit tests stay on ephemeral --port 0.
Kalin Ovtcharov and others added 2 commits September 17, 2026 14:30
A force capture removed the previous bundle before the guarded block, so a
failure during the copy cleaned up the new directory but left the old lock
entry naming a path that no longer exists — the next reload would find a
locked-but-absent skill.

Also corrects the two dispatch descriptions that said 12 categories where
EVAL_CATEGORIES lists 13, which would have led a maintainer entering the
list by hand to drop gaia_skills_capture.

Co-Authored-By: Claude Opus 5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

⚠️ Note: gh commands failed with a system-level containerd socket error on this runner — prior review status could not be verified, so this is a full review.


The capture security model is well-engineered: audit-first, code-inert-until-promoted, non-grantable (must prompt every time), binary grants withheld, atomic landing with cleanup-on-failure, and security regression tests that pin the exact invariants. The ClaudeProvider race fix (moving _tool_name_map off instance state onto a per-request local) closes a real concurrency bug. The new eval infrastructure is substantial and well-structured.

Two things to address before the next push:

🟡 scripts/ execution is not actually "inert" — the lifecycle table in capture.py's module docstring lists tools.py / scripts/ under "Code" and marks them "deferred — never imported, tools never register." That is accurate for tools.py import/registration, but scripts/ files land on disk and the shell tool can run them immediately — no gaia skill promote needed. The code acknowledges this with a scripts_warning payload key and a comment ("registration gating does NOT make a script file unrunnable"), but the spec table at docs/spec/agent-skills.mdx also carries the same lifecycle table and does not distinguish the two. A user reading the spec or the payload description that says "code inert until promoted" will reasonably infer scripts are safe to run — they are not. The spec should add a footnote explicitly carving out the scripts/ case, and the code_inert payload string should not imply a blanket guarantee over scripts.

🟡 Duplicated constant + validation logic creates a divergence risk — _EVAL_PROVIDER_ENV = "GAIA_EVAL_AGENT_PROVIDER" and its valid-values check appear independently in both src/gaia/ui/_chat_helpers.py and src/gaia/mcp/servers/agent_ui_mcp.py. The comment says "Keep in sync." If a second provider is added later and only one module is updated, the MCP server would accept a provider the UI backend rejects (or vice versa), producing an error at the wrong call site. The constant belongs in a shared location (e.g., gaia.ui.constants re-exported from the MCP file, or a minimal gaia.eval.provider module that imports cleanly without pulling the optional [ui] stack).

🟢 (nit) _loopback_allowed_hosts() in src/gaia/web/client.py parses GAIA_WEB_ALLOWED_HOSTS on every outbound HTTP request (it is on the _assert_ip_allowed hot path). A functools.lru_cache would eliminate the repeated split.

🔍 Technical details

scripts/ gap:

  • capture.py docstring table (src/gaia/skills/capture.py, the module docstring) lists tools.py / scripts/ under "Code" → "deferred". But has_scripts comment says "registration gating does NOT make a script file unrunnable" and capture_skill returns has_scripts=True with an advisory scripts_warning. code_is_deferred() gates on skill.gaia.tools and binary permissions — it never checks for scripts/.
  • docs/spec/agent-skills.mdx has the lifecycle table added in this PR. It should add a note distinguishing scripts/ (on disk, runnable by shell tool) from tools.py (never imported until promote).

Constant duplication:

  • _EVAL_PROVIDER_ENV at src/gaia/ui/_chat_helpers.py:2797 and src/gaia/mcp/servers/agent_ui_mcp.py:2023. The valid-values check in _chat_helpers._eval_provider_kwargs() raises on an unknown provider; the MCP-side _model_pin() does the same. Two places, two lists to update.
  • Minimal fix: define EVAL_PROVIDER_ENV = "GAIA_EVAL_AGENT_PROVIDER" in src/gaia/llm/providers/claude.py or a thin gaia.eval.config module, import it in both places.

ClaudeProvider fix (no action needed — flagged for visibility):

  • The _tool_name_map move (src/gaia/llm/providers/claude.py) is correct. _build_params now returns (params, name_map) and each call site receives its own map. _stream_chat takes name_map as a parameter and the generator closes over it. Concurrent calls are safe.

Kalin Ovtcharov and others added 2 commits September 17, 2026 14:57
The branch adds a 79th tool but the manifest, the registration and two docs
still declared main's 78/71 — the capability-matrix gate refused the
mismatch. SKILL.md also said "Seven" while enumerating eight gated tools.

Co-Authored-By: Claude Opus 5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

A large, cohesive PR. No critical bugs found. The three new security-sensitive surfaces — capture_skill, the SSRF loopback allowlist, and the ClaudeProvider thread-safety fix — are each implemented correctly and well-tested. Brief summary of what I checked:

  • ClaudeProvider thread-safety fix (src/gaia/llm/providers/claude.py): moving _tool_name_map from instance state to per-call state is the right fix. Two overlapping chat() calls on the same provider can no longer overwrite each other's name map mid-stream. The new test_map_is_per_call_not_per_provider test directly covers the race.
  • capture_skill security model: confirmation-gated at the UI level, code-inert until gaia skill promote, binary grants withheld for untrusted code, symlinks refused before the audit can skip them, non-grantable as a persistent "always allow" scope. The capture_entry/code_is_deferred digest check (trust bound to audited bytes, re-deferred on edit) is the right invariant.
  • SSRF loopback allowlist (GAIA_WEB_ALLOWED_HOSTS): correctly uses is_loopback, not is_private, so an allowlisted name that DNS-rebinds to 169.254.169.254 or RFC1918 is still blocked. Tests cover both the allowlist and the cloud-metadata exclusion.
  • summarize_attempts: worst-case representative (a flaky scenario never reports as a clean pass), stability field distinguishes stable-pass/flaky/stable-fail. iterations=1 path returns attempts[0] unchanged — backward-compatible.
  • TUI /clear fix: Go ResetTranscript() sends clear_history to the child; the Python _pump_stdin converts it to a _ClearHistory sentinel that the turn loop drains before the next prompt, so history doesn't leak into a "cleared" session.

Three nits (all 🟢, within the cap):

🔍 Technical details

Nit 1 — _build_create_kwargs logger assumes claude_model key

src/gaia/ui/_chat_helpers.py (~line 12896 in the diff):

logger.info(
    "create_agent: %s=claude -> use_claude=True, claude_model=%s%s",
    _EVAL_PROVIDER_ENV,
    provider_kwargs["claude_model"],   # KeyError if a second provider is added
    suffix,
)

_eval_provider_kwargs always includes claude_model for the only valid provider (claude), so this is safe today. If _VALID_EVAL_PROVIDERS is ever extended and the new provider's dict omits claude_model, this line KeyErrors during request handling. provider_kwargs.get("claude_model", "<model>") avoids the assumption.

Nit 2 — _EVAL_PROVIDER_ENV constant duplicated

"GAIA_EVAL_AGENT_PROVIDER" is defined as _EVAL_PROVIDER_ENV in both src/gaia/ui/_chat_helpers.py and src/gaia/mcp/servers/agent_ui_mcp.py. The comment in agent_ui_mcp.py correctly explains why importing from _chat_helpers is not possible (circular dep on the [ui] extras). The risk is the two copies drifting. Adding a brief cross-reference in both comments (naming the other file) makes the drift visible at code-review time.

Nit 3 — _loopback_allowed_hosts() reads env on every call

src/gaia/web/client.py: _loopback_allowed_hosts() calls os.environ.get(...) on every invocation. Under normal use _validate_host_ip calls it once and _assert_ip_allowed (called inside WebClient.get) calls it again — two env reads per fetch. The env doesn't change at runtime, so @functools.lru_cache(maxsize=None) (or a module-level sentinel) would eliminate the overhead with no semantic change.

Kalin Ovtcharov and others added 3 commits September 17, 2026 15:26
The hard-coded totals in test_capability_matrix predate the email and
image_gen bundles that landed on main, so they still read 69/11/18 against a
derived 79/13/21.

test_gaia_agent_eval.yml also still carried a pull_request base-branch
filter, which skips stacked PRs (amd#2767); its paths: already scope it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Six conflicts, resolved to keep both sides:

- runner.py: kept this branch's --iterations repeat loop, but took main's
  _resolve_scenario_agent_type() helper (its `or` also handles an empty
  `agent_type:`, which the inline .get(k, default) did not).
- tools_count: neither side's literal was right. Base 78, +1 here
  (capture_skill), +2 on main (run_python and image_gen) -> 81, which is
  what the AST union derives and reconcile_tools_count() requires.
- SKILL.md / CHANGELOG.md: both feature bullets kept; gated-tool count is
  now nine (six base incl. run_python, three flagship incl. capture_skill),
  and per-turn selection sends at most 28 of 81.
- eval-scorecard.mdx: main's --experiments paragraph closes the preceding
  variance subsection, so it sorts before this branch's new section.

Main also added a /memory REST op that this branch's new capability matrix
could not know about, so its closed-set guard failed the merged tree.
Annotated with the no-quality-eval sentinel, regenerated CAPABILITY_MATRIX.md,
and moved the pinned expectations in test_capability_matrix.py to 81/15/4.
Picks up amd#4095, which landed while the conflict resolution above was in
progress. No conflicts.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Merged main in — the branch is mergeable again. Two of the six conflicts resolved to a value neither branch contained, so they're worth a look before you merge.

The agent's tool count is now 81, not the 79 this branch had or the 80 on main. Both sides added tools (capture_skill here, run_python and image_gen on main), and the count is a union, not a pick-a-side. Taking either literal would have failed the build at packaging time.

Main also added a /memory REST endpoint that this branch's brand-new capability matrix couldn't know about, so the matrix's closed-set guard rejected the merged tree. That guard doing its job on the first merge that could trip it is a good sign, not a problem.

🔍 Technical details

The six conflicts

File Resolution
src/gaia/eval/runner.py Kept this branch's --iterations repeat loop, but took main's _resolve_scenario_agent_type() helper. Main's scenario_data.get("agent_type") or cli_agent_type also handles an empty agent_type:, which the inline .get(k, default) did not.
gaia-agent.yaml, gaia_agent/__init__.py tools_count 79/80 → 81 (see below)
npm/SKILL.md Gated tools are now nine: six base (adds main's run_python) + three flagship (adds this branch's capture_skill). Kept main's phrasing that drops the total from that sentence, since it drifts.
npm/CHANGELOG.md Both feature bullets kept — independent features. Per-turn selection line → "at most 28 of its 81".
docs/reference/eval-scorecard.mdx Main's --experiments paragraph closes the preceding ### Trustworthy numbers subsection, so it sorts before this branch's new ## Aggregate metric section.

Why 81

reconcile_tools_count() requires gaia-agent.yaml, AgentRegistration(tools_count=) and the AST union of FULL_CORE_TOOLS | FULL_BUNDLES to agree. Merge-base was 78; this branch +1, main +2. I verified the literal tracks the AST union exactly at all three points (base 78, this branch 79, main 80) before applying it, and the regenerated CAPABILITY_MATRIX.md independently derives 81 (CORE 15 + 21 bundles) with shell at 4.

Same derivation for the "at most N" line: it is core + 13 (base 13+13=26, main 15+13=28), so merged core 15 → 28.

/memory

Annotated in OP_EVAL_COVERAGE with the existing no-quality-eval sentinel — it's a read-only snapshot GET with no judged suite — and the pinned expectations in test_capability_matrix.py moved to 81 / 15 / 4 ops.

Verification

hub/agents/gaia/python/tests/ + tests/unit/eval/ → 1276 passed, 4 skipped. capability_matrix.py --check clean.

Five failures in test_ctx_overflow_device_profile_2884.py and test_chat_fix_contracts.py reproduce identically on stock origin/main in a probe worktree — Windows-local, pre-existing, not from this merge.

One thing I did not touch: the capture_skill CHANGELOG bullet still reads "(68 registered tools, up from 67)", which predates this merge and disagrees with the manifest. Left alone to keep the merge scope-clean — worth a one-line fix on your next push.

kovtcharov-amd and others added 2 commits September 22, 2026 00:06
The guide and the npm SKILL.md still described the pre-merge flagship: 80
tools with 8 gated behind confirmation. The merge with main added
`capture_skill`, so a reader following the docs would not know the tool
exists, nor that it prompts before writing under ~/.gaia/skills.

- docs/guides/gaia.mdx: 80 -> 81 registered, 79 -> 80 without Node.js,
  `capture_skill` added to the Skills row, and the confirmation paragraph
  now names nine tools.
- npm/SKILL.md §8.1 said "/query cannot run any of those eight tools" two
  sections after §8 was updated to say nine — same file, contradicting
  itself.
- gaia-agent.yaml's tools_count derivation comment summed to 80, not the
  81 it annotates.
`/clear` on --subprocess and --mock wiped the visible transcript and said
nothing, while the agent's context carried on untouched. The honest "this
connection cannot reset the agent's conversation context" warning had been
silently replaced by a no-op.

Adding ResetTranscript to SubprocessClient made every SubprocessClient
satisfy TranscriptResetter, including the ones that cannot honour it.
clearConversation dispatches on ConversationResetter first, and
SupportsConversationReset returns s.canonical, whose only write site is
NewCanonicalSubprocessClient -- so the TranscriptResetter branch is
reachable only when canonical is false: the legacy and mock transports,
where the clear_history control verb is not understood and mock has no
child at all. On the canonical path the method was dead code; the
acknowledged CLEAR_CONVERSATION_QUERY round-trip already clears
conversation_history and raises when the child does not confirm.

Its own test pinned the broken path -- `&SubprocessClient{}` leaves
canonical false -- so it passed while clear_test.go failed.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

Pushed a fix for the four red TUI lanes.

/clear in the legacy (--subprocess) and --mock modes was wiping the visible transcript and saying nothing, while the agent's context carried on untouched — the warning that tells the user their context is unchanged had been silently replaced by a no-op. The new ResetTranscript method was dead code on the canonical path and actively wrong on the only path where it could actually fire, so it's removed; the canonical clear (which already round-trips and errors if the agent doesn't confirm) is unaffected.

Full Go suite is green locally — 20 packages, zero failures.

🔍 Technical details

Adding ResetTranscript to SubprocessClient makes every SubprocessClient satisfy client.TranscriptResetter — a Go interface can't be implemented conditionally. clearConversation() dispatches on ConversationResetter first, and SupportsConversationReset() returns s.canonical, whose only write site is NewCanonicalSubprocessClient. So the TranscriptResetter branch is reachable only when canonical is false: exactly the legacy and mock transports, where the clear_history control verb isn't understood and mock has no child process at all. Taking that branch drops the "…that context is unchanged." status message.

On the canonical path the method is unreachable, and redundant anyway — CLEAR_CONVERSATION_QUERY in gaia_agent/stdio.py already does agent.conversation_history.clear() and replies conversation_cleared, with ClearConversation raising if the child doesn't acknowledge. Fire-and-forget would have been a step down from that under the repo's no-silent-fallbacks rule.

subprocess_reset_test.go is deleted with it: it constructed &SubprocessClient{}, which leaves canonical false, so it only ever pinned the broken path — which is why it passed while ui/chat/clear_test.go::TestClearLegacyAndMockTransportsKeepsViewClearAvailable failed.

Verified: go build ./..., go vet ./... clean; go test ./... → 20 ok / 0 FAIL; TestClearWaitsForAgentAcknowledgment and TestClearShowsFreshProgressWhileAwaitingAcknowledgment still PASS. SSEClient.ResetTranscript untouched — that transport holds the transcript host-side and can honour it.

kovtcharov-amd pushed a commit that referenced this pull request Sep 22, 2026
The consolidation deleted `agent_type:` from the committed scenarios but left
the code that reads it, so a scenario loaded from anywhere else — the
auto-discovered `~/.gaia/eval/scenarios`, or any `--scenario-dir` — still beat
`--agent-type`. That run scored one agent while its scorecard recorded another,
which is exactly the mixed-agent comparison `compare_scorecards` cannot detect,
since it keys on `scenario_id` alone.

`validate_scenario` now rejects the key, covering all three scenario sources at
load time rather than only the in-repo corpus the guard test walks. With nothing
able to carry the key, `_resolve_scenario_agent_type` is unreachable, so it and
its four call sites are gone and the provenance stamp records the run's agent.

Note for #3074: it adds 103 scenarios under `eval/scenarios/gaia_*/`, every one
declaring `agent_type: gaia`. All 103 fail validation the moment it merges on
top of this. `gaia` is already the default, so the key is redundant and the fix
is to strip it: sed -i '/^agent_type: gaia$/d' eval/scenarios/gaia_*/*.yaml
Every lane that runs these scenarios already passes `--agent-type gaia`
explicitly (`test_gaia_agent_eval.yml`, `gaia_scorecard_refresh.yml`), so
the per-scenario pin only restated the CLI's choice. Removing it changes
nothing measured today and keeps the corpus loadable once the eval
consolidation lands, which rejects `agent_type:` in a scenario outright.

The corpus guard in tests/test_eval.py flips with it: instead of
requiring the pin it now forbids it, so the key cannot come back.

Scope: the 103 gaia_* scenarios this branch adds. The 55 pre-existing
pins under eval/scenarios/ are untouched — the consolidation strips
those on its own side, and touching them here would only invite a
conflict.
@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

The 103 scenarios this branch adds were about to stop loading entirely once the eval consolidation lands — it rejects a scenario that names its own agent. They no longer name one, and nothing they measure changed, because every lane that runs them already chose the same agent on the command line.

Scope note: only this branch's own scenarios were touched. The 55 pre-existing pins elsewhere in the corpus are the consolidation's to remove, and editing them here would just create a conflict.

🔍 Technical details

validate_scenario on kalin/eval-consolidation (#4096) raises on any agent_type: key, from every scenario source. 158 files here carried one; 103 of them are files this branch adds, all agent_type: gaia, all in gaia_* categories. The other 55 are pre-existing files that #4096 strips on its own side, so they auto-merge clean.

Why the strip is a no-op today — both lanes that run gaia_* pass the agent explicitly:

  • test_gaia_agent_eval.yml:497 — @('eval','agent','--agent-type','gaia','--category',$category, ...)
  • gaia_scorecard_refresh.yml:309 — gaia eval agent --agent-type gaia --category $category

Both iterate exactly the 13 gaia_* categories. No lane runs a gaia_* category without --agent-type gaia; the Gemma consolidation lane omits it but runs only rag_quality / context_retention / tool_selection. Belt and braces, #4096 also sets DEFAULT_AGENT_TYPE = "gaia" (src/gaia/eval/config.py:20), so the omitted case resolves to gaia there too.

Diff is 103 files, 103 deletions, 0 insertions, every removed line identical (-agent_type: gaia).

One companion edit outside the YAMLs: tests/test_eval.py::test_gaia_corpus_categories_and_agent_type asserted the pin was present, so it would have gone red. It is now test_gaia_corpus_categories_and_tags and asserts the pin is absent — a guard against the key coming back rather than a deleted check.

Verified: pytest tests/test_eval.py 153 passed; pytest tests/unit/eval 737 passed, 1 skipped; black + isort clean.

@kovtcharov-amd

Copy link
Copy Markdown
Collaborator

--iterations 3 still costs 9 runs per scenario, not 3 — the Sep 11 finding is live on today's head. Two loops now repeat the same work, and which one to keep is a call only you can make, so I've left the code alone.

Separately, the formal CHANGES_REQUESTED from Sep 2 is stale: every item was answered on Sep 8. Nothing but a human dismissal or a fresh review clears it, so the PR keeps reading as blocked.

🔍 Technical details

Verified on 4e2be04:

  • src/gaia/cli.py:4216 — for iter_idx in range(iterations) re-runs the whole eval N times. Pre-dates this PR; its consumer is _summarize_mcp_reliability(all_scorecards).
  • src/gaia/cli.py:4249 — this PR also passes iterations=args.iterations into AgentEvalRunner.
  • src/gaia/eval/runner.py:2201 — the runner then repeats each scenario N times and folds the attempts into one stability verdict.

Both activate on the same flag. main has only the outer loop (its runner takes no iterations), so the multiplication is new here.

The two fixes are not equivalent:

keep effect
inner (range(iterations) → single pass in the CLI) per-scenario flaky/stable verdict, per-attempt traces, resume-safe — but the MCP reliability summary stops firing for N>1
outer (iterations=1 into the runner) restores exactly the pre-PR meaning of the flag, and the runner's attempt-summarisation becomes library-only

The inner implementation is clearly the better one — it's the reason summarize_attempts and the .attemptN.json traces exist — but dropping the reliability summary is a user-visible removal, which is why I'm not choosing for you.

The CLI's outer loop (pre-existing, repeating the whole eval corpus N
times) and AgentEvalRunner's inner per-scenario repeat both activated on
the same --iterations flag, so --iterations 3 ran 9 scenario-executions
per scenario instead of 3.

The flag's own help text ("Run each scenario N times for reliability
measurement") already described the inner behavior; the outer loop
predates that contract and never matched it. Collapsing the outer loop
makes --iterations do what it has always claimed to do, and removes the
N^2 multiplication outright rather than picking a side.

_print_reliability_summary (which aggregated pass rates across separate
whole-corpus runs) becomes dead code once there is only ever one run to
aggregate -- removed along with its now-unused defaultdict import and
its dedicated test class. The per-scenario stability verdict
(summarize_attempts, already in AgentEvalRunner) answers the same
"is this scenario flaky" question from repeated attempts inside one run
instead of from N separate full runs, so nothing measurable is lost.
@kovtcharov-amd
kovtcharov-amd dismissed their stale review September 23, 2026 09:38

All four items from this review were addressed by Sep 8, and the --iterations N^2 bug flagged after it is now fixed (f54c4e0). Dismissing since nothing here remains open.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Sep 23, 2026
Merged via the queue into amd:main with commit dd5babd Sep 23, 2026
61 checks passed
kovtcharov pushed a commit to kovtcharov/gaia that referenced this pull request Sep 23, 2026
Only the published tool total conflicted, and the branch's side of it was
stale: amd#3074 landed on main and took the flagship to 81, so this branch's 88
was counted against an older main. The registry reports 89 — 81 plus this
branch's eight browser tools — and the regenerated capability matrix agrees,
splitting them across the new `browser_nav` (2) and `browser_use` (6) bundles.

Co-Authored-By: Claude Opus 5 <[email protected]>
kovtcharov-amd added a commit that referenced this pull request Sep 24, 2026
The merge from kalin/eval-consolidation brought in 13 new gaia_*
scenario categories (#3074's flagship corpus) that ci_lanes.json
predates, so every lane -- and the CI lane job that validates the
map -- failed the orphan-category gate. Splits them across four new
lanes, balanced by scenario count (~25-26 scenarios each) to match
the parallelism the existing lanes already get.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents chat Chat SDK changes cli CLI changes devops DevOps/infrastructure changes documentation Documentation changes eval Evaluation framework changes llm LLM backend changes mcp MCP integration changes performance Performance-critical changes sidecar Agent sidecar contract / harness tests Test changes tui Go terminal UI (gaia-tui)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants