Repository navigation
Description
Discord Username / User ID
uxdev
What does this improvement do?
New CLI command to triage failed tests by grouping related failures into deterministic clusters.
When many tests fail in the same project, such as during test run --all, regression reruns, or MCP execution, agents and humans currently see a flat list of individual failures. In practice, many of those failures often share the same root cause, such as an expired auth token, staging environment outage, broken routing, shared code defect, or cascading test data failure.
Today, the CLI only supports per-test failure analysis through commands like test failure get and test failure summary. This forces agents to download many bundles or guess which failed test to inspect first, wasting AI tokens, testing credits, and debugging time.
This improvement adds:
testsprite test failure triage --project <id>The command lists failed tests, fetches lightweight failure summaries, and groups related failures client-side using deterministic heuristics over existing failure metadata. This helps users quickly identify the most likely root cause and choose the best representative test to investigate first.
Details / implementation notes
Implement a CLI-first failure triage command:
testsprite test failure triage --project <id>Behavior:
-
List all failed tests using the existing failed-test API surface.
-
Fetch lightweight failure or summary information for each failed test.
-
Do not download screenshots, videos, or full bundles.
-
Group failures client-side using deterministic heuristics based on existing M2.1 fields.
-
Return clusters containing:
representativeTestIdmemberTestIdsconfidencefixPriority
Suggested grouping heuristics:
-
Shared
recommendedFixTarget.reference -
Environment-wide failure kinds such as:
infranetworknetwork_timeoutrouting_404
-
Normalized
rootCauseHypothesisprefix -
Singleton fallback when no grouping signal is found
Supported flags:
--project <id>
--output json
--type
--filter
--max-concurrency
--dry-runAcceptance criteria:
-
testsprite test failure triage --project <id> --output jsonreturns clustered failure output. - Clusters include
representativeTestId,memberTestIds,confidence, andfixPriority. - Command uses existing public APIs only.
- Command does not require backend changes.
- Command avoids downloading heavy artifacts such as screenshots and videos.
-
--typeis supported. -
--filteris supported. -
--max-concurrencyis supported. -
--dry-runreturns a canned sample. - Unit tests cover grouping heuristics and singleton fallback.
- Integration tests cover command behavior.
- Documentation is updated.
- CHANGELOG is updated.
- Agent skill documentation is updated.
Why CLI-first:
- Uses only existing public APIs.
- Reduces duplicate investigation immediately.
- Avoids unnecessary bundle downloads.
- Saves AI tokens, testing credits, and debugging time.
- Provides a natural read surface for future backend-native clustering.
Future backend follow-up:
Add a native clustering API using semantic embeddings, wave/cascade graph analysis, and optional --rerun-representatives orchestration.
Confirmations
- I have searched existing issues and this is not a duplicate.
- I have provided my Discord identity above for reward coordination.
Activity
zeshi-du commentedon Jul 3, 2026
Triage: parked for design — client-side heuristic clustering can actively mislead agents when it groups wrong, and this overlaps the project-report surface we are redesigning against the V3 schema. Leaving the issue open as the anchor; PR #44 will wait on that design.
zeshi-du commentedon Aug 13, 2026
Update: I've closed #245 (the recovered PR that implemented this) rather than leave it parked indefinitely against an undated dependency. This issue stays open — the need is real — but I want to be honest that it has no date.
Two things recorded there that belong here too:
When the V3 failure surface lands I'll come back here and link #245 as the starting point. Credit for the original design is @SahilRakhaiya05's.
zeshi-du commentedon Oct 20, 2026
Thanks again @SahilRakhaiya05. This stays open but parked, with no date. Grouping failures by root cause should come from the platform's own failure classification, not CLI heuristics, and that isn't available yet. The failure commands are also being consolidated in 1.0 (
test failure getandtest failure summarymove underresult get), so a newtest failure triagewould land on a surface that is about to change. #245 is still the starting point when we pick it up.zeshi-du commentedon Nov 19, 2026
Thanks @SahilRakhaiya05 for the design and the original PR. Our roadmap has changed and this repo isn't taking new CLI features, and the next release folds
test failure getandtest failure summaryintoresult get, so atest failure triagecommand would have nowhere to live. Closing as not planned.