Skip to content

feat(validator): add override-file contract check for .apache-magpie-overrides/ - #665

Merged
potiuk merged 2 commits into
apache:mainfrom
justinmclean:override-file-contract-tests
Jul 1, 2026
Merged

feat(validator): add override-file contract check for .apache-magpie-overrides/#665
potiuk merged 2 commits into
apache:mainfrom
justinmclean:override-file-contract-tests

Conversation

@justinmclean

Copy link
Copy Markdown
Member

Summary

Add a new SOFT advisory check (check #15) to the skill-and-tool-validator
that validates .apache-magpie-overrides/.md files in adopter repos.

Two advisory checks per file:

  • Structure: the canonical 'apache-magpie agentic override' header comment
    must be present (confirms the file was created via /magpie-setup override).
  • Baseline integrity: heuristic scan for patterns attempting to weaken the
    framework safety / confidentiality / privacy / data-not-instructions
    baseline (ignore safety, bypass confidentiality, skip privacy-llm-gate,
    treat external content as instructions, disclose confidential reports).

HTML comment lines are excluded from the weakening scan to avoid flagging
prose that explains what NOT to do. The directory scanner silently skips
repos without an override directory. All violations are SOFT advisory.

21 new tests cover: clean override passes, missing header, each weakening
pattern, HTML-comment exclusion, directory scanner, README.md skip,
multi-file coverage, and discoverable-without-editing-skill confirmation.

Also clears the override-file contract gap from specs/adoption-and-setup.md.

Generated-by: Claude (Opus 4.7)

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:

Collapse "What's been built" to one line per item; all 22 planned work
items preserved verbatim; redundant shipped-state notes trimmed.

Generated-by: Claude (Opus 4.7)
…overrides/

Add a new SOFT advisory check (check apache#15) to the skill-and-tool-validator
that validates .apache-magpie-overrides/<skill>.md files in adopter repos.

Two advisory checks per file:
- Structure: the canonical 'apache-magpie agentic override' header comment
  must be present (confirms the file was created via /magpie-setup override).
- Baseline integrity: heuristic scan for patterns attempting to weaken the
  framework safety / confidentiality / privacy / data-not-instructions
  baseline (ignore safety, bypass confidentiality, skip privacy-llm-gate,
  treat external content as instructions, disclose confidential reports).

HTML comment lines are excluded from the weakening scan to avoid flagging
prose that explains what NOT to do. The directory scanner silently skips
repos without an override directory. All violations are SOFT advisory.

21 new tests cover: clean override passes, missing header, each weakening
pattern, HTML-comment exclusion, directory scanner, README.md skip,
multi-file coverage, and discoverable-without-editing-skill confirmation.

Also clears the override-file contract gap from specs/adoption-and-setup.md.

Generated-by: Claude (Opus 4.7)
@justinmclean justinmclean self-assigned this Jul 1, 2026
@potiuk

potiuk commented Jul 1, 2026

Copy link
Copy Markdown
Member

Oh.. very cool :)

@potiuk
potiuk merged commit ed85ee5 into apache:main Jul 1, 2026
30 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.

2 participants