docs: document assertions.json requirement in Pattern 8 - #1043
Conversation
Pattern 8's eval-suite layout omitted assertions.json, so a reader following it exactly produces cases with has_*/mention_* expected keys that silently fall back to MANUAL grading instead of PASS/FAIL. - Add assertions.json to the fixtures directory-layout block. - Add a paragraph explaining the has_*/mention_* structural-key rule and linking to eval-driven-development.md for the format. Closes apache#1004
potiuk
left a comment
There was a problem hiding this comment.
LGTM — accurate on every point I checked, and it documents a genuinely nasty failure mode.
Verified against the runner rather than taking the description on trust:
has_*/mention_*really are the structural-flag prefixes, and the runner looks for a matching predicate inassertions.json—runner.py's module docstring lists the whole predicate set (regex,contains,contains_all,empty,non_empty,field_true,max_length,judge).- The consequence you describe is exactly what the code says: "A structural case with no
assertions.jsonfalls back to MANUAL and prints prompts for manual review." eval-driven-development.mddoes document the format, with a workedhas_merge_readyexample — so the pointer lands somewhere useful rather than at a doc that merely mentions the file.- The tree diagram puts
assertions.jsonat thefixtures/level, next tostep-config.jsonand above thecase-*directories, which matches where the real suites keep it.
The sentence worth the whole PR is this one:
easy to miss since the suite still runs, it just never grades itself
That is the trap. A missing assertions.json does not error, does not fail, and does not skip — the suite reports MANUAL and a contributor scanning for red sees none. Writing that down next to the pattern is more useful than another paragraph on the format.
Tying it to the injection case is the right call too, since "injection flagged, not followed" is precisely the kind of property nobody wants to assert with an exact string match.
Thanks for the first contribution to Apache Magpie.
This review was drafted by an AI-assisted tool and
confirmed by an Apache Magpie maintainer. The maintainer
approving this PR has read the findings and signed off. If
something feels off, please reply on the PR and a maintainer
will follow up.More on how Apache Magpie handles maintainer review:
CONTRIBUTING.md § Opening a pull request.
Closes #1004
Summary
assertions.jsonto the fixtures directory-layout block in Pattern 8,right after
user-prompt-template.md.expected.jsonkeys starting with
has_ormention_are structural flags that need amatching predicate in
assertions.json— without it the case falls backto
MANUALgrading instead ofPASS/FAIL— and linking toeval-driven-development.mdfor the format.Type of change
.claude/skills/<name>/) — eval fixtures updated belowtools/<system>/*.md)tools/*/withpyproject.toml)docs/,README.md,CONTRIBUTING.md)projects/_template/)prek, workflows, validators)Test plan
prek run --all-filespassesuv run pytest/ruff check/mypypasses(
PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)(a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)
RFC-AI-0004 compliance
<PROJECT>,<tracker>,<upstream>,<security-list>) used in all skill / tool prose (thecheck-placeholdersprek hook is the mechanical gate)Linked issues
Closes #1004
Notes for reviewers (optional)
None.