feat(hermes): deploy Hermes backend on Vega and desktop client across fleet #371

Merged
nimmo merged 7 commits from feat/hermes-desktop-fleet into main 2026-10-19 12:25:43 +01:00
Owner

Summary

This MR enables the Hermes Agent dashboard/backend service on Vega over the encrypted Nebula mesh and provisions the Hermes Desktop client on Electra and Lena, configured with automated SOPS-backed OAuth authentication.

Closes #367, Closes #369, Closes #370
Milestone: Hermes Desktop Fleet Rollout

Key Changes

  • Vega Service (modules/services/hermes.nix):
    • Configured services.hermes-agent.backend in dashboard mode on Vega's Nebula IP (10.10.0.2:9119).
    • Restricted TCP 9119 exposure to nebula.mesh interface only on the firewall.
    • Sourced basic auth password and session secret from encrypted secrets/hermes-dashboard.yaml.
  • SOPS Secret (secrets/hermes-dashboard.yaml, .sops.yaml, secrets/README.md):
    • Created shared secret encrypted with Age recipient keys for Vega, Electra, Lena, and admin YubiKeys.
    • Documented secret roles and usage in secrets/README.md.
  • Desktop Clients (modules/profiles/ai-desktop.nix, home/users/nimmo/ai.nix):
    • Delivered /run/secrets/hermes-dashboard-client-password on non-server AI desktop hosts.
    • Modularized home/users/nimmo/desktop.nix into ai.nix, btop.nix, and standalone helper hermes-preauth.py.
    • Configured hermes-desktop wrapper to pre-authenticate against Vega's password login endpoint and seed native OAuth bearer tokens into ~/.config/Hermes/native-oauth-tokens.json and connections.json at startup.
  • Config & Policy Refinements:
    • Centralized dashboard endpoint option nixosConfig.hermes.dashboardUrl in modules/common/default-config.nix.
    • Extended auto-update policy scope in lib/auto-update-policy.nix to include electra and lena as consumers of the hermes-agent flake input.

Validation & Evidence

  • Flake Checks: nix flake check passes cleanly with all checks successful.
  • Host Builds: nixos-rebuild build --flake .#electra built successfully.
  • Backend Service (Vega): Verified hermes-backend.service running and healthy; API endpoints respond over Nebula mesh.
  • Client Auto-Authentication: Verified hermes-preauth.py successfully exchanges credentials against /auth/password-login, receives session tokens, and seeds native-oauth-tokens.json. Verified Hermes Desktop connects directly without login prompts.
  • Automated AI Review: Clean at Ready to merge on commit 8be99bc.
## Summary This MR enables the Hermes Agent dashboard/backend service on Vega over the encrypted Nebula mesh and provisions the Hermes Desktop client on Electra and Lena, configured with automated SOPS-backed OAuth authentication. Closes #367, Closes #369, Closes #370 Milestone: Hermes Desktop Fleet Rollout ### Key Changes - **Vega Service (`modules/services/hermes.nix`)**: - Configured `services.hermes-agent.backend` in dashboard mode on Vega's Nebula IP (`10.10.0.2:9119`). - Restricted TCP 9119 exposure to `nebula.mesh` interface only on the firewall. - Sourced basic auth password and session secret from encrypted `secrets/hermes-dashboard.yaml`. - **SOPS Secret (`secrets/hermes-dashboard.yaml`, `.sops.yaml`, `secrets/README.md`)**: - Created shared secret encrypted with Age recipient keys for Vega, Electra, Lena, and admin YubiKeys. - Documented secret roles and usage in `secrets/README.md`. - **Desktop Clients (`modules/profiles/ai-desktop.nix`, `home/users/nimmo/ai.nix`)**: - Delivered `/run/secrets/hermes-dashboard-client-password` on non-server AI desktop hosts. - Modularized `home/users/nimmo/desktop.nix` into `ai.nix`, `btop.nix`, and standalone helper `hermes-preauth.py`. - Configured `hermes-desktop` wrapper to pre-authenticate against Vega's password login endpoint and seed native OAuth bearer tokens into `~/.config/Hermes/native-oauth-tokens.json` and `connections.json` at startup. - **Config & Policy Refinements**: - Centralized dashboard endpoint option `nixosConfig.hermes.dashboardUrl` in `modules/common/default-config.nix`. - Extended auto-update policy scope in `lib/auto-update-policy.nix` to include `electra` and `lena` as consumers of the `hermes-agent` flake input. ### Validation & Evidence - **Flake Checks**: `nix flake check` passes cleanly with all checks successful. - **Host Builds**: `nixos-rebuild build --flake .#electra` built successfully. - **Backend Service (Vega)**: Verified `hermes-backend.service` running and healthy; API endpoints respond over Nebula mesh. - **Client Auto-Authentication**: Verified `hermes-preauth.py` successfully exchanges credentials against `/auth/password-login`, receives session tokens, and seeds `native-oauth-tokens.json`. Verified Hermes Desktop connects directly without login prompts. - **Automated AI Review**: Clean at **Ready to merge** on commit `8be99bc`.
- Enable Hermes dashboard and backend service on Vega bound to the Nebula mesh (10.10.0.2:9119) with basic authentication
- Add hermes-desktop package to electra and lena via desktop home-manager configuration
- Document SOPS secrets requirement (hermes/dashboard/password and hermes/dashboard/secret)

Refs: #367, #369
- Add creation rule in .sops.yaml for secrets/hermes-dashboard.yaml (electra, lena, vega)
- Create secrets/hermes-dashboard.yaml with encrypted dashboard credentials
- Point hermes-dashboard-password and secret in modules/services/hermes.nix to the new shared file
- Expose hermes-dashboard-client-password on desktop hosts in modules/profiles/ai-desktop.nix
- Wrap hermes-desktop in home/users/nimmo/desktop.nix to auto-configure remote connection to Vega

Refs: #367, #369
refactor(desktop): modularize desktop.nix into ai.nix, btop.nix, and hermes-preauth.py
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m33s
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 16m2s
9f86149fc9
clankbot left a comment

Automated code review

Reviewed commit: 9f86149fc9c641b58c6314c1b01dfc8093fb2193

Verdict: Requires further work

Resolve the blocking or important findings and investigate failed deterministic checks before merging.

Overall assessment

Verified the change set against the checked-out tree. The new .sops.yaml rule for secrets/hermes-dashboard.yaml (line 94) does not collide with the preceding secrets/hermes(-fleet-ssh)?\.yaml$ rule (line 86), and the six age recipients recorded in the new secret file match the electra, lena, vega, yubikey-nano5c, yubikey-5-nfc and provision-key aliases defined at .sops.yaml:7-18. The desktop.nix split into ai.nix/btop.nix is content-preserving (btop settings and the Paseo user service are byte-identical in the new files, desktop.nix no longer references inputs), and the reordered home/users/nimmo/default.nix imports introduce no duplicate option definitions (programs.btop is defined once, home.packages is additive). Secret scoping is consistent today: hermes-dashboard-client-password is provisioned only where profiles.aiDesktop.headless is false (electra/lena import modules/profiles/ai-desktop.nix; vega:133 and lyra:187 set headless = true), and the default /run/secrets/hermes-dashboard-client-password path in hermes-preauth.py matches that secret name. The one substantive gap is that Electra and Lena become real consumers of the hermes-agent flake input while lib/auto-update-policy.nix still scopes that input to Vega. Remaining items are documentation drift, a repeated endpoint literal, and validation-evidence gaps.

