Skip to content

Show which role (target, auditor, judge) failed a scenario - #86

Merged
SushantGautam merged 5 commits into
mainfrom
feat/failure-role-attribution
Nov 9, 2026
Merged

SushantGautam merged 5 commits into
mainfrom
feat/failure-role-attribution

Conversation

@SushantGautam

Copy link
Copy Markdown
Collaborator

Closes #85.

Failed scenarios now record and show which role failed. Role is the only required field; the rest is best effort and works for any target or provider.

  • New audits/failures.py builds a structured failure object (role; kind, http_status, endpoint, model, retryable, attempt when known). The role comes from the engine's error_phase plus the last turn event; the target model is never assumed.
  • infra/worker.py stores it on the result, on each failed repetition and in the scenario_failed event, counts failures per role in summary_metrics, and the run message reads "Every scenario failed (44 target, 3 judge)".
  • A semantic-judge endpoint failure is now a failed scenario with role judge, not UNCERTAIN.
  • UI: role badge per failed scenario, "8 failed: 4 target, 1 auditor…" summary with a filter, detail view keeps the raw message. Target, auditor and system failures show "Not graded" instead of the judge cards. Results without failure render as before. The results list stacks on phones.
  • 39 tests in infra/tests/test_failure_roles.py; full suite 1742 passed, 3 skipped, ruff clean on touched code.

Companion engine change: SimulaMet/SimpleAudit#148, which records the role at the source. This PR works with the current engine and falls back to inference; preferring judgment.failure when present is a follow-up.

Not verified: no real audit against a rate-limited endpoint; embedded_hatchet tests not run. Targets that return HTTP 200 with an error as the answer text are not detected (out of scope).

Store a structured failure object (role required; kind, http_status,
endpoint, model, retryable, attempt best effort) next to the raw error.
Role comes from the engine's error_phase plus the last on_turn phase.
A semantic-judge endpoint failure is now a failed scenario, not UNCERTAIN.
Per-role counts in summary_metrics, run-level message, role badge, summary
and filter in the UI. Results without the structure render as before.

Refs #85
…stem failed

The Response assessment and Judge grade cards stay for judge failures and
for results without a structured failure.
Copilot AI balanced review requested due to automatic review settings November 9, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

0.6.1 records judgment.failure (role and structured detail) and caps
agent-client-protocol<1 for the inspect extra. Full suite passes against
the released package (1746 passed, 3 skipped).
@SushantGautam
SushantGautam merged commit 40ebabe into main Nov 9, 2026
2 checks passed
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.

Show which role failed (target, auditor or judge) on failed scenarios

2 participants