Skip to content
2 min read · 321 words

Interface: PreservationRule ​

Defined in: src/batteries/validation/types.ts:206

Requires historical primitive content to remain present and/or stable.

Properties ​

PropertyTypeDescriptionDefined in
idstringStable identifier used in violations and snapshots.src/batteries/validation/types.ts:210
invariant| "count-non-decreasing" | "payload-field-stable" | "pruned-after-latest-turn"Continuity invariant: count-non-decreasing never permits historical loss, payload-field-stable preserves a selected field, and pruned-after-latest-turn permits absence only before the latest non-tool-call user Message; content after that boundary must remain present AND unchanged, mirroring payload-field-stable for the retained recent range. The latter means never drop recent or alter it, may drop old, and is distinct from full-history preservation.src/batteries/validation/types.ts:225
kindOrderingPrimitiveKindHistorical primitive kind whose continuity is required.src/batteries/validation/types.ts:212
payloadField?stringDot-path into the primitive payload when invariant is payload-field-stable.src/batteries/validation/types.ts:227
resetOnModelSwitch?booleanReset the comparison baseline when the producing model changes.src/batteries/validation/types.ts:229
severity?"blocking" | "advisory"Whether a violation blocks dispatch. Omitted means advisory. Remarks Advisory is the default because this catalog's rules were derived from vendor DOCUMENTATION, and a live audit against each rule's own native API found that most of them block turn state the vendor accepts (16 of 17 rules measured; only thought-signature-required was confirmed enforced). Documentation describes what a vendor says it requires; only observation shows what it does. Defaulting to advisory keeps the catalog's knowledge — you still learn which primitive broke which vendor's stated contract — without rejecting dispatches the model would have served. Opt into blocking per rule when you have verified the constraint on the surface you dispatch through. See docs/batteries/validation/api-surface-scope.md.src/batteries/validation/types.ts:243
type"preservation"Discriminator selecting the stateful preservation evaluator.src/batteries/validation/types.ts:208