From 1f2c1cc6e74cfbfdbd0bcf2f8da99ffa32743620 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Wed, 1 Jul 2026 21:07:38 +0200 Subject: [PATCH 1/2] fix(install-plugins): guarantee npm present, not just node>=22 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BLK-013 fix-forward. Step 1 checked `node >=22` but never verified npm. On a host where node was already recent, NODE_OK short-circuited the installer and npm was never touched — yet GSD (gsd-pi) and ctx7 install via `npm install -g`, so a missing npm made `make plugin` die Error 127 mid-run (distro `apt install nodejs` can ship npm as a separate package). Add an unconditional npm guard right after the Node block: corepack enable npm → distro package-manager install fallback → fatal exit 1 with an actionable message if still absent. Happy path (npm present) skips the whole block: zero behavior change on healthy machines. shellcheck clean (only pre-existing SC1091 infos), bash -n OK. Fresh npm-less apt host validation still pending. Closes TODO (a) 2026-06-30. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01VeBXkDr74N9whdiJyjzyVN --- .claude/tasks/TODO.md | 3 ++- install-plugins.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index ac34d89..e39ab2a 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -389,6 +389,7 @@ Aucun mécanisme n'intercepte le message utilisateur pour *lancer* un skill. La Tension réelle proactif vs intrusif. Auto-déclencher feat/bugfix sur intention CLAIRE et non-ambiguë = sain. « Déclenche tout skill jugé pertinent » = RISQUÉ (faux déclenchements, skills non sollicités, flux interrompus). Réglage cible ([[LRN-049]] borner le bruit) = déclencher sur signaux d'intention CLAIRS et non-ambigus ; **ambigu → DEMANDER, pas auto-déclencher**. À définir précisément SI (et seulement si) le RED valide : table `signal → skill` + la frontière exacte de l'ambiguïté. ## 2026-06-30 — session-close follow-ups (promoted from BLK-013 / BDR-043) -- [ ] (a) Harden install-plugins.sh Step 1 — guarantee `npm` on apt-`nodejs` hosts (detect missing npm + `corepack enable npm`), not just check `node >=22`. Fix-forward for [[BLK-013]] — stops `make plugin` Error 127 recurring on any fresh apt machine. +- [x] (a) Harden install-plugins.sh Step 1 — guarantee `npm` on apt-`nodejs` hosts (detect missing npm + `corepack enable npm`), not just check `node >=22`. Fix-forward for [[BLK-013]] — stops `make plugin` Error 127 recurring on any fresh apt machine. + [done 2026-07-01 : unconditional npm guard after Node block (corepack enable npm → distro `install npm` fallback → fatal exit 1 w/ clear msg). Catches node>=22-present-but-npm-absent (NODE_OK short-circuit). shellcheck clean, bash -n OK. Fresh-apt live validation pending (no npm-less host to hand). branch bugfix/install-plugins-npm-guard.] - [x] (b) Re-baseline darwin on the 5 ex-broken gstack skills (`benchmark-models`, `context-restore`, `context-save`, `make-pdf`, `plan-tune`) — now repaired and back in scope ([[BDR-043]], trigger cleared). Verify `results.tsv` still marks them `status=error` first. (Promoted from BDR-043's action-field — not an item the user authored.) [resolved-MOOT 2026-06-30 : won't-run. BDR-043 cleared only motif (a) of BDR-015's TWO exclusion grounds (symlinks repaired ✅); motif (b) external-ownership INTACT — the 5 resolve to skills-external/gstack/ (submodule), darwin optimizes by EDITING SKILL.md → would dirty the submodule (forbidden [[LRN-070]]). Re-baseline = unactionable score. + results.tsv gone (wiped by 23/06 make-plugin reinstall) → not even a re-baseline, a fresh-from-zero one. Geometric trigger lifted, value trigger intact — twin of --help [[LRN-080]]. See [[LRN-082]]. Not "done", not "open": MOOT.] diff --git a/install-plugins.sh b/install-plugins.sh index e8eef12..466a7a8 100644 --- a/install-plugins.sh +++ b/install-plugins.sh @@ -162,6 +162,32 @@ if [ "$NODE_OK" = false ]; then fi fi +# --- npm (bundled with Node, but distro `apt install nodejs` can ship it separately) --- +# BLK-013 fix-forward: node>=22 present does NOT imply npm present. GSD (gsd-pi) +# and ctx7 install via `npm install -g`, so a missing npm makes `make plugin` +# die with Error 127 mid-run. The Node block above short-circuits when node is +# already recent (NODE_OK=true) and never checks npm, so guarantee it here. +if ! command -v npm &>/dev/null; then + info "npm missing (Node without npm) — enabling via corepack, else package manager..." + if command -v corepack &>/dev/null; then + sudo corepack enable npm 2>/dev/null || corepack enable npm 2>/dev/null || true + fi + if ! command -v npm &>/dev/null; then + case $OS in + linux-apt) sudo apt-get install -y npm || true ;; + linux-dnf) sudo dnf install -y npm || true ;; + linux-pacman) sudo pacman -S --noconfirm npm || true ;; + macos) brew install node || true ;; # brew's node bundles npm + *) : ;; + esac + fi + if command -v npm &>/dev/null; then + ok "npm $(npm --version)" + else + err "npm still missing — GSD/ctx7 need it; install npm manually then re-run"; exit 1 + fi +fi + # --- Rust + Cargo (for RTK) --- if command -v cargo &>/dev/null; then ok "Rust/Cargo $(cargo --version | awk '{print $2}')" From 90dc7d854df37ca09090ef65416002b68f1ae1ed Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Wed, 1 Jul 2026 21:18:16 +0200 Subject: [PATCH 2/2] chore(memory): capitalize reconcile session + (a) npm-guard fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Session capture for the /reconcile pass + the BLK-013 fix-forward build: - journal 2026-07-01: reconcile real-state (1 actionable / 3 upstream / 3 deferred / release live), (c) TODO drift, (a) npm guard built. - BLK-013: append Update — fix-forward now BUILT (1f2c1cc); was "script hardening NOT built". Now fully resolved (env + script). - BLK-014 + BDR-046: append Update — MERGED 2393ca5, supersedes the stale "pending merge". Records that BDR-046 already settled the "canal d'install" question (native installer, no `elif npm` branch). Append-only (Update blocks, last-block-wins) — no past entry rewritten; verified reconcile_blk_open now returns only the true upstream trio. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01VeBXkDr74N9whdiJyjzyVN --- .claude/memory/blockers.md | 2 ++ .claude/memory/decisions.md | 1 + .claude/memory/journal.md | 3 +++ 3 files changed, 6 insertions(+) diff --git a/.claude/memory/blockers.md b/.claude/memory/blockers.md index 97ce2fb..3d04ef0 100644 --- a/.claude/memory/blockers.md +++ b/.claude/memory/blockers.md @@ -166,6 +166,7 @@ rules: - **Fix-forward**: install-plugins.sh Step 1 should GUARANTEE npm on apt-`nodejs` hosts — detect missing npm + `corepack enable npm` (not just check node) → stops Error 127 recurring on any fresh apt machine. - **Status**: resolved (env-level: corepack shim + npm prefix; zero repo change). Fix-forward (script hardening) NOT built. - **Reference**: discovered fixing `make plugin` 2026-06-30. Distinct from [[BLK-003]] (macOS playwright hardcoded path) + the Playwright-chromium `make plugin` failure. Blocked residual = [[BDR-030]]/[[LRN-042]]. +- **Update 2026-07-01**: fix-forward BUILT. install-plugins.sh Step 1 gained unconditional npm guard (`corepack enable npm` → distro `install npm` fallback → fatal `exit 1`), placed AFTER the `NODE_OK` short-circuit so a node>=22-present-but-npm-absent host no longer skips it. Now fully resolved (env-level + script). shellcheck/`bash -n` clean; fresh-apt live validation still pending. Commit `1f2c1cc`, branch `bugfix/install-plugins-npm-guard`. --- @@ -177,3 +178,4 @@ rules: - **Solution**: install.sh — skip-if-present guard `command -v claude` (mirror RTK/GSD), npm only fresh machine (`elif`). update-all.sh — channel-aware updater: `npm ls -g` → npm-managed uses npm, else native uses `claude update` (self-update). Never `npm --force` (would clobber native, break self-update). - **Status**: resolved. Fix `8dc4027`, branch `bugfix/install-claude-idempotent`, pending merge validation. - **Reference**: [[BLK-013]] npm prefix `~/.local` = contributing factor (npm bin over native bin). install-plugins.sh already pointed to code.claude.com (native) — install.sh was the npm outlier. Fresh-machine `elif npm` branch channel-consistency = open design question (potential BDR). Pattern → [[LRN-085]]. +- **Update 2026-07-01**: MERGED `2393ca5` (bugfix/install-claude-idempotent → develop), pushed — supersedes "pending merge validation". The open channel-consistency question is RESOLVED by [[BDR-046]] (fresh install → native installer, npm dropped for claude); install.sh has no `elif npm` branch → nothing left to trancher. diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index 48f8639..854842d 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -708,3 +708,4 @@ rules: - (C) Homebrew/apt — platform-specific; curl covers macOS/Linux/WSL uniformly and matches the doc's "recommended". - **Honest residual**: `curl | bash` = pipe-to-remote-bash (accepted: official Anthropic domain, same pattern already used for nvm at install.sh:29). node/npm still installed as prereqs — needed by the plugins step (gsd-pi), not by claude. PATH export added so the auth step finds the freshly-installed binary. See [[BLK-014]], [[LRN-085]]. - **Status**: accepted. Commits 8dc4027 + 6be627e, branch bugfix/install-claude-idempotent, pending merge. +- **Update 2026-07-01**: MERGED `2393ca5` → develop, pushed — supersedes "pending merge". diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index 466d6e8..044b08e 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -292,3 +292,6 @@ rules: - gitflow aiguillage-standalone (BDR-045): chore type + 4 standalone memory/doc skills branch off develop before writing; hook exemption kept. 64/64 green (e8807a7). Then repaired 5 direct-on-main `chore(memory)` → chore/reconcile-memory branches (LRN-084, LRN-034 corrob). - BLK-014 fixed: install.sh npm EEXIST on `~/.local/bin/claude` (native symlink, npm prefix `~/.local` from BLK-013) → skip-if-present guard + channel-aware update-all.sh (`claude update` for native). LRN-085. Commit 8dc4027, branch bugfix/install-claude-idempotent pending merge. - BDR-046: install.sh switched fresh-install from npm → official native installer (`curl claude.ai/install.sh | bash`); npm no longer a documented channel (verified quickstart). Aligns with install-plugins.sh. Commit 6be627e, same branch. +- /reconcile show-only (claude repo, engine-verified): confronted TODO+registries vs git/fs. Real state = 1 actionable (install-plugins npm harden), 3 blocked-upstream (BLK-001 rtk / BLK-003 darwin / BLK-009 CC #21858, re-test on CC MAJ), 3 deferred-on-trigger, release-decision live (develop 20 ahead of v4.0.0). Engine false-flagged BLK-014 (last-status-wins caught Reference "open" vs Status resolved) — verified merged. "canal d'install" = already decided by BDR-046, NOT open; faunosteo/WARN-manuel = not in this repo. +- (c) TODO drift fixed: 7 `--help` WON'T-BUILD subtasks `[ ]`→`[-]` (chore/reconcile-todo-drift, 9c02406) → naive open-count 10→3, survivors all genuine deferred-open. Registries left read-only during reconcile (staleness deferred to this capitalize). +- (a) BLK-013 fix-forward BUILT: install-plugins.sh unconditional npm guard (corepack→distro→fatal), placed after `NODE_OK` short-circuit so node>=22-but-no-npm hosts don't skip it. shellcheck/`bash -n` clean, 1f2c1cc. Capitalize refreshed BLK-013 (NOT built→built), BLK-014 + BDR-046 (pending→merged) via append-only Update blocks. Both branches finished into develop.