[PR #7464] fix(cli): reject empty native-call targets #7853

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

📋 Pull Request Information

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

Base: main ← Head: codex/fix-7448-observe-empty-target


📝 Commits (1)

  • b61e5d6 fix(cli): reject empty native-call targets

📊 Changes

2 files changed (+41 additions, -1 deletions)

View changed files

📝 src/cli/nativeCallCommands.ts (+2 -1)
➕ tests/boundary/cli/nativeCallTargetAdmission.test.ts (+39 -0)

📄 Description

Summary

Fixes #7448. Reject an empty observe-native-calls target at CLI argument validation so it cannot be normalized to the current directory. Reuses REA's shared nonempty, NUL-free local-path schema; an explicit . remains valid.

This is an AI-assisted draft. The human PR owner is @ducanhnguyen223; the author-readiness declarations below are intentionally unchecked pending human review.

Problem and expected behavior

The issue reports that an empty target can resolve to the working directory and, when that is an app bundle, launch its executable under LLDB. On the unmodified base, a local compiled-CLI call with an empty target and invalid observation JSON reached domain validation (invalid_request, missing breakpoints) instead of failing at the path boundary. That request did not launch a process. The fix should reject the empty path before the handler; explicit . must continue to mean the caller-selected working directory.

Change and scope

Use localPathStringSchema for the CLI's path argument. This is a focused correction to the existing command boundary; valid nonempty target execution and the MCP contract are unchanged. It adds no provider or capability and requires no separate maintainer scope decision.

Follow the contribution scope. This does not change target authority for valid invocations.

Contract and boundary impact

  • Semantic owner and earliest changed stage: observe-native-calls CLI argument schema, before its handler or target resolution.
  • Contribution scope fit and linked maintainer decision: ordinary input-validation fix within existing behavior; no new capability or separate scope decision.
  • CLI and MCP/tool-catalog contract: CLI rejects empty path; explicit . is accepted. MCP is unchanged.
  • Provider, bridge, target-format, or platform compatibility: no provider-specific changes.
  • Evidence, artifact, provenance, or reconstruction contract: none.
  • Target selection, authority, upstream behavior, and cleanup: valid invocations still use the existing owned LLDB workflow; an empty selection is now rejected before target resolution or launch.
  • Generated metadata, package, or installation impact: none.

Expected effects:

  • Launch or attach to a process (existing valid-input behavior is unchanged; the reported unintended empty-path launch is prevented).

Evidence and regression coverage

  • Tests added or updated: tests/boundary/cli/nativeCallTargetAdmission.test.ts exercises the public compiled CLI, asserts an empty target yields VALIDATION_ERROR on path with too_small, and confirms . advances to observation-input validation without launching LLDB.
  • Base reproduction or other evidence: before the fix, an empty target passed CLI parsing and reached domain validation; the regression failed because it did not receive the path error. The issue's supplied synthetic-app reproduction reports the target-launch case; this PR did not independently run that LLDB reproduction.
  • User-visible CLI output: after the fix, observe-native-calls "" "{}" --json returns VALIDATION_ERROR with fieldErrors.path / too_small. The explicit . control reaches the expected breakpoints validation error.
  • Remaining proof gaps: no independent valid-target LLDB run; no MCP change is proposed.

Validation performed

  • fnm exec --using=24.22.1 npm run test:focused -- tests/boundary/cli/nativeCallTargetAdmission.test.ts — 1 test passed.
  • fnm exec --using=24.22.1 npm run check:fast — typecheck and lint tasks passed.
  • fnm exec --using=24.22.1 npm exec -- oxfmt -- --check src/cli/nativeCallCommands.ts tests/boundary/cli/nativeCallTargetAdmission.test.ts — passed.
  • git diff --check — passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none intended; an empty target is invalid input, while explicit . remains supported.
  • Real Hopper/Ghidra, browser, or OS coverage: not applicable to the CLI admission check; LLDB was not run.
  • Package or release metadata impact: none.
  • Security, privacy, process, or containment review: no new execution authority; the change prevents the empty-path case from selecting and launching an unintended working-directory target.

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/7464 **Author:** [@ducanhnguyen223](https://github.com/ducanhnguyen223) **Created:** 10/27/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/fix-7448-observe-empty-target` --- ### 📝 Commits (1) - [`b61e5d6`](https://github.com/morluto/rea/commit/b61e5d6970964a0e7257e2519eab581445a566be) fix(cli): reject empty native-call targets ### 📊 Changes **2 files changed** (+41 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/cli/nativeCallCommands.ts` (+2 -1) ➕ `tests/boundary/cli/nativeCallTargetAdmission.test.ts` (+39 -0) </details> ### 📄 Description ## Summary Fixes [#7448](https://github.com/morluto/rea/issues/7448). Reject an empty `observe-native-calls` target at CLI argument validation so it cannot be normalized to the current directory. Reuses REA's shared nonempty, NUL-free local-path schema; an explicit `.` remains valid. This is an AI-assisted draft. The human PR owner is `@ducanhnguyen223`; the author-readiness declarations below are intentionally unchecked pending human review. ## Problem and expected behavior The issue reports that an empty target can resolve to the working directory and, when that is an app bundle, launch its executable under LLDB. On the unmodified base, a local compiled-CLI call with an empty target and invalid observation JSON reached domain validation (`invalid_request`, missing `breakpoints`) instead of failing at the path boundary. That request did not launch a process. The fix should reject the empty path before the handler; explicit `.` must continue to mean the caller-selected working directory. ## Change and scope Use `localPathStringSchema` for the CLI's `path` argument. This is a focused correction to the existing command boundary; valid nonempty target execution and the MCP contract are unchanged. It adds no provider or capability and requires no separate maintainer scope decision. Follow the [contribution scope](https://github.com/morluto/rea/blob/main/CONTRIBUTING.md#contribution-scope). This does not change target authority for valid invocations. ## Contract and boundary impact - Semantic owner and earliest changed stage: `observe-native-calls` CLI argument schema, before its handler or target resolution. - Contribution scope fit and linked maintainer decision: ordinary input-validation fix within existing behavior; no new capability or separate scope decision. - CLI and MCP/tool-catalog contract: CLI rejects empty `path`; explicit `.` is accepted. MCP is unchanged. - Provider, bridge, target-format, or platform compatibility: no provider-specific changes. - Evidence, artifact, provenance, or reconstruction contract: none. - Target selection, authority, upstream behavior, and cleanup: valid invocations still use the existing owned LLDB workflow; an empty selection is now rejected before target resolution or launch. - Generated metadata, package, or installation impact: none. Expected effects: - [x] Launch or attach to a process (existing valid-input behavior is unchanged; the reported unintended empty-path launch is prevented). ## Evidence and regression coverage - Tests added or updated: `tests/boundary/cli/nativeCallTargetAdmission.test.ts` exercises the public compiled CLI, asserts an empty target yields `VALIDATION_ERROR` on `path` with `too_small`, and confirms `.` advances to observation-input validation without launching LLDB. - Base reproduction or other evidence: before the fix, an empty target passed CLI parsing and reached domain validation; the regression failed because it did not receive the path error. The issue's supplied synthetic-app reproduction reports the target-launch case; this PR did not independently run that LLDB reproduction. - User-visible CLI output: after the fix, `observe-native-calls "" "{}" --json` returns `VALIDATION_ERROR` with `fieldErrors.path` / `too_small`. The explicit `.` control reaches the expected `breakpoints` validation error. - Remaining proof gaps: no independent valid-target LLDB run; no MCP change is proposed. ## Validation performed - `fnm exec --using=24.22.1 npm run test:focused -- tests/boundary/cli/nativeCallTargetAdmission.test.ts` — 1 test passed. - `fnm exec --using=24.22.1 npm run check:fast` — typecheck and lint tasks passed. - `fnm exec --using=24.22.1 npm exec -- oxfmt -- --check src/cli/nativeCallCommands.ts tests/boundary/cli/nativeCallTargetAdmission.test.ts` — passed. - `git diff --check` — passed. ## Compatibility, safety, and release - Breaking changes or migration steps: none intended; an empty target is invalid input, while explicit `.` remains supported. - Real Hopper/Ghidra, browser, or OS coverage: not applicable to the CLI admission check; LLDB was not run. - Package or release metadata impact: none. - Security, privacy, process, or containment review: no new execution authority; the change prevents the empty-path case from selecting and launching an unintended working-directory target. ## 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#7853
No description provided.