Skip to content
1 min read · 196 words

Interface: PreservationRule

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

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:124
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:139
kindOrderingPrimitiveKindHistorical primitive kind whose continuity is required.src/batteries/validation/types.ts:126
payloadField?stringDot-path into the primitive payload when invariant is payload-field-stable.src/batteries/validation/types.ts:141
resetOnModelSwitch?booleanReset the comparison baseline when the producing model changes.src/batteries/validation/types.ts:143
type"preservation"Discriminator selecting the stateful preservation evaluator.src/batteries/validation/types.ts:122