[PR #5213] test(mcp): normalize server identity fixture paths on Windows #6818

Open
opened 2026-11-01 21:43:15 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5213
Author: @abundantbeing
Created: 10/19/2026
Status: 🔄 Open

Base: main ← Head: test/mcp-identity-windows


📝 Commits (1)

  • fa8ba6f test(mcp): normalize server identity fixture paths on Windows

📊 Changes

1 file changed (+14 additions, -2 deletions)

View changed files

📝 tests/boundary/mcp/serverIdentity.test.ts (+14 -2)

📄 Description

Summary

Fix a Windows-only false failure in the MCP server-identity fixture. No production code changes.

Visual proof

These are browser-rendered execution reports built from actual identity calls and captured test output. The diagram compares fixture inputs; it does not claim a production behavior change.

flowchart LR
  A["Old fixture: raw slash path"] --> C["Unchanged production path comparison"]
  B["Fixed fixture: normalizeEntrypointPath"] --> C
  C -->|"different representations"| D["False registration mismatch"]
  C -->|"equal host-native paths"| E["Aligned registration"]

Before and after

Windows identity fixture before and after, with actual compared paths and results

The fixed fixture supplies the same host-native path shape as production. A genuinely different registered path still returns registration_path_mismatch, and a missing observed entrypoint stays unknown. Production code is unchanged.

Complete-file execution output and unchanged negative controls

Fresh MCP identity test output and verified negative controls

Local Windows verification on fa8ba6f. Checkout paths are shortened for display. Linux and macOS execution were not performed.

Problem and expected behavior

On Windows, serverIdentity.test.ts supplies raw /packaged/rea.mjs as the observed command path. The expected registration path goes through path.resolve, so the comparison incorrectly reports registration_path_mismatch for a fixture intended to be aligned.

Production supplies a path normalized by normalizeEntrypointPath. The test should exercise that same input contract on every host, while still rejecting genuinely different registration paths.

Change and scope

Use the existing normalizeEntrypointPath helper in the aligned and stale fixtures. Preserve their assertions and add a separate mismatched-path control. One test file changes. Production behavior, schemas, docs and generated metadata are unchanged.

Searched the open PR and issue inventories before submission. No competing identity-fixture portability fix was found. This was discovered while verifying #4554 and is kept separate from that feature.

Contribution scope: ordinary test fix within existing boundaries. A new maintainer scope decision is not applicable.

Contract and boundary impact

  • Semantic owner and earliest changed stage: test fixture construction for createServerIdentity.
  • Contribution scope fit and linked maintainer decision: existing boundary; not applicable.
  • CLI and MCP/tool-catalog contract: unchanged.
  • Provider, bridge, target-format, or platform compatibility: corrects the fixture for Windows; uses the same production path-normalization helper on other hosts.
  • Evidence, artifact, provenance, or reconstruction contract: unchanged.
  • Target selection, authority, upstream behavior, and cleanup: unchanged.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Documentation or usability only; no target interaction.

Evidence and regression coverage

On unmodified origin/main at 3927542, the focused alignment test fails on this Windows host:

Expected: state = aligned, reasons = []
Received: state = mcp_server_restart_required
          reasons = [registration_path_mismatch]

After the fixture correction, the complete server-identity test file passes. The added negative control verifies that genuinely different registration paths still require a restart. No test was skipped or weakened to obtain the pass.

Remaining proof gaps: Linux and macOS execution was not performed. These results are local Windows verification, not green GitHub CI.

Validation performed

  • npx vitest run tests/boundary/mcp/serverIdentity.test.ts -t 'reports unknown without a live comparison' on the base: 1 failed with the path mismatch above.
  • npx vitest run tests/boundary/mcp/serverIdentity.test.ts after the fix: 12 passed, including the live in-memory MCP identity and availability cases.
  • npm run check:fast: typecheck and lint passed.
  • npx oxfmt --check .: passed.
  • git diff --check: passed.

Host: Windows 11, Node.js 26.7.0. No real native analysis provider was exercised.

Compatibility, safety, and release

No runtime change, breaking change, new permission, target execution, network access, package change or release metadata change. The tests continue to check unknown identity, aligned registration, stale package/catalog identity and different registration paths.

Author readiness

Human owner: @abundantbeing

  • 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

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • 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/5213 **Author:** [@abundantbeing](https://github.com/abundantbeing) **Created:** 10/19/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `test/mcp-identity-windows` --- ### 📝 Commits (1) - [`fa8ba6f`](https://github.com/morluto/rea/commit/fa8ba6f4331455974a17a91a37ff080211d93dcf) test(mcp): normalize server identity fixture paths on Windows ### 📊 Changes **1 file changed** (+14 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `tests/boundary/mcp/serverIdentity.test.ts` (+14 -2) </details> ### 📄 Description ## Summary Fix a Windows-only false failure in the MCP server-identity fixture. No production code changes. ## Visual proof These are browser-rendered execution reports built from actual identity calls and captured test output. The diagram compares fixture inputs; it does not claim a production behavior change. ```mermaid flowchart LR A["Old fixture: raw slash path"] --> C["Unchanged production path comparison"] B["Fixed fixture: normalizeEntrypointPath"] --> C C -->|"different representations"| D["False registration mismatch"] C -->|"equal host-native paths"| E["Aligned registration"] ``` ### Before and after ![Windows identity fixture before and after, with actual compared paths and results](https://files.catbox.moe/p5kcs8.png) The fixed fixture supplies the same host-native path shape as production. A genuinely different registered path still returns `registration_path_mismatch`, and a missing observed entrypoint stays `unknown`. Production code is unchanged. <details> <summary>Complete-file execution output and unchanged negative controls</summary> ![Fresh MCP identity test output and verified negative controls](https://files.catbox.moe/t9djha.png) Local Windows verification on `fa8ba6f`. Checkout paths are shortened for display. Linux and macOS execution were not performed. </details> ## Problem and expected behavior On Windows, `serverIdentity.test.ts` supplies raw `/packaged/rea.mjs` as the observed command path. The expected registration path goes through `path.resolve`, so the comparison incorrectly reports `registration_path_mismatch` for a fixture intended to be aligned. Production supplies a path normalized by `normalizeEntrypointPath`. The test should exercise that same input contract on every host, while still rejecting genuinely different registration paths. ## Change and scope Use the existing `normalizeEntrypointPath` helper in the aligned and stale fixtures. Preserve their assertions and add a separate mismatched-path control. One test file changes. Production behavior, schemas, docs and generated metadata are unchanged. Searched the open PR and issue inventories before submission. No competing identity-fixture portability fix was found. This was discovered while verifying #4554 and is kept separate from that feature. Contribution scope: ordinary test fix within existing boundaries. A new maintainer scope decision is not applicable. ## Contract and boundary impact - Semantic owner and earliest changed stage: test fixture construction for `createServerIdentity`. - Contribution scope fit and linked maintainer decision: existing boundary; not applicable. - CLI and MCP/tool-catalog contract: unchanged. - Provider, bridge, target-format, or platform compatibility: corrects the fixture for Windows; uses the same production path-normalization helper on other hosts. - Evidence, artifact, provenance, or reconstruction contract: unchanged. - Target selection, authority, upstream behavior, and cleanup: unchanged. - Generated metadata, package, or installation impact: none. Expected effects: - [x] Documentation or usability only; no target interaction. ## Evidence and regression coverage On unmodified `origin/main` at `3927542`, the focused alignment test fails on this Windows host: ```text Expected: state = aligned, reasons = [] Received: state = mcp_server_restart_required reasons = [registration_path_mismatch] ``` After the fixture correction, the complete server-identity test file passes. The added negative control verifies that genuinely different registration paths still require a restart. No test was skipped or weakened to obtain the pass. Remaining proof gaps: Linux and macOS execution was not performed. These results are local Windows verification, not green GitHub CI. ## Validation performed - `npx vitest run tests/boundary/mcp/serverIdentity.test.ts -t 'reports unknown without a live comparison'` on the base: 1 failed with the path mismatch above. - `npx vitest run tests/boundary/mcp/serverIdentity.test.ts` after the fix: 12 passed, including the live in-memory MCP identity and availability cases. - `npm run check:fast`: typecheck and lint passed. - `npx oxfmt --check .`: passed. - `git diff --check`: passed. Host: Windows 11, Node.js 26.7.0. No real native analysis provider was exercised. ## Compatibility, safety, and release No runtime change, breaking change, new permission, target execution, network access, package change or release metadata change. The tests continue to check unknown identity, aligned registration, stale package/catalog identity and different registration paths. ## Author readiness Human owner: @abundantbeing - [ ] 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 - [ ] This PR addresses a concrete problem or an agreed enhancement. - [ ] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#6818
No description provided.