bootstrap
Adom Hydrogen (macOS / Lima)
Public Made by Adomby adom
The macOS platform layer for Adom Hydrogen.
← Commit history
install.sh+82−64@@ -163,72 +163,90 @@ if (!s.statusLine) { }' 2>/dev/null || log "WARN: node unavailable - statusLine not merged into settings.json" log "installed the Claude Code statusline -> ~/.claude/statusline.sh" -# 0.1.21: purge the stale `adom-desktop` skill the base layer still deploys-# (hydrogen-bootstrap ships skills/hydrogen-adom-desktop whose frontmatter-# name is `adom-desktop`, teaching the ARCHIVED Windows-line app). On macOS-# the Bridge docs are the adom-bridge/adom-bridge-* skills from-# adom/adom-bridge-macos; the old doc just misleads agents. Runs after deps,-# so it wins regardless of install order. Remove when the base drops the skill.-for stale in "$HOME/.claude/skills/adom-desktop" "$HOME/.codex/skills/adom-desktop"; do- if [ -e "$stale" ]; then- rm -rf "$stale"- log "purged stale adom-desktop skill ($stale) - superseded by adom-bridge-* on macOS"- fi-done--# 0.1.22: platform hygiene (Kyle's 2026-08-25 container audit). A mac container-# must not teach windows facts:-#-# (a) The WINDOWS Bridge pkg (adom/adom-bridge — pulled onto mac boxes by-# adom/nb-bridge's dependency) delivers ~15 windows-only skills-# (SendInput verbs, -anywhere-windows, the windows sdk docs …). Purge every-# skill delivered EXCLUSIVELY by it, data-driven from the pkg DB's-# delivered_skills — never a hardcoded list, so pkg evolution stays covered.-# (Skills BOTH pkgs deliver — the contested adom-bridge-* dirs — are NOT-# touched here; Hydrogen re-asserts adom/adom-bridge-macos after any-# nb-bridge install so the mac docs win those dirs deterministically.)-#-# (b) The base layer's windows-flavored twins: for every skill X-mac THIS-# package ships, the base layer's X is the windows doc (hydrogen-api,-# hydrogen-ui, hydrogen-recording, …). Purge X — the -mac fork is canonical-# on this platform. Re-runs every converge, so base-layer updates that-# re-deliver them are re-purged. Remove when hydrogen-bootstrap moves them-# into hydrogen-windows-bootstrap (upstream request filed 2026-08-25).-INSTALLED_JSON="$HOME/project/adom_modules/.installed.json"-if [ -f "$INSTALLED_JSON" ] && command -v python3 >/dev/null 2>&1; then- python3 - "$INSTALLED_JSON" <<'PY' || log "WARN: windows-bridge skill purge failed (non-fatal)"-import json, os, shutil, sys-pk = json.load(open(sys.argv[1]))-pk = pk.get('packages', pk)-owner = {}-for name, e in pk.items():- for s in (e.get('delivered_skills') or []):- owner.setdefault(s, []).append(name)+# 0.1.24: platform hygiene is now a STANDING HOOK, not just a converge step+# (Kyle 2026-08-26: "run the whole cleanup"). The 0.1.22 purges only ran when+# THIS package's install script ran — but the adom-core auto-update hook runs+# `pkg update` every <=30 min, and a hydrogen-bootstrap bump re-delivers the+# windows-flavored twins while a same-version mac-bootstrap SKIPS its script+# (observed live 2026-08-26: twins resurrected right after a pkg update). The+# purge logic now lives in ~/.adom/hooks/hydrogen-mac-platform-hygiene.sh,+# registered as its own UserPromptSubmit hook (idempotent settings.json merge,+# same pattern as the statusLine), so any resurrection self-heals within one+# prompt. Everything is data-driven — no hardcoded skill lists:+# (a) skills delivered EXCLUSIVELY by the windows adom/adom-bridge pkg+# (dragged in via adom/nb-bridge's dep) — purged, symlink-aware;+# (b) base-layer windows twins: X purged when X-mac exists AND+# adom/hydrogen-bootstrap delivers X (guards user-made X/X-mac pairs);+# (c) the stale adom-desktop skill (archived Windows-line app doc).+# Remove (b) when hydrogen-bootstrap moves the twins into+# hydrogen-windows-bootstrap (upstream request filed 2026-08-25).+mkdir -p "$HOME/.adom/hooks"+cat > "$HOME/.adom/hooks/hydrogen-mac-platform-hygiene.sh" <<'HYGIENE'+#!/usr/bin/env bash+# hydrogen-mac-bootstrap platform hygiene — see the package's install.sh for+# the full rationale. Fast (a few stats), silent when clean; prints one line+# only when it purged something (surfaces in the agent's additionalContext).+command -v python3 >/dev/null 2>&1 || exit 0+python3 - <<'PY' 2>/dev/null || true+import json, os, shutil+SK = os.path.expanduser('~/.claude/skills')+if not os.path.isdir(SK):+ raise SystemExit(0)+def rm(p):+ if os.path.islink(p): os.unlink(p)+ elif os.path.isdir(p): shutil.rmtree(p)+ else: return False+ return True purged = []+owner = {}+try:+ pk = json.load(open(os.path.expanduser('~/project/adom_modules/.installed.json')))+ pk = pk.get('packages', pk)+ for name, e in pk.items():+ for s in (e.get('delivered_skills') or []):+ owner.setdefault(s, []).append(name)+except Exception:+ pk = {}+# (a) windows-bridge exclusives for s, o in sorted(owner.items()):- if o == ['adom/adom-bridge']:- p = os.path.join(os.path.expanduser('~'), '.claude/skills', s)- # delivered skills can be SYMLINKS into the pkg store — unlink those;- # rmtree refuses them (seen live 2026-08-25).- if os.path.islink(p):- os.unlink(p)- purged.append(s)- elif os.path.isdir(p):- shutil.rmtree(p)- purged.append(s)-print("[hydrogen-mac-bootstrap] purged %d windows-only Bridge skills: %s"- % (len(purged), ', '.join(purged) if purged else '(none present)'))+ if o == ['adom/adom-bridge'] and rm(os.path.join(SK, s)):+ purged.append(s)+# (b) base twins where the -mac fork exists+skills = set(os.listdir(SK))+for s in sorted(skills):+ if s.endswith('-mac') and s[:-4] in skills:+ base = s[:-4]+ if 'adom/hydrogen-bootstrap' in owner.get(base, []) and rm(os.path.join(SK, base)):+ purged.append(base)+# (c) the archived adom-desktop doc+for p in ('~/.claude/skills/adom-desktop', '~/.codex/skills/adom-desktop'):+ if rm(os.path.expanduser(p)):+ purged.append('adom-desktop')+if purged:+ print('[mac-platform-hygiene] purged %d windows-line skill(s): %s' % (len(purged), ', '.join(purged))) PY-fi-for macskill in "$HERE"/skills/*-mac/; do- [ -d "$macskill" ] || continue- base_name="$(basename "${macskill%/}")"- base_name="${base_name%-mac}"- base="$SKILLS/$base_name"- if [ -e "$base" ]; then- rm -rf "$base"- log "purged windows-flavored base skill $base_name (the ${base_name}-mac fork is canonical on macOS)"- fi-done+HYGIENE+chmod 0755 "$HOME/.adom/hooks/hydrogen-mac-platform-hygiene.sh"+# Register as a UserPromptSubmit hook (idempotent — same merge pattern as the+# statusLine block above; a container without node still gets the converge-time+# run below, just not the standing hook).+node -e '+const fs = require("fs");+const p = process.env.HOME + "/.claude/settings.json";+let s = {};+try { s = JSON.parse(fs.readFileSync(p, "utf8")); } catch {}+s.hooks = s.hooks || {};+const ups = s.hooks.UserPromptSubmit = s.hooks.UserPromptSubmit || [];+const cmd = "bash " + process.env.HOME + "/.adom/hooks/hydrogen-mac-platform-hygiene.sh";+const present = ups.some(g => (g.hooks || []).some(h => h.command === cmd));+if (!present) {+ ups.push({ hooks: [{ type: "command", command: cmd, timeout: 10 }] });+ fs.writeFileSync(p, JSON.stringify(s, null, 2));+ console.log("[hydrogen-mac-bootstrap] platform-hygiene hook registered");+} else {+ console.log("[hydrogen-mac-bootstrap] platform-hygiene hook already registered");+}' 2>/dev/null || log "WARN: node unavailable - hygiene hook not registered (converge-time purge still ran)"+# Run it once NOW so this converge leaves the container clean.+bash "$HOME/.adom/hooks/hydrogen-mac-platform-hygiene.sh" | while read -r l; do log "$l"; done log "macOS platform layer converged."
package.json+1−1@@ -4,7 +4,7 @@ "type": "bootstrap", "title": "Adom Hydrogen (macOS / Lima)", "brief": "The macOS platform layer for Adom Hydrogen.",- "version": "0.1.23",+ "version": "0.1.24", "description": "The macOS platform layer for Adom Hydrogen, where the workspace runs in a Lima Ubuntu VM hosting the Adom-Workspace systemd-nspawn machine. Depends on adom/hydrogen-bootstrap (the platform-generic Hydrogen layer) and adds everything specific to the Lima/nspawn runtime: the container/networking/ports/setup/topology/volume/workspace-lifecycle hydrogen-* skills (the macOS-runtime bucket), the in-machine workspace-updater daemon, and the macOS code-server workbench seed. Sibling layers adom/hydrogen-windows-bootstrap (WSL2) and adom/hydrogen-ubuntu-bootstrap depend on the same adom/hydrogen-bootstrap. This is the package the golden Lima image installs.", "org": "adom", "tags": [
page.json+1−1@@ -4,7 +4,7 @@ "slug": "hydrogen-mac-bootstrap", "title": "Adom Hydrogen (macOS / Lima)", "brief": "The macOS platform layer for Adom Hydrogen.",- "version": "0.1.23",+ "version": "0.1.24", "license": "proprietary", "visibility": "public", "metadata": {