Blocking findings

None.

Important findings

  • Electra and Lena now consume the hermes-agent input, but lib/auto-update-policy.nix still scopes it to Vega only (home/users/nimmo/ai.nix:18; high confidence)
    home/users/nimmo/ai.nix:18 evaluates inputs.hermes-agent.packages.${pkgs.stdenv.hostPlatform.system}.desktop and line 68 installs it under lib.mkIf (!isServer) with isServer = osConfig.nixosConfig.host.isServer; modules/common/default-config.nix:68-70 derives isServer from nixosConfig.host.role == "server", and hosts/electra/default.nix:176 and hosts/lena/default.nix:38 set role = "laptop", so the package is installed on both laptops. lib/auto-update-policy.nix:215-218 still declares name = "hermes-agent"; inputs = [ "hermes-agent" ]; hosts = [ "vega" ], while the file header (line 3) states 'Groups scope validation to the hosts consuming an input' and README.md:171 states inputs 'must also be classified by real consumers in lib/auto-update-policy.nix'. Comparable desktop-consuming inputs list the laptops (e.g. the trilium-next group at lines 205-213 lists electra and lena).
    Impact: The hermes-agent input's validation scope no longer matches its real consumers: electra and lena are nixosConfig.autoUpdate.role = "consumer" hosts (hosts/electra/default.nix:202, hosts/lena/default.nix:54), so an updated lock for this input would be pulled and activated on the laptops while being validated only against Vega. A regression in the desktop package or in the extraRun override contract would surface as a failed auto-update on the desktops rather than as a caught mismatch.
    Suggested fix: Extend the hermes-agent group in lib/auto-update-policy.nix to hosts = [ "electra" "lena" "vega" ] (or add a separate group for the desktop package) and update the rationale to state that Electra and Lena consume packages.<system>.desktop, so the declared scope matches the consumers introduced by this change.

Suggestions

  • Dashboard option descriptions still name secrets/hermes.yaml instead of the file actually read (modules/services/hermes.nix:165; high confidence)
    modules/services/hermes.nix:165 and :171 describe passwordSecretKey and secretKey as 'SOPS key in secrets/hermes.yaml ...', but the same change resolves both against sopsFile = ../../secrets/hermes-dashboard.yaml at lines 195 and 199. secrets/README.md:233 and .sops.yaml:93-103 document secrets/hermes-dashboard.yaml as the source; secrets/hermes.yaml is used only by the pre-existing keys at lines 180-189.
    Impact: Generated option documentation points operators at the wrong secret file; anyone rotating the dashboard password or session signing secret from the description would edit secrets/hermes.yaml, which is not read by this code path.
    Suggested fix: Update both descriptions to reference secrets/hermes-dashboard.yaml, matching the sopsFile used at lines 195 and 199.

  • Vega dashboard endpoint is repeated as a literal in three client places while the server side is configurable (home/users/nimmo/ai.nix:29; medium confidence)
    http://10.10.0.2:9119 is hardcoded in the generated connection.json (home/users/nimmo/ai.nix:29), in connections.json (home/users/nimmo/ai.nix:52) and as the HERMES_URL default in home/users/nimmo/hermes-preauth.py:17. The server side is option-driven: modules/services/hermes.nix:139 defaults listenAddress to config.nixosConfig.nebula.overlayIp and line 145 defaults port = 9119, enabled by hosts/vega/default.nix:276. The repository's existing convention for cross-host client URLs is a nixosConfig value (e.g. nixosConfig.trilium.clientUrl set per host at hosts/electra/default.nix:201, hosts/lena/default.nix:53 and consumed at modules/mcp/trilium.nix:8).
    Impact: Changing Vega's dashboard port or the Nebula overlay IP would leave Electra and Lena pointing at the previous address with no evaluation-time error; the desktop would target a closed endpoint and hermes-preauth.py would fall into its except Exception: pass branch (line 89) with no diagnostic.
    Suggested fix: Follow the existing convention: expose a single client URL (e.g. a nixosConfig.hermes.clientUrl defaulting to "http://${config.nixosConfig.nebula.overlayIp}:${cfg.dashboard.port}") and derive the generated connection.json, connections.json and HERMES_URL from it instead of repeating the literal.

  • No test-deployment (canary) evidence for the newly added backend service and desktop client (hosts/vega/default.nix:276; medium confidence)
    This change enables a new service (dashboard.enable = true at hosts/vega/default.nix:276, which adds systemd.services.hermes-backend at modules/services/hermes.nix:425-432 and a new serviceFailureMonitor watch entry at line 416-419) and a new desktop package on Electra and Lena. AGENTS.md:43 states 'Prefer just test or just test-remote as the canary when adding or fundamentally changing something, exercising documented user-facing commands as well as systemd services', and AGENTS.md:45 states 'Use just test rather than raw nixos-rebuild test' plus 'When testing remotely, create an auto-update hold first'. The supplied material contains no activation/test evidence for these units on any host.
    Impact: The new unit ordering (bindsTo = [ "sys-subsystem-net-devices-nebula.mesh.device" ]) and the desktop package's extraRun startup path are exercised only by the change narrative, not by the repository's stated canary for added services.
    Suggested fix: Run just test on Electra and Lena (with an auto-update hold when testing remotely, per AGENTS.md:45) and just test-remote vega for the new backend service, and record that evidence before merge readiness.

Tests and validation

  • No configured deterministic checks.

Questions

  • The hermes-agent flake input (flake.nix:27) is external and absent from this checkout, so I could not confirm that packages.<system>.desktop accepts an extraRun override, that services.hermes-agent.backend accepts { mode, host, port }, or that the upstream nixosModule defines a hermes-backend unit carrying a description/ExecStart. The last one matters for checks.x86_64-linux.service-failure-monitor-coverage (flake.nix:382), whose script scripts/check-service-failure-monitor.nix asserts every watched name has unit.description != "" || unit.serviceConfig != { } || unit.script != "", and this change adds "hermes-backend" to that watch list.
  • modules/services/hermes.nix:247-249 injects HERMES_DASHBOARD_BASIC_AUTH_* into sops.templates."hermes-env". Does that template reach hermes-backend.service, or only the gateway unit? The supplied evidence shows the backend unit being ordered after Nebula but not that basic auth is enforced on it.
  • Is the token layout assumed by home/users/nimmo/hermes-preauth.py stable — hermes_session_at/hermes_session_rt cookies, base64url(JSON header) with 32 trailing signature bytes, expiresAt from the header exp, and the /auth/password-login request body {provider: "basic", username, password}? Every failure path in that script is swallowed (except Exception: pass, lines 89 and the outer handler), so a contract change would be silent.
  • Should the connections.json seeding be idempotent against user-edited connection lists? The current test (! grep -q '"vega"', ai.nix line 44) overwrites any file that lacks a literal "vega" string, including a user-customised list.
  • auth.username defaults to config.nixosConfig.primaryUser (modules/services/hermes.nix:16) and hermes-preauth.py:18 defaults HERMES_USER to nimmo; these agree today, but is the dashboard basic-auth username intended to be the primary user rather than the hermes service account?

