Skip to content

agentcore: add 12-scenario harness scorecard, oscillating doom-loop guard, and 16-task eval suite - #389

Merged
d41sys merged 1 commit into
mainfrom
agentcore-eval-suite
Dec 4, 2026
Merged

d41sys merged 1 commit into
mainfrom
agentcore-eval-suite

Conversation

@d41sys

@d41sys d41sys commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a two-layer evaluation system for Bate's agentcore (plus oscillating doom-loop interception in agentcore/src/turn.rs) so harness regressions are caught deterministically in CI and live model/ACP changes can be measured with paired statistics and automatic failure taxonomy:

  1. Oscillating 2-call doom-loop guard (agentcore/src/turn.rs): extends Repeats from consecutive-only (A, A, A) to also catch period-2 alternating cycles (A, B, A, B, A) and inject a structured recovery nudge after 3 repetitions.
  2. Layer 1 — Offline CI-gated Harness Scorecard (agentcore/tests/harness_eval.rs): 12 deterministic failure-mode tests against agentcore with a scripted local SSE server (0 API cost, ~0.55s): consecutive & oscillating doom loops, multi-cycle proactive compaction, reactive HTTP 400 overflow compaction, edit resilience & undo snapshot, giant (>180 KiB) & non-UTF-8 output budgeting, mid-turn fallback model failover, mid-batch abort & resume, late Op::Steer intercept, parallel & unnamed tool calls, permission denial recovery, and step-limit wrap-up + check early-stop guard.
  3. Layer 2 — Local 16-Task Live Eval Suite + Trajectory Analyzer (evals/):
    • evals/tasks.py: 16 deterministically verified tasks across 5 categories (coding [4], shell_data [4], edit_precision [2], bate_native [4: cross-turn memory/, SKILL.md adherence, compaction needle recall, stdio MCP orchestration], safety_recovery [2]).
    • evals/mock_mcp.py: real stdio JSON-RPC 2.0 MCP server fixture (lookup_order, apply_credit).
    • evals/driver.py: drives real compiled agentcore (or agentcore acp <cmd>) over stdio JSON-lines, records trace.jsonl + result.json, and supports zero-cost --mock self-tests.
    • evals/analyze.py: classifies failure modes (pass, early_stop, doom_loop, edit_mismatch, step_limit, timeout, model_error, wrong_answer), computes pass@1 and pass^k, exports d41sys/evalkit-compatible results.jsonl, and computes paired exact two-sided McNemar A/B comparisons.
    • evals/run.py, evals/test_evals.py, evals/README.md, and .gitignore entries for evals/runs/ and evals/__pycache__/.

Evidence

  • Offline Harness Scorecard: cargo test -p agentcore --test harness_eval -- --nocapture → 12/12 passed (~0.55s).
  • End-to-end 16-task --mock run against compiled agentcore + real tools + real stdio MCP: python3 -B evals/run.py --mock --engine <target>/debug/agentcore --out /tmp/bate-eval-mock → 16/16 passed (100.0% pass@1, 100.0% pass^k, 2.9 tools/trial, 0.54s/trial); verified analyze, compare, and results.jsonl export.
  • Eval analyzer unit tests: python3 -B -m unittest discover -s evals -v → 7/7 passed (task registry, trace telemetry/compaction, consecutive & oscillating doom-loop detection, all 8 failure modes, pass^k, evalkit schema, exact McNemar p-value).
  • Full 4-step verification gate passed:
    • cd window/ui && npm ci && npm run build && npm test (147/147 pass)
    • cargo fmt --all --check
    • cargo clippy --workspace --all-targets --locked -- -D warnings
    • cargo test --workspace --locked

Merge Danger

  • Low. Production code change is strictly scoped to Repeats in agentcore/src/turn.rs (+49/-3 lines) to detect alternating 2-call loops in addition to consecutive repeats, covered by both eval_consecutive_doom_loop and eval_oscillating_doom_loop. All other additions are test/eval tooling under agentcore/tests/harness_eval.rs and evals/.

Device decision

  • No installed app (/Applications/Bate.app) or user data (~/.bate) changes required; pure engine test + CLI eval tooling.

@d41sys
d41sys merged commit cac5990 into main Dec 4, 2026
5 checks passed
@d41sys
d41sys deleted the agentcore-eval-suite branch December 4, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant