fix(apm): commit the hook ownership sidecar so fresh installs stay idempotent

apm recognises its own settings.json hook entries only through the
.claude/apm-hooks.json sidecar. With the sidecar gitignored, apm install
in a fresh clone keeps the committed SessionStart entry as user-owned and
appends a duplicate, so apm audit --ci reports drift and the apm-audit-ci
pre-push hook fails. Reproduced on main and this branch with apm 0.28.0.

Commit the sidecar in apm's exact serialisation, exclude it from
pretty-format-json alongside settings.json, and record the correction
in ADR-0019.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-16 15:26:56 +00:00
parent 55221d099f
commit 3a9d257225
4 changed files with 37 additions and 8 deletions

15
.claude/apm-hooks.json Normal file
View File

@@ -0,0 +1,15 @@
{
"SessionStart": [
{
"matcher": "startup",
"hooks": [
{
"type": "command",
"command": "\"${CLAUDE_PROJECT_DIR}/.claude/hooks/kyberforge/.apm/hooks/check-apm-current.sh\"",
"timeout": 380
}
],
"_apm_source": "Defame1297/holocron/plugins/kyberforge"
}
]
}