heph daemon: bake mode/hub/oidc/self-update-interval into the service #12

Merged
eblume merged 1 commit from feature/daemon-self-update-interval into main 2026-06-08 13:32:48 -07:00
Owner

Summary

heph daemon start/restart previously hardcoded hephd --mode local and only wired the bare --self-update bool. The poll interval and all spoke/hub sync config (--hub-url, --http-addr, --oidc-*) could not be set on the managed service without hand-editing the plist/unit — and a later start/restart would clobber the hand edits. (This is exactly why gilbert's LaunchAgent carried a "Do NOT run heph daemon start/restart" warning.)

This change:

  • Generates the hephd argument vector from a DaemonConfig (shared by the launchd + systemd renderers).
  • Adds heph daemon start/restart flags: --mode, --hub-url, --http-addr, --oidc-issuer, --oidc-audience, --oidc-client-id, and --self-update-interval-secs.
  • Preserves baked config on regeneration: start and restart now parse the existing service file and carry over any flags not passed, so a bare invocation never silently drops spoke/hub or self-update config. Removes the old footgun where start dropped --self-update (only restart preserved it before).

Closes two backlog tasks: "pass through --self-update-interval-secs" and "bake hub/spoke config into the generated service".

Testing

  • cargo test -p heph (12 service unit tests incl. spoke/hub baking, interval gating, and launchd/systemd config round-trip parse)
  • cargo clippy -p heph --all-targets clean
  • cargo fmt + prek hooks pass
  • Regenerate the live gilbert LaunchAgent via the new generator (faithful round-trip verified against the current plist)

Notes

  • --web-root / --server-url are intentionally not baked (PWA-host / client-proxy concerns, out of scope here).
  • Spoke sync remains HTTP-only (separate backlog item).

🤖 Generated with Claude Code

## Summary `heph daemon start`/`restart` previously hardcoded `hephd --mode local` and only wired the bare `--self-update` bool. The poll interval and all spoke/hub sync config (`--hub-url`, `--http-addr`, `--oidc-*`) could **not** be set on the managed service without hand-editing the plist/unit — and a later `start`/`restart` would clobber the hand edits. (This is exactly why gilbert's LaunchAgent carried a "Do NOT run `heph daemon start/restart`" warning.) This change: - Generates the `hephd` argument vector from a `DaemonConfig` (shared by the launchd + systemd renderers). - Adds `heph daemon start/restart` flags: `--mode`, `--hub-url`, `--http-addr`, `--oidc-issuer`, `--oidc-audience`, `--oidc-client-id`, and `--self-update-interval-secs`. - **Preserves baked config on regeneration**: `start` and `restart` now parse the existing service file and carry over any flags not passed, so a bare invocation never silently drops spoke/hub or self-update config. Removes the old footgun where `start` dropped `--self-update` (only `restart` preserved it before). Closes two backlog tasks: "pass through `--self-update-interval-secs`" and "bake hub/spoke config into the generated service". ## Testing - [x] `cargo test -p heph` (12 service unit tests incl. spoke/hub baking, interval gating, and launchd/systemd config round-trip parse) - [x] `cargo clippy -p heph --all-targets` clean - [x] `cargo fmt` + prek hooks pass - [ ] Regenerate the live gilbert LaunchAgent via the new generator (faithful round-trip verified against the current plist) ## Notes - `--web-root` / `--server-url` are intentionally not baked (PWA-host / client-proxy concerns, out of scope here). - Spoke sync remains HTTP-only (separate backlog item). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(heph): bake daemon mode/hub/oidc/self-update-interval into the service
All checks were successful
Build / validate (pull_request) Successful in 5m45s
626c796e6c
`heph daemon start`/`restart` previously hardcoded `hephd --mode local` and
only wired the bare `--self-update` bool — the poll interval and all spoke/hub
sync config (`--hub-url`, `--http-addr`, `--oidc-*`) could not be set on the
managed service without hand-editing the plist/unit (which a later
start/restart would clobber).

Generate the hephd arg vector from a DaemonConfig and add the corresponding
`heph daemon start/restart` flags: --mode, --hub-url, --http-addr,
--oidc-issuer, --oidc-audience, --oidc-client-id, and
--self-update-interval-secs. Regenerating now reads the existing service file
and preserves any flags not passed (start as well as restart), so a bare
invocation never silently drops baked config.

Closes the "pass through --self-update-interval-secs" and "bake hub/spoke
config into the generated service" backlog tasks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author
Owner

Applied to the live gilbert LaunchAgent: backed up the hand-managed plist (*.bak.pre-managed), regenerated via heph daemon restart. Diff confirms all ProgramArguments preserved (--mode local, db/socket, --hub-url, --oidc-issuer, --oidc-client-id, --self-update --self-update-interval-secs 600); only the hand comments + a cosmetic PATH reorder changed. Daemon healthy, socket responds, self-update re-enabled at 600s.

Note: restart hit a launchd bootout→bootstrap race (5: Input/output error) needing a manual re-bootstrap — captured as a separate backlog task.

Applied to the live gilbert LaunchAgent: backed up the hand-managed plist (`*.bak.pre-managed`), regenerated via `heph daemon restart`. Diff confirms all ProgramArguments preserved (`--mode local`, db/socket, `--hub-url`, `--oidc-issuer`, `--oidc-client-id`, `--self-update --self-update-interval-secs 600`); only the hand comments + a cosmetic PATH reorder changed. Daemon healthy, socket responds, self-update re-enabled at 600s. Note: `restart` hit a launchd bootout→bootstrap race (`5: Input/output error`) needing a manual re-bootstrap — captured as a separate backlog task.
eblume merged commit 5535cc7127 into main 2026-06-08 13:32:48 -07:00
Sign in to join this conversation.
No reviewers
No labels
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
eblume/hephaestus!12
No description provided.