fix(kyberforge): apply the #273 review to the apm 0.39.3 refresh
- 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
This commit is contained in:
1 parent
c68b67301a
commit
e6d680a4c5
14 files changed
+49
-26
No files matched your search
@@ -24,7 +24,7 @@ metadata:
|
||||
|
||||
| Condition | Method | Where |
|
||||
|---|---|---|
|
||||
| The repo pins apm: `pyproject.toml` names `apm-cli` in a dependency group, beside a `uv.lock` | Per-repo pin. Use or upgrade it, never the global apm | `references/uv-pin.md` |
|
||||
| The repo pins apm: `pyproject.toml` has a quoted `apm-cli` or `apm_cli` requirement, beside a `uv.lock` | Per-repo pin. Use or upgrade it, never the global apm | `references/uv-pin.md` |
|
||||
| The user wants apm fixed per repo, and uv is available | Per-repo pin. Set it up | `references/uv-pin.md` |
|
||||
| Anything else: a machine-wide apm, a CI image, no uv | Global install | Step 2 |
|
||||
|
||||
@@ -60,7 +60,7 @@ Default:
|
||||
apm runtime setup copilot
|
||||
```
|
||||
|
||||
Other targets: `apm runtime setup codex`, `apm runtime setup gemini`, `apm runtime setup llm`. In a repo that pins apm, spell each of these as `uv run --frozen apm runtime …`.
|
||||
Other targets: `apm runtime setup codex`, `apm runtime setup gemini`, `apm runtime setup llm`. In a repo that pins apm, spell each of these as `uv run --project <repo root> --frozen apm runtime …`.
|
||||
|
||||
- `apm runtime list` — show installed runtimes.
|
||||
- `apm runtime status` — show which runtime `apm run` will pick by default.
|
||||
|
||||
@@ -41,21 +41,22 @@ this method. It was tested with uv 0.11.24 and apm-cli 0.39.3.
|
||||
apm-cli and every transitive dependency.
|
||||
3. On each checkout, run `uv sync --frozen` once. The first sync on a machine needs the network,
|
||||
because a cold uv cache cannot download wheels offline.
|
||||
4. Run `uv run --frozen apm install`. The first install with apm 0.39 or later also needs the
|
||||
4. Run `uv run --project . --frozen apm install` from the repo root. The first install with apm 0.39 or later also needs the
|
||||
network once, to record commit verdicts.
|
||||
5. Check the version with `uv run --frozen apm --version`.
|
||||
5. Check the version with `uv run --project . --frozen apm --version`.
|
||||
|
||||
## Run it
|
||||
|
||||
- Spell every apm command in the repo as `uv run --frozen apm <args>`. `--frozen` runs from
|
||||
- Spell every apm command in the repo as `uv run --project <repo root> --frozen apm <args>`. `--frozen` runs from
|
||||
`uv.lock` as 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.
|
||||
- In a script that may run from a subdirectory, add `--project <repo root>`.
|
||||
- Offline, `uv run --frozen --offline apm …` works once the uv cache is warm, even with no
|
||||
- Scripts always pass `--project <repo root>`. Without it, `uv run` from a directory outside the repo finds no project and silently runs the `PATH` apm. The same happens under a nested `pyproject.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. Use `--no-sync --offline`, and check first that
|
||||
`.venv` exists, because even `--no-sync` creates an empty one.
|
||||
- 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-sync` creates an empty one.
|
||||
|
||||
## Upgrade the pin
|
||||
|
||||
@@ -79,10 +80,11 @@ uv installs the apm tool and nothing else. Packages, skills and agents still com
|
||||
**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.
|
||||
|
||||
1. Detect the pin: `grep -q '"apm-cli' pyproject.toml && test -f uv.lock`.
|
||||
1. Detect the pin: a quoted `apm-cli` or `apm_cli` requirement in `pyproject.toml`, and a `uv.lock` beside it:
|
||||
`grep -Eq "[\"']apm[-_]cli" pyproject.toml && test -f uv.lock`.
|
||||
2. Run `uv sync --frozen`, the first time on this checkout.
|
||||
3. Run `uv run --frozen apm --version`. It prints 0.39.3.
|
||||
4. Run `uv run --frozen apm install`.
|
||||
3. Run `uv run --project . --frozen apm --version`. It prints 0.39.3.
|
||||
4. 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 apm-cli@0.39.3
|
||||
|
||||
Reference in new issue
Block a user