[PR #5612] [CLOSED] fix(native): keep .. after directory symlinks in selected plist paths #6995

Closed
opened 2026-11-01 21:44:35 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5612
Author: @HawkForge
Created: 10/20/2026
Status: ❌ Closed

Base: main ← Head: fix/plist-relative-path-symlink


📝 Commits (2)

  • dd5d21b fix(native): keep .. after directory symlinks in selected plist paths
  • 993b72f Merge remote-tracking branch 'origin/main' into fix/plist-relative-path-symlink

📊 Changes

2 files changed (+34 additions, -3 deletions)

View changed files

📝 src/native/NativePlistSource.ts (+8 -2)
📝 tests/boundary/providers/native/nativePlistSelection.test.ts (+26 -1)

📄 Description

Summary

Fixes #5492. inspect-plist --relative-path read a different plist than the one the path names when the path has a directory symlink followed by ... Both the relative and the absolute form of plists/contents/../Info.plist returned plists/Info.plist (Lexical) instead of Fixture.app/Info.plist (BundleRoot), with exit 0.

Problem and expected behavior

resolveNativePlistSelection() built the selected path with path.resolve(), which collapses link/.. as text. POSIX follows link first and then applies .., so the lexical result names another file. The selected path should name the same file the filesystem would open.

Change and scope

Use the existing absoluteCallerPath() (src/filesystem/callerPath.ts) for both the absolute and the app-root-relative selection. It makes the path absolute and keeps every .. for the filesystem to resolve, like the other caller-selected paths already do. The default Contents/Info.plist path is unchanged.

Not included: the sibling path issues in the same cluster (#5103, #5479).

Contract and boundary impact

  • Semantic owner and earliest changed stage: src/native/NativePlistSource.ts, plist selection before any file is read.
  • Contribution scope fit and linked maintainer decision: ordinary fix within existing boundaries; not applicable.
  • CLI and MCP/tool-catalog contract: none.
  • Provider, bridge, target-format, or platform compatibility: POSIX selection now matches filesystem resolution; Windows already resolves .. lexically and is unchanged (absoluteCallerPath handles both).
  • Evidence, artifact, provenance, or reconstruction contract: the reported plist path keeps the caller's .. segments instead of a collapsed path that named another file.
  • Target selection, authority, upstream behavior, and cleanup details (if applicable): selection only.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Read existing files or captured data.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/providers/native/nativePlistSelection.test.ts adds a bundle with plists/contents -> ../Contents and checks that both the relative and absolute plists/contents/../Info.plist select and read Fixture.app/Info.plist. It fails on main and passes with this change.
  • Base reproduction or other evidence: replayed the issue's three CLI calls on the built CLI. With this change all three return {"CFBundleName": "BundleRoot"}.
  • User-visible CLI/MCP output: the selected plist's values above.
  • Remaining proof gaps: not run on Windows.

Validation performed

  • npx vitest run tests/boundary/providers/native/nativePlistSelection.test.ts — 7 passed; the new test fails without the source change.
  • npx vitest run tests/boundary/cli/nativePlistSelectionFailureCli.test.ts tests/boundary/mcp/nativePlistDiagnosticsMcp.test.ts tests/acceptance/applications/appBundleEncodingCli.test.ts (after npm run build:cached) — 12 passed.
  • npx vitest run tests/boundary/providers/native/ tests/boundary/filesystem/ — 3585 passed, 3 failed; the same 3 (jsonOutputOwnership, productCatalog, setupSkill) fail on main without this change.
  • npx tsc -p . --noEmit — no errors.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS 26 arm64, real plutil.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: reading the file the path actually names; no new access.

Author readiness

Human owner:

  • 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/5612 **Author:** [@HawkForge](https://github.com/HawkForge) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/plist-relative-path-symlink` --- ### 📝 Commits (2) - [`dd5d21b`](https://github.com/morluto/rea/commit/dd5d21bf70d40afc1ea3365dd400374a7e9ba41f) fix(native): keep .. after directory symlinks in selected plist paths - [`993b72f`](https://github.com/morluto/rea/commit/993b72f32a88c715b4ac6e43f9745e9fd63d5647) Merge remote-tracking branch 'origin/main' into fix/plist-relative-path-symlink ### 📊 Changes **2 files changed** (+34 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/native/NativePlistSource.ts` (+8 -2) 📝 `tests/boundary/providers/native/nativePlistSelection.test.ts` (+26 -1) </details> ### 📄 Description ## Summary Fixes #5492. `inspect-plist --relative-path` read a different plist than the one the path names when the path has a directory symlink followed by `..`. Both the relative and the absolute form of `plists/contents/../Info.plist` returned `plists/Info.plist` (`Lexical`) instead of `Fixture.app/Info.plist` (`BundleRoot`), with exit 0. ## Problem and expected behavior `resolveNativePlistSelection()` built the selected path with `path.resolve()`, which collapses `link/..` as text. POSIX follows `link` first and then applies `..`, so the lexical result names another file. The selected path should name the same file the filesystem would open. ## Change and scope Use the existing `absoluteCallerPath()` (`src/filesystem/callerPath.ts`) for both the absolute and the app-root-relative selection. It makes the path absolute and keeps every `..` for the filesystem to resolve, like the other caller-selected paths already do. The default `Contents/Info.plist` path is unchanged. Not included: the sibling path issues in the same cluster (#5103, #5479). ## Contract and boundary impact - Semantic owner and earliest changed stage: `src/native/NativePlistSource.ts`, plist selection before any file is read. - Contribution scope fit and linked maintainer decision: ordinary fix within existing boundaries; not applicable. - CLI and MCP/tool-catalog contract: none. - Provider, bridge, target-format, or platform compatibility: POSIX selection now matches filesystem resolution; Windows already resolves `..` lexically and is unchanged (`absoluteCallerPath` handles both). - Evidence, artifact, provenance, or reconstruction contract: the reported plist path keeps the caller's `..` segments instead of a collapsed path that named another file. - Target selection, authority, upstream behavior, and cleanup details (if applicable): selection only. - Generated metadata, package, or installation impact: none. Expected effects: - [x] Read existing files or captured data. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/providers/native/nativePlistSelection.test.ts` adds a bundle with `plists/contents -> ../Contents` and checks that both the relative and absolute `plists/contents/../Info.plist` select and read `Fixture.app/Info.plist`. It fails on main and passes with this change. - Base reproduction or other evidence: replayed the issue's three CLI calls on the built CLI. With this change all three return `{"CFBundleName": "BundleRoot"}`. - User-visible CLI/MCP output: the selected plist's values above. - Remaining proof gaps: not run on Windows. ## Validation performed - `npx vitest run tests/boundary/providers/native/nativePlistSelection.test.ts` — 7 passed; the new test fails without the source change. - `npx vitest run tests/boundary/cli/nativePlistSelectionFailureCli.test.ts tests/boundary/mcp/nativePlistDiagnosticsMcp.test.ts tests/acceptance/applications/appBundleEncodingCli.test.ts` (after `npm run build:cached`) — 12 passed. - `npx vitest run tests/boundary/providers/native/ tests/boundary/filesystem/` — 3585 passed, 3 failed; the same 3 (`jsonOutputOwnership`, `productCatalog`, `setupSkill`) fail on main without this change. - `npx tsc -p . --noEmit` — no errors. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real Hopper/Ghidra, browser, or OS coverage: macOS 26 arm64, real `plutil`. - Package or release metadata impact: none. - Security, privacy, process, or containment review: reading the file the path actually names; no new access. ## Author readiness Human owner: <!-- @GitHub-handle --> - [ ] 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>
bsakaguchi 2026-11-01 21:44:35 +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#6995
No description provided.