[PR #795] [MERGED] fix(cli): preserve unsupported historical-source imports #2245

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/795
Author: @N0zoM1z0
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/6/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/787-reference-import-host-diagnostic


📝 Commits (1)

  • cae3369 fix(cli): preserve unsupported historical-source imports

📊 Changes

8 files changed (+85 additions, -5 deletions)

View changed files

📝 .github/workflows/ci.yml (+2 -0)
📝 README.md (+5 -0)
📝 src/application/ReferenceSourceImport.ts (+2 -0)
📝 src/application/ReferenceSourceImportTypes.ts (+7 -1)
📝 src/cli/referenceSourceImportStatus.ts (+6 -1)
📝 src/cliReferenceSourceImportStatus.test.ts (+2 -1)
📝 tests/boundary/cli/referenceSourceImportStatus.test.ts (+57 -1)
📝 tests/boundary/filesystem/referenceSourceImport.test.ts (+4 -1)

📄 Description

Summary

Fixes #787. Importing readable historical source on native Windows now reports unsupported_host with the actual no-follow constraint and a supported-host workflow, instead of telling users to change permissions. The CLI still exits with status 1 and logs the operation as failed.

Problem and expected behavior

The reader correctly refuses hosts without safe no-follow file opens, but the application collapsed that outcome into I/O. Preserve the reason through application, CLI presentation, failure classification, and command logging.

{
  "error": "Import failed",
  "category": "unsupported_host",
  "message": "Safe no-follow file opens are unavailable on this host. Import the source tree with REA on Linux (including WSL) or macOS."
}

Change and scope

  • Retain the reader's unsupported error in the import result and provide actionable host-specific recovery.
  • Recognize the new CLI category so JSON and legacy full-output forms retain failure exit/log status.
  • Document the current historical-source host boundary.
  • Add real compiled Windows CLI regressions and run them, plus failure/logging unit tests, in the existing Windows lane. Existing invalid-root controls remain distinct.

Contract and boundary impact

  • Semantic owner and earliest changed stage: application mapping of the reference-source reader failure.
  • CLI and MCP/tool-catalog contract: CLI import gains unsupported_host; no import MCP tool or catalog/schema change.
  • Provider, bridge, target-format, or platform compatibility: no Windows source-reader enablement or provider changes.
  • Evidence, artifact, provenance, or reconstruction contract: successful imports and source bytes unchanged.
  • Process execution, authorization, cleanup, or containment impact: no new permission field; no-follow refusal retained.
  • Generated metadata, package, or installation impact: none.

Evidence and regression coverage

  • Before-fix real Windows packaged CLI returned permission advice for a readable source directory; the reader reported unsupported.
  • New tests cover classification, failure logging/exit status, actual compiled Windows CLI JSON/full-output forms with logging on/off, input preservation, and existing missing/non-directory roots.
  • Remaining proof gaps: native Windows historical-source reading remains unavailable; this change corrects its diagnosis. No real Hopper/Ghidra execution was performed for this diagnostic-only batch.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run build:cached — passed.
  • npm run test:focused -- src/cliReferenceSourceImportStatus.test.ts tests/boundary/filesystem/referenceSourceImport.test.ts tests/boundary/cli/referenceSourceImportStatus.test.ts tests/process-global/curatedWindowsLane.test.ts — 61 passed; four Windows-only cases skipped on Linux.
  • npm run check:fast, npm run docs:check, formatting and git diff --check — passed.
  • npm pack --json --pack-destination <isolated-directory> and isolated Windows-native production installation — passed.
  • Ordinary-user Windows production application/CLI acceptance — reader reason preserved, four JSON/full-output/logging combinations returned the expected category and exit 1, invalid roots retained invalid_input, source unchanged, owned temporary source cleaned.

Compatibility, safety, and release

  • Breaking changes or migration steps: consumers of this previously misclassified unsupported outcome should recognize unsupported_host; output shape unchanged.
  • Real Hopper/Ghidra, browser, or OS coverage: real Windows x64 production CLI and import workflow; Linux successful-import regressions. No provider execution needed.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: safe-reader admission unchanged; raw internal messages are not substituted into public projection; no ambient environment persisted or global configuration changed.

Review checklist

  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning documentation and Windows verification lane updated; generated metadata unchanged.
  • Concrete sanitized CLI output included.
  • Final diff checked for credentials, private paths, 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/795 **Author:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/787-reference-import-host-diagnostic` --- ### 📝 Commits (1) - [`cae3369`](https://github.com/morluto/rea/commit/cae336954f5ae086e5f3b5623d4512fe54e77c7e) fix(cli): preserve unsupported historical-source imports ### 📊 Changes **8 files changed** (+85 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `.github/workflows/ci.yml` (+2 -0) 📝 `README.md` (+5 -0) 📝 `src/application/ReferenceSourceImport.ts` (+2 -0) 📝 `src/application/ReferenceSourceImportTypes.ts` (+7 -1) 📝 `src/cli/referenceSourceImportStatus.ts` (+6 -1) 📝 `src/cliReferenceSourceImportStatus.test.ts` (+2 -1) 📝 `tests/boundary/cli/referenceSourceImportStatus.test.ts` (+57 -1) 📝 `tests/boundary/filesystem/referenceSourceImport.test.ts` (+4 -1) </details> ### 📄 Description ## Summary Fixes #787. Importing readable historical source on native Windows now reports `unsupported_host` with the actual no-follow constraint and a supported-host workflow, instead of telling users to change permissions. The CLI still exits with status 1 and logs the operation as failed. ## Problem and expected behavior The reader correctly refuses hosts without safe no-follow file opens, but the application collapsed that outcome into I/O. Preserve the reason through application, CLI presentation, failure classification, and command logging. ```json { "error": "Import failed", "category": "unsupported_host", "message": "Safe no-follow file opens are unavailable on this host. Import the source tree with REA on Linux (including WSL) or macOS." } ``` ## Change and scope - Retain the reader's unsupported error in the import result and provide actionable host-specific recovery. - Recognize the new CLI category so JSON and legacy full-output forms retain failure exit/log status. - Document the current historical-source host boundary. - Add real compiled Windows CLI regressions and run them, plus failure/logging unit tests, in the existing Windows lane. Existing invalid-root controls remain distinct. ## Contract and boundary impact - Semantic owner and earliest changed stage: application mapping of the reference-source reader failure. - CLI and MCP/tool-catalog contract: CLI import gains `unsupported_host`; no import MCP tool or catalog/schema change. - Provider, bridge, target-format, or platform compatibility: no Windows source-reader enablement or provider changes. - Evidence, artifact, provenance, or reconstruction contract: successful imports and source bytes unchanged. - Process execution, authorization, cleanup, or containment impact: no new permission field; no-follow refusal retained. - Generated metadata, package, or installation impact: none. ## Evidence and regression coverage - Before-fix real Windows packaged CLI returned permission advice for a readable source directory; the reader reported unsupported. - New tests cover classification, failure logging/exit status, actual compiled Windows CLI JSON/full-output forms with logging on/off, input preservation, and existing missing/non-directory roots. - Remaining proof gaps: native Windows historical-source reading remains unavailable; this change corrects its diagnosis. No real Hopper/Ghidra execution was performed for this diagnostic-only batch. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run build:cached` — passed. - `npm run test:focused -- src/cliReferenceSourceImportStatus.test.ts tests/boundary/filesystem/referenceSourceImport.test.ts tests/boundary/cli/referenceSourceImportStatus.test.ts tests/process-global/curatedWindowsLane.test.ts` — 61 passed; four Windows-only cases skipped on Linux. - `npm run check:fast`, `npm run docs:check`, formatting and `git diff --check` — passed. - `npm pack --json --pack-destination <isolated-directory>` and isolated Windows-native production installation — passed. - Ordinary-user Windows production application/CLI acceptance — reader reason preserved, four JSON/full-output/logging combinations returned the expected category and exit 1, invalid roots retained `invalid_input`, source unchanged, owned temporary source cleaned. ## Compatibility, safety, and release - Breaking changes or migration steps: consumers of this previously misclassified unsupported outcome should recognize `unsupported_host`; output shape unchanged. - Real Hopper/Ghidra, browser, or OS coverage: real Windows x64 production CLI and import workflow; Linux successful-import regressions. No provider execution needed. - Package or release metadata impact: none. - Security, privacy, process, or containment review: safe-reader admission unchanged; raw internal messages are not substituted into public projection; no ambient environment persisted or global configuration changed. ## Review checklist - [x] The PR has one focused outcome and the title follows `type(scope): outcome`. - [x] Related issue is linked. - [x] Tests cover changed observable behavior and meaningful failure paths. - [x] Owning documentation and Windows verification lane updated; generated metadata unchanged. - [x] Concrete sanitized CLI output included. - [x] Final diff checked for credentials, private paths, 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-16 21:16:13 +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#2245
No description provided.