Skip to content

fix(home-scope): infrastructure-security and mcp-config read $HOME only when opted in - #422

Merged
joepetjr merged 1 commit into
mainfrom
fix/home-scope-infra-mcp
Oct 11, 2026
Merged

joepetjr merged 1 commit into
mainfrom
fix/home-scope-infra-mcp

Conversation

@joepetjr

Copy link
Copy Markdown
Collaborator

What

infrastructure-security and mcp-config now read the operator's $HOME only with --include-home-skills. They go through src/lib/home-scope.js like every other home-reading check (RS-10).

  • infrastructure-security §5/§6: ~/.claude/settings.json and settings.local.json drop out of settingsPaths unless home scope is on. Project .claude/settings.json is always read.
  • mcp-config: with home scope off, the scan uses repoMcpPaths(cwd) (the committed base: 'cwd' configs) instead of mcpConfigPaths(cwd, homedir). checkClaudeSettings gets null for home, so home enableAllProjectMcpServers and home hooks no longer change a project's verdict.

Why

The same tree scored 65 with a bare runner HOME and 81 with a populated one. A project score that depends on who ran the scan contradicts the CLI's own promise that "home findings do not affect project scores unless --include-home-skills is set."

Tests

  • New, red before the fix:
    • test/infrastructure-security.test.js: identical deny-list findings and score for a bare vs a populated home; opting in reads home; project settings are always read.
    • test/home-scope.test.js: home MCP configs are N/A without the flag; home auto-approve leaves the project findings unchanged; opting in reads home.
  • Opted into home scope: five existing tests (Codex TOML, Goose YAML, Cline, two Zed) wrote their fixture only under $HOME, so they now pass includeHomeSkills: true. Their assertions are unchanged.
  • Results:
    • npm test: 2249 passed. The 3 that failed are timing tests (performance ×2, the RS-32 --quiet 10s timeout) at load average 51. Run alone, those two files pass 19/19.
    • npm run verify:docs: OK.
    • npm run test:fixture: 5 passed.

Not in this PR

Sandbox-gate detection is still a substring match on the hooks JSON (audit R3). Making it structural, counting it only as a PreToolUse hook command, is a separate unit.

…ly when opted in

The deny-list section and the MCP config/settings scan read the operator's home unconditionally, so a bare CI runner and a populated laptop scored the same project 65 vs 81. Route both through homeScopeEnabled(), as every other home-reading check already does.
@joepetjr
joepetjr added this pull request to the merge queue Oct 11, 2026
Merged via the queue into main with commit 148bf0a Oct 11, 2026
6 checks passed
@joepetjr
joepetjr deleted the fix/home-scope-infra-mcp branch October 11, 2026 20:36
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