fix(cli): four binaries resolve the default config dir differently from archied #1165

Closed
opened 2026-10-27 13:39:17 +00:00 by sam · 0 comments
Owner

cmd/archie-state-store/main.go:26 (the serve default), cmd/archie-gateway/main.go:19, cmd/archie-messaging/main.go:20 and cmd/archie-ui/main.go:26 derive their default config path with os.UserConfigDir(), while archied uses configHome() (internal/app/archied/main.go:908-921, now exported as archied.DefaultConfigPath()).

They agree on Linux with an absolute XDG_CONFIG_HOME. They diverge on darwin (os.UserConfigDir returns ~/Library/Application Support, configHome returns ~/.config) and on a relative XDG_CONFIG_HOME (os.UserConfigDir errors, so the derived path is "" while archied resolves relative-dir/archie/config.toml). Result: one deployment resolves a different config file depending on which binary starts, and the same process may boot from a file the others do not read.

Found by the recovery lane's out-of-band contract review (2026-09-21). That lane fixed only the recovery and archied paths it owned and deliberately left this alone, because it is a cross-binary fleet-wide change and not a recovery-lane decision - the same reason it is filed rather than folded in.

Fix direction: derive all five from one shared helper (archied's configHome/DefaultConfigPath) and pin the equality, including the relative-XDG_CONFIG_HOME and darwin cases. Note it is adjacent to, but distinct from, archie-core-i3qm: i3qm is about which settings are validated at boot, this is about which file each binary reads at all.

Close reason

Already delivered and guarded: configuration.DefaultConfigPath() is the single source, all five binaries consume it, zero production os.UserConfigDir call sites, pinned by TestDefaultConfigPathFollowsTheConfigHome + TestBinariesTakeTheDefaultConfigPathFromHere (green, 0.012s). Verified against issue #1147.


Imported from beads archie-core-8i6l · GitHub #1147 · type bug · priority P2 · created 2026-09-21 · closed 2026-09-30

cmd/archie-state-store/main.go:26 (the serve default), cmd/archie-gateway/main.go:19, cmd/archie-messaging/main.go:20 and cmd/archie-ui/main.go:26 derive their default config path with os.UserConfigDir(), while archied uses configHome() (internal/app/archied/main.go:908-921, now exported as archied.DefaultConfigPath()). They agree on Linux with an absolute XDG_CONFIG_HOME. They diverge on darwin (os.UserConfigDir returns ~/Library/Application Support, configHome returns ~/.config) and on a relative XDG_CONFIG_HOME (os.UserConfigDir errors, so the derived path is "" while archied resolves relative-dir/archie/config.toml). Result: one deployment resolves a different config file depending on which binary starts, and the same process may boot from a file the others do not read. Found by the recovery lane's out-of-band contract review (2026-09-21). That lane fixed only the recovery and archied paths it owned and deliberately left this alone, because it is a cross-binary fleet-wide change and not a recovery-lane decision - the same reason it is filed rather than folded in. Fix direction: derive all five from one shared helper (archied's configHome/DefaultConfigPath) and pin the equality, including the relative-XDG_CONFIG_HOME and darwin cases. Note it is adjacent to, but distinct from, archie-core-i3qm: i3qm is about which settings are validated at boot, this is about which file each binary reads at all. ### Close reason Already delivered and guarded: configuration.DefaultConfigPath() is the single source, all five binaries consume it, zero production os.UserConfigDir call sites, pinned by TestDefaultConfigPathFollowsTheConfigHome + TestBinariesTakeTheDefaultConfigPathFromHere (green, 0.012s). Verified against issue #1147. --- _Imported from beads `archie-core-8i6l` · GitHub #1147 · type bug · priority P2 · created 2026-09-21 · closed 2026-09-30_
sam added the mediumbug labels 2026-10-27 13:39:17 +00:00
sam self-assigned this 2026-10-27 13:39:17 +00:00
sam closed this issue 2026-10-27 13:39:17 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1165