feat(gates): sweep the provenance corpus on pre-push

Nothing ran validate-provenance.sh across the real corpus, so the 36
INFOs it reported for Research doc mismatches were found only by a
manual loop, and a FAIL tier would have been inert. Add
scripts/check-provenance-corpus.sh, which runs the validator over every
plugins/*/.apm/skills/*/ that has references/sources.md.

Exit 1 when any skill FAILs, naming them; INFO lines are printed but do
not fail; exit 2 when the gate cannot run (missing validator, validator
exit 2, or no skills found). Registered as a pre-push hook shaped like
check-scope-walkup-sync, documented in docs/spec/gates.md, and pinned in
test-adr0020-contract.sh's list of repo-authored hooks.

Refs: #121
ADR: 0028
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EGHFJextYtVQseaHPDDhxB
This commit is contained in:
2026-09-21 17:29:20 +00:00
parent 740f631d1d
commit a1f9fa9091
5 changed files with 338 additions and 1 deletions

View File

@@ -220,6 +220,21 @@ repos:
pass_filenames: false
always_run: true
- id: check-provenance-corpus
name: Check provenance across the skill corpus
description: Run factory-audit's validate-provenance.sh over every plugins/*/.apm/skills/*/ that has references/sources.md and fail on any FAIL (ADR-0028, #121)
entry: bash scripts/check-provenance-corpus.sh
language: system
stages: [pre-push]
pass_filenames: false
always_run: true
# Nothing else runs validate-provenance.sh over the real corpus --
# check-scope-walkup-sync exercises it against synthetic fixtures only --
# so ADR-0028's FAIL tier for a Research doc mismatch would be inert
# without this caller. The skill set is globbed, not counted, and
# discovering zero skills is an error (exit 2), not a pass. Needs no
# network; needs python3, which the validator's own preflight names.
- id: check-skill-version-bump
name: Check changed skills bump metadata.version
description: On every push, fail if a skill directory changed (tests/ excluded) since the merge-base with main without its SKILL.md metadata.version rising above both that merge-base's and main's tip's (ADR-0022)