[PR #792] [CLOSED] fix(reference): preserve unsupported import diagnostics #2244

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/792
Author: @kaoru0822-kitauji
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: fix/reference-source-unsupported


📝 Commits (1)

  • bcca659 fix(reference): preserve unsupported import diagnostics

📊 Changes

7 files changed (+64 additions, -4 deletions)

View changed files

📝 README.md (+4 -0)
📝 docs/user-visible-errors.csv (+1 -0)
📝 src/application/ReferenceSourceImport.ts (+4 -1)
📝 src/application/ReferenceSourceImportTypes.ts (+7 -1)
📝 src/cli/referenceSourceImportStatus.ts (+6 -1)
📝 src/cliReferenceSourceImportStatus.test.ts (+2 -1)
➕ tests/boundary/filesystem/referenceSourceUnsupportedHost.test.ts (+40 -0)

📄 Description

Summary

Preserve the reference reader's unsupported-host outcome instead of collapsing it into a generic I/O failure. A Windows-native import-reference-source request now returns the existing unsupported_provider category with actionable Linux/macOS and WSL guidance, while keeping the safe no-follow admission check intact.

Fixes #787.

Problem and expected behavior

The reader already reports code: "unsupported" when safe no-follow file opens are unavailable. The import workflow converted every non-cancelled reader failure to io, so the CLI told Windows users to change directory permissions even though permissions cannot supply the missing host capability.

The unsupported condition should stay distinct through the application and CLI boundary. Invalid roots, genuine I/O failures, cancellation, parser failures, and readable imports should retain their existing behavior.

Change and scope

  • Add unsupported to the typed import failure algebra.
  • Preserve the reader's unsupported code through importReferenceSource.
  • Project it as unsupported_provider with the supported-host/WSL recovery path.
  • Keep the CLI failure classifier nonzero for the new projection.
  • Document the Windows-native limitation at the import command and in the user-visible error inventory.
  • Add an injected reader seam so the real application workflow can be tested deterministically without weakening filesystem admission.

This does not enable unchecked Windows reads or change traversal, symlink, exclusion, parsing, Evidence, or source-to-bundle semantics. PR #770 concerns failures for individual entries after traversal begins; this change covers the top-level host capability rejection before traversal.

Evidence and regression coverage

  • Baseline regression: the new application-boundary test failed because the injected unsupported reader result became code: "io".
  • After the fix, the same test proves the typed code and public recovery projection are retained.
  • Existing import behavior and CLI failure-classification suites pass alongside the regression: 53 tests.
  • Material unverified coverage: no real packaged Windows execution or WSL filesystem workflow was run in this environment. The regression exercises the production import/projection path through its reader seam.

Validation performed

  • vitest run tests/boundary/filesystem/referenceSourceUnsupportedHost.test.ts tests/boundary/filesystem/referenceSourceImport.test.ts src/cliReferenceSourceImportStatus.test.ts --coverage.enabled=false — 53 passed.
  • npm exec --package=typescript@5.9.3 -- tsc --noEmit — passed.
  • Changed-file lint with --deny-warnings — passed.
  • Changed-file oxfmt --check — passed.
  • npm run knip — passed.
  • npm run metadata:check — passed.
  • Stable-TypeScript build followed by npm run docs:check:built — passed.
  • git diff --check — passed.
  • The repository-native npm run check and npm run test:focused cannot start their TypeScript 7 build in this container because /proc/self/exe is unavailable; the stable compiler and direct Vitest commands above passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none.
  • CLI grammar, MCP contracts, generated catalogs, and package contents: unchanged.
  • Security: safe no-follow admission remains fail-closed; the fix changes only failure preservation and recovery guidance.
  • AI-assisted implementation and tests; I reviewed the final diff and validation output.

🔄 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/792 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/reference-source-unsupported` --- ### 📝 Commits (1) - [`bcca659`](https://github.com/morluto/rea/commit/bcca659dddf1f2c797f41cd0b59f8c5f825b8114) fix(reference): preserve unsupported import diagnostics ### 📊 Changes **7 files changed** (+64 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+4 -0) 📝 `docs/user-visible-errors.csv` (+1 -0) 📝 `src/application/ReferenceSourceImport.ts` (+4 -1) 📝 `src/application/ReferenceSourceImportTypes.ts` (+7 -1) 📝 `src/cli/referenceSourceImportStatus.ts` (+6 -1) 📝 `src/cliReferenceSourceImportStatus.test.ts` (+2 -1) ➕ `tests/boundary/filesystem/referenceSourceUnsupportedHost.test.ts` (+40 -0) </details> ### 📄 Description ## Summary Preserve the reference reader's unsupported-host outcome instead of collapsing it into a generic I/O failure. A Windows-native `import-reference-source` request now returns the existing `unsupported_provider` category with actionable Linux/macOS and WSL guidance, while keeping the safe no-follow admission check intact. Fixes #787. ## Problem and expected behavior The reader already reports `code: "unsupported"` when safe no-follow file opens are unavailable. The import workflow converted every non-cancelled reader failure to `io`, so the CLI told Windows users to change directory permissions even though permissions cannot supply the missing host capability. The unsupported condition should stay distinct through the application and CLI boundary. Invalid roots, genuine I/O failures, cancellation, parser failures, and readable imports should retain their existing behavior. ## Change and scope - Add `unsupported` to the typed import failure algebra. - Preserve the reader's unsupported code through `importReferenceSource`. - Project it as `unsupported_provider` with the supported-host/WSL recovery path. - Keep the CLI failure classifier nonzero for the new projection. - Document the Windows-native limitation at the import command and in the user-visible error inventory. - Add an injected reader seam so the real application workflow can be tested deterministically without weakening filesystem admission. This does not enable unchecked Windows reads or change traversal, symlink, exclusion, parsing, Evidence, or source-to-bundle semantics. PR #770 concerns failures for individual entries after traversal begins; this change covers the top-level host capability rejection before traversal. ## Evidence and regression coverage - Baseline regression: the new application-boundary test failed because the injected `unsupported` reader result became `code: "io"`. - After the fix, the same test proves the typed code and public recovery projection are retained. - Existing import behavior and CLI failure-classification suites pass alongside the regression: 53 tests. - Material unverified coverage: no real packaged Windows execution or WSL filesystem workflow was run in this environment. The regression exercises the production import/projection path through its reader seam. ## Validation performed - `vitest run tests/boundary/filesystem/referenceSourceUnsupportedHost.test.ts tests/boundary/filesystem/referenceSourceImport.test.ts src/cliReferenceSourceImportStatus.test.ts --coverage.enabled=false` — 53 passed. - `npm exec --package=typescript@5.9.3 -- tsc --noEmit` — passed. - Changed-file lint with `--deny-warnings` — passed. - Changed-file `oxfmt --check` — passed. - `npm run knip` — passed. - `npm run metadata:check` — passed. - Stable-TypeScript build followed by `npm run docs:check:built` — passed. - `git diff --check` — passed. - The repository-native `npm run check` and `npm run test:focused` cannot start their TypeScript 7 build in this container because `/proc/self/exe` is unavailable; the stable compiler and direct Vitest commands above passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none. - CLI grammar, MCP contracts, generated catalogs, and package contents: unchanged. - Security: safe no-follow admission remains fail-closed; the fix changes only failure preservation and recovery guidance. - AI-assisted implementation and tests; I reviewed the final diff and validation output. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-16 21:16:10 +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#2244
No description provided.