by adom
Registry-native cross-agent auto-update hook, claude-rc (the keeper for Claude Remote Control), and Claude's start-here: a managed block in ~/.claude/CLAUDE.md plus adom-context, a SessionStart printout of where the session runs, who is signed in and which machines are reachable. Keeps adom/core apps and skills current from wiki.adom.inc on every Claude Code and Codex prompt, and keeps `claude rc` alive so users can open AI threads on their container from the Claude mobile app or claude.ai/code.
Spread the fleet's update cron over the half hour #1
Every container's crontab runs the update hook at */30, so the whole fleet checks at exactly :00 and :30. On wiki.adom.inc that is about 2,400 version checks in the same 30 seconds every half hour, against about 20 requests a second otherwise (measured 2026-10-20 from the wiki's per-route counters; it is the spike on the traffic dashboard).
This gives each machine its own two minutes of the hour instead: a hash of uname -n and $HOME, mod 30, so it is stable across reinstalls and spreads the fleet evenly. ADOM_HOOK_CRON_MINUTE (0-29) overrides it. The cron filter already replaces any line that runs this hook path, so a reinstall swaps the old */30 line rather than adding one. Version bumped to 1.3.10 so install.sh re-runs on update.
Only install.sh changes besides the version; check-updates.sh and its throttle are untouched. sh -n clean.
Diff Skip to comments
@@ -1,224 +1,235 @@⋯ 128 unchanged lines ⋯ # observable surface for a headless box is the status/log file the script writes # (~/.adom/last-update.status, ~/.adom/last-update.log), plus the CLI version it # reports to the registry on each update.-CRON_LINE_INTERVAL="*/30 * * * * $HOOK_CMD >/dev/null 2>&1"+# Each machine runs at its own two minutes of the hour, not */30: with every+# container in the fleet on */30, all of them checked at :00 and :30 at once+# (wiki.adom.inc 2026-10-20: about 2,400 version checks in the same 30 seconds,+# every half hour, against ~20 requests a second otherwise). The minute is a+# hash of this machine's name and HOME, so it is stable across reinstalls and+# spreads the fleet evenly over the half hour. ADOM_HOOK_CRON_MINUTE (0-29)+# overrides it.+CRON_MIN="${ADOM_HOOK_CRON_MINUTE:-$(( $(printf '%s' "$(uname -n 2>/dev/null)$HOME" | cksum | cut -d' ' -f1) % 30 ))}"+case "$CRON_MIN" in ''|*[!0-9]*) CRON_MIN=0 ;; esac+CRON_MIN=$(( CRON_MIN % 30 ))+CRON_LINE_INTERVAL="$CRON_MIN,$(( CRON_MIN + 30 )) * * * * $HOOK_CMD >/dev/null 2>&1" # The boot run waits ten minutes. On a fresh Hydrogen workspace the distro's first boot IS the # setup cascade (import, code-server start, the editor's extension host), and a full # `adom-wiki pkg update` in the same minute competed with it for a 4 vCPU box's CPU (winvm,⋯ 15 unchanged lines ⋯ } if { crontab -l 2>/dev/null | cron_filter; \ echo "$CRON_LINE_INTERVAL"; echo "$CRON_LINE_REBOOT"; } | crontab - 2>/dev/null; then- echo " registered cron for headless updates (*/30 + @reboot)"+ echo " registered cron for headless updates (minutes $CRON_MIN and $(( CRON_MIN + 30 )) of each hour, + @reboot)" # Another HOME's hook in the same user crontab is legal but almost always a # mistake (a stray isolated-test install). Name it instead of leaving two # updaters racing invisibly.⋯ 64 unchanged lines ⋯ fi echo "Installed adom-hook (auto-update wired for Claude + Codex; checks every ${ADOM_HOOK_INTERVAL:-1800}s; claude-rc staged, offer on next prompt)"+@@ -1,75 +1,76 @@ { "slug": "hook",- "version": "1.3.9",+ "version": "1.3.10", "type": "app", "org": "adom", "bundled": true,⋯ 66 unchanged lines ⋯ } ] }+@@ -1,82 +1,82 @@ { "slug": "hook",- "version": "1.3.9",+ "version": "1.3.10", "type": "app", "org": "adom", "bundled": true,⋯ 76 unchanged lines ⋯
Comments
Log in to comment.
No comments yet.