- apm-workflow and apm-orchestrate always pass --project to uv run, because uv run outside the project silently runs the PATH apm. The agent now checks that the reported version equals the pin, or is 0.39.2 or later where nothing pins it, not only that it exits 0. - A pin is a quoted apm-cli or apm_cli requirement plus a uv.lock, matching the SessionStart hook, in apm-install, uv-pin.md and apm-workflow. - uv-pin.md spells the hook's exact invocation and its environment check, and says scripts always pass --project. - instructions-author and its research note: a Claude rule leaves .claude/rules/ only when compile actually wrote it into AGENTS.md; install-then-compile dedups it. - prompt-author: Kiro strips every key with a warning, not silently. - Record the 0.39.3 executables findings in approvals-and-executables.md and the output-profile and type-routing facts in cli-reference.md, and cite those digests. - forge's routing table notes that Kiro gets the body only. Refs: #273 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
4.7 KiB
source_keys
| source_keys | |||
|---|---|---|---|
|
Pinning apm per repo with uv
Reached from SKILL.md Step 1. apm has no apm.yml field for a minimum apm version, and upstream
advises pinning apm outside the manifest. A uv pin gives every checkout of the repo the same apm
and the same transitive dependencies, whatever is installed globally. apm's docs do not describe
this method. It was tested with uv 0.11.24 and apm-cli 0.39.3.
Set up the pin
-
Add this
pyproject.tomlat the repo root:[project] name = "<repo>-tooling" version = "0.0.0" requires-python = ">=3.11" dependencies = [] [tool.uv] package = false [dependency-groups] dev = ["apm-cli==0.39.3"]- There is no
[build-system], andpackage = falsekeeps uv from ever building the project, so uv installs only thedevgroup.uv syncinstalls that group by default. >=3.11is apm-cli's own floor.- Pin with
==. Choose 0.39.2 or later. Older versions refuse a lockfile that 0.39.2 or later rewrote. - If the repo already has a
pyproject.tomlfor a real Python project, addapm-cli==<version>to a dependency group there. Do not addpackage = falseto a project that builds.
- There is no
-
Run
uv lock. Commitpyproject.tomlanduv.lock, and gitignore.venv/. The lock hashes apm-cli and every transitive dependency. -
On each checkout, run
uv sync --frozenonce. The first sync on a machine needs the network, because a cold uv cache cannot download wheels offline. -
Run
uv run --project . --frozen apm installfrom the repo root. The first install with apm 0.39 or later also needs the network once, to record commit verdicts. -
Check the version with
uv run --project . --frozen apm --version.
Run it
- Spell every apm command in the repo as
uv run --project <repo root> --frozen apm <args>.--frozenruns fromuv.lockas committed and never re-resolves it. It still syncs the environment to the lock first. After the one-time sync that costs nothing, and when a pull moves the pin it brings the environment up to the new version. - Scripts always pass
--project <repo root>. Without it,uv runfrom a directory outside the repo finds no project and silently runs thePATHapm. The same happens under a nestedpyproject.toml. - Offline,
uv run --project <repo root> --frozen --offline apm …works once the uv cache is warm, even with no.venv. With a cold cache it fails. - A hook with a short timeout must never sync. kyberforge's SessionStart hook runs
uv run --project <root> --frozen --no-sync --offline apm, after checking that${UV_PROJECT_ENVIRONMENT:-<root>/.venv}exists, because even--no-synccreates an empty one.
Upgrade the pin
Change the == version, then run uv lock and uv sync --frozen, and commit both files. Then
follow apm's own upgrade notes for the versions crossed. Every machine and CI job that runs
apm install or apm audit --ci on the repo's lockfile needs an apm at least as new as the one
that last wrote it. apm audit --ci fails on lockfile fields it does not know.
Why not uvx or uv tool
uvx apm-cli@<version>pins only apm-cli. Its transitive dependencies float between runs and nothing is locked. A cache warmed byuv addalso did not satisfyuvx --offline.uv tool install apm-cliis machine-global, the same drift as a global pipx install under another name.
uv installs the apm tool and nothing else. Packages, skills and agents still come from
apm install.
Worked example: one pinned repo, one unpinned
Repo A pins apm. The user asks to install the repo's apm dependencies. The root
pyproject.toml has dev = ["apm-cli==0.39.3"], and uv.lock sits beside it.
- Detect the pin: a quoted
apm-cliorapm_clirequirement inpyproject.toml, and auv.lockbeside it:grep -Eq "[\"']apm[-_]cli" pyproject.toml && test -f uv.lock. - Run
uv sync --frozen, the first time on this checkout. - Run
uv run --project . --frozen apm --version. It prints 0.39.3. - Run
uv run --project . --frozen apm install.
Wrong moves: a bare apm install, because the PATH apm may be 0.28.0, which refuses the v4 lock.
pipx upgrade apm-cli, because that changes every repo on the machine. uvx [email protected] install, because its dependencies are unlocked.
Repo B does not pin apm. It has no pyproject.toml naming apm-cli, or no uv.lock.
- Run
apm --version. If nothing answers, install apm globally (SKILL.mdStep 2). - If apm is older than the repo's lock needs (0.39.2 or later for a lock 0.39.2 or later wrote), upgrade the global apm, or propose a per-repo pin. Do not add the pin unasked: it is a repo change the user should approve.
- Run
apm install.