You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@magpie.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2026/09/08 01:40:08 UTC
[PR] fix(skill-evals): a CLI that grades nothing is an ERROR, not a PASS [magpie]
potiuk opened a new pull request, #1161:
URL: https://github.com/apache/magpie/pull/1161
## Summary
When the model CLI produced no usable JSON, the runner wrapped its stdout as
`{"raw_output": …}` and handed that to the intersection-only comparator. The
comparator only checks keys present on **both** sides, so if `expected.json`
declared no wrap key it compared nothing — and printed `PASS`.
That turns a broken CLI into a fully green run.
This is not hypothetical. A sandboxed `claude -p` cannot reach the keychain or
`~/.claude.json`, so it returns `Not logged in`. #1156's test plan claims the
three `security-model-*` suites passed **35/35** on exactly that basis; no model
graded a single case. Re-run with credentials, the real result is **28/35**.
## The fix
The wrap stays, because a step whose output is prose has two legitimate ways to
gate on it:
- a `raw_output` / `stderr` / `exit_code` key in `expected.json`, or
- a structural assertion whose `field` addresses one of those in
`assertions.json` — which is what
`security-issue-deduplicate/step-3-merge-body` does.
`wrap_is_asserted()` checks both. When neither is present, the case reports
ERROR naming the cause and printing the first 120 characters of stdout, instead
of a pass that asserted nothing. The same guard covers the non-zero-exit branch,
since some auth failures and safety filters signal via exit code rather than
prose. `--exact` mode is unchanged.
## Blast radius
Narrow by construction: the guard only fires where **no JSON was extracted at
all**. A working CLI emits JSON, takes the normal path, and is unaffected — the
only runs that change are ones where nothing was being graded.
Verified end-to-end rather than by argument:
- Sandboxed (unauthenticated) `security-model-prepare`: was `9 passed`, now
`0 passed, 9 errored`, each naming the cause. Same command, same fixtures.
- `security-issue-deduplicate/step-3-merge-body/case-1` — the one suite that
grades prose via `raw_output` assertions — still reports FAIL, not ERROR, so
the guard does not intercept it. (It fails for an unrelated pre-existing
reason: the model returns `[]` rather than the prose body the step specifies.
Not addressed here.)
## Test plan
- [x] `prek run --all-files` passes (exit 0)
- [x] Workspace: pytest 32/32 members, mypy 26/26, ruff + ruff-format 29/29
- [x] `skill-evals` suite: 161 tests pass
- [x] Two tests that asserted the old vacuous-PASS behaviour are inverted, with
the reasoning in their docstrings
- [x] Three new tests cover the paths that must keep grading:
`assertions.json` field, `expected.json` key, and a negative case
## Notes for reviewers
The two inverted tests are the interesting part of the diff —
`test_cli_mode_non_json_wraps_and_passes_under_field_aware` and
`test_cli_mode_non_zero_exit_wraps_under_field_aware` encoded the vacuous pass
as intended behaviour, which is why nothing caught this earlier.
The README passage describing the old behaviour is rewritten, and a note is
added to *Prerequisites*: `--cli` runs must happen outside any sandbox that
denies the CLI its credentials.
**Follow-up, not in this PR:** the seven real failures the corrected numbers
exposed (`security-model-prepare` 8/9, `verify` 9/11, `update` 11/15). Five of
the seven are rejection paths — cases asserting a cluster is *not* eligible for
a suppression rule, or that a widening suggestion must be refused. Each needs
diagnosing as either an over-specified fixture or a genuine gap in the skill
prose.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01So3JRGXrbqSGrohtZuHWKg
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(skill-evals): a CLI that grades nothing is an ERROR, not a PASS [magpie]
Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #1161:
URL: https://github.com/apache/magpie/pull/1161
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@magpie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org