Review limitations

  • No Nix tooling was run: no evaluation, nix flake check, build, or test deployment was performed, so all evaluation-level claims are read from the supplied diff and checked-out sources.
  • The hermes-agent flake input, its nixosModules, its backend option names, its desktop package and its generated hermes-backend unit are external and absent from the checkout; option names and unit ownership could not be inspected.
  • SOPS decryption was not performed; I compared the six recipient key strings in secrets/hermes-dashboard.yaml against the alias values in .sops.yaml:7-18, which match, but the ciphertext/MAC were not verified.
  • No live host state, systemd status, firewall state, or Nebula reachability was inspected; runtime behaviour of the dashboard and desktop client is unverified.
  • hermes-preauth.py was not exercised against the real Hermes /auth/password-login contract; the endpoint, cookie names and token encoding are unverified.
  • Only the listed changed files and files reachable by navigation from them were examined; unrelated repository areas were not reviewed.

Diff coverage

  • .sops.yaml: reviewed — included in a context-limited batch
  • README.md: reviewed — included in a context-limited batch
  • home/users/nimmo/ai.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/btop.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/default.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/desktop.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/hermes-preauth.py: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • modules/profiles/ai-desktop.nix: reviewed — included in a context-limited batch
  • modules/services/hermes.nix: reviewed — included in a context-limited batch
  • secrets/README.md: reviewed — included in a context-limited batch
  • secrets/hermes-dashboard.yaml: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/hermes-fleet-ssh.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 6
  • Previous automated review: none found
  • Findings: 4
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `9f86149fc9c641b58c6314c1b01dfc8093fb2193` ## Verdict: Requires further work Resolve the blocking or important findings and investigate failed deterministic checks before merging. ### Overall assessment Verified the change set against the checked-out tree. The new `.sops.yaml` rule for `secrets/hermes-dashboard.yaml` (line 94) does not collide with the preceding `secrets/hermes(-fleet-ssh)?\.yaml$` rule (line 86), and the six age recipients recorded in the new secret file match the `electra`, `lena`, `vega`, `yubikey-nano5c`, `yubikey-5-nfc` and `provision-key` aliases defined at `.sops.yaml:7-18`. The `desktop.nix` split into `ai.nix`/`btop.nix` is content-preserving (btop settings and the Paseo user service are byte-identical in the new files, `desktop.nix` no longer references `inputs`), and the reordered `home/users/nimmo/default.nix` imports introduce no duplicate option definitions (`programs.btop` is defined once, `home.packages` is additive). Secret scoping is consistent today: `hermes-dashboard-client-password` is provisioned only where `profiles.aiDesktop.headless` is false (electra/lena import `modules/profiles/ai-desktop.nix`; vega:133 and lyra:187 set `headless = true`), and the default `/run/secrets/hermes-dashboard-client-password` path in `hermes-preauth.py` matches that secret name. The one substantive gap is that Electra and Lena become real consumers of the `hermes-agent` flake input while `lib/auto-update-policy.nix` still scopes that input to Vega. Remaining items are documentation drift, a repeated endpoint literal, and validation-evidence gaps. ### Blocking findings None. ### Important findings - **Electra and Lena now consume the hermes-agent input, but lib/auto-update-policy.nix still scopes it to Vega only** (home/users/nimmo/ai.nix:18; high confidence) `home/users/nimmo/ai.nix:18` evaluates `inputs.hermes-agent.packages.${pkgs.stdenv.hostPlatform.system}.desktop` and line 68 installs it under `lib.mkIf (!isServer)` with `isServer = osConfig.nixosConfig.host.isServer`; `modules/common/default-config.nix:68-70` derives `isServer` from `nixosConfig.host.role == "server"`, and `hosts/electra/default.nix:176` and `hosts/lena/default.nix:38` set `role = "laptop"`, so the package is installed on both laptops. `lib/auto-update-policy.nix:215-218` still declares `name = "hermes-agent"; inputs = [ "hermes-agent" ]; hosts = [ "vega" ]`, while the file header (line 3) states 'Groups scope validation to the hosts consuming an input' and README.md:171 states inputs 'must also be classified by real consumers in lib/auto-update-policy.nix'. Comparable desktop-consuming inputs list the laptops (e.g. the `trilium-next` group at lines 205-213 lists electra and lena). Impact: The `hermes-agent` input's validation scope no longer matches its real consumers: electra and lena are `nixosConfig.autoUpdate.role = "consumer"` hosts (hosts/electra/default.nix:202, hosts/lena/default.nix:54), so an updated lock for this input would be pulled and activated on the laptops while being validated only against Vega. A regression in the `desktop` package or in the `extraRun` override contract would surface as a failed auto-update on the desktops rather than as a caught mismatch. Suggested fix: Extend the `hermes-agent` group in `lib/auto-update-policy.nix` to `hosts = [ "electra" "lena" "vega" ]` (or add a separate group for the desktop package) and update the rationale to state that Electra and Lena consume `packages.<system>.desktop`, so the declared scope matches the consumers introduced by this change. ### Suggestions - **Dashboard option descriptions still name secrets/hermes.yaml instead of the file actually read** (modules/services/hermes.nix:165; high confidence) `modules/services/hermes.nix:165` and `:171` describe `passwordSecretKey` and `secretKey` as 'SOPS key in secrets/hermes.yaml ...', but the same change resolves both against `sopsFile = ../../secrets/hermes-dashboard.yaml` at lines 195 and 199. `secrets/README.md:233` and `.sops.yaml:93-103` document `secrets/hermes-dashboard.yaml` as the source; `secrets/hermes.yaml` is used only by the pre-existing keys at lines 180-189. Impact: Generated option documentation points operators at the wrong secret file; anyone rotating the dashboard password or session signing secret from the description would edit `secrets/hermes.yaml`, which is not read by this code path. Suggested fix: Update both descriptions to reference `secrets/hermes-dashboard.yaml`, matching the `sopsFile` used at lines 195 and 199. - **Vega dashboard endpoint is repeated as a literal in three client places while the server side is configurable** (home/users/nimmo/ai.nix:29; medium confidence) `http://10.10.0.2:9119` is hardcoded in the generated `connection.json` (home/users/nimmo/ai.nix:29), in `connections.json` (home/users/nimmo/ai.nix:52) and as the `HERMES_URL` default in `home/users/nimmo/hermes-preauth.py:17`. The server side is option-driven: `modules/services/hermes.nix:139` defaults `listenAddress` to `config.nixosConfig.nebula.overlayIp` and line 145 defaults `port = 9119`, enabled by `hosts/vega/default.nix:276`. The repository's existing convention for cross-host client URLs is a `nixosConfig` value (e.g. `nixosConfig.trilium.clientUrl` set per host at hosts/electra/default.nix:201, hosts/lena/default.nix:53 and consumed at modules/mcp/trilium.nix:8). Impact: Changing Vega's dashboard port or the Nebula overlay IP would leave Electra and Lena pointing at the previous address with no evaluation-time error; the desktop would target a closed endpoint and `hermes-preauth.py` would fall into its `except Exception: pass` branch (line 89) with no diagnostic. Suggested fix: Follow the existing convention: expose a single client URL (e.g. a `nixosConfig.hermes.clientUrl` defaulting to `"http://${config.nixosConfig.nebula.overlayIp}:${cfg.dashboard.port}"`) and derive the generated `connection.json`, `connections.json` and `HERMES_URL` from it instead of repeating the literal. - **No test-deployment (canary) evidence for the newly added backend service and desktop client** (hosts/vega/default.nix:276; medium confidence) This change enables a new service (`dashboard.enable = true` at hosts/vega/default.nix:276, which adds `systemd.services.hermes-backend` at modules/services/hermes.nix:425-432 and a new `serviceFailureMonitor` watch entry at line 416-419) and a new desktop package on Electra and Lena. AGENTS.md:43 states 'Prefer `just test` or `just test-remote` as the canary when adding or fundamentally changing something, exercising documented user-facing commands as well as systemd services', and AGENTS.md:45 states 'Use `just test` rather than raw `nixos-rebuild test`' plus 'When testing remotely, create an auto-update hold first'. The supplied material contains no activation/test evidence for these units on any host. Impact: The new unit ordering (`bindsTo = [ "sys-subsystem-net-devices-nebula.mesh.device" ]`) and the desktop package's `extraRun` startup path are exercised only by the change narrative, not by the repository's stated canary for added services. Suggested fix: Run `just test` on Electra and Lena (with an auto-update hold when testing remotely, per AGENTS.md:45) and `just test-remote vega` for the new backend service, and record that evidence before merge readiness. ### Tests and validation - No configured deterministic checks. ### Questions - The `hermes-agent` flake input (flake.nix:27) is external and absent from this checkout, so I could not confirm that `packages.<system>.desktop` accepts an `extraRun` override, that `services.hermes-agent.backend` accepts `{ mode, host, port }`, or that the upstream nixosModule defines a `hermes-backend` unit carrying a description/ExecStart. The last one matters for `checks.x86_64-linux.service-failure-monitor-coverage` (flake.nix:382), whose script `scripts/check-service-failure-monitor.nix` asserts every watched name has `unit.description != "" || unit.serviceConfig != { } || unit.script != ""`, and this change adds `"hermes-backend"` to that watch list. - `modules/services/hermes.nix:247-249` injects `HERMES_DASHBOARD_BASIC_AUTH_*` into `sops.templates."hermes-env"`. Does that template reach `hermes-backend.service`, or only the gateway unit? The supplied evidence shows the backend unit being ordered after Nebula but not that basic auth is enforced on it. - Is the token layout assumed by `home/users/nimmo/hermes-preauth.py` stable — `hermes_session_at`/`hermes_session_rt` cookies, `base64url(JSON header)` with 32 trailing signature bytes, `expiresAt` from the header `exp`, and the `/auth/password-login` request body `{provider: "basic", username, password}`? Every failure path in that script is swallowed (`except Exception: pass`, lines 89 and the outer handler), so a contract change would be silent. - Should the `connections.json` seeding be idempotent against user-edited connection lists? The current test (`! grep -q '"vega"'`, ai.nix line 44) overwrites any file that lacks a literal `"vega"` string, including a user-customised list. - `auth.username` defaults to `config.nixosConfig.primaryUser` (modules/services/hermes.nix:16) and `hermes-preauth.py:18` defaults `HERMES_USER` to `nimmo`; these agree today, but is the dashboard basic-auth username intended to be the primary user rather than the `hermes` service account? ### Review limitations - No Nix tooling was run: no evaluation, `nix flake check`, build, or test deployment was performed, so all evaluation-level claims are read from the supplied diff and checked-out sources. - The `hermes-agent` flake input, its `nixosModules`, its `backend` option names, its `desktop` package and its generated `hermes-backend` unit are external and absent from the checkout; option names and unit ownership could not be inspected. - SOPS decryption was not performed; I compared the six recipient key strings in `secrets/hermes-dashboard.yaml` against the alias values in `.sops.yaml:7-18`, which match, but the ciphertext/MAC were not verified. - No live host state, systemd status, firewall state, or Nebula reachability was inspected; runtime behaviour of the dashboard and desktop client is unverified. - `hermes-preauth.py` was not exercised against the real Hermes `/auth/password-login` contract; the endpoint, cookie names and token encoding are unverified. - Only the listed changed files and files reachable by navigation from them were examined; unrelated repository areas were not reviewed. ### Diff coverage - `.sops.yaml`: **reviewed** — included in a context-limited batch - `README.md`: **reviewed** — included in a context-limited batch - `home/users/nimmo/ai.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/btop.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/default.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/desktop.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/hermes-preauth.py`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ai-desktop.nix`: **reviewed** — included in a context-limited batch - `modules/services/hermes.nix`: **reviewed** — included in a context-limited batch - `secrets/README.md`: **reviewed** — included in a context-limited batch - `secrets/hermes-dashboard.yaml`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/hermes-fleet-ssh.md, docs/nova-remote-builder.md, README.md - Commits considered: 6 - Previous automated review: none found - Findings: 4 </details>
Author
Owner

