kyberforge SessionStart hook resolves the repo-pinned apm and flags apm older than 0.39.2 #270

Open
opened 2026-12-01 22:57:38 +00:00 by Claude · 0 comments
Owner

Parent

#268 (spec). Decisions: ADR-0034. Read the findings comment from #269 on #268 first.

What to build

The kyberforge SessionStart hook (ADR-0019) ships to every consumer repo. Today it always runs the bare apm on PATH. Change it to choose the right apm:

  1. the repo's uv-pinned apm, when the project declares an apm-cli pin and uv is on PATH;
  2. otherwise the apm on PATH;
  3. otherwise nothing, and it exits silently.

It decides the binary once and uses it for both the outdated check and the update. It never runs a uv sync or install. When the chosen apm is older than 0.39.2, it prints a fixed "apm too old" line instead of running the outdated check, because a refused v4 lock would otherwise look up to date. All advice lines are fixed text that names the chosen binary (uv run apm install or apm install), and command output is never interpolated.

This must land, released and tagged, before the cutover. The new hook must already be deployed when this repo's lock goes to v4. On this repo it still falls back to the global apm until the cutover adds the pin.

Also amend ADR-0034 to say the test seam is a PATH stub of uv, not an APM env override.

Acceptance criteria

  • The hook test (seam A: fake binaries first on PATH, asserting only exit code and stdout) covers every case below, and all pass:
    • pin plus uv present: uses uv run;
    • pin but no uv: falls back to PATH apm;
    • no pin with a PATH apm;
    • no apm at all: silent, exit 0;
    • PATH apm below 0.39.2: prints the fixed too-old line and runs no outdated check;
    • stale and current outdated output on the uv path and on the PATH path.
  • A fake uv records every invocation, and the tests assert that uv sync, or any uv command other than run, is never called.
  • Every advice string is a fixed literal that names the chosen binary. A test with hostile outdated output, such as ANSI codes or shell metacharacters, shows that none of it reaches the advice text.
  • The existing real-apm probe still passes on this machine. It uses PATH apm 0.28.0 here until the cutover.
  • The kyberforge version is bumped, with metadata.version bumps for any changed skill. The root executables.allow key follows the new version, and the marketplace manifest is re-packed. Pre-commit and pre-push pass.
  • ADR-0034 carries a dated amendment recording the PATH-stub test seam.
  • Once merged, scripts/tag-plugin-releases.sh is run. The exact tag and push command are shown to the maintainer and pushed only on their explicit yes. git ls-remote --tags origin 'kyberforge-v*' shows the new tag.

Blocked by

## Parent #268 (spec). Decisions: ADR-0034. Read the findings comment from #269 on #268 first. ## What to build The kyberforge SessionStart hook (ADR-0019) ships to every consumer repo. Today it always runs the bare `apm` on PATH. Change it to choose the right apm: 1. the repo's uv-pinned apm, when the project declares an apm-cli pin and uv is on PATH; 2. otherwise the apm on PATH; 3. otherwise nothing, and it exits silently. It decides the binary once and uses it for both the outdated check and the update. It never runs a uv sync or install. When the chosen apm is older than 0.39.2, it prints a fixed "apm too old" line instead of running the outdated check, because a refused v4 lock would otherwise look up to date. All advice lines are fixed text that names the chosen binary (`uv run apm install` or `apm install`), and command output is never interpolated. This must land, released and tagged, before the cutover. The new hook must already be deployed when this repo's lock goes to v4. On this repo it still falls back to the global apm until the cutover adds the pin. Also amend ADR-0034 to say the test seam is a PATH stub of `uv`, not an `APM` env override. ## Acceptance criteria - [ ] The hook test (seam A: fake binaries first on PATH, asserting only exit code and stdout) covers every case below, and all pass: - pin plus uv present: uses `uv run`; - pin but no uv: falls back to PATH apm; - no pin with a PATH apm; - no apm at all: silent, exit 0; - PATH apm below 0.39.2: prints the fixed too-old line and runs no outdated check; - stale and current outdated output on the uv path and on the PATH path. - [ ] A fake `uv` records every invocation, and the tests assert that `uv sync`, or any uv command other than `run`, is never called. - [ ] Every advice string is a fixed literal that names the chosen binary. A test with hostile outdated output, such as ANSI codes or shell metacharacters, shows that none of it reaches the advice text. - [ ] The existing real-apm probe still passes on this machine. It uses PATH apm 0.28.0 here until the cutover. - [ ] The kyberforge version is bumped, with `metadata.version` bumps for any changed skill. The root `executables.allow` key follows the new version, and the marketplace manifest is re-packed. Pre-commit and pre-push pass. - [ ] ADR-0034 carries a dated amendment recording the PATH-stub test seam. - [ ] Once merged, `scripts/tag-plugin-releases.sh` is run. The exact tag and push command are shown to the maintainer and pushed only on their explicit yes. `git ls-remote --tags origin 'kyberforge-v*'` shows the new tag. ## Blocked by - #269
Claude added the Kind/Enhancement
Priority
Medium
3
Status/Ready for Agent
labels 2026-12-01 22:57:38 +00:00
Claude added a new dependency 2026-12-01 22:58:13 +00:00
Claude added a new dependency 2026-12-01 22:58:14 +00:00
Claude added this to the Spec: Upgrade apm to 0.39.3 and pin it per repo with uv milestone 2026-12-01 22:58:24 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: Mortis/Holocron#270