fix(gates): read leading-whitespace frontmatter in check-skill-version-bump

read_version required --- at byte 0 while skill-size-check accepts
leading blank lines, so a file one gate passed the other reported as
unversioned, and an unversioned merge-base side let an unbumped change
through. Match FRONTMATTER_RE, add case 39, and describe the main-tip
check and fail-closed cases in the hook entry.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-16 15:27:17 +00:00
parent 3a9d257225
commit 614a0d5efa
3 changed files with 33 additions and 7 deletions

View File

@@ -189,16 +189,19 @@ repos:
- 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 (ADR-0022)
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)
entry: bash scripts/check-skill-version-bump.sh
language: system
stages: [pre-push]
pass_filenames: false
always_run: true
# Baseline is the merge-base with origin/main (falling back to main),
# not the remote branch tip: readers install from main. Fails closed
# when no main ref resolves. Merges through Gitea's merge button run no
# local hook, so they bypass this.
# "Changed" is measured from the merge-base with origin/main (falling
# back to main), not the remote branch tip: readers install from main.
# The version must also beat main's tip, so two branches making the same
# bump cannot both land. Fails closed when no main ref resolves, when
# there is no merge-base, or when only local main resolves and already
# contains the pushed commit. Merges through Gitea's merge button run no
# local hook, so they bypass this. See docs/spec/gates.md.
- id: validate-marketplace
name: Validate marketplace manifest