Repository navigation
fix(home): Phase 4 home-resolution inventory audit fixes (#5763) - #8222
Conversation
Same-shape sites fixed in-phase per the #5762 contract (non-empty HOME only; unset/empty is a named error, never a substitute directory): pkgs/id world_compile locate_roc probe (was root-anchored empty + hardcoded /home/user candidates) and world.rs known_hosts (empty HOME slipped through as CWD-relative); bin/sync-models and bin/provider-catalog-sync hardcoded /home/user fallbacks; mcpx discarded os.UserHomeDir errors (new internal/homeutil helper with probe-matrix tests; daemon/mcpclient path resolvers and CLI init/skills surfaces). Probe-matrix tests added for the Rust candidate fn, the JS defaultRuntimeConfigPath, and Go homeutil. Full inventory + dispositions on issue #5763.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 16 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Phase 4 closing inventory audit for the home-resolution contract (#5762). Queue task 12780; the full grep inventory with a disposition for every production site is posted on #5763. Gate re-verified at start: #5737 and #5640 both CLOSED.
Fixed in this PR (same-shape: unset/empty HOME silently producing a substitute directory)
pkgs/id/src/world_compile.rs—locate_roc()probed a root-anchored path (env::var("HOME").unwrap_or_default()) and a hardcoded/home/user. Now probes only a non-empty HOME (new pureroc_home_candidates, probe-matrix unit test); otherwise the PATH lookup decides.pkgs/id/src/commands/world.rs— the contract's own embodiment let an empty HOME through (var_osSome("")), joining a CWD-relative.ssh/known_hosts. Now filtered, with the named error.bin/sync-models.mjs—process.env.HOME || '/home/user'→ fails loudly (exit 2, naming HOME). Probe:env -u HOME node bin/sync-models.mjs --dry-runexits 2 with the named error.bin/provider-catalog-sync.mjs— same fallback → new exporteddefaultRuntimeConfigPath(env)throws the named error; probe-matrix test added.pkgs/mcpx(Go) — discardedos.UserHomeDir()errors at the path-inventing sites. New single helperinternal/homeutil(Home()named error;MustHome()for the no-error-channel resolvers, mirroring the atlas panic precedent) with probe-matrix tests. Fixed: CLIinit --global, CLI skills-install global dests,daemon.ResolvePaths/DefaultStateDir,mcpclient.StateDir. Guarded/skip sites dispositioned conforms on Home-resolution inventory audit — disposition every remaining site against the contract #5763 (recipes.Dirs skips empty home; config discovery guardshome != ""; write.go already propagates a named error).Filed separately (genuinely different shape: platform passwd resolution, other deploy units)
os.homedir()JS/TS surface (bin/, mcpx plugin, pm-stack).expanduser/Path.home()surface (infra/, pm-stack/, pkgs/, scripts/).Tests
go test ./internal/homeutil/ ./internal/daemon/ ./internal/mcpclient/ ./internal/cli/ ./internal/scriptresolve/ ./internal/recipes/— all pass.internal/confighas one pre-existing failure (TestServerKeysAnotherHostWritesAreRecordedNotRefused) that fails identically on the unmodified primary clone; untouched by this PR.node --test bin/provider-catalog-sync.test.mjs— 39/39 pass.pkgs/idtest build exceeded the laptop's 900s window under multi-lane contention (wasmtime); the new unit test isworld_compile::tests::roc_home_candidates_follow_the_home_contract— CI is the verification route for it.Refs #5763 (audit issue stays open until this lands; closing inventory is posted there and on #5762).
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.