bootstrap
Adom Hydrogen (platform base)
Public Made by Adomby adom
Layer Hydrogen's workspace onto a standard Adom workstation.
← Commit history
install.sh+39−33@@ -168,42 +168,48 @@ CSCONF # it has the token (write-through); this section installs the machinery and, # if a live key exists but no persistent copy yet, migrates it — so a plain # `adom-wiki pkg update` retrofits running workspaces. No key material ships-# in this package; only the plumbing.-log "api-key persistence: tmpfiles machinery + persistent-copy migration"-install -d -m 0700 "$HOME/.adom"-if [ -s /var/run/adom/api-key ] && [ ! -s "$HOME/.adom/api-key" ]; then- cp /var/run/adom/api-key "$HOME/.adom/api-key" && chmod 600 "$HOME/.adom/api-key"- log " migrated live key to persistent copy"-fi-printf 'd /run/adom 0755 root root --C /run/adom/api-key 0644 root root - /home/adom/.adom/api-key-' | sudo tee /etc/tmpfiles.d/adom-api-key.conf >/dev/null && log " tmpfiles.d/adom-api-key.conf installed (boot-time re-materialization)" || log " WARN: could not install tmpfiles snippet (no sudo?) — HD self-heal will retry"--# 6b. AUTO-MODE CLASSIFIER POSTURE (John 2026-08-25) ─────────────────────────────-# Claude Code's auto mode judges every Bash call with a classifier that knows nothing-# about Adom. Measured before this existed: the golden image shipped exactly ONE-# permission rule (Bash(adom-wiki:*)), every other CLI fell through to the classifier-# on every call, and a long-lived container had accumulated 121 hyper-specific one-off-# allow rules, a log of a human clicking approve one command at a time for months.+# ── Agent-permission posture: NOW THE REGISTRY'S JOB ─────────────────────────+# This used to seed an autoMode block for the Adom toolchain (seed-agent-permissions.py).+# It was always a stopgap, and its own comment said to DELETE it rather than grow it once+# the registry could compose postures. That landed: adom/wiki#156 shipped the registry arm+# (serve-time agent_permissions for the whole catalogue) and adom-wiki 1.7.13 composes the+# managed autoMode region from the installed set, regenerating rather than appending, with+# user lines outranking package lines and hard_deny client-owned. #-# Bash(...) rules cannot fix it: they are prefix matches on the literal command string,-# and our CLIs put flags BEFORE the verb (adom-bridge --target X --ai-thread Y <verb>),-# so no prefix expresses "these verbs, not those". autoMode takes natural language the-# classifier actually reads, which is the only shape that fits this CLI grammar.+# So the seed is gone. Two writers on one settings file is exactly the drift the managed+# region exists to prevent, and the composed posture is strictly better: every package+# speaks for its own binaries, and uninstall removes their lines for free. #-# THIS IS A STOPGAP, scoped to Hydrogen. The right home is the registry: every package-# that installs a CLI should declare its own posture and adom-wiki should compose them,-# because only a publisher knows which of their verbs are safe, a central list goes-# stale, and third-party orgs cannot edit ours. Filed as adom/wiki#900. When that lands,-# DELETE this section rather than growing it.+# The floor lives in dependencies (adom/adom-wiki-cli), so a container cannot end up with+# neither the seed nor a CLI able to replace it. #-# Discipline, so this never becomes the 121-rule pile it replaces:-# - it is DERIVED state in a managed region we own and REGENERATE, never append to-# - a user's own autoMode block wins: if one exists that we did not write, leave it-# - hard_deny only ADDS safety; we never weaken a built-in rule-log "auto-mode classifier posture (Adom toolchain)"-python3 "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/seed-agent-permissions.py" "$HOME/.claude/settings.json" \- || log " WARN: could not seed autoMode (continuing)"+# ONE-TIME HANDOFF: drop our ownership marker if it is still there, so nothing+# double-manages the block. The LINES stay: the composing CLI treats anything it did not+# write as a user line and preserves it (proven on this container, where John's+# broad-process-kill hard stop survived every converge and uninstall untouched).+if [ -f "$HOME/.claude/settings.json" ]; then+ python3 - "$HOME/.claude/settings.json" <<'PYEOF' || true+import json, sys+p = sys.argv[1]+try:+ with open(p) as f:+ s = json.load(f)+except Exception:+ raise SystemExit(0)+m = s.get("_adom_managed")+if isinstance(m, dict) and m.pop("autoMode", None) is not None:+ if not m:+ s.pop("_adom_managed", None)+ else:+ s["_adom_managed"] = m+ tmp = p + ".tmp"+ with open(tmp, "w") as f:+ json.dump(s, f, indent=2)+ import os+ os.replace(tmp, p)+ print(" handed the autoMode region to adom-wiki (marker removed, lines kept)")+PYEOF+fi # 7. tidy — install.mjs / tooling leave an empty ~/project/.mcp.json; remove it. rm -f "$HOME/project/.mcp.json" 2>/dev/null || true
package.json+3−3@@ -4,10 +4,9 @@ "type": "bootstrap", "title": "Adom Hydrogen (platform base)", "brief": "Layer Hydrogen's workspace onto a standard Adom workstation.",- "version": "0.4.2",+ "version": "0.5.0", "description": "Hydrogen's PLATFORM-GENERIC workspace layer on top of adom/core. Installs adom/core for the full Adom ecosystem, then adds everything common to running inside Hydrogen on ANY platform: the runtime-neutral hydrogen-* skills and the generic editor configuration (Claude Code CLI + extension, VS Code settings, trusted domains). Platform-specific layers depend on THIS: adom/hydrogen-windows-bootstrap (WSL2), adom/hydrogen-mac-bootstrap, adom/hydrogen-ubuntu-bootstrap. The reference design other orgs copy to build their own bootstrap on adom/core.", "org": "adom",- "platform": "any", "tags": [ "bootstrap", "hydrogen",@@ -19,7 +18,8 @@ }, "dependencies": { "adom/core": "^4.9.0",- "adom/adom-ui-design": "^3.0.0"+ "adom/adom-ui-design": "^3.0.0",+ "adom/adom-wiki-cli": "^1.7.13" }, "discovery_triggers": [ "hydrogen bootstrap",