feat: add one-command trial flow#482
Conversation
Closes #470 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a new Changesmadar try First-Run Trial Command
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI as executeCli
participant Parser as parseTryArgs
participant TryCmd as runTryCommand
participant Gen as prepareWorkspace/generateGraph
participant Pack as runContextPack
participant Sample as packaged sample workspace
User->>CLI: madar try "how does auth work?" [path]
CLI->>Parser: parseTryArgs(args)
Parser-->>CLI: TryCliOptions
CLI->>TryCmd: runTryCommand(options, io)
TryCmd->>Gen: prepareWorkspace(target)
alt target usable
Gen->>Pack: runContextPack(graphPath, format:'text')
Pack-->>TryCmd: pack output
else fallback-eligible
Gen->>Sample: prepareWorkspace(sample)
Sample->>Pack: runContextPack(sampleGraphPath, format:'text')
Pack-->>TryCmd: pack output (with fallback note)
end
TryCmd-->>CLI: formatted output string
CLI->>User: log output / exit
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 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.
Actionable comments posted: 2
🤖 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.
Inline comments:
In `@src/infrastructure/try-command.ts`:
- Around line 78-81: isFallbackEligibleGenerateError currently discriminates
generator failures by exact Error.message text which is brittle; change the
generator to throw a stable discriminator (e.g. set an error.code like
'NO_SUPPORTED_FILES' or throw a dedicated class NoSupportedFilesError from
generateGraph) and update isFallbackEligibleGenerateError to check that
error.code or instanceof NoSupportedFilesError instead of matching message text;
apply the same change to the other checks referenced (around lines 206-214) so
all fallback logic uses the stable error.code or error type rather than
Error.message.
- Around line 163-185: The current try block around
analyzeFreshness/summarizeGraph also wraps runPackForWorkspace, causing pack
errors to be caught and misreported as "Existing graph could not be read";
narrow the try to only cover dependencies.analyzeFreshness(graphPath) and
dependencies.summarizeGraph(graphPath) (and the tooSmallReason check), then
after determining reuse call runPackForWorkspace(workspace, prompt, graphPath,
notes, io, dependencies) outside that try (or in its own try that
surfaces/rewraps errors correctly), ensuring errors from runPackForWorkspace are
not transformed into a "could not be read" message; refer to analyzeFreshness,
isReusableFreshnessStatus, summarizeGraph, tooSmallReason, runPackForWorkspace,
and graphFreshnessStatusLabel when locating the code to change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0e080025-654e-4742-9503-6656957b4fa3
📒 Files selected for processing (9)
README.mddocs/tutorials/getting-started.mdsrc/cli/main.tssrc/cli/parser.tssrc/infrastructure/try-command.tstests/unit/cli.test.tstests/unit/getting-started-docs.test.tstests/unit/try-command.test.tstests/unit/why-madar-doc.test.ts
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
madar tryfirst-run command that builds or reuses a local graph, emits a text explain-pack, and recommends the next install commandmadar tryand add focused coverage for parser, CLI routing, fallback behavior, and docs orderingVerification
Closes #470
Summary by CodeRabbit
New Features
Documentation
Tests
Bug Fixes