[PR #225] [MERGED] fix(setup): preserve client config symlinks #1876

Closed
opened 2026-10-16 21:12:05 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/225
Author: @N0zoM1z0
Created: 7/14/2026
Status: ✅ Merged
Merged: 7/14/2026
Merged by: @morluto

Base: main ← Head: agent/setup-symlink-safety


📝 Commits (3)

  • df87544 fix(setup): preserve client config symlinks
  • d1ef7a5 test(package): cover config symlink lifecycle
  • c50e51e test(package): preserve unrelated symlink config

📊 Changes

8 files changed (+371 additions, -29 deletions)

View changed files

📝 scripts/verify-package.mjs (+93 -4)
➕ src/application/ClientConfigPath.ts (+53 -0)
📝 src/application/Setup.ts (+26 -16)
📝 src/application/SetupClients.ts (+3 -1)
📝 src/application/Uninstall.ts (+35 -7)
📝 tests/setup.test.ts (+4 -0)
📝 tests/setupConfig.test.ts (+70 -1)
📝 tests/setupLifecycle.test.ts (+87 -0)

📄 Description

Summary

  • resolve an existing client-config symlink once to a stable canonical transaction path
  • require both link and regular-file target to be owned by the current user
  • use that path consistently for read, backup, atomic write, readback, and restore
  • preserve JSON and TOML symlinks through setup and uninstall
  • fail before backup or mutation for dangling, unverifiable, non-regular, or ownership-mismatched targets
  • use the same atomic writer for JSON configuration

The root cause was reading through the symlink but renaming the replacement onto the link path, which replaced the link itself and left its target unchanged.

Verification

  • 44 setup/config/uninstall tests passed
  • npm run typecheck
  • touched-file oxlint and Prettier checks
  • npm run knip
  • full check passed typecheck/lint/format before encountering the separately triaged process-capture flake

🔄 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/225 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 7/14/2026 **Status:** ✅ Merged **Merged:** 7/14/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `agent/setup-symlink-safety` --- ### 📝 Commits (3) - [`df87544`](https://github.com/morluto/rea/commit/df87544a5dcee13f15aa6e435c2b61fb3b220397) fix(setup): preserve client config symlinks - [`d1ef7a5`](https://github.com/morluto/rea/commit/d1ef7a54394ff2ed4316ba01cfe0aa4aac313aed) test(package): cover config symlink lifecycle - [`c50e51e`](https://github.com/morluto/rea/commit/c50e51eb6fe5686ad9d680abe0d96b3e4b58dc78) test(package): preserve unrelated symlink config ### 📊 Changes **8 files changed** (+371 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `scripts/verify-package.mjs` (+93 -4) ➕ `src/application/ClientConfigPath.ts` (+53 -0) 📝 `src/application/Setup.ts` (+26 -16) 📝 `src/application/SetupClients.ts` (+3 -1) 📝 `src/application/Uninstall.ts` (+35 -7) 📝 `tests/setup.test.ts` (+4 -0) 📝 `tests/setupConfig.test.ts` (+70 -1) 📝 `tests/setupLifecycle.test.ts` (+87 -0) </details> ### 📄 Description ## Summary - resolve an existing client-config symlink once to a stable canonical transaction path - require both link and regular-file target to be owned by the current user - use that path consistently for read, backup, atomic write, readback, and restore - preserve JSON and TOML symlinks through setup and uninstall - fail before backup or mutation for dangling, unverifiable, non-regular, or ownership-mismatched targets - use the same atomic writer for JSON configuration The root cause was reading through the symlink but renaming the replacement onto the link path, which replaced the link itself and left its target unchanged. ## Verification - 44 setup/config/uninstall tests passed - `npm run typecheck` - touched-file oxlint and Prettier checks - `npm run knip` - full check passed typecheck/lint/format before encountering the separately triaged process-capture flake --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:12:05 +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#1876
No description provided.