[PR #2125] [MERGED] fix(managed): validate CLI type selections with the member contract #5046

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

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/2125
Author: @kaoru0822-kitauji
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @morluto

Base: main ← Head: fix/issue-2121


📝 Commits (2)

  • 3a76244 fix(managed): validate CLI type selections with the member contract
  • 34f7005 Merge remote-tracking branch 'origin/main' into fix/issue-2121

📊 Changes

2 files changed (+36 additions, -6 deletions)

View changed files

📝 src/cli/managedCommands.ts (+4 -6)
📝 tests/acceptance/managedCliOutput.test.ts (+32 -0)

📄 Description

Summary

rea inspect-managed-members --type declared its option as z.array(z.string()), so a repeated or empty type name reached ManagedStaticProvider. There, managedMembersInputSchema.parse threw, and the CLI reported execution_failure ("Run rea doctor …") for what is a caller input mistake. The option now reuses the contract's type_names schema, as binaryDiagnosticsCommands.ts already does for its options. The CLI therefore applies the same rules as the MCP tool: at least one name, non-empty names, no repeats.

Fixes #2121

Before / after

$ rea inspect-managed-members Pager.dll --type A --type A --json
before: {"code":"execution_failure","message":"Analysis could not complete. Run `rea doctor` …"}
after:  {"code":"VALIDATION_ERROR","fieldErrors":[{"path":"type","message":"type_names must not repeat a name"}]}

Valid selections (one or several distinct names, or no --type) behave as before. I checked against the PSReadLine Microsoft.PowerShell.Pager.dll shipped in VS Code.

Validation

  • New acceptance test managed CLI rejects repeated or empty type selections as invalid input (tests/acceptance/managedCliOutput.test.ts). It fails on main (execution_failure) and passes with this change; the other 5 tests in the file pass.
  • npm run lint and npm run docs:check pass.
  • npm test: 9150 passed, 15 failed in 8 files. These are the same 8 files and 15 tests that fail on clean origin/main c22111eca on this host. Most are environmental (no Hopper, Command Line Tools only, hdiutil, inspector target locations). promptCompletion.test.ts is the main regression tracked in #2123.

No provider behavior is involved.

🤖 Generated with Claude Code


🔄 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/2125 **Author:** [@kaoru0822-kitauji](https://github.com/kaoru0822-kitauji) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `fix/issue-2121` --- ### 📝 Commits (2) - [`3a76244`](https://github.com/morluto/rea/commit/3a76244b1f3962058a75f9cd9ee146c2274a62ba) fix(managed): validate CLI type selections with the member contract - [`34f7005`](https://github.com/morluto/rea/commit/34f700566df658a860a669f98b921d1a07f0122e) Merge remote-tracking branch 'origin/main' into fix/issue-2121 ### 📊 Changes **2 files changed** (+36 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/cli/managedCommands.ts` (+4 -6) 📝 `tests/acceptance/managedCliOutput.test.ts` (+32 -0) </details> ### 📄 Description ## Summary `rea inspect-managed-members --type` declared its option as `z.array(z.string())`, so a repeated or empty type name reached `ManagedStaticProvider`. There, `managedMembersInputSchema.parse` threw, and the CLI reported `execution_failure` ("Run `rea doctor` …") for what is a caller input mistake. The option now reuses the contract's `type_names` schema, as `binaryDiagnosticsCommands.ts` already does for its options. The CLI therefore applies the same rules as the MCP tool: at least one name, non-empty names, no repeats. Fixes #2121 ## Before / after ```text $ rea inspect-managed-members Pager.dll --type A --type A --json before: {"code":"execution_failure","message":"Analysis could not complete. Run `rea doctor` …"} after: {"code":"VALIDATION_ERROR","fieldErrors":[{"path":"type","message":"type_names must not repeat a name"}]} ``` Valid selections (one or several distinct names, or no `--type`) behave as before. I checked against the PSReadLine `Microsoft.PowerShell.Pager.dll` shipped in VS Code. ## Validation - New acceptance test `managed CLI rejects repeated or empty type selections as invalid input` (`tests/acceptance/managedCliOutput.test.ts`). It fails on main (`execution_failure`) and passes with this change; the other 5 tests in the file pass. - `npm run lint` and `npm run docs:check` pass. - `npm test`: 9150 passed, 15 failed in 8 files. These are the same 8 files and 15 tests that fail on clean `origin/main` c22111eca on this host. Most are environmental (no Hopper, Command Line Tools only, `hdiutil`, inspector target locations). `promptCompletion.test.ts` is the main regression tracked in #2123. No provider behavior is involved. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:00:41 +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#5046
No description provided.