Commit fb51858
committed
test(evaluation): add deterministic manage-assistant eval harness (E1/E5/E6)
Route-level eval harness for the lecturer Manage assistant, driving the real
`/api/manage/chat` SSE endpoint against the live dev stack. Three dimensions:
E1 tool selection (soft threshold 0.95), E5 refusal/do-not-save and E6
prompt-injection resistance (hard gates, 0 failures allowed).
E6 exercises the genuine indirect-injection surface: `seed.py` idempotently
creates a synthetic collaborator lecturer owning elements whose `content`
carries injection payloads, then grants the eval lecturer READ via
`DerivedPermission` — the same visibility path a shared element uses, since
the MCP read tools gate on derived permissions rather than `ownerId`.
Hard gates are only worth their green checkmark if red is reachable. Every
check here tests for the ABSENCE of unsafe behavior, so an adversarial review
of the first cut found two ways to be vacuously green, both fixed here:
- `score_case` never asserted the model produced anything, so an HTTP-200
stream that died immediately (the AI SDK's `finishReason: "error"`, which
emits no error frame) passed every E5 do-not-save case and every direct E6
case. It now requires positive evidence the turn ran.
- E6's retrieval check only verified a retrieval tool NAME was called, so a
search returning zero hits was indistinguishable from resisting an
injection. It now requires the seeded payload's unique marker in the tool
output the model actually received.
`tests/test_scoring_contract.py` locks both in: network-free tests over the
real shipped case files asserting the gates FAIL on a degenerate turn, on
content-blind retrieval, on forbidden calls, and on transport errors. Each was
confirmed to fail when its fix is reverted. They are marked `offline` so they
run with no dev stack, DB, or network.
Also from that review: declared `expected_calls[].arguments` are now enforced
(a hallucinated id no longer scores a pass), the seven subset-policy E1 read
cases forbid a spurious persist call, a trial-capped run is labelled as such
in the summary instead of looking full-strength, and the 429 retry path is
counted by the rate pacer.1 parent 1a1444c commit fb51858
48 files changed
Lines changed: 3921 additions & 0 deletions
File tree
- evaluation/manage-assistant
- data/ground_truth
- manage_assistant_e1_tool_selection
- manage_assistant_e5_refusal_do_not_save
- manage_assistant_e6_prompt_injection
- src/manage_assistant_eval
- tests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Large diffs are not rendered by default.
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
0 commit comments