Repository navigation
DEGRADED codebase-MCP remedy prints a runnable registration command (sc-7321) - #285
Merged
norvalbv merged 2 commits intoNov 20, 2026
Merged
Conversation
…sc-7321) ## Why About 300 `gate_degraded` rows a day carry the cause "MCP codebase unavailable (missing from the trusted MCP registry)". On those ships, reviewers still return verdicts, but they have no codebase search. This is not an outage. `~/.claude.json` registers the `codebase` server (`search-code serve`) only for frink, qavis and frink-oss. The "October spike" is just when sc-2837 started recording this cause (2026-10-01). | repo | registry-missing rows (Oct + Nov) | |---|---| | devkit | 8,547 | | claude-usage-dashboard | 1,851 | | sonar | 401 | | frink (registered) | 0 | The remedy printed today is prose, and in 7 weeks nobody acted on it. `devkit init --search-code` never says the server needs registering. ## What changes - **The DEGRADED line ends with a command you can paste.** It is built by `codebaseRegisterCommand` in the new `gate-engine/judge/mcp/registration-remedy.mts` and used by `registryRemedy` in `profile.mts`. For this repo it prints: ``` cd '/Users/benji/Desktop/Personal and learning/devkit' && env -u CLAUDE_CONFIG_DIR claude mcp add -s local codebase -e SEMANTIC_SEARCH_ROOT='/Users/benji/Desktop/Personal and learning/devkit' -- search-code serve ``` - **Primary checkout.** `codebaseRegisterCommand` targets the primary checkout. `profile.mts` already reads that checkout's project row from linked gate worktrees. Paths are shell-quoted. - **The root is pinned.** frink, qavis and frink-oss all register this way and show 0 DEGRADED rows. Gate worktrees live under `$TMPDIR`, and an overlay consumer git-excludes `search-code.config.json`. So an unpinned server would walk up from the worktree, find no config, and clear DEGRADED while searching nothing. - **`env -u CLAUDE_CONFIG_DIR`.** When that variable is set, as in a Frink session, `claude` writes `$CLAUDE_CONFIG_DIR/.claude.json`. devkit's registry never reads that file. - **`claude mcp add` does not clear `disabledMcpServers`.** The probe showed this, so the remedy names that extra step. - **An explicit `DEVKIT_JUDGE_MCP_CONFIG` registry gets no `claude` command.** The command would write `~/.claude.json`, not that registry. - **A repo with no `search-code.config.json` is told to opt in first.** DEGRADED checks only that the server is registered, not that search works. A bare registration would clear it while reviewers had nothing to search (sonar, the dashboard). - **`devkit init --search-code` prints the same command for the primary checkout.** When it runs from a linked worktree whose primary checkout has not opted in, it prints no command and says to run init there too, since gates register and search the primary checkout. - The warning's dedupe key now includes the checkout, so a second checkout with the same registry state still prints its own command. - A decision note on `judge-mcp-profiles` records all of the above, plus why one user-scope registration and a `doctor` row were rejected. ## Proof - **Probe 1: `claude -p --strict-mcp-config`** with a stdio server that logs its cwd. The server starts in the judge's cwd. - **Probe 2: `claude mcp add -s local`**, run from a linked worktree subdirectory with a temp `HOME`. - It keys the row by the main worktree root. - It leaves `disabledMcpServers` unchanged. - With `CLAUDE_CONFIG_DIR` set, it writes into that directory instead of `HOME`. - **End to end.** I ran the exact printed command with `CLAUDE_CONFIG_DIR` pointing at a decoy directory: - the decoy stayed empty; - `$HOME/.claude.json` got the pinned row; - devkit's resolver then found `codebase` from a linked worktree, with `root` = the primary checkout. - **Tests:** 144 tests pass across 6 files (`registration-remedy`, `mcp-profile`, `judge-exec-telemetry`, `mcp-degraded`, `completeness-mcp-degraded`, `install-search-code`). - The command test runs the printed command through `/bin/sh` against a stub `claude`. It checks the cwd, the pinned root (a path with spaces and a `'`), that `CLAUDE_CONFIG_DIR` is unset, and the argv. - **Revert proofs:** - The old `registryRemedy` text fails 4 mcp-profile tests. - Dropping `primaryCheckout` from init fails the linked-worktree test. - **Coverage:** 18/18 added lines covered. - **Line count:** `profile.mts` went from 499 to 497 lines. - **Dry run:** `devkit ship --dry-gates` passed. ## Owner steps (the agent did not write `~/.claude.json`); leave sc-7321 open until step 4 1. In devkit, run the printed command. 2. Refresh devkit's primary index: `search-code index` in the primary checkout. It was last refreshed 2026-10-01, and the pinned root makes reviewers search it. 3. For claude-usage-dashboard and sonar: `devkit init --search-code`, `search-code index`, then the printed command. 4. Seven days later, re-read the `gate_degraded` rows with the cause "missing from the trusted MCP registry". The acceptance criterion is near zero. ## Embeddings share (acceptance item c) The "embeddings endpoint unreachable" rows fell from about 560 in October to about 10 in November. The drop matches sc-4215 (2026-10-08), which approves codex MCP calls. Before that fix, a refused MCP call sent codex judges to a sandboxed shell, where the localhost fetch failed. What remains is small, so it gets its own follow-up and no fix here. ## Follow-ups (not in this PR) - A ship's worktree index refresh never writes the primary checkout's index, so the pinned root searches a stale index until someone re-indexes. (devkit, bug) - Should DEGRADED fire at all for repos that never opted into search-code? That would change the sc-2837 ruling. (devkit, feature) - DEGRADED checks only that the server is registered, not that search works. A health probe would catch a missing binary or an empty index. (devkit, feature) - The remaining "embeddings endpoint unreachable" rows. (devkit, bug) - The search-code README's registration example. (search-code, chore) - Already tracked as autonomous report a9570be1: Frink says not to edit `~/.claude.json`, but devkit's judges read it. Reviewer notes declined: - correctness-reviewer, `profile.mts:271` (`projectRoots: []` makes `roots.at(-1)` fall back to cwd): no production caller passes an empty list (only the eval harness passes one root), and an empty list reads no project row, so cwd is the only registration site. Story: sc-7321 🤖 Generated with [Claude Code](https://claude.com/claude-code) Complete against acceptance criteria: NO — owner registration and 7-day gate_degraded re-read: needs the owner (the agent may not write ~/.claude.json, and the check is time-gated)
|
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 33 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. |
…sc-7321) ## Why About 300 `gate_degraded` rows a day carry the cause "MCP codebase unavailable (missing from the trusted MCP registry)". On those ships, reviewers still return verdicts, but they have no codebase search. This is not an outage. `~/.claude.json` registers the `codebase` server (`search-code serve`) only for frink, qavis and frink-oss. The "October spike" is just when sc-2837 started recording this cause (2026-10-01). | repo | registry-missing rows (Oct + Nov) | |---|---| | devkit | 8,547 | | claude-usage-dashboard | 1,851 | | sonar | 401 | | frink (registered) | 0 | The remedy printed today is prose, and in 7 weeks nobody acted on it. `devkit init --search-code` never says the server needs registering. ## What changes - **The DEGRADED line ends with a command you can paste.** It is built by `codebaseRegisterCommand` in the new `gate-engine/judge/mcp/registration-remedy.mts` and used by `registryRemedy` in `profile.mts`. For this repo it prints: ``` cd '/Users/benji/Desktop/Personal and learning/devkit' && env -u CLAUDE_CONFIG_DIR claude mcp add -s local codebase -e SEMANTIC_SEARCH_ROOT='/Users/benji/Desktop/Personal and learning/devkit' -- search-code serve ``` - **Primary checkout.** `codebaseRegisterCommand` targets the primary checkout. `profile.mts` already reads that checkout's project row from linked gate worktrees. Paths are shell-quoted. - **The root is pinned.** frink, qavis and frink-oss all register this way and show 0 DEGRADED rows. Gate worktrees live under `$TMPDIR`, and an overlay consumer git-excludes `search-code.config.json`. So an unpinned server would walk up from the worktree, find no config, and clear DEGRADED while searching nothing. - **`env -u CLAUDE_CONFIG_DIR`.** When that variable is set, as in a Frink session, `claude` writes `$CLAUDE_CONFIG_DIR/.claude.json`. devkit's registry never reads that file. - **`claude mcp add` does not clear `disabledMcpServers`.** The probe showed this, so the remedy names that extra step. - **An explicit `DEVKIT_JUDGE_MCP_CONFIG` registry gets no `claude` command.** The command would write `~/.claude.json`, not that registry. - **A repo with no `search-code.config.json` is told to opt in first.** DEGRADED checks only that the server is registered, not that search works. A bare registration would clear it while reviewers had nothing to search (sonar, the dashboard). - **`devkit init --search-code` prints the same command for the primary checkout.** When it runs from a linked worktree whose primary checkout has not opted in, it prints no command and says to run init there too, since gates register and search the primary checkout. - The warning's dedupe key now includes the checkout, so a second checkout with the same registry state still prints its own command. - A decision note on `judge-mcp-profiles` records all of the above, plus why one user-scope registration and a `doctor` row were rejected. ## Proof - **Probe 1: `claude -p --strict-mcp-config`** with a stdio server that logs its cwd. The server starts in the judge's cwd. - **Probe 2: `claude mcp add -s local`**, run from a linked worktree subdirectory with a temp `HOME`. - It keys the row by the main worktree root. - It leaves `disabledMcpServers` unchanged. - With `CLAUDE_CONFIG_DIR` set, it writes into that directory instead of `HOME`. - **End to end.** I ran the exact printed command with `CLAUDE_CONFIG_DIR` pointing at a decoy directory: - the decoy stayed empty; - `$HOME/.claude.json` got the pinned row; - devkit's resolver then found `codebase` from a linked worktree, with `root` = the primary checkout. - **Tests:** 144 tests pass across 6 files (`registration-remedy`, `mcp-profile`, `judge-exec-telemetry`, `mcp-degraded`, `completeness-mcp-degraded`, `install-search-code`). - The command test runs the printed command through `/bin/sh` against a stub `claude`. It checks the cwd, the pinned root (a path with spaces and a `'`), that `CLAUDE_CONFIG_DIR` is unset, and the argv. - **Revert proofs:** - The old `registryRemedy` text fails 4 mcp-profile tests. - Dropping `primaryCheckout` from init fails the linked-worktree test. - **Coverage:** 18/18 added lines covered. - **Line count:** `profile.mts` went from 499 to 497 lines. - **Dry run:** `devkit ship --dry-gates` passed. ## Owner steps (the agent did not write `~/.claude.json`); leave sc-7321 open until step 4 1. In devkit, run the printed command. 2. Refresh devkit's primary index: `search-code index` in the primary checkout. It was last refreshed 2026-10-01, and the pinned root makes reviewers search it. 3. For claude-usage-dashboard and sonar: `devkit init --search-code`, `search-code index`, then the printed command. 4. Seven days later, re-read the `gate_degraded` rows with the cause "missing from the trusted MCP registry". The acceptance criterion is near zero. ## Embeddings share (acceptance item c) The "embeddings endpoint unreachable" rows fell from about 560 in October to about 10 in November. The drop matches sc-4215 (2026-10-08), which approves codex MCP calls. Before that fix, a refused MCP call sent codex judges to a sandboxed shell, where the localhost fetch failed. What remains is small, so it gets its own follow-up and no fix here. ## Follow-ups (not in this PR) - A ship's worktree index refresh never writes the primary checkout's index, so the pinned root searches a stale index until someone re-indexes. (devkit, bug) - Should DEGRADED fire at all for repos that never opted into search-code? That would change the sc-2837 ruling. (devkit, feature) - DEGRADED checks only that the server is registered, not that search works. A health probe would catch a missing binary or an empty index. (devkit, feature) - The remaining "embeddings endpoint unreachable" rows. (devkit, bug) - The search-code README's registration example. (search-code, chore) - Already tracked as autonomous report a9570be1: Frink says not to edit `~/.claude.json`, but devkit's judges read it. Reviewer notes declined: - correctness-reviewer, `profile.mts:266` (`root = roots.at(-1)` assumes the primary checkout comes last): `projectCandidates` fixes the production order as `[cwd, primary]` (`profile.mts:161`). The eval harness passes a single root. The end-to-end probe on the default path returned root = primary. - api-security-reviewer, `registration-remedy.mts:12` (control characters in a directory name could spoof how the command displays): the path is the user's own checkout, printed to their own terminal. It is quoted by the same `shellWord` that devkit's other paste commands (waive, resume) use, so changing it here alone would only make the two disagree. - correctness-reviewer, `profile.mts:271` (`projectRoots: []` makes `roots.at(-1)` fall back to cwd): no production caller passes an empty list (only the eval harness passes one root), and an empty list reads no project row, so cwd is the only registration site. Story: sc-7321 🤖 Generated with [Claude Code](https://claude.com/claude-code) Complete against acceptance criteria: NO — owner registration and 7-day gate_degraded re-read: needs the owner (the agent may not write ~/.claude.json, and the check is time-gated)
norvalbv
deleted the
sc-7321-reviewers-degraded-mcp-codebase-unavailable
branch
November 20, 2026 08:29
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
About 300
gate_degradedrows a day carry the cause "MCP codebase unavailable (missing from the trusted MCP registry)". On those ships, reviewers still return verdicts, but they have no codebase search.This is not an outage.
~/.claude.jsonregisters thecodebaseserver (search-code serve) only for frink, qavis and frink-oss. The "October spike" is just when sc-2837 started recording this cause (2026-10-01).The remedy printed today is prose, and in 7 weeks nobody acted on it.
devkit init --search-codenever says the server needs registering.What changes
codebaseRegisterCommandin the newgate-engine/judge/mcp/registration-remedy.mtsand used byregistryRemedyinprofile.mts. For this repo it prints:codebaseRegisterCommandtargets the primary checkout.profile.mtsalready reads that checkout's project row from linked gate worktrees. Paths are shell-quoted.$TMPDIR, and an overlay consumer git-excludessearch-code.config.json. So an unpinned server would walk up from the worktree, find no config, and clear DEGRADED while searching nothing.env -u CLAUDE_CONFIG_DIR. When that variable is set, as in a Frink session,claudewrites$CLAUDE_CONFIG_DIR/.claude.json. devkit's registry never reads that file.claude mcp adddoes not cleardisabledMcpServers. The probe showed this, so the remedy names that extra step.DEVKIT_JUDGE_MCP_CONFIGregistry gets noclaudecommand. The command would write~/.claude.json, not that registry.search-code.config.jsonis told to opt in first. DEGRADED checks only that the server is registered, not that search works. A bare registration would clear it while reviewers had nothing to search (sonar, the dashboard).devkit init --search-codeprints the same command for the primary checkout. When it runs from a linked worktree whose primary checkout has not opted in, it prints no command and says to run init there too, since gates register and search the primary checkout.judge-mcp-profilesrecords all of the above, plus why one user-scope registration and adoctorrow were rejected.Proof
claude -p --strict-mcp-configwith a stdio server that logs its cwd. The server starts in the judge's cwd.claude mcp add -s local, run from a linked worktree subdirectory with a tempHOME.disabledMcpServersunchanged.CLAUDE_CONFIG_DIRset, it writes into that directory instead ofHOME.CLAUDE_CONFIG_DIRpointing at a decoy directory:$HOME/.claude.jsongot the pinned row;codebasefrom a linked worktree, withroot= the primary checkout.registration-remedy,mcp-profile,judge-exec-telemetry,mcp-degraded,completeness-mcp-degraded,install-search-code)./bin/shagainst a stubclaude. It checks the cwd, the pinned root (a path with spaces and a'), thatCLAUDE_CONFIG_DIRis unset, and the argv.registryRemedytext fails 4 mcp-profile tests.primaryCheckoutfrom init fails the linked-worktree test.profile.mtswent from 499 to 497 lines.devkit ship --dry-gatespassed.Owner steps (the agent did not write
~/.claude.json); leave sc-7321 open until step 4 (sc-4541)search-code indexin the primary checkout. It was last refreshed 2026-10-01, and the pinned root makes reviewers search it.devkit init --search-code,search-code index, then the printed command.gate_degradedrows with the cause "missing from the trusted MCP registry". The acceptance criterion is near zero.Embeddings share (acceptance item c)
The "embeddings endpoint unreachable" rows fell from about 560 in October to about 10 in November. The drop matches sc-4215 (2026-10-08), which approves codex MCP calls. Before that fix, a refused MCP call sent codex judges to a sandboxed shell, where the localhost fetch failed. What remains is small, so it gets its own follow-up and no fix here.
Follow-ups (not in this PR)
indexPath. (devkit, bug) (sc-8972)~/.claude.json, but devkit's judges read it (autonomous a9570be1).CLAUDE_CONFIG_DIRis undocumented, so aclaude mcp addthere writes a file the judges never read (autonomous 99239f9e).Not filed
CLAUDE_CONFIG_DIR: intended. Judges read the user's~/.claude.json(orDEVKIT_JUDGE_MCP_CONFIG); a per-session config dir is the wrong registry. Documenting it is autonomous 99239f9e.search-code.config.json: no devkit code reads it in a gate worktree, and the pinned root no longer depends on it.Reviewer notes declined:
profile.mts:266(root = roots.at(-1)assumes the primary checkout comes last):projectCandidatesfixes the production order as[cwd, primary](profile.mts:161). The eval harness passes a single root. The end-to-end probe on the default path returned root = primary.registration-remedy.mts:12(control characters in a directory name could spoof how the command displays): the path is the user's own checkout, printed to their own terminal. It is quoted by the sameshellWordthat devkit's other paste commands (waive, resume) use, so changing it here alone would only make the two disagree.profile.mts:271(projectRoots: []makesroots.at(-1)fall back to cwd): no production caller passes an empty list (only the eval harness passes one root), and an empty list reads no project row, so cwd is the only registration site.Story: sc-7321
🤖 Generated with Claude Code
Complete against acceptance criteria: NO — owner registration and 7-day gate_degraded re-read (sc-4541): needs the owner (the agent may not write ~/.claude.json, and the check is time-gated)
Automated evidence
Merge verdict: 🟡 human-review · advisory, at
bd920f942a6eHead
bd920f942a6e· basee7bfe421f0fbDid not load on red (3 files): red's counts leave out the tests inside
<checkout>/cli/__tests__/install-search-code.test.mts:Cannot find module '<checkout>/gate-engine/judge/mcp/registration-remedy.mts' imported from <checkout>/cli/__tests__/install-search-code.test.mts<checkout>/gate-engine/judge/__tests__/mcp-profile.test.mts:Cannot find module '<checkout>/gate-engine/judge/mcp/registration-remedy.mts' imported from <checkout>/gate-engine/judge/__tests__/mcp-profile.test.mts<checkout>/gate-engine/judge/__tests__/registration-remedy.test.mts:Cannot find module '<checkout>/gate-engine/judge/mcp/registration-remedy.mts' imported from <checkout>/gate-engine/judge/__tests__/registration-remedy.test.mtsTest command
Captured runs, not proof of causality. Dependencies are the shipping checkout's installed packages. Stale unless the PR head is
bd920f942a6e0eb1a42aa9babb49e1085a1b4e57.💬 Reviewer notes · 2 notes at
4d6150b811dfgate-engine/judge/mcp/registration-remedy.mtsshellWordsingle-quotes a root containing control characters (for example a newline or ANSI escape in a directory name) but prints them raw to the terminal. A hostile directory name could therefore spoof the pasted command's display. · api-securitygate-engine/judge/mcp/profile.mtsrootisroots.at(-1), which only equals the primary checkout whenprojectRootsis absent. Eval passes a single consumer root and the test passes primary last, so the ordering assumption is implicit and untested. · correctness