Investigate a failure

Find why something fails before you change it. A fix chosen before the cause is known can hide the failure without removing it. Swapping a version, image, or provider until the symptom stops teaches nothing. The next failure stays as mysterious as this one.ΒΆ

Read AGENTS.md first. Then read these leaves:ΒΆ

Terms used here

1. Bound the symptom

Write down what fails, how often, and under which conditions. Keep receipts: logs, error codes, timestamps, and inputs. Separate the failure from events near it. Output that looks corrupted may be a side effect of a crash.ΒΆ

2. Make it happen on demand

Write the smallest repro that triggers the failure. Report its rate as counts, for example β€œ17 in 1,000 runs”. A rare failure needs enough runs per attempt to show up. Then make it deterministic where you can, so the same input fails every time. The repro proves the fix later.ΒΆ

3. Rebuild what runs

Investigate code you can read and rebuild. If the running artifact holds changes that exist nowhere else, extract them as readable patches and pin every commit. Confirm the rebuild reproduces the failure before you trust an experiment on it.ΒΆ

4. Test one hypothesis at a time

Record each hypothesis, then run one experiment that can prove or falsify it.ΒΆ

A falsified hypothesis is a result. Write it down with its evidence and move to the next layer.ΒΆ

5. Fix at the cause

Fix the cause where it lives, not where it surfaced. A setting that avoids the failure, such as a longer timeout or a disabled feature, is a workaround. Measure its cost and label it as one.ΒΆ

Prove the fix with the repro. Then repeat the original workload enough times to show the rate is zero.ΒΆ

Example: two web tests read the same build output while the build rewrote it. Two repro runs found 17 and 28 torn reads. The fix wrote each file to a temporary path and renamed it into place. After the fix, 8.5 million reads showed no torn read. The fix lives in apps/web/scripts/reader-build.ts.ΒΆ

6. Leave a notebook and a recipe

Write the notebook as you go, not at the end. Each entry records:ΒΆ

End the notebook with:ΒΆ

If the cause is upstream, send the maintainer the repro and the proof. Sending it is an outward action and follows the project’s approval rules.ΒΆ

Report

Report these items:ΒΆ


Last changed 2026-10-10 in 0d43dfc. Source on GitHub. Change log.