fix: support positional installs and trace discovery#504
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📝 WalkthroughWalkthroughThis PR enhances the Madar CLI with stricter platform argument validation and refines trace analysis to distinguish Madar tool-discovery queries from broad exploration. The install command now rejects duplicate platform arguments and updates help text; the trace classifier tracks and excludes deferred Madar tool selections from exploration counts, improving exploration-outcome categorization. ChangesCLI Install Argument Validation
Madar Tool-Discovery Metadata & Trace Classification
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/unit/cli.test.ts (1)
1112-1115: ⚡ Quick winAdd one more duplicate-selector test path for
--platform=.Please add a case like
parseInstallArgs(['--platform=claude', 'cursor'], 'windows')(and/or repeated flag forms) to cover the new duplicate-detection branch introduced for equals syntax.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/unit/cli.test.ts` around lines 1112 - 1115, Add a unit test to cover the duplicate-platform detection for the equals-style flag in parseInstallArgs: add an assertion that calling parseInstallArgs(['--platform=claude', 'cursor'], 'windows') throws the same usage error, and optionally add a similar case for repeated equals flags (e.g., ['--platform=claude', '--platform=cursor']) to exercise the new duplicate-detection branch; reference the parseInstallArgs function in your test file and use the same expected error string 'Usage: madar install [platform|--platform P]'.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/unit/cli.test.ts`:
- Around line 1112-1115: Add a unit test to cover the duplicate-platform
detection for the equals-style flag in parseInstallArgs: add an assertion that
calling parseInstallArgs(['--platform=claude', 'cursor'], 'windows') throws the
same usage error, and optionally add a similar case for repeated equals flags
(e.g., ['--platform=claude', '--platform=cursor']) to exercise the new
duplicate-detection branch; reference the parseInstallArgs function in your test
file and use the same expected error string 'Usage: madar install
[platform|--platform P]'.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 690e6b6a-8f99-490a-8144-0f123159dce2
📒 Files selected for processing (5)
src/cli/main.tssrc/cli/parser.tssrc/infrastructure/compare.tstests/unit/cli.test.tstests/unit/compare.test.ts
Summary
madar install <platform>alongside--platformand update the help/usage contractselect:mcp__madar__...lookupsTesting
Summary by CodeRabbit
Bug Fixes
New Features
Tests