From f6cf83c841f18d0536e62fc9fdbfa130394f2080 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Fri, 14 Aug 2026 01:52:23 +0000 Subject: [PATCH] fix(ci): make the content-sync gate fire on the cases it exists to catch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `check-plugin-content-sync` was the only local pre-push hook scoped with `files:` instead of `always_run`, and its regex missed both compiled `plugin.json` paths — exactly the manifests the script had been taught to diff. A commit tampering only with one of those passed the entire pre-push suite at exit 0. A regex fix alone could not close it: pre-commit drops deleted paths from the file list, so removing a mirror directory skipped the hook too. The `hooks\.json` alternative was also already dead, matching only the pre-move flat path. Dropping `files:` for `always_run: true` closes all three and makes the hook uniform with its three siblings; the check costs ~2-4s. Also excludes `.github/plugin/marketplace.json` from `pretty-format-json`. This was not hypothetical: `json.dumps(indent=2, sort_keys=True)` reproduces the manifests committed at HEAD byte-for-byte, so `--autofix` had already rewritten compiled apm output once. Without the exclusion it would do so again on the next commit, silently breaking the byte-identical mirror invariant. Landing first, ahead of the regenerated manifests, so that cannot happen. Refs: #90 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01X7GvKuJfy2WrdBmUttV4DT --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1fbafde..ab25009 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,7 +28,7 @@ repos: - id: pretty-format-json stages: ['pre-commit'] args: [--autofix] - exclude: '(^|/)(\.claude-plugin/plugin\.json|\.github/plugin/plugin\.json|\.claude-plugin/marketplace\.json)$|^\.agents/plugins/marketplace\.json$' + exclude: '(^|/)(\.claude-plugin/plugin\.json|\.github/plugin/plugin\.json|\.claude-plugin/marketplace\.json|\.github/plugin/marketplace\.json)$|^\.agents/plugins/marketplace\.json$' - id: check-yaml stages: ['pre-commit'] - id: trailing-whitespace @@ -64,12 +64,12 @@ repos: - id: check-plugin-content-sync name: Check plugin content sync - description: Verify each plugin's flat skills/agents/commands/hooks.json mirror is in sync with .apm/ -- Claude Code has no .apm/ awareness so this compiled mirror must stay current (see issue #90) + description: Verify each plugin's flat skills/agents/commands/hooks/hooks.json mirror is in sync with .apm/ -- Claude Code has no .apm/ awareness so this compiled mirror must stay current (see issue #90) entry: bash scripts/sync-plugin-content.sh --check --all language: system stages: [pre-push] pass_filenames: false - files: '^(scripts/sync-plugin-content\.sh|\.claude-plugin/marketplace\.json|plugins/[^/]+/(apm\.yml|\.mcp\.json|hooks\.json|\.apm/|agents/|skills/|commands/|instructions/|extensions/))' + always_run: true - id: check-marketplace-mirror-sync name: Check marketplace mirror sync