Repository navigation
fix(cli): reject empty native-call targets - #7464
ducanhnguyen223 wants to merge 1 commit into
Conversation
[Medium impact] The code appears safe to merge; no actionable issue was found. Summary
Reviews (1) · Last reviewed commit: "fix(cli): reject empty native-call targe..." · Reviewed by Greptile |
|
TL;DR: The new test passes on Node 22.23.4, 24.22.1 and 26.12.1 at draft head b61e5d6. With the old
The failing test in the red run is CI on b61e5d6: CI and The head is 733 commits behind main b81da90. GitHub says the PR is mergeable, and its merge state is blocked. Not run
Test setup
Commandsnpm ci --offline
npm run test:prepare
xvfb-run -a npm run test:focused -- tests/boundary/cli/nativeCallTargetAdmission.test.ts🤖 Written and tested with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
|
Thank you for this fix. The same change is on main: #9465 (25d3c72) makes |
Summary
Fixes #7448. Reject an empty
observe-native-callstarget 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, missingbreakpoints) 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
localPathStringSchemafor the CLI'spathargument. 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
observe-native-callsCLI argument schema, before its handler or target resolution.path; explicit.is accepted. MCP is unchanged.Expected effects:
Evidence and regression coverage
tests/boundary/cli/nativeCallTargetAdmission.test.tsexercises the public compiled CLI, asserts an empty target yieldsVALIDATION_ERRORonpathwithtoo_small, and confirms.advances to observation-input validation without launching LLDB.observe-native-calls "" "{}" --jsonreturnsVALIDATION_ERRORwithfieldErrors.path/too_small. The explicit.control reaches the expectedbreakpointsvalidation error.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
.remains supported.Author readiness
Human owner: @ducanhnguyen223
Before merge
type(scope): outcome.