docs: apply the #272 review notes on the apm 0.39 docs

- Name kyberforge's SessionStart hook as a lock writer that can write
  the bad lock in a 0.28-populated checkout, with the recovery steps
  (README, AGENTS.md, gates.md).
- AGENTS.md: put the pinned-invocation rule above the lock-churn rule,
  make the bare-apm remark conditional on what PATH holds, and replace
  the two 0.28 migration notes with one pointer to gates.md
  "apm-audit-ci".
- Use one wording for the offline guarantee: a synced .venv/ and a
  populated apm_modules/.
- Say the #204 leak was not re-tested on 0.39.3, and narrow the claim to
  git_subprocess_env (gates.md, LESSONS.md, git-env test header).
- State the apm-audit-ci timing as 70-90 s, drop a duplicate README
  sentence, give the 0.39.3 shorthand error, reflow gates.md to about
  100 columns, and move the ADR-0033 note into amendment blockquote form.

Refs #272

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-12-02 12:25:51 +00:00
1 parent 66443e7458
commit db34dfa728
7 files changed
+71 -64

No files matched your search

+3 -3
View File
@@ -28,10 +28,10 @@ Fall back to raw shell only when no skill covers it.
## Session rules
- **Do not add repo-owned keys to `.claude/settings.json`.** apm treats it as its own deployed artifact and `apm audit --ci` replays the install and diffs, so anything apm would not have written is permanent drift that fails the `apm-audit-ci` pre-push hook. A hook you want here is authored in `plugins/<name>/.apm/hooks/` and deployed by apm, never hand-written into that file. The `SessionStart` entry already in it is exactly that: kyberforge authors it in `plugins/kyberforge/.apm/hooks/hooks.json` and apm merges it in, so it is apm's own output, it is what the replay expects, and it belongs in the commit — do not strip it (ADR-0019). Machine-specific settings go in the gitignored `.claude/settings.local.json`; shared enforcement goes in `.pre-commit-config.yaml`.
- **`apm.lock.yaml` turning up modified is expected, not a bug.** kyberforge's `SessionStart` hook keeps the install current on launch and rewrites the lock in the process (ADR-0019). On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `uv run --frozen apm install`). This keeps unrelated lock churn out of the branch diff and keeps `apm pack --check-clean` consistent with the committed lock. The session then runs the older `main` that the lock records, which is accepted on a branch, and the next session start refreshes again. Before writing the lock with apm 0.39 in a checkout whose `apm_modules/` apm 0.28 populated, move `apm_modules/` aside and run `uv run --frozen apm install`, or the lock loses its third-party `carried_licenses` entries (`docs/spec/gates.md`, "apm-audit-ci").
- **Run apm only as `uv run --frozen apm …`.** The root `pyproject.toml` and `uv.lock` pin apm 0.39.3 (ADR-0034). A bare `apm` reaches whatever is on `PATH`, possibly an older apm that refuses the v4 `apm.lock.yaml`.
- **`apm.lock.yaml` turning up modified is expected, not a bug.** kyberforge's `SessionStart` hook keeps the install current on launch: it runs `uv run --frozen apm update --yes` and rewrites the lock in the process (ADR-0019). On `main`, commit or discard it deliberately. On a feature branch, discard it (`git checkout -- apm.lock.yaml`, then `uv run --frozen apm install`). This keeps unrelated lock churn out of the branch diff and keeps `apm pack --check-clean` consistent with the committed lock. The session then runs the older `main` that the lock records, which is accepted on a branch, and the next session start refreshes again. A checkout that apm 0.28 deployed or populated needs one-time migration steps, and its first session-start rewrite of the lock can be wrong: see `docs/spec/gates.md`, "apm-audit-ci".
- **A `.apm/` edit is not live until it is on the remote's `main`.** Root `apm.yml`'s first-party dependencies resolve from the holocron remote, unpinned against the default branch, so pushing a feature branch does not deploy it (ADR-0019). `uv run --frozen apm install` deploys from the lock; `uv run --frozen apm update` is what re-resolves refs.
- **Run apm only as `uv run --frozen apm …`.** The root `pyproject.toml` and `uv.lock` pin apm 0.39.3 (ADR-0034). A bare `apm` reaches the machine-global 0.28.0, which this repo does not use and which refuses the v4 `apm.lock.yaml`.
- **No pre-push hook needs the network — once the two one-time online steps have run.** A new checkout runs `uv sync --frozen`, then `uv run --frozen apm install`, each online once. Root `apm.yml`'s marketplace has no remote package entries, so every hook then resolves locally. The guarantee is a property of a synced `.venv/` and a populated `apm_modules/`, not of the hook set: on a fresh clone `apm-audit-ci`'s `deployed-files-present` fails outright, and its `drift` and `config-consistency` install-replays have no cache to replay from and clone from the remote. A checkout whose `.claude/skills`, `.claude/agents` and `.claude/commands` were deployed by 0.28 moves those three directories aside before its first 0.39 install, or apm refuses with "no trustworthy local deployment baseline" (`docs/spec/gates.md`, "Pushing without a network").
- **No pre-push hook needs the network — once the two one-time online steps have run.** A new checkout runs `uv sync --frozen`, then `uv run --frozen apm install`, each online once. Root `apm.yml`'s marketplace has no remote package entries, so every hook then resolves locally. The guarantee is a property of a synced `.venv/` and a populated `apm_modules/`, not of the hook set: on a fresh clone `apm-audit-ci`'s `deployed-files-present` fails outright, and its `drift` and `config-consistency` install-replays have no cache to replay from and clone from the remote. (`docs/spec/gates.md`, "Pushing without a network").
- **A plugin `version:` bump that has merged to `main` gets its release tag.** Run `git fetch origin --tags`, then `scripts/tag-plugin-releases.sh`; exit 1 means a tag is missing, and `--apply` creates it locally and prints the push command. The script reads local tags only, so OK means present locally, not published: confirm with `git ls-remote --tags origin '<plugin>-v*'` before calling it done. A tag push is an irreversible publish, not a free Propose-tier push (ADR-0032): show the maintainer the exact tags and that command, and only on their explicit yes in this conversation run exactly it yourself (named tags, never `--tags` or other refs). Agents cut release tags only with the script, which never moves or deletes one; exit 2 means stop and report it to the maintainer, never hand-fix, move or delete a tag (ADR-0033).
- **This repo and Gitea are the only source of truth.** All project state, decisions, and working conventions live here. Do not use an external memory system for this project — cached state diverges from the repo and you get a split brain. Before answering any design or architecture question, check `docs/adr/` for an existing decision.