# Half-finished failures

Prompt · Correctness and reliability · R06

Finds what is left behind when something fails halfway.

## Prompt

```text
Trace error, timeout and cancellation paths for transactions, locks, file handles, temporary files, worker jobs and network connections. Identify paths that leave resources held or state half-committed, and demonstrate them with controlled failure injection where practical.
```

**What it returns:** Each failure path with the resource left held, shown by injecting the failure.

**Skip it when:** Code that holds nothing open beyond a single request.

**Tools:** Repository; a way to force errors in tests.

**Changes:** Adds a test that shows it

**Sessions:** One session

## Skills

- [diagnosing-bugs](https://atlasscope.dev/skills/diagnosing-bugs): Diagnosis loop for hard bugs and performance regressions.

## Related

- [Timers and connections nobody closes](https://atlasscope.dev/prompts/timers-and-connections-nobody-closes): Finds timers, listeners and connections that nobody clearly owns or shuts off.
- [Safe to run twice?](https://atlasscope.dev/prompts/safe-to-run-twice): Finds actions that do damage when they run twice: double sends, double charges, duplicate rows.
- [Background jobs that hang or stop halfway](https://atlasscope.dev/prompts/background-jobs-that-hang-or-stop-halfway): Finds scheduled jobs and background workers that can hang, overlap or stop halfway.

Source: https://atlasscope.dev/prompts/half-finished-failures
