ang-fleet-workers[bot]
b6ab666b6d
fix(gateway): a service definition is written only by the home it pins
...
Two homes can resolve to one gateway service name: `<root>/profiles/<name>`
and `~/.hermes/profiles/<name>` both take `hermes-gateway-<name>`
(`ai.hermes.gateway-<name>` on launchd). Every gateway boot, start and
restart calls `refresh_systemd_unit_if_needed` / `refresh_launchd_plist_if_needed`,
which rewrote whatever definition sat at that name with no check of the
HERMES_HOME it pins. A scratch/E2E gateway started from a custom root
therefore repointed the real install's unit at the scratch directory; the
real gateway failed on its next restart (200/CHDIR once the scratch dir was
cleaned up). `systemd_install --force` and `launchd_install --force` did
the same. Uninstall already refused a unit pinning another home
(`_systemd_unit_belongs_to_current_home`); the writers did not.
- hermes_cli/gateway_service_owner.py (new sibling): `pinned_home()` reads
the HERMES_HOME a unit or plist pins; `definition_belongs_to_home()`
refuses a write from any other home; `refuse_foreign_home_install()`
gates `gateway install` for a home outside the platform-default tree.
- Writers refuse a definition pinned to another home: the systemd and
launchd refreshes (boot/start/restart) and both installers, `--force`
included. The system-scope check runs on the caller's own home, before
`systemd_unit_is_current` adopts the unit's home into os.environ (else
the check compares the unit with itself); a sudo-stripped caller with no
HERMES_HOME still acts for the unit's pinned home, as before.
- `gateway install` refuses a HERMES_HOME outside the account's Hermes
tree that owns no bare service name and has no service installed yet: a
service registered for a scratch home outlives the run.
- New `gateway install --force-unit-path` overrides both refusals (an
explicit repoint of the definition at this home).
- Refused installs exit 1, so `gateway install` no longer goes on to start
the other home's service; the setup wizard reports the refusal and
continues, as ensure_gateway_service already did.
- Existing tests whose sandbox HERMES_HOME is a tmp dir opt in to the
admission check (5 files, one monkeypatch each).
Tests: tests/hermes_cli/test_gateway_service_owner.py, 18 tests. On
e36a818033 (sources reverted, tests kept): 11 failed, 7 passed (foreign
unit/plist rewritten on refresh and --force, refused install starts the
service, scratch install proceeds, no --force-unit-path). With this change:
18 passed. test_colliding_profile_names_share_a_unit pins the premise on
the real name resolution.
2026-10-08 17:06:02 -07:00
..
2026-10-08 19:54:07 +02:00
2026-10-08 17:22:54 +02:00
2026-10-07 20:37:24 +05:30
2026-10-08 19:54:07 +02:00
2026-10-08 17:06:02 -07:00
2026-10-08 21:29:48 +02:00
2026-10-06 06:22:29 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-07 06:15:58 -07:00
2026-10-02 04:39:28 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 19:54:07 +02:00
2026-10-06 06:22:29 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-06 03:44:49 -07:00
2026-10-08 19:28:23 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 19:28:23 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-07 14:19:47 -05:00
2026-10-08 17:22:54 +02:00
2026-10-08 12:41:27 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-06 14:22:13 -07:00
2026-10-08 21:29:48 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-07 02:29:54 -07:00
2026-10-08 19:54:07 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-02 22:47:50 -04:00
2026-10-08 17:22:54 +02:00
2026-10-05 10:20:42 -05:00
2026-10-08 04:11:24 -07:00
2026-10-08 04:11:24 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-06 12:50:31 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-07 07:11:29 +05:30
2026-10-03 17:41:14 -04:00
2026-10-07 19:29:35 +05:30
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 17:22:54 +02:00
2026-09-30 23:10:24 -05:00
2026-10-08 17:22:54 +02:00
2026-10-03 19:51:54 +05:30
2026-10-05 13:18:19 +05:30
2026-10-06 03:44:49 -07:00
2026-10-06 06:22:28 -07:00
2026-10-03 21:15:17 +05:30
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-07 10:20:18 +05:30
2026-10-04 00:08:20 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-06 15:00:21 -05:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:06:02 -07:00
2026-10-08 17:22:54 +02:00
2026-10-03 21:57:13 -04:00
2026-10-08 17:06:02 -07:00
2026-10-08 17:06:02 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 19:22:03 +02:00
2026-10-08 17:06:02 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-03 20:44:07 +05:30
2026-10-08 19:54:07 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 17:22:54 +02:00
2026-10-01 04:50:26 -05:00
2026-10-06 12:28:00 -04:00
2026-10-08 19:28:23 +02:00
2026-10-07 17:21:31 -04:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 21:29:48 +02:00
2026-10-03 16:31:23 +05:30
2026-10-07 11:19:10 +05:30
2026-10-06 15:15:06 -04:00
2026-10-07 11:19:10 +05:30
2026-10-08 17:22:54 +02:00
2026-10-04 00:08:20 -07:00
2026-10-08 17:22:54 +02:00
2026-10-06 03:44:49 -07:00
2026-10-08 19:54:07 +02:00
2026-10-05 16:00:48 -07:00
2026-10-06 04:36:02 -07:00
2026-10-06 14:23:00 -04:00
2026-10-06 05:44:21 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-03 23:05:48 -07:00
2026-10-08 12:41:27 -07:00
2026-10-08 18:56:50 -04:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-05 16:06:32 -07:00
2026-10-02 04:39:28 -07:00
2026-10-08 17:22:54 +02:00
2026-10-06 14:57:23 -05:00
2026-10-08 17:22:54 +02:00
2026-10-08 18:04:50 +02:00
2026-10-08 17:22:54 +02:00
2026-10-03 22:32:13 -04:00
2026-10-05 23:33:41 -07:00
2026-10-08 21:29:48 +02:00
2026-10-08 21:29:48 +02:00
2026-10-07 17:12:40 -04:00
2026-10-08 19:28:23 +02:00
2026-10-08 00:18:12 +05:30
2026-10-04 00:10:54 +05:30
2026-10-06 23:14:10 +05:30
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-04 00:08:20 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 04:07:30 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 18:58:42 +02:00
2026-10-08 17:22:54 +02:00
2026-10-07 01:01:14 +05:30
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 19:22:03 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 04:12:02 -07:00
2026-10-08 17:22:54 +02:00
2026-10-06 11:10:43 -07:00
2026-10-08 04:12:02 -07:00
2026-10-03 10:15:11 -07:00
2026-10-08 03:40:04 -07:00
2026-10-07 16:57:01 -07:00
2026-10-08 15:15:47 -07:00
2026-10-07 16:01:10 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-05 17:11:30 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-06 11:10:43 -07:00
2026-10-08 17:22:54 +02:00
2026-10-01 16:22:28 +05:30
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-02 01:29:41 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 19:22:03 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-07 11:27:35 +05:30
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-05 16:42:57 -05:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-05 12:37:47 +05:30
2026-10-08 10:18:00 -04:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-07 19:22:43 +05:30
2026-10-08 21:29:48 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-02 02:58:18 +05:30
2026-10-08 21:29:48 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 15:20:58 -07:00
2026-10-08 17:22:54 +02:00
2026-10-01 22:35:29 -07:00
2026-10-08 17:22:54 +02:00
2026-10-01 22:27:03 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-06 12:08:49 -07:00
2026-10-08 21:29:48 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-02 18:06:40 +00:00
2026-10-08 17:22:54 +02:00
2026-10-06 04:36:02 -07:00
2026-10-07 06:15:58 -07:00
2026-10-07 06:15:58 -07:00
2026-10-06 03:44:49 -07:00
2026-10-06 04:36:02 -07:00
2026-10-06 06:21:10 -07:00
2026-10-06 03:44:49 -07:00
2026-10-08 17:22:54 +02:00
2026-10-07 06:15:58 -07:00
2026-10-08 17:22:54 +02:00
2026-10-06 06:27:57 -07:00
2026-10-07 04:39:00 -07:00
2026-10-06 03:44:49 -07:00
2026-10-07 06:15:58 -07:00
2026-10-08 19:28:23 +02:00
2026-10-07 06:15:58 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 21:35:58 +02:00
2026-10-08 17:22:54 +02:00
2026-10-06 06:18:39 -07:00
2026-10-06 03:44:49 -07:00
2026-10-06 06:22:29 -07:00
2026-10-06 03:44:49 -07:00
2026-10-07 23:07:43 -07:00
2026-10-07 04:39:00 -07:00
2026-10-08 17:22:54 +02:00
2026-10-06 03:44:49 -07:00
2026-10-06 14:23:00 -04:00
2026-10-08 17:22:54 +02:00
2026-10-06 04:36:02 -07:00
2026-10-07 07:18:58 -07:00
2026-10-06 12:50:31 -07:00
2026-10-06 11:15:27 -04:00
2026-10-07 17:13:11 -04:00
2026-10-08 17:22:54 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-06 14:23:00 -04:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-04 00:08:20 -07:00
2026-10-08 17:22:54 +02:00
2026-10-03 19:51:54 +05:30
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-06 04:36:02 -07:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 17:22:54 +02:00
2026-10-06 21:52:50 -05:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 17:22:54 +02:00
2026-10-08 17:22:54 +02:00