v0.3.16-pre.002

This commit is contained in:
2026-09-21 08:31:42 +02:00
parent c7a6df859d
commit b0deefddb7
8 changed files with 597 additions and 36 deletions

View File

@@ -1,6 +1,5 @@
// file: crates/ksp-store-api/src/model/raw_outcome.rs
// version: 1
// version: 2
/// Outcome for one canonical RAW entity in an idempotent persistence operation.
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
@@ -14,7 +13,6 @@ pub enum RawEntityWriteOutcome {
/// Normal persistence skipped a durable purged tombstone.
SkippedPurged,
}
/// Outcome for one deterministic acquisition observation write.
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
@@ -26,14 +24,12 @@ pub enum RawObservationWriteOutcome {
/// No observation was recorded because the associated RAW entity was intentionally skipped.
NotRecorded,
}
/// Combined outcome of one atomic canonical RAW entity plus observation acquisition.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub struct RawAcquisitionWriteOutcome {
entity: crate::RawEntityWriteOutcome,
observation: crate::RawObservationWriteOutcome,
}
impl RawAcquisitionWriteOutcome {
/// Creates one backend-independent atomic acquisition outcome.
#[must_use]
@@ -46,10 +42,33 @@ impl RawAcquisitionWriteOutcome {
pub const fn entity(&self) -> crate::RawEntityWriteOutcome {
return self.entity;
}
/// Returns the acquisition observation write outcome.
#[must_use]
pub const fn observation(&self) -> crate::RawObservationWriteOutcome {
return self.observation;
}
}
/// Durable Store outcome for one RAW transaction acquisition after variant-aware convergence.
///
/// Every variant represents a successful Store-domain result. In particular,
/// [`Self::QuarantinedConflict`] is durable success and must not be reinterpreted as a
/// transport failure or terminal persistence error by callers.
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum RawTransactionVariantWriteOutcome {
/// First durable variant became the initial canonical transaction.
InsertedCanonical,
/// Incoming content exactly matched an already durable variant/canonical representation.
ObservedExact,
/// Incoming content was durably observed while the current canonical variant remained strictly more complete.
ObservedCompatibleLessComplete,
/// Incoming content was durably persisted and atomically promoted because it was strictly more complete.
PromotedCompatibleMoreComplete,
/// Divergent or incomparable content was durably preserved without changing the current canonical variant.
QuarantinedConflict,
/// Explicit force-rehydration restored a previously purged logical transaction into variant-aware storage.
Rehydrated,
/// Normal acquisition respected an existing purged tombstone and performed no rehydration.
SkippedPurged,
}