Skip to content

Check an evaluation's judge against the people who rated its traces - #757

Draft
TonsOfFun wants to merge 3 commits into
mainfrom
feat/judge-human-agreement
Draft

TonsOfFun wants to merge 3 commits into
mainfrom
feat/judge-human-agreement

Conversation

@TonsOfFun

Copy link
Copy Markdown
Contributor

The second of two steps. #748 made feedback a review signal: dashboard users mark traces good or bad, and end-user votes and implicit signals rank the traces that need a look. This uses those human labels to measure whether an evaluation's judge scores answers the way people do, and to propose rewording its criteria where it does not.

This branch is based on #748 and carries its commit. Review the second commit here; merge #748 first. The base is main rather than #748's branch so that merging #748 cannot strand this one on a branch that is not main.

What changes

  • ActiveAgent::Evals::Calibration (framework). Takes answers a person rated positive or negative and a Judge, and reports the agreement rate, the disagreements (lenient: the judge passed what a person rated bad; strict: the reverse), each llm_judge criterion's own agreement, and a suggested rewording for each criterion that sided with the judge in a disagreement. It loads with require "active_agent/evals", so an application that keeps prompts and answers out of its telemetry can run the check where the content lives.
  • Judge#revise_criterion. Asks the judge to reword one criterion from the cases it scored against a person, with their comments. It returns prompt, rationale and, when the people relied on something the judge is never shown, missing_evidence. A block that accepts kind: is told :revise.
  • Judge vs. people (dashboard). A panel on every evaluation. Check the judge reads the agent's rated traces from the last 30 days that have a captured prompt and answer, up to 20, taking the newest of each rating first. Use this wording writes a suggestion into the evaluation's criteria; the criterion keeps what it replaced under revised.
  • A trace's label is the reviewers' majority when any dashboard user reviewed it, the end users' majority otherwise. A tie is no label, and implicit signals are never labels.
  • GET / POST <mount>/api/evaluations/:id/calibration, POST <mount>/api/evaluations/:id/calibration/apply, the evaluations_calibration and evaluations_calibrate MCP tools, and activeagent evals calibration EVALUATION [--run] [--wait].

Decisions worth a look

  • No migration. The last check is kept under the evaluation's config["calibration"], and the evaluation serializer leaves that key out of evaluation payloads.
  • The stored check holds no trace content. People's comments and the prompt and answer previews are read from the feedback and the trace when the check is shown, so they leave with the trace under a retention window. A disagreement whose trace is gone shows as such. The suggested wording and its rationale are stored, and they are written by the judge from that content.
  • A check costs provider credits: one judge call per trace and criterion, and one per suggestion. It runs in a job (JudgeCalibrationJob), is refused while one is under way, and is refused up front when the owner has no credentials for the judge.
  • Applying a suggestion changes what later runs are judged by. Runs do not record the criteria they used, so a run before and a run after are not directly comparable.

Not in this PR

  • Runs do not snapshot their criteria.
  • The judge's score prompts still return only a number, so a disagreement shows the scores without the judge's reasoning.
  • The judge sees only the user's message and the answer, never the tool calls. missing_evidence reports that gap; nothing closes it.
  • An evaluation whose host application judges its own runs is checked here with the dashboard's judge, which may be a different model. Such an application should use ActiveAgent::Evals::Calibration with its own judge.
  • No permission action of its own: any dashboard user who can see the evaluation can start a check and apply a suggestion.

Validation

  • bin/test: 4760 runs, 0 failures, 5 errors. The 5 are RubyLLMIntegrationTest, which calls OpenAI live and was refused the placeholder key.
  • bin/lint: no offenses.
  • npm test in actionagent/frontend: 794 pass. The committed dashboard bundle is rebuilt.
  • In a browser against the dummy app with synthetic traces: the panel rendered a stored check, Use this wording rewrote the criterion, and Check again without provider credentials showed the refusal. The same session exercised Rank traces by human feedback and let dashboard users review them #748's Needs attention panel and a trace review.
  • Not exercised: a check against a real judge model. The suite covers that path with a stubbed judge.

Guide: docs/framework/feedback.md.

🤖 Generated with Claude Code

TonsOfFun and others added 3 commits December 4, 2026 15:39
Interaction feedback gains a source: an end user's vote, an implicit
signal the reporting application observed (named by `signal`), or a
dashboard user's own good/bad review of a trace.

- PUT/DELETE <mount>/api/traces/:id/review stores one review per
  dashboard user per trace. The ingest key cannot write or overwrite one.
- GET <mount>/api/feedback/attention ranks the traces in a window by
  negative feedback and failures, drops the ones a reviewer marked good,
  and groups them by end user and session (the root span's `user.id` and
  `session.id`). The same report is the `traces_attention` MCP tool and
  `activeagent traces attention`.
- The Traces page carries a Needs attention panel, and a trace's detail
  lists its feedback with the reviewer's controls.
- Trace listings carry each trace's feedback counts.

Migration 036 adds source, signal and reviewer_id to interaction
feedback.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PCEJHpjdek9evJw7V8o55G
ActiveAgent::Evals::Calibration scores answers people rated good or bad
with a Judge and reports how often the two agree, the lenient and strict
disagreements, each criterion's own agreement, and a reworded criterion
for each one that sided with the judge (Judge#revise_criterion, a
`kind: :revise` call).

The dashboard runs it over an agent's traces that a reviewer or an end
user rated and whose prompt and answer were captured:

- GET/POST <mount>/api/evaluations/:id/calibration reads and queues a
  check; POST .../calibration/apply writes a suggestion into the
  evaluation's criteria, which keep what they replaced under `revised`.
- The result is kept under the evaluation's config without the people's
  comments, which are read from the feedback when the check is shown.
- An evaluation's page carries a Judge vs. people panel.
- The same check is the evaluations_calibration and
  evaluations_calibrate MCP tools and `activeagent evals calibration`.

Co-Authored-By: Claude <noreply@anthropic.com>
…r config

The dummy app's provider configuration carries tokens wherever its Rails
credentials can be read, as in CI, so the check was not refused there and
the assertion saw no error. JudgeCalibrationTest stubs the configuration
the same way.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@TonsOfFun
TonsOfFun force-pushed the feat/judge-human-agreement branch from 88da0c9 to 808bfc8 Compare December 4, 2026 23:44

This branch has not been deployed

No deployments
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