Skip to content

fix(home): Phase 4 home-resolution inventory audit fixes (#5763) - #8222

Merged
dezren39 merged 2 commits into
mainfrom
queue/12780-5763-home-inventory-audit
Nov 10, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/12780-5763-home-inventory-audit

Conversation

@dezren39

@dezren39 dezren39 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

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 pure roc_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_os Some("")), 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-run exits 2 with the named error.
  • bin/provider-catalog-sync.mjs — same fallback → new exported defaultRuntimeConfigPath(env) throws the named error; probe-matrix test added.
  • pkgs/mcpx (Go) — discarded os.UserHomeDir() errors at the path-inventing sites. New single helper internal/homeutil (Home() named error; MustHome() for the no-error-channel resolvers, mirroring the atlas panic precedent) with probe-matrix tests. Fixed: CLI init --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 guards home != ""; write.go already propagates a named error).

Filed separately (genuinely different shape: platform passwd resolution, other deploy units)

Tests

  • Go (laptop): go test ./internal/homeutil/ ./internal/daemon/ ./internal/mcpclient/ ./internal/cli/ ./internal/scriptresolve/ ./internal/recipes/ — all pass. internal/config has one pre-existing failure (TestServerKeysAnotherHostWritesAreRecordedNotRefused) that fails identically on the unmodified primary clone; untouched by this PR.
  • JS (laptop): node --test bin/provider-catalog-sync.test.mjs — 39/39 pass.
  • Rust: the pkgs/id test build exceeded the laptop's 900s window under multi-lane contention (wasmtime); the new unit test is world_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).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

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.
@dezren39
dezren39 requested a review from a team as a code owner November 10, 2026 20:09
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T20:09:14.367542Z
We couldn’t complete this review. Comment @codex review to try again.
5289c89 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3deb5cda-f80e-4180-beae-7ed194edbbcb
Commits

Reviewing files that changed from the base of the PR and between 3399062 and 55c34df.

Files selected for processing: 10

  • bin/provider-catalog-sync.mjs
  • bin/provider-catalog-sync.test.mjs
  • bin/sync-models.mjs
  • pkgs/id/src/commands/world.rs
  • pkgs/id/src/world_compile.rs
  • pkgs/mcpx/internal/cli/commands.go
  • pkgs/mcpx/internal/daemon/paths.go
  • pkgs/mcpx/internal/homeutil/home.go
  • pkgs/mcpx/internal/homeutil/home_test.go
  • pkgs/mcpx/internal/mcpclient/supervised.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit 578e178 into main Nov 10, 2026
4 of 10 checks passed
@dezren39
dezren39 deleted the queue/12780-5763-home-inventory-audit branch November 10, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant