Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
docs(agents): require restoring shared pnpm shims before worktree removal
vastsad2cd523e99dc
diff --git a/AGENTS.md b/AGENTS.mdindex b06c4e48f..d8393a19a 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,6 +1,6 @@# AGENTS.md-Policy-Sync: 2026-09-26.1+Policy-Sync: 2026-11-17.1Mandatory rules for AI coding agents working in PI-Desktop.@@ -250,6 +250,26 @@ isolated to the request worktree or its scratch directory. Install or rebuilddependencies only when the host environment is missing or incompatible, andrecord that reason. Clean CI and release runners may install from lockfiles.+### Shared install teardown++A worktree that shares the primary checkout's `node_modules` also shares+its pnpm bin shims. Shims written from inside the worktree record absolute+worktree paths, so removing the worktree silently breaks `tsc`, `electron`,+`vitest`, `electron-builder`, and every other package script in the primary+checkout.++Before removing a worktree, confirm no shim still references one:++```bash+grep -h "worktrees/" node_modules/.bin/* apps/*/node_modules/.bin/* \+ packages/*/node_modules/.bin/* | grep -v "^# cmd-shim-target="+```++The command must print nothing. If it does, rewrite the offending shims+back to the primary checkout path, then verify `tsc --version` and+`electron --version` actually run. Never delete the worktree first and+leave the shared shims dangling.+### Before candidate validationRefresh the task against the latest remote `main`.diff --git a/CLAUDE.md b/CLAUDE.mdindex f4d13738e..8af386214 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -1,6 +1,6 @@# CLAUDE.md-Policy-Sync: 2026-09-26.1+Policy-Sync: 2026-11-17.1Instructions for Claude Code CLI and Claude Cowork on PI-Desktop.@@ -105,6 +105,24 @@ ports, logs, and artifacts isolated. Install or rebuild only for missing orincompatible host dependencies, and record the reason; clean CI/releaserunners may install from lockfiles.+### Shared install teardown++A worktree that shares the primary checkout's `node_modules` also shares its+pnpm bin shims. Shims written from inside the worktree record absolute+worktree paths, so removing the worktree breaks `tsc`, `electron`, `vitest`,+and `electron-builder` in the primary checkout.++Before `git worktree remove`, verify no shim still references a worktree:++```bash+grep -h "worktrees/" node_modules/.bin/* apps/*/node_modules/.bin/* \+ packages/*/node_modules/.bin/* | grep -v "^# cmd-shim-target="+```++It must print nothing. Rewrite offenders back to the primary checkout path+and confirm `tsc --version` / `electron --version` run. Never delete the+worktree first and leave dangling shims behind.+### Architecture (frozen)```text