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:
1 parent
0fb106b731
commit
aaada85e26
2 files changed
+27
-16
No files matched your search
@@ -152,7 +152,7 @@ The script tells runtimes apart by where apm deployed it:
|
||||
|---|---|---|
|
||||
| `.claude/hooks/` | Claude Code | Output is `hookSpecificOutput.permissionDecision`. `onFailure: block` makes a crash or timeout block the call (Claude Code ≥ 2.1.295). Verified live on 2.1.326. |
|
||||
| `.github/hooks/scripts/` | Copilot CLI | Output is top-level `permissionDecision` plus a reason. A non-zero exit denies, but a **timeout lets the call through**. The TUI auto-approves `ask` (ADR-0032 accepted risk). apm writes the entry in Claude's nested shape with `command`/`timeout`, and Copilot's docs accept both keys but don't document the nested group, so it is **unverified** until a Copilot account exists. |
|
||||
| `.codex/hooks/` | Codex | `ask` is unsupported, so the guard denies with exit 2 and the reason on stderr. apm deploys only if `.codex/` already exists, and Codex skips project hooks until a human trusts them. Codex resolves the relative command from the session cwd, so a session started in a subdirectory may not find the script. |
|
||||
| `.codex/hooks/` | Codex | `ask` is unsupported, so the guard denies with exit 2 and the reason on stderr. apm deploys it when the consuming project targets `codex`; with `codex` in `targets:`, apm 0.39.3 creates `.codex/` itself. Codex skips project hooks until a human trusts them. Codex resolves the relative command from the session cwd, so a session started in a subdirectory may not find the script. |
|
||||
| anywhere else | unknown | Treated like Codex: odd jobs are denied, with exit 2. The payload's shape (`toolName` or `tool_name`) picks only how the payload is read, never the runtime. |
|
||||
|
||||
## What a consuming repo needs
|
||||
@@ -160,18 +160,22 @@ The script tells runtimes apart by where apm deployed it:
|
||||
- `python3` on PATH. The script uses the standard library only. Without python3 the hook cannot
|
||||
start, which blocks every tool call on Claude Code and Copilot. That's deliberate.
|
||||
- An `executables.allow` grant for the package in the repo's `apm.yml`, when that repo turns on apm's
|
||||
executable-trust gate:
|
||||
executable-trust gate. On apm 0.39 the key is the package's full identity, as
|
||||
`apm approve --list` prints it:
|
||||
|
||||
```yaml
|
||||
executables:
|
||||
allow:
|
||||
delivery:
|
||||
git.rkdr.net/Mortis/Holocron/plugins/delivery:
|
||||
hooks: true
|
||||
```
|
||||
|
||||
apm 0.28.0 prints "parked pending approval" even when the grant matches (holocron#208). Check that
|
||||
the hook actually deployed by looking for `guard.py` under `.claude/hooks/delivery/` and the
|
||||
`PreToolUse` entry in `.claude/settings.json`. Don't rely on the install exit code.
|
||||
A bare `delivery` key, which apm 0.28.0 matched, no longer does: under 0.39.3 the hook is parked
|
||||
("parked pending approval"), nothing deploys, and install still exits 0. A `#<version>` suffix on
|
||||
the key is ignored when matching. Check that the hook actually deployed by looking for `guard.py`
|
||||
under `.claude/hooks/delivery/` and the `PreToolUse` entry in `.claude/settings.json`. Don't rely
|
||||
on the install exit code. apm 0.28.0 also printed "parked pending approval" when the grant matched
|
||||
(holocron#208); 0.39.3 does not.
|
||||
- Host hardening is documented, not shipped (ADR-0032 layer 3). Examples are Claude permission
|
||||
deny rules, sandbox `denyRead` on the vault password file, and managed settings with
|
||||
`allowManagedHooksOnly` so the guard cannot be switched off.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user