chore(ai): adopt apm install --root + apm compile --root (pin to fork, upstream #928)#716
chore(ai): adopt apm install --root + apm compile --root (pin to fork, upstream #928)#716
apm install --root + apm compile --root (pin to fork, upstream #928)#716Conversation
e03da4a to
97e5e8b
Compare
Rewrite `just ai::apm-sync` around two upstream apm improvements: * microsoft/apm#889 (merged) wires content-integrity hash verification into `apm audit --ci` — every APM-managed file (`.claude/`, `.codex/`, `.agents/`, `.opencode/`, `opencode.json`, MCP configs) is now checked against the lockfile's recorded hashes. The recursive `diff -r` loop that re-installed into scratch and compared each deploy dir is redundant and goes away. * microsoft/apm#888 (`apm install --root`) replaces the rsync-the- worktree-into-scratch dance with a single flag. The scratch staging that remains is purely for the `apm compile` leg — apm's distributed compiler scans the project tree to score AGENTS.md placement, so the scratch needs the source file inventory. It drops to an `rsync -aH` with one set of excludes (down from ~20 lines of setup + 25 lines of diff gates). * Staged on juspay/apm@feat/install-compile-root-flag until #888 lands in microsoft/apm — revert the `apm_cmd` pin once that happens. Net: the recipe trims from 127 lines to 51; all seven audit checks pass, and the per-AGENTS.md diff loop still catches compile-output drift that audit can't (AGENTS.md files aren't lockfile-tracked).
97e5e8b to
ddf3a08
Compare
apm install --root + drop scratch-diff hackapm install --root + apm compile --root (pin to fork, upstream #928)
Future simplification pathTraced what else upstream has cooking for Once microsoft/apm#842 lands (open; adds apm audit --ci && apm compile --check --target codex,opencodeThat kills the scratch dir entirely — no Once microsoft/apm#898 Epic also lands (per-asset lockfile granularity + The still-missing piece, even after both land — compile outputs ( The one upstreamable ask left is that audit-extension. Small issue, clean framing ("after #842 the only thing stopping For now the shipped state here ( |
just ai::apm-syncused to rsync the whole worktree into a scratch directory, run install + compile inside it, then recursively diff every deploy dir against the live tree — all to catch post-install drift without mutating.claude/while a Claude Code session was active in the same worktree (#468).Two upstream apm improvements retire the entire scaffolding:
microsoft/apm#889 (merged) finally closes microsoft/apm#684 by wiring content-integrity hash verification into
apm audit --ci. Every APM-managed file — everything under.claude/,.codex/,.agents/,.opencode/, plusopencode.jsonand MCP configs — is now checked against its lockfile-recorded hash. The recursivediff -rloop that re-installed into scratch and compared each deploy dir is redundant and goes away.microsoft/apm#888 adds
apm install --root <dir>andapm compile --root <dir>. Both commands redirect their writes (apm_modules/,apm.lock.yaml,.claude/,.codex/,.agents/,.opencode/,AGENTS.md,CLAUDE.md) into an arbitrary directory while sources continue resolving from$PWD. Together they collapse the entire scratch-staging dance into two flag invocations — no rsync, nocd, no symlinks. Upstream PR: microsoft/apm#928 (draft, pending maintainer review on a chdir-vs-refactor design call surfaced by Hickey/Lowy structural review).Until #928 lands we pin
apm_cmdtojuspay/apm@feat/install-compile-root-flag— the same branch the upstream PR is built from. Once it merges, flip the pin back tomicrosoft/apm.What's left in
apm-syncA single
cpofapm.lock.yaml(so install resolves to the same commits as the live tree) plus theapm install --root+apm compile --rootpair. That's it. The per-AGENTS.md diff loop stays because compile outputs aren't in the lockfile'sdeployed_files, so audit doesn't cover them.agents/ai.justdrops from 127 lines to 38 for the apm-related recipes (apm-sync went from ~60+ lines to ~16). All seven audit checks pass, every AGENTS.md output matches the live tree byte-for-byte.Test plan
just ai::apm-syncgreen locally (all 7 audit checks pass + every AGENTS.md matches)just cigreenapm_cmdpin back tomicrosoft/apm🤖 Generated with Claude Code