Change

sealed interface Change

A single structural, direction-neutral delta between two Snapshots, as produced by SnapshotDiffer. A Change states what differs, never whether it is safe or breaking — that judgment (rule name + Severity + direction) is the classifier's job (design §7). Keeping changes neutral lets one differ feed backward, forward, and config-aware classification without re-diffing.

Inheritors

Types

Link copied to clipboard
data class ConfigChanged(val field: String, val oldValue: String, val newValue: String) : Change

A Json configuration field that affects the wire contract changed.

Link copied to clipboard
data class ContractAdded(val serialName: String, val kind: ContractKind) : Change

A @Serializable type present in the new snapshot but not the old.

Link copied to clipboard
data class ContractMoved(val oldSerialName: String, val newSerialName: String, val kind: ContractKind) : Change

A type whose serial name changed via a declared rename/move (design §8): wire-neutral for a plain type, a discriminator break for a polymorphic one.

Link copied to clipboard
data class ContractRemoved(val serialName: String, val kind: ContractKind) : Change

A @Serializable type present in the old snapshot but not the new.

Link copied to clipboard
data class ContractUnpaired(val contract: String) : Change

A current contract that could not be paired with a baseline one (#200): no baseline contract has the same (serialName, base) identity, and its bare serial name is shared by several contracts on at least one side (e.g. a pre-base-identity baseline recorded one bare created while the current snapshot has OrderEvent/created and UserEvent/created). Pairing by guess could diff the wrong bodies, and calling it added/removed would be false, so — like a CoverageGap — it is surfaced as unverified. contract is the qualified display name.

Link copied to clipboard
data class CoverageGap(val serialName: String) : Change

An unanalysable (OPAQUE) contract in the current snapshot: the extractor could not derive its wire shape (e.g. a custom serializer), so the gate cannot verify it. Surfaced on every diff so an unanalysable type is never silently treated as compatible ("unanalysable ≠ safe", design §10).

Link copied to clipboard
data class DiscriminatorChanged(val contract: String, val oldDiscriminator: String?, val newDiscriminator: String?) : Change

The polymorphic discriminator key of an existing contract changed.

Link copied to clipboard
data class DiscriminatorCollision(val contract: String, val discriminator: String, val subtype: String) : Change

A sealed/polymorphic contract whose class discriminator key collides with a property of its subtype of the same name. Such a model is unserializable — kotlinx-serialization refuses to encode it — so, like a CoverageGap, it is a defect of a single snapshot surfaced on every diff (not a delta between two), letting the gate catch it statically before the first encode throws (#132).

Link copied to clipboard
data class ElementAdded(val contract: String, val element: Element) : Change

A new element (field) on an existing contract.

Link copied to clipboard
data class ElementJsonNamesChanged(val contract: String, val element: String, val oldAliases: List<String>, val newAliases: List<String>) : Change

An existing element's @JsonNames alias set changed. Aliases are a wire fact (they widen what keys a reader accepts) and are §7's mitigation for a key rename, so adding/removing one must not be silently dropped.

Link copied to clipboard
data class ElementNullabilityChanged(val contract: String, val element: String, val wasNullable: Boolean, val nowNullable: Boolean) : Change

An existing element's nullability changed.

Link copied to clipboard
data class ElementOptionalityChanged(val contract: String, val element: String, val wasOptional: Boolean, val nowOptional: Boolean, val newEncodeDefault: EncodeDefaultMode? = null) : Change

An existing element became optional or required.

Link copied to clipboard
data class ElementRemoved(val contract: String, val element: Element) : Change

An element removed from an existing contract.

Link copied to clipboard
data class ElementTypeChanged(val contract: String, val element: String, val oldType: String, val newType: String) : Change

An existing element's type reference changed.

Link copied to clipboard
data class EnumValueAdded(val contract: String, val value: String, val baselineFieldsCoercible: Boolean = false) : Change

An enum value added to an existing enum contract.

Link copied to clipboard
data class EnumValueRemoved(val contract: String, val value: String) : Change

An enum value removed from an existing enum contract.

Link copied to clipboard
data class SubtypeAdded(val contract: String, val subtype: Subtype, val baseHadDefaultDeserializer: Boolean = false) : Change

A subtype added to an existing sealed/polymorphic contract.

Link copied to clipboard
data class SubtypeRemoved(val contract: String, val subtype: Subtype) : Change

A subtype removed from an existing sealed/polymorphic contract.