package file→ .shtukbase/packages/code-pragmatic/judges/crash-early.md
judges/crash-early.md
15 lines, 750 B.
- # Judge: the program checks its preconditions and crashes early
- Norm PRG-R05. Code checks at the entry whatever it cannot work without, and on a violation stops with a clear message instead of going on with bad data.
- **Who judges.** The reviewer of the change.
- **When.** On a change where code takes external data: files, network replies, user input, parameters of public interface functions.
- **What the judge looks at.**
- 1. Preconditions are checked at the entry; an impossible state is not silently "fixed" with a default value.
- 2. The failure message says what is wrong and where.
- 3. The check does not duplicate what the type already guarantees.
- **Result.** "holds" or "violated: which precondition is not checked, where to add the check".