Response to Automated Review (commit 9f86149)

Thank you for the review. Addressed the feedback with the following updates:

  1. Auto-update policy input scoping (lib/auto-update-policy.nix):

    • Extended the hermes-agent input group to hosts = [ "electra" "lena" "vega" ] with an updated rationale reflecting that Electra and Lena consume the desktop package while Vega consumes the backend service.
  2. Dashboard option secret file documentation (modules/services/hermes.nix):

    • Corrected option descriptions for passwordSecretKey and secretKey to state secrets/hermes-dashboard.yaml matching the actual SOPS file loaded.
  3. Centralized dashboard endpoint option (modules/common/default-config.nix, home/users/nimmo/ai.nix):

    • Declared nixosConfig.hermes.dashboardUrl (defaulting to "http://10.10.0.2:9119").
    • Updated home/users/nimmo/ai.nix to derive connection.json, connections.json, and pass HERMES_URL to hermes-preauth.py dynamically from osConfig.nixosConfig.hermes.dashboardUrl.
  4. Validation:

    • nix flake check passed cleanly across all host configurations.
    • Live testing confirmed Vega's hermes-backend.service is running and bound to 10.10.0.2:9119, and hermes-preauth.py successfully exchanges credentials against /auth/password-login to seed native OAuth tokens for automated connection.
