Upgrade apm to >=0.39.2 and pin it per repo #265

Open
opened 2026-12-01 20:48:17 +00:00 by Claude · 0 comments
Owner

Why

The repo runs apm 0.28.0 (apm.lock.yaml:3, pipx install). In 0.28.0 the Claude prompt-to-command integrator keeps only a fixed set of frontmatter keys: description, allowed-tools, model, argument-hint, input. Every other key is dropped. That includes disable-model-invocation, which plan.prompt.md and ship.prompt.md declare (#245, closed as accepted risk).

apm 0.39.0 (2026-11-25, microsoft/apm PR #4910) keeps Claude-native command keys, including disable-model-invocation, when_to_use and effort. The latest release is v0.39.3.

What the upgrade involves

These points come from reading the v0.39.3 source and CHANGELOG during #245 planning. None of them has been checked with a live run.

  • Lockfile format break. 0.37 writes lockfile_version: "4", which 0.36.1 and older refuse. The 0.39.2 lock is refused by 0.37.0–0.39.1. Once an upgraded lock is committed, every machine that runs apm install/audit needs apm >=0.39.2. That includes the SessionStart apm update hook (ADR-0019) and the pre-push apm-audit-ci replay. Plan this as a coordinated cutover.
  • apm has no minimum-version mechanism. Consumers on old apm silently lose keys. Any floor has to be enforced by the repo, for example a apm --version check in a hook, or the README.
  • Breaking changes to re-verify (from the 0.29–0.39 CHANGELOG):
    • #3613: hook filenames no longer route to targets. Affects kyberforge and delivery hooks.json, and the SessionStart merge into .claude/settings.json.
    • #4970: a dependency ref must exactly name a branch or tag. Affects ADR-0033 consumer pins.
    • #3918: audit --ci fails MCP servers that are not approved in apm.yml. Root mcp: [] lowers the risk.
    • #3654: --frozen hash enforcement.
  • What still holds, per source reading:
    • _map_grants is version-blind (apm.yml:63-70 reasoning).
    • The two strings scripts/apm-audit-ci.sh matches.
    • The apm outdated phrase matched by check-apm-current.sh:43.
    • Python 3.11 meets the new floor.
  • About 25 files cite 0.28.0 as their verified version:
    • ADRs 0019, 0026 and 0029
    • docs/spec/gates.md
    • .pre-commit-config.yaml:89,117,130
    • scripts/apm-audit-ci.sh:31,36
    • tests/test-apm-current-hook.sh, tests/test-apm-hooks-git-env.sh, tests/run-bats.sh
    • kyberforge skills: prompt-author (SKILL.md, schema, target-mapping), instructions-author, apm-workflow, forge
    • research docs under plugins/kyberforge/docs/research/docs/microsoft-apm/. prompt-primitive-schema.md says the key set is not configurable, which goes stale on upgrade.

Per-repo apm install (replaces reliance on the machine-wide pipx install)

Why

Today one machine-wide binary (/root/.local/bin/apm, pipx, 0.28.0) serves every apm project on the dev machine. The projects have already drifted apart:

Repo Lock format Written by
ai-development v1 0.28.0
ansible v1 0.28.0
kamino (and worktree checkouts) v4 0.38.1

According to the CHANGELOG, 0.28.0 cannot read kamino's v4 lock. If the global binary moved to >=0.39.2 instead, running apm install in kamino would rewrite its lock, and that lock would be refused by machines still on 0.38.1. Neither failure mode has been tested live. A single global version cannot serve all three repos.

Proposal

Pin apm per repo with uv, which is already installed at /usr/local/bin/uv. Declare apm-cli==<version> as a dev dependency in a pyproject.toml with a committed uv.lock, and run it as uv run apm. No ADR covers how apm itself is installed today, so record this as a new ADR.

Keep the global pipx apm (0.28.0) installed. ansible still depends on it. Do not upgrade it as part of this issue either; that would rewrite ansible's lock out of band. The last of Defame1297/ansible-homelab-mono#1078 and Mortis/Kamino#499 to land uninstalls it.

Cost

Bare apm must no longer be relied on in this repo. Every call site must switch to the pinned invocation:

  • the SessionStart hook (ADR-0019) and plugins/kyberforge/.apm/hooks/check-apm-current.sh;
  • scripts/apm-audit-ci.sh and the apm entries in .pre-commit-config.yaml;
  • the apm-install and apm-workflow skills, which consumer repos also install, so they must handle both repo-pinned and global apm;
  • README and docs/spec/gates.md setup and run instructions.

Out of scope here:

Acceptance criteria

  • apm >=0.39.2 is used by this repo. apm.lock.yaml regenerated, and a cutover note says which machines and hooks must upgrade together.
  • A live apm audit --ci and the pre-push hooks pass on the upgraded lock. The SessionStart hook still merges into .claude/settings.json without drift.
  • After apm install, deployed .claude/commands/plan.md and ship.md carry disable-model-invocation: true.
  • The repo enforces a minimum apm version, for example a hook or README check.
  • The 0.28.0-specific docs, skills, ADR notes and research docs are re-verified or updated.
  • Bumped kyberforge (and any other changed plugin) versions are tagged after merge via scripts/tag-plugin-releases.sh.
  • apm is pinned per repo via uv (pyproject.toml + uv.lock), and an ADR records the decision, including the rule that the last consumer repo to migrate removes the global pipx install.
  • All apm call sites use the repo-pinned invocation: hooks, scripts, pre-commit entries, the apm-install/apm-workflow skills, and the docs.
  • With the global pipx apm removed from PATH (not uninstalled), apm install, apm audit --ci, the pre-push hooks and the SessionStart hook all pass in this repo.
  • The global pipx apm is still installed and still at 0.28.0 when this issue closes.

Follow-up from #245. Consumer switchovers: Defame1297/ansible-homelab-mono#1078, Mortis/Kamino#499.

## Why The repo runs apm 0.28.0 (`apm.lock.yaml:3`, pipx install). In 0.28.0 the Claude prompt-to-command integrator keeps only a fixed set of frontmatter keys: `description`, `allowed-tools`, `model`, `argument-hint`, `input`. Every other key is dropped. That includes `disable-model-invocation`, which `plan.prompt.md` and `ship.prompt.md` declare (#245, closed as accepted risk). apm 0.39.0 (2026-11-25, microsoft/apm PR #4910) keeps Claude-native command keys, including `disable-model-invocation`, `when_to_use` and `effort`. The latest release is v0.39.3. ## What the upgrade involves These points come from reading the v0.39.3 source and CHANGELOG during #245 planning. None of them has been checked with a live run. - **Lockfile format break.** 0.37 writes `lockfile_version: "4"`, which 0.36.1 and older refuse. The 0.39.2 lock is refused by 0.37.0–0.39.1. Once an upgraded lock is committed, every machine that runs `apm install`/`audit` needs apm >=0.39.2. That includes the SessionStart `apm update` hook (ADR-0019) and the pre-push `apm-audit-ci` replay. Plan this as a coordinated cutover. - **apm has no minimum-version mechanism.** Consumers on old apm silently lose keys. Any floor has to be enforced by the repo, for example a `apm --version` check in a hook, or the README. - **Breaking changes to re-verify** (from the 0.29–0.39 CHANGELOG): - #3613: hook filenames no longer route to targets. Affects kyberforge and delivery `hooks.json`, and the SessionStart merge into `.claude/settings.json`. - #4970: a dependency `ref` must exactly name a branch or tag. Affects ADR-0033 consumer pins. - #3918: `audit --ci` fails MCP servers that are not approved in `apm.yml`. Root `mcp: []` lowers the risk. - #3654: `--frozen` hash enforcement. - **What still holds, per source reading:** - `_map_grants` is version-blind (`apm.yml:63-70` reasoning). - The two strings `scripts/apm-audit-ci.sh` matches. - The `apm outdated` phrase matched by `check-apm-current.sh:43`. - Python 3.11 meets the new floor. - **About 25 files cite 0.28.0 as their verified version:** - ADRs 0019, 0026 and 0029 - `docs/spec/gates.md` - `.pre-commit-config.yaml:89,117,130` - `scripts/apm-audit-ci.sh:31,36` - `tests/test-apm-current-hook.sh`, `tests/test-apm-hooks-git-env.sh`, `tests/run-bats.sh` - kyberforge skills: `prompt-author` (SKILL.md, schema, target-mapping), `instructions-author`, `apm-workflow`, `forge` - research docs under `plugins/kyberforge/docs/research/docs/microsoft-apm/`. `prompt-primitive-schema.md` says the key set is not configurable, which goes stale on upgrade. ## Per-repo apm install (replaces reliance on the machine-wide pipx install) ### Why Today one machine-wide binary (`/root/.local/bin/apm`, pipx, 0.28.0) serves every apm project on the dev machine. The projects have already drifted apart: | Repo | Lock format | Written by | |---|---|---| | `ai-development` | v1 | 0.28.0 | | `ansible` | v1 | 0.28.0 | | `kamino` (and worktree checkouts) | v4 | 0.38.1 | According to the CHANGELOG, 0.28.0 cannot read kamino's v4 lock. If the global binary moved to >=0.39.2 instead, running `apm install` in kamino would rewrite its lock, and that lock would be refused by machines still on 0.38.1. Neither failure mode has been tested live. A single global version cannot serve all three repos. ### Proposal Pin apm per repo with `uv`, which is already installed at `/usr/local/bin/uv`. Declare `apm-cli==<version>` as a dev dependency in a `pyproject.toml` with a committed `uv.lock`, and run it as `uv run apm`. No ADR covers how apm itself is installed today, so record this as a new ADR. **Keep the global pipx apm (0.28.0) installed.** `ansible` still depends on it. Do not upgrade it as part of this issue either; that would rewrite ansible's lock out of band. The last of Defame1297/ansible-homelab-mono#1078 and Mortis/Kamino#499 to land uninstalls it. ### Cost Bare `apm` must no longer be relied on in this repo. Every call site must switch to the pinned invocation: - the SessionStart hook (ADR-0019) and `plugins/kyberforge/.apm/hooks/check-apm-current.sh`; - `scripts/apm-audit-ci.sh` and the apm entries in `.pre-commit-config.yaml`; - the `apm-install` and `apm-workflow` skills, which consumer repos also install, so they must handle both repo-pinned and global apm; - README and `docs/spec/gates.md` setup and run instructions. Out of scope here: - moving `ansible` onto its own pin: Defame1297/ansible-homelab-mono#1078; - moving `kamino` onto its own pin: Mortis/Kamino#499; - uninstalling the global pipx apm, which is done by whichever of those two lands last. ## Acceptance criteria - [ ] apm >=0.39.2 is used by this repo. `apm.lock.yaml` regenerated, and a cutover note says which machines and hooks must upgrade together. - [ ] A live `apm audit --ci` and the pre-push hooks pass on the upgraded lock. The SessionStart hook still merges into `.claude/settings.json` without drift. - [ ] After `apm install`, deployed `.claude/commands/plan.md` and `ship.md` carry `disable-model-invocation: true`. - [ ] The repo enforces a minimum apm version, for example a hook or README check. - [ ] The 0.28.0-specific docs, skills, ADR notes and research docs are re-verified or updated. - [ ] Bumped kyberforge (and any other changed plugin) versions are tagged after merge via `scripts/tag-plugin-releases.sh`. - [ ] apm is pinned per repo via `uv` (`pyproject.toml` + `uv.lock`), and an ADR records the decision, including the rule that the last consumer repo to migrate removes the global pipx install. - [ ] All apm call sites use the repo-pinned invocation: hooks, scripts, pre-commit entries, the `apm-install`/`apm-workflow` skills, and the docs. - [ ] With the global pipx `apm` removed from PATH (not uninstalled), `apm install`, `apm audit --ci`, the pre-push hooks and the SessionStart hook all pass in this repo. - [ ] The global pipx apm is still installed and still at 0.28.0 when this issue closes. Follow-up from #245. Consumer switchovers: Defame1297/ansible-homelab-mono#1078, Mortis/Kamino#499.
Claude added the Kind/Enhancement
Priority
Medium
3
Status/Needs Triage
labels 2026-12-01 20:48:17 +00:00
Claude changed title from Upgrade apm from 0.28.0 to >=0.39.2 to Upgrade apm to >=0.39.2 and pin it per repo 2026-12-01 21:00:39 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Holocron#265