[PR #2687] [MERGED] fix(cli): reject empty analyze and artifact target paths #5313

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2687
Author: @chqcjq
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @morluto

Base: main ← Head: fix/cli-reject-empty-target-path


📝 Commits (3)

  • 367bb3b fix(cli): reject empty analyze and artifact target paths
  • edc40d2 Merge remote-tracking branch 'origin/main' into fix/cli-reject-empty-target-path
  • d9ce34a chore(ci): merge upstream baseline fixes

📊 Changes

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

View changed files

📝 src/cli/artifactCommands.ts (+1 -1)
📝 src/cli/coreBinaryCommands.ts (+4 -1)
➕ tests/acceptance/emptyTargetPathCli.test.ts (+35 -0)

📄 Description

An explicitly empty target passed to analyze or inspect-artifact currently reaches path resolution, which substitutes the working directory. In an empty working directory both commands then report target_unavailable with directory_requires_file, describing a directory the caller did not select.

Require at least one character in these two CLI target arguments before routing or provider admission. Empty arguments now produce the CLI parser’s VALIDATION_ERROR; explicit . retains its existing behavior. No whitespace trimming or filesystem-name normalization is added.

Validation on Windows x64 with Node 24.18.0:

  • Before the change: both compiled CLI empty-target regressions fail with target_unavailable; the explicit-directory control passes.
  • After the change: 7 tests pass across emptyTargetPathCli.test.ts and cliInputSchemaRequired.test.ts, including compiled CLI invocations and advertised-schema checks.
  • npm run check, npm run docs:check, and npm run verify:test-discovery pass (1,038 test files discovered).

Scope is the two CLI entrypoints named above. No native analysis engine was required or exercised.


🔄 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/2687 **Author:** [@chqcjq](https://github.com/chqcjq) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/cli-reject-empty-target-path` --- ### 📝 Commits (3) - [`367bb3b`](https://github.com/morluto/rea/commit/367bb3b5a447023ec4fff55fdc1bda977ffd2914) fix(cli): reject empty analyze and artifact target paths - [`edc40d2`](https://github.com/morluto/rea/commit/edc40d2866a9ae8becfb864e3271b3cd5dd3a513) Merge remote-tracking branch 'origin/main' into fix/cli-reject-empty-target-path - [`d9ce34a`](https://github.com/morluto/rea/commit/d9ce34a587b55d4ac663de66861dbf09876ea141) chore(ci): merge upstream baseline fixes ### 📊 Changes **3 files changed** (+40 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/cli/artifactCommands.ts` (+1 -1) 📝 `src/cli/coreBinaryCommands.ts` (+4 -1) ➕ `tests/acceptance/emptyTargetPathCli.test.ts` (+35 -0) </details> ### 📄 Description An explicitly empty target passed to `analyze` or `inspect-artifact` currently reaches path resolution, which substitutes the working directory. In an empty working directory both commands then report `target_unavailable` with `directory_requires_file`, describing a directory the caller did not select. Require at least one character in these two CLI target arguments before routing or provider admission. Empty arguments now produce the CLI parser’s `VALIDATION_ERROR`; explicit `.` retains its existing behavior. No whitespace trimming or filesystem-name normalization is added. Validation on Windows x64 with Node 24.18.0: - Before the change: both compiled CLI empty-target regressions fail with `target_unavailable`; the explicit-directory control passes. - After the change: 7 tests pass across `emptyTargetPathCli.test.ts` and `cliInputSchemaRequired.test.ts`, including compiled CLI invocations and advertised-schema checks. - `npm run check`, `npm run docs:check`, and `npm run verify:test-discovery` pass (1,038 test files discovered). Scope is the two CLI entrypoints named above. No native analysis engine was required or exercised. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:05:39 +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#5313
No description provided.