# Triage Test Results

Find out what failed, whether a suite is healthy, and what to do about a red
run. Read results first, then decide; do not guess from a status alone.

## Recent suite runs

```bash
cofactor test-suite executions
cofactor test-suite get <executionId> --failures-only
cofactor test-suite get <executionId> --failures-only --json
```

`executions` lists recent suite runs; `get` shows one, and `--failures-only`
keeps just the failing test runs plus any degraded ones. The execution id comes
from `executions`, from `cofactor test-suite run`, or from a run page.

A degraded flow was auto-disabled after failing repeatedly and was not run in
this suite; its message says why. Treat it as a real problem: read its history
with `cofactor workflow runs list <workflowId>`, then fix and re-enable the flow
(`cofactor-write-test`), or hand its failure history to `cofactor-debug-run` to
find the cause.

## One failing test

```bash
cofactor test-suite diagnostics <workflowId> <runId>
cofactor test-suite diagnostics <workflowId> <runId> --thoughts
cofactor workflow runs list <workflowId>
```

`diagnostics` returns the failure diagnostic for one run (`--thoughts` adds the
agent's reasoning trace). `workflow runs list` is the run history of one
test: use it to see whether the failure is new, intermittent or constant.

## Runs from your own CI

Results from a framework Cofactor ran for you (not a Cofactor Workflow) are
external runs. Read `cofactor external-run guide` for get, failures, triage
and rerun. For how tests are structured, read the other sections of this
guide (`cofactor workflow guide`).

## Real failure or flake

1. A failure is real only when it reproduces with the same evidence: the
   same step, the same error, in more than one run.
2. An intermittent failure with different errors each time is a flake
   candidate. Check the run history before calling it one.
3. A failure that began right after a change is a real regression until
   shown otherwise.

## Next step

- Real and new: file or find the issue (`cofactor issues guide`).
- One unexplained failure: read the run's evidence (the diagnostic above),
  then hand it to `cofactor-debug-run` rather than guessing.
- Flake: say so with the run history as evidence; do not delete the test.
