[PR #3498] [CLOSED] fix(reference): preserve root permission failures #5781

Closed
opened 2026-10-31 01:09:24 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3498
Author: @zpf2234
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/reference-root-permission-diagnostic


📝 Commits (2)

  • 3f8fc42 fix(reference): preserve root permission failures
  • fa8bd60 test(reference): assert root path in permission failures

📊 Changes

2 files changed (+33 additions, -0 deletions)

View changed files

📝 src/reference/ReferenceSourceReaderEntries.ts (+1 -0)
📝 tests/boundary/filesystem/referenceSourceFailureDetails.test.ts (+32 -0)

📄 Description

Summary

Fixes #3401. When the selected reference-source root can be resolved but cannot be enumerated, the reader currently projects the root as .. That path violates the graph contract and replaces the original permission diagnostic with a normalization error.

Problem and expected behavior

A root directory read failure has no valid relative entry path. It should remain a reader error, retaining the operating-system message and selected path, instead of becoming a synthetic graph entry.

Change and scope

The traversal now returns the existing I/O failure directly when the failed directory is the selected root. Child-directory failures keep their existing partial-entry behavior. The regression test covers the root permission case on hosts that support permission checks.

Contract and boundary impact

  • Semantic owner and earliest changed stage: reference-source directory traversal.
  • Contribution scope fit and linked maintainer decision: ordinary error-preservation fix; no additional decision required.
  • CLI and MCP/tool-catalog contract: no schema or catalog change.
  • Provider, bridge, target-format, or platform compatibility: platform-specific permission test; no provider change.
  • Evidence, artifact, provenance, or reconstruction contract: retains the original filesystem failure rather than inventing a path.
  • Target selection, authority, upstream behavior, and cleanup details: no target execution or mutation.
  • Generated metadata or package impact: none.

Evidence and regression coverage

  • Tests added or updated: tests/boundary/filesystem/referenceSourceFailureDetails.test.ts covers a searchable but non-enumerable root.
  • Base reproduction or other evidence: issue #3401 reports the . normalization failure and loss of EACCES.
  • Remaining proof gaps: permission cases are skipped on Windows; the existing readable-control case in the focused boundary file cannot run here because Windows lacks the repository's required O_NOFOLLOW support.

Validation performed

  • npm run check:fast — typecheck and lint passed.
  • npm run test:focused -- tests/boundary/filesystem/referenceSourceFailureDetails.test.ts — permission cases skipped on Windows; the pre-existing readable-control case failed with Safe no-follow file opens are unavailable.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • Real provider or OS coverage: Linux/macOS permission behavior remains to be run on a host with O_NOFOLLOW and non-root permissions.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new access or execution; the change preserves the existing fail-closed traversal path.

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.
  • 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/3498 **Author:** [@zpf2234](https://github.com/zpf2234) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/reference-root-permission-diagnostic` --- ### 📝 Commits (2) - [`3f8fc42`](https://github.com/morluto/rea/commit/3f8fc425a9ea9f8f702eef5c2d6af484045d9ffd) fix(reference): preserve root permission failures - [`fa8bd60`](https://github.com/morluto/rea/commit/fa8bd60581a0e57d5b2c9118310f5297bcf25614) test(reference): assert root path in permission failures ### 📊 Changes **2 files changed** (+33 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/reference/ReferenceSourceReaderEntries.ts` (+1 -0) 📝 `tests/boundary/filesystem/referenceSourceFailureDetails.test.ts` (+32 -0) </details> ### 📄 Description ## Summary Fixes #3401. When the selected reference-source root can be resolved but cannot be enumerated, the reader currently projects the root as `.`. That path violates the graph contract and replaces the original permission diagnostic with a normalization error. ## Problem and expected behavior A root directory read failure has no valid relative entry path. It should remain a reader error, retaining the operating-system message and selected path, instead of becoming a synthetic graph entry. ## Change and scope The traversal now returns the existing I/O failure directly when the failed directory is the selected root. Child-directory failures keep their existing partial-entry behavior. The regression test covers the root permission case on hosts that support permission checks. ## Contract and boundary impact - Semantic owner and earliest changed stage: reference-source directory traversal. - Contribution scope fit and linked maintainer decision: ordinary error-preservation fix; no additional decision required. - CLI and MCP/tool-catalog contract: no schema or catalog change. - Provider, bridge, target-format, or platform compatibility: platform-specific permission test; no provider change. - Evidence, artifact, provenance, or reconstruction contract: retains the original filesystem failure rather than inventing a path. - Target selection, authority, upstream behavior, and cleanup details: no target execution or mutation. - Generated metadata or package impact: none. ## Evidence and regression coverage - Tests added or updated: `tests/boundary/filesystem/referenceSourceFailureDetails.test.ts` covers a searchable but non-enumerable root. - Base reproduction or other evidence: issue #3401 reports the `.` normalization failure and loss of `EACCES`. - Remaining proof gaps: permission cases are skipped on Windows; the existing readable-control case in the focused boundary file cannot run here because Windows lacks the repository's required `O_NOFOLLOW` support. ## Validation performed - `npm run check:fast` — typecheck and lint passed. - `npm run test:focused -- tests/boundary/filesystem/referenceSourceFailureDetails.test.ts` — permission cases skipped on Windows; the pre-existing readable-control case failed with `Safe no-follow file opens are unavailable`. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - Real provider or OS coverage: Linux/macOS permission behavior remains to be run on a host with `O_NOFOLLOW` and non-root permissions. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no new access or execution; the change preserves the existing fail-closed traversal path. ## 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`. - [ ] 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-10-31 01:09:24 +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#5781
No description provided.