pub struct ContextCheckpointV1 {
pub schema_version: u32,
pub identity: ContextCheckpointIdentityV1,
pub lineage: ContextCheckpointLineageV1,
pub live_state: ContextCheckpointLiveStateV1,
pub carrier: Option<ContextCheckpointCarrierBindingV1>,
pub engine_version: SemanticVersion,
pub created_at: UtcTimestamp,
pub updated_at: UtcTimestamp,
pub encryption_metadata: Option<ContextCheckpointEncryptionMetadataV1>,
}Expand description
Canonical typed live-state checkpoint.
Fields§
§schema_version: u32Schema version of the checkpoint contract.
identity: ContextCheckpointIdentityV1Parent, branch, and device identity.
lineage: ContextCheckpointLineageV1Work-graph lineage references.
live_state: ContextCheckpointLiveStateV1Portable live state.
carrier: Option<ContextCheckpointCarrierBindingV1>Binding to a P6 carrier envelope, when the checkpoint travels in one.
engine_version: SemanticVersionEngine version that produced the checkpoint.
created_at: UtcTimestampCanonical UTC creation timestamp.
updated_at: UtcTimestampCanonical UTC timestamp of the latest portable semantic update.
encryption_metadata: Option<ContextCheckpointEncryptionMetadataV1>Metadata for an encrypted downstream projection, when present.
Implementations§
Source§impl ContextCheckpointV1
impl ContextCheckpointV1
Sourcepub const SCHEMA_VERSION: u32 = 1
pub const SCHEMA_VERSION: u32 = 1
Schema version represented by this type.
Sourcepub const SCHEMA_ID: &'static str = CONTEXT_CHECKPOINT_SCHEMA_ID
pub const SCHEMA_ID: &'static str = CONTEXT_CHECKPOINT_SCHEMA_ID
Schema identity represented by this type.
Sourcepub fn try_new(
identity: ContextCheckpointIdentityV1,
lineage: ContextCheckpointLineageV1,
live_state: ContextCheckpointLiveStateV1,
carrier: Option<ContextCheckpointCarrierBindingV1>,
engine_version: SemanticVersion,
created_at: UtcTimestamp,
) -> Result<Self, ValidationError>
pub fn try_new( identity: ContextCheckpointIdentityV1, lineage: ContextCheckpointLineageV1, live_state: ContextCheckpointLiveStateV1, carrier: Option<ContextCheckpointCarrierBindingV1>, engine_version: SemanticVersion, created_at: UtcTimestamp, ) -> Result<Self, ValidationError>
Construct a validated checkpoint.
This is the only way to obtain a ContextCheckpointV1 that is known
valid at construction time; every digest and signing API revalidates
because the fields remain publicly assignable.
Sourcepub fn with_optional_metadata(
self,
encryption_metadata: Option<ContextCheckpointEncryptionMetadataV1>,
) -> Result<Self, ValidationError>
pub fn with_optional_metadata( self, encryption_metadata: Option<ContextCheckpointEncryptionMetadataV1>, ) -> Result<Self, ValidationError>
Attach optional portable metadata through a fallible API.
Sourcepub fn with_updated_at(
self,
updated_at: UtcTimestamp,
) -> Result<Self, ValidationError>
pub fn with_updated_at( self, updated_at: UtcTimestamp, ) -> Result<Self, ValidationError>
Set the portable semantic update timestamp.
Sourcepub fn with_portable_state(
self,
session_state: Option<ContextCheckpointSessionStateV1>,
learning_state: Option<ContextCheckpointLearningStateV1>,
encryption_metadata: Option<ContextCheckpointEncryptionMetadataV1>,
) -> Result<Self, ValidationError>
pub fn with_portable_state( self, session_state: Option<ContextCheckpointSessionStateV1>, learning_state: Option<ContextCheckpointLearningStateV1>, encryption_metadata: Option<ContextCheckpointEncryptionMetadataV1>, ) -> Result<Self, ValidationError>
Attach all optional portable continuation state through a fallible API.
Sourcepub fn validate(&self) -> Result<(), ValidationError>
pub fn validate(&self) -> Result<(), ValidationError>
Validate every invariant, including the cross-field bindings.
Sourcepub fn canonical_bytes(&self) -> Result<Vec<u8>, ValidationError>
pub fn canonical_bytes(&self) -> Result<Vec<u8>, ValidationError>
Return canonical compact JSON bytes with lexicographically sorted keys.
Sourcepub fn canonical_json(&self) -> Result<String, ValidationError>
pub fn canonical_json(&self) -> Result<String, ValidationError>
Return the canonical JSON encoding as UTF-8 text.
Sourcepub fn from_canonical_bytes(bytes: &[u8]) -> Result<Self, ValidationError>
pub fn from_canonical_bytes(bytes: &[u8]) -> Result<Self, ValidationError>
Decode exactly canonical JSON and validate every invariant.
Sourcepub fn from_legacy_v1_canonical_bytes(
bytes: &[u8],
authenticated_tenant_id: TenantId,
) -> Result<Self, ValidationError>
pub fn from_legacy_v1_canonical_bytes( bytes: &[u8], authenticated_tenant_id: TenantId, ) -> Result<Self, ValidationError>
Migrate a canonical legacy-v1 checkpoint that predates mandatory tenant binding.
The caller must supply the authenticated tenant context; this function never
guesses or derives a tenant from untrusted checkpoint fields. Payloads already
carrying a tenant must use Self::from_canonical_bytes instead.
Sourcepub fn digest(&self) -> Result<Sha256Digest, ValidationError>
pub fn digest(&self) -> Result<Sha256Digest, ValidationError>
Domain-separated content identity of the whole checkpoint.
Sourcepub fn digest_inputs(
&self,
) -> Result<ContextCheckpointDigestInputsV1, ValidationError>
pub fn digest_inputs( &self, ) -> Result<ContextCheckpointDigestInputsV1, ValidationError>
Domain-separated digest inputs consumed by downstream slices.
Sourcepub fn signing_payload(
&self,
) -> Result<ContextCheckpointSigningPayloadV1, ValidationError>
pub fn signing_payload( &self, ) -> Result<ContextCheckpointSigningPayloadV1, ValidationError>
Build the sealed payload a downstream signer may cover.