Repository navigation
feat(#783): surface failureCategory breakdown from metrics.json in sequant stats - #786
Merged
admarble merged 5 commits intoJul 19, 2026
Conversation
Add a Failure Categories section to the metrics-based analytics display, computed from MetricRun.failureCategory over failed runs and rendered adjacent to the outcome bars. Pre-#761 records without the field are bucketed as "unclassified", distinct from the "unknown" enum value. Section is hidden when there are zero failed runs. The --json metrics output includes the same breakdown as failureCategories; CSV is log-sourced and unaffected. Cohort filters (--label/--since) continue to force log-mode per #640, so the breakdown is post-filter by construction. Fixes #783
6 tasks
Widen the breakdown from failed-only to any run that recorded a failure (outcome "failed" or "partial") — a partial run's failed issue is equally the answer to "what's killing my runs". Success runs never carry a failureCategory and stay excluded. This deliberately widens AC-1's literal "over failed runs" wording (per user decision); the header is relabeled "(N runs with a failure)" and the hide condition is now "no run recorded a failure". AC-2 unclassified bucketing is preserved for uncategorized partials. Tests, analytics docs, and CHANGELOG updated.
…s-surface-failurecategory-breakdown-from- # Conflicts: # CHANGELOG.md
…s-surface-failurecategory-breakdown-from- # Conflicts: # CHANGELOG.md
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
sequant statsdisplay, computed fromMetricRun.failureCategory(feat: detect rate-limit failures mid-chain and halt cleanly instead of timeout-cascading #761) over failed runs and rendered adjacent to the outcome bars — answers "what's killing my runs — rate limits or real failures?" without needing run logs to still exist.unclassified, deliberately distinct from theunknownenum value; section is hidden entirely when there are zero failed runs.sequant stats --json(metrics source) includes the same breakdown asfailureCategories; CSV is log-sourced and unaffected. Cohort filters (--label/--since) continue to force log-mode per feat(stats): add --label and --since filters for cohort measurement #640, so the breakdown is post-filter by construction.AC Verification
src/commands/stats.ts(calculateFailureCategoryBreakdown+ display block after outcome bars); dogfooded on the real 102-run corpusunclassifieddistinct fromunknownrun.failureCategory ?? "unclassified"; test asserts both buckets coexistfailedCount > 0guard; asserted by test--labeland--since; breakdown is a pure function of the passed runsfailureCategoriesin--jsonmetrics output; CSV N/A (log-sourced)src/commands/stats-failure-categories.test.tsTest plan
npm run build,npm run lintpassnpx vitest run src/commands/stats-failure-categories.test.ts src/commands/stats.test.ts— 30/30 pass.sequant/metrics.json(102 runs, 25 failed): rendersunclassified 23 (92%),billing 2 (8%); hidden under--label; present in--jsonQA verdict: READY_FOR_MERGE (see issue comment)
Closes #783
🤖 Generated with Claude Code