[PR #7284] fix(cli): reject empty decompile-all targets #7809

Open
opened 2026-11-05 01:47:49 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7284
Author: @ducanhnguyen223
Created: 10/26/2026
Status: 🔄 Open

Base: main ← Head: codex/fix-7280-empty-target


📝 Commits (1)

  • e14bbfd fix(cli): reject empty decompile-all targets

📊 Changes

2 files changed (+71 additions, -2 deletions)

View changed files

📝 src/cli/decompileDirectoryCommand.ts (+1 -1)
📝 tests/boundary/cli/decompileAllCli.test.ts (+70 -1)

📄 Description

Summary

Fixes #7280 by rejecting an empty decompile-all target before resolving it against the working directory.

Problem and expected behavior

The CLI accepted "" as a target, which made path resolution select the current working directory. In the reported app-bundle case, REA analyzed the bundle executable and wrote pseudocode even though the caller supplied no path. Empty input should fail validation before resolution or export; an explicit . should continue to select the current directory.

Change and scope

Use the existing localPathStringSchema for the command's path argument. This rejects empty and NUL-containing local paths at the CLI boundary, before analysis or provider work. No provider, MCP, target-execution, or generated-metadata behavior changes.

Evidence and regression coverage

  • Added a compiled CLI-boundary regression with a synthetic app bundle and the offline fake Kuna provider.
  • The regression failed on the base revision: decompile-all "" exited successfully in the reproducing setup.
  • After the fix, the empty target returns VALIDATION_ERROR and leaves the output directory absent; the explicit . control still exports 0x1000.c.
  • Real providers and the packaged dispatcher were not exercised.

Validation performed

  • npm run test:focused -- tests/boundary/cli/decompileAllCli.test.ts — 2 tests passed.
  • npm run check:fast — typecheck and lint passed.
  • npm run format:check — passed.
  • Pre-push check:fast — passed.

Author readiness

Human owner: @ducanhnguyen223

  • 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/7284 **Author:** [@ducanhnguyen223](https://github.com/ducanhnguyen223) **Created:** 10/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/fix-7280-empty-target` --- ### 📝 Commits (1) - [`e14bbfd`](https://github.com/morluto/rea/commit/e14bbfdb624adeb9270c9b86a809a36a353f932e) fix(cli): reject empty decompile-all targets ### 📊 Changes **2 files changed** (+71 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/cli/decompileDirectoryCommand.ts` (+1 -1) 📝 `tests/boundary/cli/decompileAllCli.test.ts` (+70 -1) </details> ### 📄 Description ## Summary Fixes #7280 by rejecting an empty `decompile-all` target before resolving it against the working directory. ## Problem and expected behavior The CLI accepted `""` as a target, which made path resolution select the current working directory. In the reported app-bundle case, REA analyzed the bundle executable and wrote pseudocode even though the caller supplied no path. Empty input should fail validation before resolution or export; an explicit `.` should continue to select the current directory. ## Change and scope Use the existing `localPathStringSchema` for the command's `path` argument. This rejects empty and NUL-containing local paths at the CLI boundary, before analysis or provider work. No provider, MCP, target-execution, or generated-metadata behavior changes. ## Evidence and regression coverage - Added a compiled CLI-boundary regression with a synthetic app bundle and the offline fake Kuna provider. - The regression failed on the base revision: `decompile-all ""` exited successfully in the reproducing setup. - After the fix, the empty target returns `VALIDATION_ERROR` and leaves the output directory absent; the explicit `.` control still exports `0x1000.c`. - Real providers and the packaged dispatcher were not exercised. ## Validation performed - `npm run test:focused -- tests/boundary/cli/decompileAllCli.test.ts` — 2 tests passed. - `npm run check:fast` — typecheck and lint passed. - `npm run format:check` — passed. - Pre-push `check:fast` — passed. ## Author readiness Human owner: @ducanhnguyen223 - [ ] 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7809
No description provided.