generated from eblume/project-template
C2: hephd self-update (Mikado plan — cards for review) #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "mikado/hephd-self-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
C2 Mikado chain: opt-in hephd self-update
This PR opens the planning layer of a C2 Mikado chain (cards only, no code yet) for review of the dependency graph before implementation cycles begin. From
Hephaestustask01KTA2NSNRYT902HC3VRW00S1J.Goal: an opt-in, default-off mode where
hephdpolls the forge for a newer release and, when one exists, rebuilds viacargo installfrom the release tag and restarts itself onto the new binary.Owner decisions baked in
cargo installfrom the tag for now (prebuilt binaries a possible future).Dependency graph
The three leaves under
self-update-poll-loopyield a working notify-only daemon first; the apply path (service-env-forge-access→cargo-install-from-tag→service-respawn-on-clean-exit→self-restart-after-update) layers on auto-apply.Key findings driving the cards
KeepAlive=true); systemd isRestart=on-failureand won't — needsRestart=always(service-respawn-on-clean-exit).cargo/forge blocker is real for the service environment: the SSH URL works interactively, but launchd/systemd likely lack cargo on PATH + forge SSH (service-env-forge-access).verify-hub-dropout-resiliencelocks it in with a test.Review asks
Next per the C2 process: pick a ready leaf and start a work cycle (
impl→close).mise run docs-mikado hephd-self-updaterenders the live graph.🤖 Generated with Claude Code
Kick off the C2 Mikado chain for an opt-in (default-off) hephd self-update mode (forge-poll -> cargo install from tag -> self-restart). Goal card plus eight prerequisite cards, indexed from how-to.md: release-poll-version-check, self-update-opt-in-flag (leaves) -> self-update-poll-loop (notify-only core) service-env-forge-access (leaf, the cargo/forge blocker) + self-update-poll-loop -> cargo-install-from-tag service-respawn-on-clean-exit (leaf, systemd Restart=always) + cargo-install-from-tag -> self-restart-after-update verify-hub-dropout-resilience (leaf, lock in the base-case guarantee) Grounded in research of hephd's sync loop, daemon lifecycle, the launchd/systemd service templates, and the forge releases API. Captured from Hephaestus task 01KTA2NSNRYT902HC3VRW00S1J. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Add crates/hephd/src/selfupdate.rs: a pure update_available() that compares the running heph_core::VERSION (e.g. "1.0.3 (sha)") against a release tag ("v1.0.4") via semver, ignoring the build suffix and v prefix; plus parse_latest_tag() / fetch_latest_tag() for the forge releases/latest feed. Decision logic and JSON parsing are unit-tested against sample payloads; the network fetch is isolated. Adds the semver workspace dep. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Add --self-update (default off) and --self-update-interval-secs to the hephd CLI, a SelfUpdateConfig (Some => enabled), and thread it into the Daemon (with_self_update) for every mode. spawn_self_update_loop() currently just announces the mode at startup ('self-update enabled') so the opt-in is observable; the poll/apply cycle is wired in later leaves. Omitting the flag leaves behaviour unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>Update: chain finalized — all 8 leaves closed
The public-repo correction removed the only real blocker (
service-env-forge-access).cargo install --gitis a plain anonymous clone of the public repo — not the access-restricted Forgejo cargo registry (that was what requiredforge.ops.eblu.me). So: no SSH, no credentials.Done since last update:
INSTALL_GIT_URL+ release poll → canonical public HTTPS host. Verified end-to-end:cargo install --git https://forge.eblu.me/eblume/hephaestus.git --tag v1.0.3 hephdbuilds a working binary with zero auth.heph daemon start --self-update(default off) generates a launchd/systemd service that passes--self-updateand bakes a cargo-capable PATH/HOME;restartpreserves it. Default services unchanged.service-env-forge-accessclosed (card corrected — the SSH premise was wrong); goal finalized; changelog added.One owner check remains: a live older→newer upgrade can only be observed at the next release. Enable
--self-updatethen and confirm. All detection/apply logic is unit-tested and the install mechanism is verified, so this is a smoke test, not a risk.Ready for review/merge.
c321d72e7d443763489b