Skip to content

docs: document assertions.json requirement in Pattern 8 - #1043

Merged
potiuk merged 1 commit into
apache:mainfrom
deepusnath:docs/document-assertions-json-pattern-8
Jul 31, 2026
Merged

docs: document assertions.json requirement in Pattern 8#1043
potiuk merged 1 commit into
apache:mainfrom
deepusnath:docs/document-assertions-json-pattern-8

Conversation

@deepusnath

Copy link
Copy Markdown
Contributor

Closes #1004

Summary

  • Add assertions.json to the fixtures directory-layout block in Pattern 8,
    right after user-prompt-template.md.
  • Add a paragraph after the four-case list explaining that expected.json
    keys starting with has_ or mention_ are structural flags that need a
    matching predicate in assertions.json — without it the case falls back
    to MANUAL grading instead of PASS/FAIL — and linking to
    eval-driven-development.md for the format.

Type of change

  • Skill change (.claude/skills/<name>/) — eval fixtures updated below
  • Tool / bridge contract (tools/<system>/*.md)
  • Python package (tools/*/ with pyproject.toml)
  • Groovy reference impl
  • Cross-cutting (RFC, AGENTS.md, sandbox, privacy-LLM)
  • Documentation (docs/, README.md, CONTRIBUTING.md)
  • Project template (projects/_template/)
  • CI / dev loop (prek, workflows, validators)
  • Other:

Test plan

  • prek run --all-files passes
  • For Python packages touched: uv run pytest / ruff check / mypy passes
  • For Groovy bridges touched: command-line invocation tested end-to-end
  • For skill changes: eval suite passes for the affected skill
    (PYTHONPATH=tools/skill-evals/src python3 -m skill_evals.runner tools/skill-evals/evals/<skill>/)
  • For skill behaviour changes: a new or updated eval fixture is included in this PR
    (a regression test for the bug fixed / the behaviour added — see CONTRIBUTING.md)
  • Other:

RFC-AI-0004 compliance

  • HITL — any new mutation is gated on explicit user confirmation
  • Sandbox — no new unrestricted host access; network reach declared in the adapter
  • Vendor neutrality — placeholders (<PROJECT>, <tracker>, <upstream>, <security-list>) used in all skill / tool prose (the check-placeholders prek hook is the mechanical gate)
  • Conversational + correctable — agentic-override path documented if behaviour is adopter-tunable
  • Write-access discipline — no autonomous outbound messages; drafts only, sent on confirmation
  • Privacy LLM — private content does not reach a non-approved LLM; redactor invoked where needed

Linked issues

Closes #1004

Notes for reviewers (optional)

None.

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
@deepusnath
deepusnath marked this pull request as ready for review July 30, 2026 19:14

@potiuk potiuk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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 in assertions.jsonrunner.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.json falls back to MANUAL and prints prompts for manual review."
  • eval-driven-development.md does document the format, with a worked has_merge_ready example — so the pointer lands somewhere useful rather than at a doc that merely mentions the file.
  • The tree diagram puts assertions.json at the fixtures/ level, next to step-config.json and above the case-* 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.

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.

Document assertions.json in the pattern catalogue's eval-suite pattern

2 participants