Unify the clawdie npm-global PATH snippet into one shared file (image + jail) #122

Closed
opened 2026-06-21 09:31:43 +02:00 by clawdie · 1 comment
Owner

Why

The "npm-global on PATH" setup lives in several divergent places, with no single source:

  • clawdie-iso build.sh writes /etc/profile.d/clawdie.sh as an inline heredoc (prefix /opt/clawdie/npm-global).
  • colibri packaging/freebsd/agent-jail-bootstrap.sh writes /etc/profile.d/clawdie-npm.sh (prefix /home/clawdie/.npm-global) — added in #121 after #120's ~/.profile band-aid.
  • plus xfce-session and firstboot copies.

Because the canonical snippet is trapped inside build.sh, the agent jail (a separate environment) couldn't reuse it and re-grew the "pi/bw not found" bug (#120#121). Two prefixes, several copies.

Proposal

One shared, committed snippet installed by every environment:

  • put a canonical profile snippet in colibri packaging/freebsd/ (same "colibri owns runtime packaging, clawdie-iso consumes" pattern as the FreeBSD port);
  • clawdie-iso build.sh installs that file instead of its inline heredoc;
  • the agent-jail bootstrap installs the same file (parameterized by NPM_PREFIX);
  • decide the prefix split (/opt/clawdie/npm-global vs ~/.npm-global) or have the snippet handle both.

Acceptance

  • exactly one source file defines the npm-global PATH line;
  • both the ISO image and a fresh agent jail get PATH via that file;
  • (optional) a drift check guards it, like check-agent-jail-pkgs.sh.

Context: #120, #121 — same duplication class as the retired FreeBSD port duplicate.

## Why The "npm-global on PATH" setup lives in several divergent places, with no single source: - clawdie-iso `build.sh` writes `/etc/profile.d/clawdie.sh` as an **inline heredoc** (prefix `/opt/clawdie/npm-global`). - colibri `packaging/freebsd/agent-jail-bootstrap.sh` writes `/etc/profile.d/clawdie-npm.sh` (prefix `/home/clawdie/.npm-global`) — added in #121 after #120's `~/.profile` band-aid. - plus xfce-session and firstboot copies. Because the canonical snippet is trapped inside `build.sh`, the agent jail (a separate environment) couldn't reuse it and **re-grew the "pi/bw not found" bug** (#120 → #121). Two prefixes, several copies. ## Proposal One shared, committed snippet installed by every environment: - put a canonical profile snippet in **colibri `packaging/freebsd/`** (same "colibri owns runtime packaging, clawdie-iso consumes" pattern as the FreeBSD port); - clawdie-iso `build.sh` installs that file instead of its inline heredoc; - the agent-jail bootstrap installs the same file (parameterized by `NPM_PREFIX`); - decide the prefix split (`/opt/clawdie/npm-global` vs `~/.npm-global`) or have the snippet handle both. ## Acceptance - exactly one source file defines the npm-global PATH line; - both the ISO image and a fresh agent jail get PATH via that file; - (optional) a drift check guards it, like `check-agent-jail-pkgs.sh`. Context: #120, #121 — same duplication class as the retired FreeBSD port duplicate.
clawdie reopened this issue 2026-06-21 16:35:27 +02:00
Author
Owner

Status after review:

  • colibri #130 — added canonical packaging/freebsd/clawdie-npm-profile.sh; agent-jail-bootstrap now installs it.
  • clawdie-iso #92 — ISO build.sh now installs the same shared file instead of its inline heredoc. (This is why I reopened then re-scoped: the original close was premature, but #92 had in fact landed the iso migration.)
  • clawdie-iso #93 (open) — hardens #92: resolve the snippet via resolve_colibri_paths/COLIBRI_REPO (it was hardcoded to ${SCRIPT_DIR}/../colibri) and preflight its existence (a missing file silently produced a half-written snippet).

Acceptance ("exactly one source file defines the snippet, installed by image + jail") is met. Closing once #93 merges.

Status after review: - **colibri #130** — added canonical `packaging/freebsd/clawdie-npm-profile.sh`; agent-jail-bootstrap now installs it. ✅ - **clawdie-iso #92** — ISO `build.sh` now installs the same shared file instead of its inline heredoc. ✅ (This is why I reopened then re-scoped: the original close was premature, but #92 had in fact landed the iso migration.) - **clawdie-iso #93** (open) — hardens #92: resolve the snippet via `resolve_colibri_paths`/`COLIBRI_REPO` (it was hardcoded to `${SCRIPT_DIR}/../colibri`) and preflight its existence (a missing file silently produced a half-written snippet). Acceptance ("exactly one source file defines the snippet, installed by image + jail") is met. Closing once #93 merges.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clawdie/colibri#122
No description provided.