Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Validate persisted control state before publication
Validate a checkpoint or published-pointer record against the same schema used by its readers before writing it. Invalid state can prevent every subsequent worker from recovering.
Bad example
| 1 | await savePointer(candidate); |
Explanation (EN)
Validate a checkpoint or published-pointer record against the same schema used by its readers before writing it. Invalid state can prevent every subsequent worker from recovering.
Objašnjenje (HR)
Primjer ne provodi opisanu zastitu.
Good example
| 1 | const state = checkpointSchema.parse(candidate); |
| 2 | await savePointer(state); |
Explanation (EN)
Apply to durable control records such as checkpoints and generation pointers. Static types do not validate runtime callers. Reject invalid state before the mutation and keep the old pointer intact.
Objašnjenje (HR)
Provjeri uvjete prije operacije i sacuvaj jasno definirano ponasanje.
Notes (EN)
Apply to durable control records such as checkpoints and generation pointers. Static types do not validate runtime callers. Reject invalid state before the mutation and keep the old pointer intact.
Bilješke (HR)
Primijeni kod spremanja podataka i skupnih operacija kada vrijede opisani uvjeti.
Exceptions / Tradeoffs (EN)
An equivalent enforced database constraint or validated opaque type may provide this guarantee without a duplicate parse.
Iznimke / Tradeoffi (HR)
Iznimke ovise o ugovoru sustava navedenom u engleskom opisu.