[PR #5367] [CLOSED] fix(cli): preserve caller-selected paths in JSON inputs #6901

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

📋 Pull Request Information

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

Base: main ← Head: fix/cli-json-caller-paths


📝 Commits (1)

  • 2cc8852 fix(cli): preserve caller-selected paths in JSON inputs

📊 Changes

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

View changed files

📝 src/cliJsonInput.ts (+2 -2)
📝 tests/boundary/cli/callerPathSymlinkParentCli.test.ts (+81 -1)

📄 Description

Summary

CLI JSON paths can silently select the wrong Evidence file. Reuse absoluteCallerPath. Related #5103, including earlier work on this helper.

Problem and expected behavior

Save different valid Evidence records as real/evidence.json and evidence.json. Create real/inner and a directory symlink link pointing to it. Run from their parent:

rea inspect-analysis-view '{"source":{"kind":"evidence-file","path":"link/../evidence.json"},"view":{"kind":"summary"}}' --json

Main reads the sibling with exit 0. Fixed reads real/evidence.json, matching filesystem traversal.

Change and scope

One import and one call change, plus CLI regressions. Ordinary fix; advance scope approval is not applicable.

Contract and boundary impact

  • Owner: resolveCliJsonPaths, before filesystem admission.
  • Schemas, metadata and execution authority: unchanged.
  • Evidence: preserve selected parent identity and links.
  • Windows: retain native resolution.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process through existing scenario workflows.

Evidence and regression coverage

Four new CLI cases fail on main and pass with the fix: selected parent identity, directory suffixes and missing components. Existing blank/URL controls pass.

Manual CLI checks pass with generated application Evidence. Four Electron path variants reach a finite launcher that exits 77; missing/blank/URL inputs refuse before launch.

Validation performed

Linux x64, Node 24.18.0, npm 11.16.0:

  • npm run test:focused with nine affected files: 92 passed.
  • npm run check: passed.
  • git diff --check: passed.

Compatibility, safety, and release

Windows/macOS, full Electron/browser captures and the full suite are unverified. Browser launch has a separate later lexical resolution, unchanged here.

Author readiness

Human owner: @x1mm4nu3l

  • 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/5367 **Author:** [@x1mm4nu3l](https://github.com/x1mm4nu3l) **Created:** 10/20/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/cli-json-caller-paths` --- ### 📝 Commits (1) - [`2cc8852`](https://github.com/morluto/rea/commit/2cc885249155e8e96d474b104259b23525e7facb) fix(cli): preserve caller-selected paths in JSON inputs ### 📊 Changes **2 files changed** (+83 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/cliJsonInput.ts` (+2 -2) 📝 `tests/boundary/cli/callerPathSymlinkParentCli.test.ts` (+81 -1) </details> ### 📄 Description ## Summary CLI JSON paths can silently select the wrong Evidence file. Reuse `absoluteCallerPath`. Related #5103, including earlier work on this helper. ## Problem and expected behavior Save different valid Evidence records as `real/evidence.json` and `evidence.json`. Create `real/inner` and a directory symlink `link` pointing to it. Run from their parent: ```sh rea inspect-analysis-view '{"source":{"kind":"evidence-file","path":"link/../evidence.json"},"view":{"kind":"summary"}}' --json ``` Main reads the sibling with exit 0. Fixed reads `real/evidence.json`, matching filesystem traversal. ## Change and scope One import and one call change, plus CLI regressions. Ordinary fix; advance scope approval is not applicable. ## Contract and boundary impact - Owner: `resolveCliJsonPaths`, before filesystem admission. - Schemas, metadata and execution authority: unchanged. - Evidence: preserve selected parent identity and links. - Windows: retain native resolution. Expected effects: - [x] Read existing files or captured data. - [x] Launch or attach to a process through existing scenario workflows. ## Evidence and regression coverage Four new CLI cases fail on main and pass with the fix: selected parent identity, directory suffixes and missing components. Existing blank/URL controls pass. Manual CLI checks pass with generated application Evidence. Four Electron path variants reach a finite launcher that exits 77; missing/blank/URL inputs refuse before launch. ## Validation performed Linux x64, Node 24.18.0, npm 11.16.0: - `npm run test:focused` with nine affected files: 92 passed. - `npm run check`: passed. - `git diff --check`: passed. ## Compatibility, safety, and release Windows/macOS, full Electron/browser captures and the full suite are unverified. Browser launch has a separate later lexical resolution, unchanged here. ## Author readiness Human owner: @x1mm4nu3l - [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] This PR addresses a concrete problem or an agreed enhancement. - [x] Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff. - [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-11-01 21:43:56 +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#6901
No description provided.