### Response to Automated Review (commit 9f86149) Thank you for the review. Addressed the feedback with the following updates: 1. **Auto-update policy input scoping (`lib/auto-update-policy.nix`)**: - Extended the `hermes-agent` input group to `hosts = [ "electra" "lena" "vega" ]` with an updated rationale reflecting that Electra and Lena consume the desktop package while Vega consumes the backend service. 2. **Dashboard option secret file documentation (`modules/services/hermes.nix`)**: - Corrected option descriptions for `passwordSecretKey` and `secretKey` to state `secrets/hermes-dashboard.yaml` matching the actual SOPS file loaded. 3. **Centralized dashboard endpoint option (`modules/common/default-config.nix`, `home/users/nimmo/ai.nix`)**: - Declared `nixosConfig.hermes.dashboardUrl` (defaulting to `"http://10.10.0.2:9119"`). - Updated `home/users/nimmo/ai.nix` to derive `connection.json`, `connections.json`, and pass `HERMES_URL` to `hermes-preauth.py` dynamically from `osConfig.nixosConfig.hermes.dashboardUrl`. 4. **Validation**: - `nix flake check` passed cleanly across all host configurations. - Live testing confirmed Vega's `hermes-backend.service` is running and bound to `10.10.0.2:9119`, and `hermes-preauth.py` successfully exchanges credentials against `/auth/password-login` to seed native OAuth tokens for automated connection.
fix(hermes): address review feedback on auto-update policy and dashboard options
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m30s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 13m9s
8be99bccd1
clankbot left a comment

Automated code review

Reviewed commit: 8be99bccd1ccc40c3a08e093ff401cbcb33e8e21

Verdict: Ready to merge

No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.

Overall assessment

The supplied change is internally consistent on the points that could be checked against the checkout: the new .sops.yaml rule at line 94 is not shadowed by the earlier secrets/hermes(-fleet-ssh)?\.yaml$ rule (that regex cannot match hermes-dashboard.yaml), and the six recipients recorded in secrets/hermes-dashboard.yaml (electra, lena, vega, both YubiKeys, provision key) match the rule's key group exactly, so Electra and Lena can decrypt the client password they are given at /run/secrets/hermes-dashboard-client-password. The desktop.nix split into ai.nix/btop.nix preserves every previous attribute (the btop block is byte-identical, and bruno/mimeApps/xdg.configFile remain in desktop.nix; paseo-daemon moved verbatim into ai.nix), home/users/nimmo/default.nix imports all three, and no duplicate programs.btop or paseo-daemon definition exists elsewhere. nixosConfig.hermes.dashboardUrl is reachable on Electra and Lena (hosts → profiles/laptop.nix → profiles/gui.nix → common/base.nix → default-config.nix), so ai.nix's osConfig.nixosConfig.hermes.dashboardUrl does not reference an undefined option; inputs is supplied to home modules via home-manager.extraSpecialArgs. The firewall addition follows the established networking.firewall.interfaces."nebula.mesh".allowedTCPPorts pattern (trilium-web, token-tv, kiwifs, paseo-daemon, navidrome-mcp) and list options concatenate with Vega's own [4533 5432] assignment. hermes-preauth.py is tracked and referenced as ${./hermes-preauth.py} from the same directory; the heredoc EOF markers sit at the string's minimum indentation and terminate correctly. The auto-update-policy extension to electra/lena matches the actual consumers (ai.nix desktop package under !isServer, with electra/lena role = "laptop" so isServer defaults false via default-config.nix:70). No evaluation defect is demonstrable from the supplied material; the findings below are scoping and coupling gaps introduced by the change.

Blocking findings

None.

Important findings

None.

Suggestions

  • Pre-auth script hardcodes the basic-auth username while the server derives it from primaryUser (home/users/nimmo/hermes-preauth.py:18; medium confidence)
    hermes-preauth.py:18 reads username = os.environ.get("HERMES_USER", "nimmo"), and home/users/nimmo/ai.nix:64 exports only HERMES_URL when invoking the script, so HERMES_USER is never set. The server side takes its basic-auth username from cfg.dashboard.auth.username, whose default in modules/services/hermes.nix is user = config.nixosConfig.primaryUser, and modules/common/default-config.nix:8-11 documents primaryUser as an overridable portability default (AGENTS.md and README.md:168 show nixosConfig.primaryUser = "newuser" as the supported override). The same file also hardcodes the URL default http://10.10.0.2:9119 at line 17, duplicating default-config.nix:431.
    Impact: The client identity is duplicated in a new file outside the portability mechanism the repository centralises. If primaryUser is ever overridden, HERMES_DASHBOARD_BASIC_AUTH_USERNAME changes but the pre-auth still posts username=nimmo, and the token exchange fails silently behind the script's except Exception: pass, leaving the desktop client on a manual login prompt with no error surfaced.
    Suggested fix: Pass the matching identity from the wrapper, e.g. HERMES_URL="${hermesDashboardUrl}" HERMES_USER="${osConfig.nixosConfig.primaryUser}" HERMES_PASSWORD_FILE=/run/secrets/hermes-dashboard-client-password, and drop the hardcoded "nimmo" default (and the duplicated URL default) in the script so both values come from configuration.

  • Client credential and client package are gated on different predicates (modules/profiles/ai-desktop.nix:33; medium confidence)
    ai-desktop.nix:32 provisions hermes-dashboard-client-password under lib.mkIf (!config.profiles.aiDesktop.headless), while the consumer is gated on a different predicate: home/users/nimmo/ai.nix:69 installs hermesDesktop under lib.mkIf (!osConfig.nixosConfig.host.isServer). Today they agree for the four registered hosts (vega/lyra set profiles.aiDesktop.headless = true and have role = "server", so isServer defaults true via default-config.nix:70; electra/lena set neither headless nor a server role), but nothing in the tree enforces the agreement.
    Impact: A host that is non-server but headless (or a headless host left non-server) would install the Hermes desktop client with no /run/secrets/hermes-dashboard-client-password, so hermes-preauth.py exits at its if not os.path.exists(pw_file) guard and the client silently requires manual login; the reverse case provisions an unused secret. The failure is invisible at evaluation time.
    Suggested fix: Use one predicate for the pair: gate the secret on the same !osConfig.nixosConfig.host.isServer condition, or expose a single nixosConfig.hermes.desktopClient boolean consumed by both ai-desktop.nix and ai.nix, so the credential and the client cannot drift apart.

  • dashboardUrl duplicates the backend address and port instead of tying them to the configured backend (modules/common/default-config.nix:431; medium confidence)
    hermes.dashboardUrl defaults to the literal "http://10.10.0.2:9119". The backend it must match is configured elsewhere: modules/services/hermes.nix sets dashboard.listenAddress default to config.nixosConfig.nebula.overlayIp, which modules/networking/nebula.nix:127-133 derives from the hostMap (nebula.nix:10 vegaIp = "10.10.0.2", commented as the 'single source of truth for bare hostname -> overlay IP'), and dashboard.port defaults to 9119. The literal is repeated a third time as the script default in hermes-preauth.py:17. No supplied check ties them: scripts/check-service-exposure.nix evaluates only lyra (check-service-exposure.nix:5) and scripts/check-token-tv-config.nix covers only token-tv.
    Impact: Editing vegaIp in nebula.nix or overriding hermes.dashboard.port would leave every desktop client pointing at a stale URL with no evaluation error and no failing check; the failure would surface only at runtime as an unreachable dashboard. Note the repository already hardcodes mesh client URLs (nixosConfig.trilium.clientUrl = "http://10.10.0.2:37840" in all three client host configs), so this is a pre-existing pattern rather than a new inconsistency - but those are per-host overrides, whereas this is a global default.
    Suggested fix: Either define the default as "http://${config.nixosConfig.nebula.overlayIp}:${toString config.nixosConfig.hermes.dashboard.port}" with a defaultText, or add a deterministic flake check on Vega asserting nixosConfig.hermes.dashboardUrl equals the composed backend host/port, following the pattern in scripts/check-token-tv-config.nix:33-35.

  • Shared secret file exposes the Vega-only session signing secret to desktop host keys (.sops.yaml:94; medium confidence)
    The new rule grants *electra, *lena and *vega the whole of secrets/hermes-dashboard.yaml, which holds both hermes/dashboard/password and hermes/dashboard/secret. Only the password is requested on desktop hosts (modules/profiles/ai-desktop.nix:35 key = "hermes/dashboard/password"); hermes/dashboard/secret is consumed only through sops.secrets.hermes-dashboard-secret in modules/services/hermes.nix, which is reached only where nixosConfig.hermes.enable is set - hosts/vega/default.nix:274 is the sole such assignment in hosts/. The repository already separates server-only from client-shared material in sibling files (secrets/navidrome-mcp.yaml vs secrets/navidrome-mcp-clients.yaml, karakeep-server.yaml vs karakeep.yaml, kiwifs-mcp.yaml), and secrets/README.md:233 documents those distinctions.
    Impact: Electra's and Lena's host keys can decrypt the backend's session signing secret, not just the credential they use. secrets/README.md:233 states the wider sharing is intended ('local users can inspect credentials'), so this is a deliberate scope choice rather than an error, but it is broader than the stated functional need and diverges from the per-consumer scoping used for the analogous server/client pairs.
    Suggested fix: Either accept the wider scope explicitly (no change), or move the client credential into a separate file (e.g. secrets/hermes-dashboard-clients.yaml) encrypted for electra/lena plus admin keys, keep hermes/dashboard/secret in a Vega-only file, and update secrets/README.md and the two sopsFile references accordingly.

  • Supplied material shows no build or activation evidence for Lena (lib/auto-update-policy.nix:215; medium confidence)
    The change adds a system-level sops.secrets entry (modules/profiles/ai-desktop.nix:33) and a desktop package (home/users/nimmo/ai.nix:69) that apply to Lena, and lib/auto-update-policy.nix:215-221 now declares Lena a consumer of hermes-agent. Nothing in the supplied material reports a build, activation, or check result for Lena; the flake checks that exist do not cover it (check-service-exposure.nix evaluates lyra, check-service-failure-monitor.nix evaluates every registered host but only asserts unit ownership for monitored names). AGENTS.md states 'Prefer just test or just test-remote as the canary when adding or fundamentally changing something' and 'When testing remotely, create an auto-update hold first'.
    Impact: No supplied evidence shows the new secret being installed and readable by the primary user on a desktop host, or that the desktop client starts on Lena; a build alone would not exercise activation or the /run/secrets file mode.
    Suggested fix: Create an auto-update hold and run just test (or just test-remote lena) on Lena, then confirm /run/secrets/hermes-dashboard-client-password exists with the declared owner and mode 0400.

