Skip to content

fix(#1160): mcp-config writes replace a .mcp.json symlink - #1168

Merged
admarble merged 4 commits into
mainfrom
feature/1160-fix-mcp-config-mcp-json-writes-still-follow-an-exi
Sep 25, 2026
Merged

admarble merged 4 commits into
mainfrom
feature/1160-fix-mcp-config-mcp-json-writes-still-follow-an-exi

Conversation

@admarble

@admarble admarble commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add a sync writeFileSync to src/lib/fs.ts (same replace-the-link rule as fix(writers): update/init/sync write through an existing symlink at a sequant-owned destination (#1053 class) #1122's writeFile) and route the three mcp-config.ts writes through it.
  • Add the 1160 case in mcp-config.test.ts and a unit test for the helper; annotate the mcpJson symlink rows in the writer-state matrix. The letter stays M, but it now comes from the file arm of classify (link replaced, target byte-identical, else V) instead of the write-through symlink arm.
  • Behaviour change: a symlinked client config (e.g. dotfiles-managed) becomes a plain file. Noted in the CHANGELOG.

AC verification

AC Status Evidence
AC-1 Implemented writer-state-matrix.test.ts green (729 tests across the three touched files)
AC-2 Implemented mcp-config.test.ts > ... > 1160: ...
AC-3 Implemented marker below
AC-4 Implemented grep -n "fs.writeFileSync" src/lib/mcp-config.ts prints nothing

Not run: the full npm test. Build, lint and the three touched test files pass.

Mutation-verified: AC-2 — replaced the helper with direct fs.writeFileSync in mcp-config.ts; src/lib/mcp-config.test.ts > mcp-config > symlinked .mcp.json (#1160) > 1160 case failed; restored.

Mutation-verified: AC-1 — restored direct fs.writeFileSync at the three mcp-config.ts writes; src/lib/tests/writer-state-matrix.test.ts failed exactly the four .mcp.json local/foreign symlink × init/init --force cells (4 failed | 645 passed); restored.

Runner fix after QA (0addb27e): QA showed that AC-1's matrix evidence didn't gate the fix. classify returned M both for a replaced link carrying merged content and for a merge written through the link, so the matrix passed 649/649 with the fix reverted. The symlink arm now reports a merge written through a link as W, which the legend already defines as a write-through. No current cell used that path (still 649/649), and reverting the fix now fails exactly the four .mcp.json symlink cells.

Closes #1160

🤖 Generated with Claude Code

@admarble
admarble merged commit 24b764e into main Sep 25, 2026
9 checks passed
@admarble
admarble deleted the feature/1160-fix-mcp-config-mcp-json-writes-still-follow-an-exi branch September 25, 2026 22:39
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.

fix(mcp-config): .mcp.json writes still follow an existing symlink (#1122 follow-up)

1 participant