Found in the 2026-09-28 code audit (finding N-8).
Where: internal/config/paths.go:49-62 (UserConfigDir has no override seam); internal/tui/model.go:891-892 (newModel reads the real config.UserConfigDir()/zero/commands/*.md); internal/cli/app.go:754, internal/cli/observability.go:43 (call config.DefaultResolveOptions directly, bypassing the deps.userConfigPath seam at app.go:141).
Problem: 551 newModel( calls in TUI tests, only one TUI test file sets APPDATA/XDG_CONFIG_HOME/HOME. Repo-wide only 5 test files set APPDATA/LOCALAPPDATA, while 22 non-test files call os.User{Config,Home,Cache}Dir directly (e.g. skills/skills.go x3, sandbox/profile.go x3, sessions/store.go, cron/store.go, hooks/hooks.go). This violates the "Hermetic tests" rule in AGENTS.md: developer config leaks into tests and tests can write to real state directories.
Suggested fix: add a ZERO_CONFIG_DIR (or package-level) override in config, route the 22 callers through it, and add a per-package TestMain pointing HOME, USERPROFILE, APPDATA, LOCALAPPDATA, XDG_CONFIG_HOME, XDG_CACHE_HOME at a temp dir.
Found in the 2026-09-28 code audit (finding N-8).
Where:
internal/config/paths.go:49-62(UserConfigDirhas no override seam);internal/tui/model.go:891-892(newModelreads the realconfig.UserConfigDir()/zero/commands/*.md);internal/cli/app.go:754,internal/cli/observability.go:43(callconfig.DefaultResolveOptionsdirectly, bypassing thedeps.userConfigPathseam atapp.go:141).Problem: 551
newModel(calls in TUI tests, only one TUI test file setsAPPDATA/XDG_CONFIG_HOME/HOME. Repo-wide only 5 test files setAPPDATA/LOCALAPPDATA, while 22 non-test files callos.User{Config,Home,Cache}Dirdirectly (e.g.skills/skills.gox3,sandbox/profile.gox3,sessions/store.go,cron/store.go,hooks/hooks.go). This violates the "Hermetic tests" rule in AGENTS.md: developer config leaks into tests and tests can write to real state directories.Suggested fix: add a
ZERO_CONFIG_DIR(or package-level) override inconfig, route the 22 callers through it, and add a per-packageTestMainpointingHOME,USERPROFILE,APPDATA,LOCALAPPDATA,XDG_CONFIG_HOME,XDG_CACHE_HOMEat a temp dir.