docs(plugins): describe full-identity hook grants on apm 0.39

The kyberforge and delivery hook docs still described apm 0.28.0: a bare
kyberforge#<version> or delivery key matching, and "parked pending
approval" printed for a granted package. On 0.39.3 a bare key parks the
hook and deploys nothing with exit 0, the full
<host>/<owner>/<repo>/<path> identity is required, and the #<version>
suffix is still ignored when matching. Re-run the copilot and codex hook
placement on 0.39.3: with codex in targets, apm now creates .codex/
itself.

Refs: #273

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-12-02 11:59:17 +00:00
1 parent 0fb106b731
commit aaada85e26
2 files changed
+27 -16

No files matched your search

+17 -10
View File
@@ -70,15 +70,21 @@ tracked in a `.claude/apm-hooks.json` sidecar, so an uninstall removes them with
hand-authored hooks. Both `.claude/hooks/` and the sidecar are gitignored install output.
Note that apm's **executable-trust gate is off** unless the consuming project's `apm.yml` has an
`executables:` block — without one, package hooks deploy with no prompt. The grant is
**version-blind**: apm also matches an allow key such as `kyberforge#<version>` by its bare package
name, so a version bump on one side does not stop the hook deploying (verified against apm 0.28.0;
the correction is recorded in ADR-0019 and `docs/spec/gates.md`). This repo still keeps each key at
`<name>#<version>` as a record of which version was reviewed, and `check-executables-allow-sync` is
the pre-push gate that holds every plugin shipping `.apm/hooks/` or `bin/` to that.
`executables:` block — without one, package hooks deploy with no prompt. An allow key must be the
package's **full identity**, `<host>/<owner>/<repo>/<path>`, as `apm approve --list` prints it, for
example `git.rkdr.net/Mortis/Holocron/plugins/kyberforge`. apm 0.39 no longer matches the bare
`kyberforge#<version>` form that 0.28.0 accepted: under 0.39.3 that key parks the hook ("parked
pending approval"), deploys nothing and exits 0 (spike #269, re-run under #273). The grant is still
**version-blind**: apm strips a `#<version>` suffix before matching, so a key at one version admits
any other, and a version bump on one side does not stop the hook deploying. This repo keeps each key
at `<identity>#<version>` as a record of which version was reviewed, and
`check-executables-allow-sync` is the pre-push gate that holds every plugin shipping `.apm/hooks/` or
`bin/` to that.
apm 0.28.0 prints "parked pending approval" for a granted package even when it deploys the hook
(holocron#208). Check for the deployed script and settings entry, not the warning.
A matching type-level grant (`hooks: true`) deploys the hook, and every install then warns that the
approval is "not pinned to content". apm 0.28.0 printed "parked pending approval" even for a granted
package (holocron#208); 0.39.3 prints it only when the hook really was not deployed. Either way, check
for the deployed script and settings entry, not the exit code.
## The SessionStart hook
@@ -149,14 +155,15 @@ hook.
An earlier version of this section said Copilot loads no hooks from an apm package, because nothing
pointed Copilot at a hooks file and apm wrote only a Claude-shaped definition. That no longer holds:
apm 0.28.0 shapes and deploys hooks per target itself, with no `plugin.json` pointer involved.
apm shapes and deploys hooks per target itself, with no `plugin.json` pointer involved. The table
below was observed on 0.28.0 and re-run on 0.39.3 (holocron#273).
Sources: `docs/research/infra-packages/enforcement-hooks.md` on the `research/enforcement-hooks`
branch, and the [delivery guard hook](https://git.rkdr.net/Mortis/Holocron/issues/190) work.
| Target | Where apm writes the hook | Status |
|---|---|---|
| `copilot` | One file per hook, `.github/hooks/<pkg>-<name>.json`, with the script under `.github/hooks/scripts/<pkg>/.apm/hooks/`. Event names are renamed to camelCase and `version: 1` is added. | **Unverified.** Entries keep Claude's nested matcher group with `command`/`timeout`. Copilot's docs accept `command`/`timeout` as aliases for `bash`/`powershell`, but don't document the nested group, so whether Copilot CLI runs the hook is untested until a Copilot account exists. |
| `codex` | Merged into `.codex/hooks.json`, with the script under `.codex/hooks/<pkg>/.apm/hooks/`. Claude's event names and shape are kept. | apm skips the target unless `.codex/` already exists, and Codex runs project hooks only after a human trusts them. |
| `codex` | Merged into `.codex/hooks.json`, with the script under `.codex/hooks/<pkg>/.apm/hooks/` and ownership in `.codex/apm-hooks.json`. Claude's event names and shape are kept. | With `codex` in `targets:`, apm 0.39.3 creates `.codex/` and deploys; whether it skips an auto-detected codex target with no `.codex/` was not re-run. Codex runs project hooks only after a human trusts them. |
Only enabled targets get a hook: this repo's root `apm.yml` targets `claude` alone, so nothing lands
in `.github/hooks/` or `.codex/` here. VS Code's Copilot reads both `.github/hooks/` and