[PR #4825] [CLOSED] fix(claude): refuse unknown publisher in Claude Desktop family probe #6427

Closed
opened 2026-10-31 01:14:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4825
Author: @XiaoBinGan
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: fix/claude-desktop-family-refusal


📝 Commits (1)

  • 7944112 fix(setup): refuse an unrecognized Claude Desktop publisher

📊 Changes

2 files changed (+48 additions, -1 deletions)

View changed files

📝 src/application/ClaudeDesktopConfigLocation.test.ts (+43 -0)
📝 src/application/ClaudeDesktopConfigLocation.ts (+5 -1)

📄 Description

Summary

On a Store/MSIX Claude Desktop build whose package family is AnthropicPBC.Claude_fnn82j28hfe8t, REA registered mcpServers.rea in %APPDATA%\Claude\claude_desktop_config.json while the app read %LOCALAPPDATA%\Claude-3p\claude_desktop_config.json (morluto/rea#4432). Setup reported success and rea doctor --client claude_desktop reported the registration healthy against a file the app never loads.

The package-family pattern only matched Claude_<publisher hash> exactly, so a package named AnthropicPBC.Claude_<hash> was filtered out of the MSIX package listing before the unrecognized-publisher guard could run. REA therefore treated the install as having no package storage and silently used the AppData file.

This change recognizes a Claude Desktop package by its package name with any publisher prefix, so the existing guard now reports the unrecognized publisher instead of assuming the AppData file.

Problem and expected behavior

Install Before After
Claude_pzs8sxrjxfjjc (documented publisher) package-private or AppData file, as documented unchanged
AnthropicPBC.Claude_fnn82j28hfe8t (other publisher) silently resolved %APPDATA%\Claude\claude_desktop_config.json; setup succeeded; doctor ok: true / healthy typed refusal: the Claude_<publisher hash> directory uses an unrecognized publisher, and REA does not fall back to the AppData file; doctor reports state: "invalid" with that remediation
no Claude package installed AppData file unchanged

Both halves of the silent failure follow from the one resolution, and the surrounding plumbing already consumes it:

  • SetupClientConfiguration.ts returns { status: "failed", reason: "path" } when the client carries configPathError, so setup refuses instead of writing the AppData file.
  • ClientRegistrationStatus.ts records state: "invalid" with the refusal as remediation, so doctor no longer reports the registration as healthy.

The issue also offers recognizing the 3P layout (%LOCALAPPDATA%\Claude-3p) instead. This change does not guess that mapping: the issue reports that no documented contract for a 3P deployment exists, and a guessed path would write a config the app may ignore again, which is the failure being fixed.

Change and scope

  • src/application/ClaudeDesktopConfigLocation.ts: the package-family pattern now accepts an optional publisher-name prefix before Claude_<publisher hash>, with a comment naming the reported build. The foreign-package refusal branch itself is unchanged.
  • src/application/ClaudeDesktopConfigLocation.test.ts: new regression tests — a AnthropicPBC.Claude_fnn82j28hfe8t package storage resolves to the unrecognized-publisher failure naming the AppData path, and a non-Claude package (Microsoft.WindowsCalculator_8wekyb3d8bbwe) still resolves to the AppData file. The existing foreign-package branch had no test coverage before this.

Contract and boundary impact

  • Semantic owner and earliest changed stage: Windows Claude Desktop config-location resolution, before setup writes or doctor reads anything.
  • Contribution scope fit and linked maintainer decision: the issue is a direct report; the change implements the refusal behavior that docs/client-configuration.md already documents for a Claude_<publisher ID> package from another publisher. No new scope decision required.
  • CLI and MCP/tool-catalog contract: unchanged.
  • Provider, bridge, target-format, or platform compatibility: win32 only; non-Windows Claude Desktop resolution is untouched.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata / package / installation impact: none.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

The new refusal test fails on unpatched main (the resolver returns the AppData location with ok: true) and passes with this change. The second new test guards that an unrelated MSIX package does not trigger the refusal.

Checks actually run (Node 24.18.0):

  • npx vitest run src/application/ClaudeDesktopConfigLocation.test.ts → 19 passed.
  • npx vitest run src/application/ tests/boundary/mcp/mcpDoctor.test.ts → 1100 passed (84 files).
  • npm run check:fast → 2 successful (typecheck + lint).
  • npm run format:check → all files formatted.
  • npm run verify:test-discovery → all 1415 test files discovered exactly once.

Unverified gaps: no Windows host was available, so the resolver is verified through its injected filesystem and the setup/doctor plumbing was verified by reading its consumers; the -3p userData layout itself is not handled, as described above.

Compatibility, safety, and release

  • Breaking changes or migration steps: on a Windows install whose Claude MSIX package comes from another publisher, setup now refuses instead of writing the AppData file, and doctor reports the registration invalid with the reason; users register manually in the configuration the app reads.
  • Real Hopper/Ghidra, browser, or OS coverage: none required.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: none applicable. The refusal previously existed in the code but was unreachable for publisher-prefixed package names.

Author readiness

Human owner: @XiaoBinGan

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before-merge:

  • I will respond to review feedback and keep the PR current with main until it merges.

  • This PR addresses a concrete problem or an agreed enhancement.

  • The PR has one focused outcome and the title follows type(scope): outcome.

  • Related issue is linked, or the reason for not linking one is stated above.

  • Tests cover changed observable behavior and meaningful failure paths.

  • Owning docs, contracts, and generated metadata are updated where needed.

  • User-visible CLI/MCP changes include representative output.

  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4825 **Author:** [@XiaoBinGan](https://github.com/XiaoBinGan) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/claude-desktop-family-refusal` --- ### 📝 Commits (1) - [`7944112`](https://github.com/morluto/rea/commit/79441120e17e935e7064df9e70f1c3d14439f909) fix(setup): refuse an unrecognized Claude Desktop publisher ### 📊 Changes **2 files changed** (+48 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/application/ClaudeDesktopConfigLocation.test.ts` (+43 -0) 📝 `src/application/ClaudeDesktopConfigLocation.ts` (+5 -1) </details> ### 📄 Description ## Summary On a Store/MSIX Claude Desktop build whose package family is `AnthropicPBC.Claude_fnn82j28hfe8t`, REA registered `mcpServers.rea` in `%APPDATA%\Claude\claude_desktop_config.json` while the app read `%LOCALAPPDATA%\Claude-3p\claude_desktop_config.json` (morluto/rea#4432). Setup reported success and `rea doctor --client claude_desktop` reported the registration healthy against a file the app never loads. The package-family pattern only matched `Claude_<publisher hash>` exactly, so a package named `AnthropicPBC.Claude_<hash>` was filtered out of the MSIX package listing **before** the unrecognized-publisher guard could run. REA therefore treated the install as having no package storage and silently used the AppData file. This change recognizes a Claude Desktop package by its package name with any publisher prefix, so the existing guard now reports the unrecognized publisher instead of assuming the AppData file. ## Problem and expected behavior | Install | Before | After | | --- | --- | --- | | `Claude_pzs8sxrjxfjjc` (documented publisher) | package-private or AppData file, as documented | unchanged | | `AnthropicPBC.Claude_fnn82j28hfe8t` (other publisher) | silently resolved `%APPDATA%\Claude\claude_desktop_config.json`; setup succeeded; doctor `ok: true / healthy` | typed refusal: the `Claude_<publisher hash>` directory uses an unrecognized publisher, and REA does not fall back to the AppData file; doctor reports `state: "invalid"` with that remediation | | no Claude package installed | AppData file | unchanged | Both halves of the silent failure follow from the one resolution, and the surrounding plumbing already consumes it: - `SetupClientConfiguration.ts` returns `{ status: "failed", reason: "path" }` when the client carries `configPathError`, so setup refuses instead of writing the AppData file. - `ClientRegistrationStatus.ts` records `state: "invalid"` with the refusal as `remediation`, so doctor no longer reports the registration as healthy. The issue also offers recognizing the 3P layout (`%LOCALAPPDATA%\Claude-3p`) instead. This change does not guess that mapping: the issue reports that no documented contract for a 3P deployment exists, and a guessed path would write a config the app may ignore again, which is the failure being fixed. ## Change and scope - `src/application/ClaudeDesktopConfigLocation.ts`: the package-family pattern now accepts an optional publisher-name prefix before `Claude_<publisher hash>`, with a comment naming the reported build. The foreign-package refusal branch itself is unchanged. - `src/application/ClaudeDesktopConfigLocation.test.ts`: new regression tests — a `AnthropicPBC.Claude_fnn82j28hfe8t` package storage resolves to the unrecognized-publisher failure naming the AppData path, and a non-Claude package (`Microsoft.WindowsCalculator_8wekyb3d8bbwe`) still resolves to the AppData file. The existing foreign-package branch had no test coverage before this. ## Contract and boundary impact - Semantic owner and earliest changed stage: Windows Claude Desktop config-location resolution, before setup writes or doctor reads anything. - Contribution scope fit and linked maintainer decision: the issue is a direct report; the change implements the refusal behavior that `docs/client-configuration.md` already documents for a `Claude_<publisher ID>` package from another publisher. No new scope decision required. - CLI and MCP/tool-catalog contract: unchanged. - Provider, bridge, target-format, or platform compatibility: `win32` only; non-Windows Claude Desktop resolution is untouched. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup details: not applicable. - Generated metadata / package / installation impact: none. Expected effects: - [x] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [x] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage The new refusal test fails on unpatched `main` (the resolver returns the AppData location with `ok: true`) and passes with this change. The second new test guards that an unrelated MSIX package does not trigger the refusal. Checks actually run (Node 24.18.0): - `npx vitest run src/application/ClaudeDesktopConfigLocation.test.ts` → **19 passed**. - `npx vitest run src/application/ tests/boundary/mcp/mcpDoctor.test.ts` → **1100 passed** (84 files). - `npm run check:fast` → 2 successful (typecheck + lint). - `npm run format:check` → all files formatted. - `npm run verify:test-discovery` → all 1415 test files discovered exactly once. Unverified gaps: no Windows host was available, so the resolver is verified through its injected filesystem and the setup/doctor plumbing was verified by reading its consumers; the `-3p` userData layout itself is not handled, as described above. ## Compatibility, safety, and release - Breaking changes or migration steps: on a Windows install whose `Claude` MSIX package comes from another publisher, setup now refuses instead of writing the AppData file, and doctor reports the registration invalid with the reason; users register manually in the configuration the app reads. - Real Hopper/Ghidra, browser, or OS coverage: none required. - Package or release metadata impact: none. - Security, privacy, process, or containment review: none applicable. The refusal previously existed in the code but was unreachable for publisher-prefixed package names. ## Author readiness <!-- The human owner completes these declarations before requesting review. --> Human owner: @XiaoBinGan - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. Before-merge: - [x] I will respond to review feedback and keep the PR current with `main` until it merges. - [x] This PR addresses a concrete problem or an agreed enhancement. - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked, or the reason for not linking one is stated above. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning docs, contracts, and generated metadata are updated where needed. - [x] User-visible CLI/MCP changes include representative output. - [x] I checked the final diff for secrets, unrelated cleanup, and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:14:23 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6427
No description provided.