fix: guard summary and score display on parseFailed analysis#67
Merged
fix: guard summary and score display on parseFailed analysis#67
Conversation
When analysis parsing fails, the stub analysis object has zero scores across all fields. Before this fix, printAnalysisSummary still ran, showing a misleading "STRATEGY ASSESSMENT" section with all-zero bars right after the spinner already reported the parse failure. Guard all four call sites (run.ts, run-flow.ts, analyze.ts, results-flow.ts) so summary and score output are skipped when parseFailed is true. In analyze.ts multi-run mode, show an explicit "Score: N/A (parse failed)" line instead of silent skip. Add export.test.ts covering promptExport behavior for undefined, parseFailed: true, parseFailed: false, and valid analysis inputs.
Treelovah
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #65. When analysis parsing fails, the stub object has all-zero scores — but
printAnalysisSummaryandprintScoreSummarystill ran, showing misleading "STRATEGY ASSESSMENT" bars and KSM scores of 0.0 right after the spinner already warned about the parse failure.printAnalysisSummarycall sites to skip whenparseFailedis trueanalyze.tsmulti-run mode, showScore: N/A (parse failed)instead of silent skipresults-flow.ts, show retry message when user selects "View analysis" on a failed parseexport.test.tscoveringpromptExportfor undefined, parseFailed: true, parseFailed: false, and valid analysisFiles changed:
src/commands/run.ts— guard summary + score blocksrc/interactive/run-flow.ts— guard summary + score blocksrc/commands/analyze.ts— guard summary + add N/A fallback for multi-runsrc/interactive/results-flow.ts— guard interactive "View analysis" menu actiontests/unit/export.test.ts— new (4 tests)Test plan
npm run build— cleannpx vitest run— 415/415 pass (including 4 new export tests)oasis analyzeon multiple runs with one corrupted — verifyScore: N/A (parse failed)appears