Tests and validation

  • No configured deterministic checks.

Questions

  • The hermes-agent flake (github:NousResearch/hermes-agent) is an external input and is not present in the checked-out tree, so I could not confirm that inputs.hermes-agent.packages.<system>.desktop is overridable with an extraRun list, that services.hermes-agent.backend accepts mode/host/port, or that the upstream module defines a systemd unit literally named hermes-backend. Both modules/services/hermes.nix (systemd.services.hermes-backend, services.serviceFailureMonitor.services) and scripts/check-service-failure-monitor.nix depend on that name: the check asserts unit.description != "" || unit.serviceConfig != {} || unit.script != "", and the addition in hermes.nix sets only after/wants/bindsTo, so the check passes only if the upstream module supplies the rest.
  • home/users/nimmo/ai.nix seeds both connection.json (singular) and connections.json in ~/.config/Hermes. Is connection.json a distinct upstream file, or is one of the two a stale name that the client never reads?
  • Does the Hermes desktop client key native-oauth-tokens.json on the exact URL string written into connections.json? If so, a change to nixosConfig.hermes.dashboardUrl would leave a token under a stale key rather than invalidating it.
  • Does hermes-preauth.py's base64.urlsafe_b64decode(at.encode()) / blob[:-32] header parse match the current hermes_session_at cookie encoding? A mismatch is swallowed by the surrounding except Exception: pass, so it would not be visible as a failure.
  • The pre-auth POSTs the basic-auth password in plaintext to http://10.10.0.2:9119 over the mesh leg. Is that acceptable, or is a TLS/Pangolin endpoint intended (as used for the Paseo relay)?

Review limitations

  • No Nix evaluation was run (no Nix toolchain in this review container) and no repository code was executed; nix flake check and per-host build results were not reproduced here.
  • The hermes-agent flake (its desktop package, nixosModules, backend option schema, and /auth/password-login contract) is an external input absent from the tree, so every upstream option name and runtime behaviour attributed to it is unverified.
  • Runtime state on Electra, Lena and Vega (mesh reachability, service health, delivered secret ownership/mode, desktop launch behaviour) is not observable from the supplied material.
  • The SOPS recipient lists were compared by public key against the .sops.yaml aliases; nothing was decrypted, so the encrypted values themselves are unverified.
  • Only the listed changed files and their direct callers/definitions were inspected; unchanged code outside those paths was not reviewed for defects.

Diff coverage

  • .sops.yaml: reviewed — included in a context-limited batch
  • README.md: reviewed — included in a context-limited batch
  • home/users/nimmo/ai.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/btop.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/default.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/desktop.nix: reviewed — included in a context-limited batch
  • home/users/nimmo/hermes-preauth.py: reviewed — included in a context-limited batch
  • hosts/vega/default.nix: reviewed — included in a context-limited batch
  • lib/auto-update-policy.nix: reviewed — included in a context-limited batch
  • modules/common/default-config.nix: reviewed — included in a context-limited batch
  • modules/profiles/ai-desktop.nix: reviewed — included in a context-limited batch
  • modules/services/hermes.nix: reviewed — included in a context-limited batch
  • secrets/README.md: reviewed — included in a context-limited batch
  • secrets/hermes-dashboard.yaml: reviewed — included in a context-limited batch
Review metadata
  • Reviewer: forgejo-ai-review v1
  • Model: strata/strata
  • Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/hermes-fleet-ssh.md, docs/nova-remote-builder.md, README.md
  • Commits considered: 7
  • Previous automated review: none found
  • Findings: 5
