|
| 1 | +--- |
| 2 | +paths: ["plugin/**", "client/**"] |
| 3 | +--- |
| 4 | +# Failure Investigation Convention |
| 5 | + |
| 6 | +## Never Assume — Always Investigate |
| 7 | + |
| 8 | +When a test run, build step, or tool invocation fails, **do not assume a cause**. Investigate |
| 9 | +the actual failure before taking action or changing code. |
| 10 | + |
| 11 | +Common assumptions that lead to incorrect fixes: |
| 12 | +- "The runner timed out" (might be a permission error, missing binary, or API failure) |
| 13 | +- "The test scenario is wrong" (might be an infrastructure issue or a real skill defect) |
| 14 | +- "It's a transient failure" (might be a consistent bug that needs fixing) |
| 15 | +- "The binary is missing" (might be a path resolution error) |
| 16 | + |
| 17 | +## Use `get-history-agent` for Session Failures |
| 18 | + |
| 19 | +When a runner or grader fails (`TC{N}: runner failed` or `TC{N}: grader failed`), use the |
| 20 | +`cat:get-history-agent` skill to inspect the session transcript before concluding anything. |
| 21 | + |
| 22 | +**CRITICAL timing**: Act immediately when you see a failure notification — do NOT wait for |
| 23 | +the batch to finish. Session files live inside the run worktree's isolated config directory |
| 24 | +(`${RUN_WORKTREE}/.cat/config/projects/...`). Once SPRT's cleanup step runs, the worktree |
| 25 | +is deleted and the session is unrecoverable. |
| 26 | + |
| 27 | +**Procedure when a runner/grader fails:** |
| 28 | +1. Kill SPRT immediately: `kill ${SPRT_PID}` |
| 29 | +2. Wait for monitor to stop |
| 30 | +3. Find the session: |
| 31 | + ```bash |
| 32 | + ENCODED=$(echo "${RUN_WORKTREE}" | sed 's|[/.]|-|g') |
| 33 | + ls "${RUN_WORKTREE}/.cat/config/projects/${ENCODED}/" |
| 34 | + ``` |
| 35 | +4. Use `cat:get-history-agent` on the session ID to understand what actually happened |
| 36 | +5. Only after reading the session: form a hypothesis and fix |
| 37 | + |
| 38 | +## When Artifacts Are Already Gone |
| 39 | + |
| 40 | +If you missed the failure and the run worktree was cleaned up: |
| 41 | +- The session is unrecoverable — acknowledge this explicitly |
| 42 | +- Rerun SPRT and kill it immediately on the next failure occurrence |
| 43 | +- Do NOT hypothesize a fix based on the missing evidence |
| 44 | + |
| 45 | +## Scope |
| 46 | + |
| 47 | +This applies to all failure types encountered during work: |
| 48 | +- SPRT runner/grader failures |
| 49 | +- Build failures (`mvn verify` errors) |
| 50 | +- Hook failures |
| 51 | +- Test assertion failures |
| 52 | + |
| 53 | +The rule is: **read the evidence first, then conclude**. |
0 commit comments