<!-- forgejo-ai-review:v1 --> ## Automated code review Reviewed commit: `8be99bccd1ccc40c3a08e093ff401cbcb33e8e21` ## Verdict: Ready to merge No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory. ### Overall assessment The supplied change is internally consistent on the points that could be checked against the checkout: the new `.sops.yaml` rule at line 94 is not shadowed by the earlier `secrets/hermes(-fleet-ssh)?\.yaml$` rule (that regex cannot match `hermes-dashboard.yaml`), and the six recipients recorded in `secrets/hermes-dashboard.yaml` (electra, lena, vega, both YubiKeys, provision key) match the rule's key group exactly, so Electra and Lena can decrypt the client password they are given at `/run/secrets/hermes-dashboard-client-password`. The `desktop.nix` split into `ai.nix`/`btop.nix` preserves every previous attribute (the btop block is byte-identical, and bruno/mimeApps/xdg.configFile remain in `desktop.nix`; `paseo-daemon` moved verbatim into `ai.nix`), `home/users/nimmo/default.nix` imports all three, and no duplicate `programs.btop` or `paseo-daemon` definition exists elsewhere. `nixosConfig.hermes.dashboardUrl` is reachable on Electra and Lena (hosts → profiles/laptop.nix → profiles/gui.nix → common/base.nix → default-config.nix), so `ai.nix`'s `osConfig.nixosConfig.hermes.dashboardUrl` does not reference an undefined option; `inputs` is supplied to home modules via `home-manager.extraSpecialArgs`. The firewall addition follows the established `networking.firewall.interfaces."nebula.mesh".allowedTCPPorts` pattern (trilium-web, token-tv, kiwifs, paseo-daemon, navidrome-mcp) and list options concatenate with Vega's own `[4533 5432]` assignment. `hermes-preauth.py` is tracked and referenced as `${./hermes-preauth.py}` from the same directory; the heredoc `EOF` markers sit at the string's minimum indentation and terminate correctly. The `auto-update-policy` extension to electra/lena matches the actual consumers (`ai.nix` desktop package under `!isServer`, with electra/lena `role = "laptop"` so `isServer` defaults false via `default-config.nix:70`). No evaluation defect is demonstrable from the supplied material; the findings below are scoping and coupling gaps introduced by the change. ### Blocking findings None. ### Important findings None. ### Suggestions - **Pre-auth script hardcodes the basic-auth username while the server derives it from primaryUser** (home/users/nimmo/hermes-preauth.py:18; medium confidence) `hermes-preauth.py:18` reads `username = os.environ.get("HERMES_USER", "nimmo")`, and `home/users/nimmo/ai.nix:64` exports only `HERMES_URL` when invoking the script, so `HERMES_USER` is never set. The server side takes its basic-auth username from `cfg.dashboard.auth.username`, whose default in `modules/services/hermes.nix` is `user = config.nixosConfig.primaryUser`, and `modules/common/default-config.nix:8-11` documents `primaryUser` as an overridable portability default (`AGENTS.md` and `README.md:168` show `nixosConfig.primaryUser = "newuser"` as the supported override). The same file also hardcodes the URL default `http://10.10.0.2:9119` at line 17, duplicating `default-config.nix:431`. Impact: The client identity is duplicated in a new file outside the portability mechanism the repository centralises. If `primaryUser` is ever overridden, `HERMES_DASHBOARD_BASIC_AUTH_USERNAME` changes but the pre-auth still posts `username=nimmo`, and the token exchange fails silently behind the script's `except Exception: pass`, leaving the desktop client on a manual login prompt with no error surfaced. Suggested fix: Pass the matching identity from the wrapper, e.g. `HERMES_URL="${hermesDashboardUrl}" HERMES_USER="${osConfig.nixosConfig.primaryUser}" HERMES_PASSWORD_FILE=/run/secrets/hermes-dashboard-client-password`, and drop the hardcoded `"nimmo"` default (and the duplicated URL default) in the script so both values come from configuration. - **Client credential and client package are gated on different predicates** (modules/profiles/ai-desktop.nix:33; medium confidence) `ai-desktop.nix:32` provisions `hermes-dashboard-client-password` under `lib.mkIf (!config.profiles.aiDesktop.headless)`, while the consumer is gated on a different predicate: `home/users/nimmo/ai.nix:69` installs `hermesDesktop` under `lib.mkIf (!osConfig.nixosConfig.host.isServer)`. Today they agree for the four registered hosts (vega/lyra set `profiles.aiDesktop.headless = true` and have `role = "server"`, so `isServer` defaults true via `default-config.nix:70`; electra/lena set neither headless nor a server role), but nothing in the tree enforces the agreement. Impact: A host that is non-server but headless (or a headless host left non-server) would install the Hermes desktop client with no `/run/secrets/hermes-dashboard-client-password`, so `hermes-preauth.py` exits at its `if not os.path.exists(pw_file)` guard and the client silently requires manual login; the reverse case provisions an unused secret. The failure is invisible at evaluation time. Suggested fix: Use one predicate for the pair: gate the secret on the same `!osConfig.nixosConfig.host.isServer` condition, or expose a single `nixosConfig.hermes.desktopClient` boolean consumed by both `ai-desktop.nix` and `ai.nix`, so the credential and the client cannot drift apart. - **dashboardUrl duplicates the backend address and port instead of tying them to the configured backend** (modules/common/default-config.nix:431; medium confidence) `hermes.dashboardUrl` defaults to the literal `"http://10.10.0.2:9119"`. The backend it must match is configured elsewhere: `modules/services/hermes.nix` sets `dashboard.listenAddress` default to `config.nixosConfig.nebula.overlayIp`, which `modules/networking/nebula.nix:127-133` derives from the `hostMap` (`nebula.nix:10` `vegaIp = "10.10.0.2"`, commented as the 'single source of truth for bare hostname -> overlay IP'), and `dashboard.port` defaults to `9119`. The literal is repeated a third time as the script default in `hermes-preauth.py:17`. No supplied check ties them: `scripts/check-service-exposure.nix` evaluates only `lyra` (`check-service-exposure.nix:5`) and `scripts/check-token-tv-config.nix` covers only token-tv. Impact: Editing `vegaIp` in `nebula.nix` or overriding `hermes.dashboard.port` would leave every desktop client pointing at a stale URL with no evaluation error and no failing check; the failure would surface only at runtime as an unreachable dashboard. Note the repository already hardcodes mesh client URLs (`nixosConfig.trilium.clientUrl = "http://10.10.0.2:37840"` in all three client host configs), so this is a pre-existing pattern rather than a new inconsistency - but those are per-host overrides, whereas this is a global default. Suggested fix: Either define the default as `"http://${config.nixosConfig.nebula.overlayIp}:${toString config.nixosConfig.hermes.dashboard.port}"` with a `defaultText`, or add a deterministic flake check on Vega asserting `nixosConfig.hermes.dashboardUrl` equals the composed backend host/port, following the pattern in `scripts/check-token-tv-config.nix:33-35`. - **Shared secret file exposes the Vega-only session signing secret to desktop host keys** (.sops.yaml:94; medium confidence) The new rule grants `*electra`, `*lena` and `*vega` the whole of `secrets/hermes-dashboard.yaml`, which holds both `hermes/dashboard/password` and `hermes/dashboard/secret`. Only the password is requested on desktop hosts (`modules/profiles/ai-desktop.nix:35` `key = "hermes/dashboard/password"`); `hermes/dashboard/secret` is consumed only through `sops.secrets.hermes-dashboard-secret` in `modules/services/hermes.nix`, which is reached only where `nixosConfig.hermes.enable` is set - `hosts/vega/default.nix:274` is the sole such assignment in `hosts/`. The repository already separates server-only from client-shared material in sibling files (`secrets/navidrome-mcp.yaml` vs `secrets/navidrome-mcp-clients.yaml`, `karakeep-server.yaml` vs `karakeep.yaml`, `kiwifs-mcp.yaml`), and `secrets/README.md:233` documents those distinctions. Impact: Electra's and Lena's host keys can decrypt the backend's session signing secret, not just the credential they use. `secrets/README.md:233` states the wider sharing is intended ('local users can inspect credentials'), so this is a deliberate scope choice rather than an error, but it is broader than the stated functional need and diverges from the per-consumer scoping used for the analogous server/client pairs. Suggested fix: Either accept the wider scope explicitly (no change), or move the client credential into a separate file (e.g. `secrets/hermes-dashboard-clients.yaml`) encrypted for electra/lena plus admin keys, keep `hermes/dashboard/secret` in a Vega-only file, and update `secrets/README.md` and the two `sopsFile` references accordingly. - **Supplied material shows no build or activation evidence for Lena** (lib/auto-update-policy.nix:215; medium confidence) The change adds a system-level `sops.secrets` entry (`modules/profiles/ai-desktop.nix:33`) and a desktop package (`home/users/nimmo/ai.nix:69`) that apply to Lena, and `lib/auto-update-policy.nix:215-221` now declares Lena a consumer of `hermes-agent`. Nothing in the supplied material reports a build, activation, or check result for Lena; the flake checks that exist do not cover it (`check-service-exposure.nix` evaluates `lyra`, `check-service-failure-monitor.nix` evaluates every registered host but only asserts unit ownership for monitored names). `AGENTS.md` states 'Prefer `just test` or `just test-remote` as the canary when adding or fundamentally changing something' and 'When testing remotely, create an auto-update hold first'. Impact: No supplied evidence shows the new secret being installed and readable by the primary user on a desktop host, or that the desktop client starts on Lena; a build alone would not exercise activation or the `/run/secrets` file mode. Suggested fix: Create an auto-update hold and run `just test` (or `just test-remote lena`) on Lena, then confirm `/run/secrets/hermes-dashboard-client-password` exists with the declared owner and mode 0400. ### Tests and validation - No configured deterministic checks. ### Questions - The `hermes-agent` flake (`github:NousResearch/hermes-agent`) is an external input and is not present in the checked-out tree, so I could not confirm that `inputs.hermes-agent.packages.<system>.desktop` is overridable with an `extraRun` list, that `services.hermes-agent.backend` accepts `mode`/`host`/`port`, or that the upstream module defines a systemd unit literally named `hermes-backend`. Both `modules/services/hermes.nix` (`systemd.services.hermes-backend`, `services.serviceFailureMonitor.services`) and `scripts/check-service-failure-monitor.nix` depend on that name: the check asserts `unit.description != "" || unit.serviceConfig != {} || unit.script != ""`, and the addition in `hermes.nix` sets only `after`/`wants`/`bindsTo`, so the check passes only if the upstream module supplies the rest. - `home/users/nimmo/ai.nix` seeds both `connection.json` (singular) and `connections.json` in `~/.config/Hermes`. Is `connection.json` a distinct upstream file, or is one of the two a stale name that the client never reads? - Does the Hermes desktop client key `native-oauth-tokens.json` on the exact URL string written into `connections.json`? If so, a change to `nixosConfig.hermes.dashboardUrl` would leave a token under a stale key rather than invalidating it. - Does `hermes-preauth.py`'s `base64.urlsafe_b64decode(at.encode())` / `blob[:-32]` header parse match the current `hermes_session_at` cookie encoding? A mismatch is swallowed by the surrounding `except Exception: pass`, so it would not be visible as a failure. - The pre-auth POSTs the basic-auth password in plaintext to `http://10.10.0.2:9119` over the mesh leg. Is that acceptable, or is a TLS/Pangolin endpoint intended (as used for the Paseo relay)? ### Review limitations - No Nix evaluation was run (no Nix toolchain in this review container) and no repository code was executed; `nix flake check` and per-host build results were not reproduced here. - The `hermes-agent` flake (its `desktop` package, `nixosModules`, `backend` option schema, and `/auth/password-login` contract) is an external input absent from the tree, so every upstream option name and runtime behaviour attributed to it is unverified. - Runtime state on Electra, Lena and Vega (mesh reachability, service health, delivered secret ownership/mode, desktop launch behaviour) is not observable from the supplied material. - The SOPS recipient lists were compared by public key against the `.sops.yaml` aliases; nothing was decrypted, so the encrypted values themselves are unverified. - Only the listed changed files and their direct callers/definitions were inspected; unchanged code outside those paths was not reviewed for defects. ### Diff coverage - `.sops.yaml`: **reviewed** — included in a context-limited batch - `README.md`: **reviewed** — included in a context-limited batch - `home/users/nimmo/ai.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/btop.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/default.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/desktop.nix`: **reviewed** — included in a context-limited batch - `home/users/nimmo/hermes-preauth.py`: **reviewed** — included in a context-limited batch - `hosts/vega/default.nix`: **reviewed** — included in a context-limited batch - `lib/auto-update-policy.nix`: **reviewed** — included in a context-limited batch - `modules/common/default-config.nix`: **reviewed** — included in a context-limited batch - `modules/profiles/ai-desktop.nix`: **reviewed** — included in a context-limited batch - `modules/services/hermes.nix`: **reviewed** — included in a context-limited batch - `secrets/README.md`: **reviewed** — included in a context-limited batch - `secrets/hermes-dashboard.yaml`: **reviewed** — included in a context-limited batch <details><summary>Review metadata</summary> - Reviewer: forgejo-ai-review v1 - Model: strata/strata - Guidance loaded: .forgejo/ai-review.md, .forgejo/ai-review.yml, AGENTS.md, docs/auto-update-remediation.md, docs/hermes-fleet-ssh.md, docs/nova-remote-builder.md, README.md - Commits considered: 7 - Previous automated review: none found - Findings: 5 </details>
nimmo force-pushed feat/hermes-desktop-fleet from 8be99bccd1
All checks were successful
Build and Push Attic Cache / test (pull_request) Successful in 1m30s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
AI pull-request review / review (pull_request) Successful in 13m9s
to 9bc6c167db
Some checks failed
AI pull-request review / review (pull_request) Failing after 15m6s
Build and Push Attic Cache / test (pull_request) Successful in 1m35s
Build and Push Attic Cache / build (pull_request) Has been skipped
Build and Push Attic Cache / pin-lifecycle (pull_request) Has been skipped
Build and Push Attic Cache / remediate (pull_request) Has been skipped
Build and Push Attic Cache / notify-remediation (pull_request) Has been skipped
Build and Push Attic Cache / record-remediation-notify-failure (pull_request) Has been skipped
2026-10-19 12:25:38 +01:00
Compare
nimmo merged commit 2e61fc60e3 into main 2026-10-19 12:25:43 +01:00
Sign in to join this conversation.
No reviewers
No assignees
2 participants
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
nimmo/nixos-config!371
No description provided.