AuditResult

sealed interface AuditResult

DSL-layer view of ca.acendas.kstate.saga.journal.VerifyResult returned by the saga audit "id" DSL.

Provides plain-English sealed case names for pattern-matching:

when (val r = saga audit "order-42") {
is AuditResult.Intact -> log("chain ok, head=${r.headHash}")
is AuditResult.Tampered -> alert("tamper at seq ${r.atSeq}")
is AuditResult.Incomplete -> resume(r.resumeFromSeq)
}

With import ca.acendas.kstate.saga.dsl.* the AuditResult. prefix can be dropped (see Intact, Tampered, Incomplete typealiases below).

Typed API coexistence

Users who need ca.acendas.kstate.saga.journal.VerifyResult.Valid.verifiedSeqs call journal.verify(runId) directly — the DSL form intentionally drops low-level fields to keep the audit vocabulary at the user's mental model.

Inheritors

Types

Link copied to clipboard
data class Incomplete(val resumeFromSeq: Long, val headHash: String) : AuditResult

The verified range was larger than one page; resume from resumeFromSeq.

Link copied to clipboard
data class Intact(val headHash: String) : AuditResult

Every entry in the verified range re-hashed cleanly — no tampering detected.

Link copied to clipboard
data class Tampered(val atSeq: Long, val expected: String, val actual: String) : AuditResult

A tamper, corruption, or precondition failure was detected.

Link copied to clipboard
data class Unavailable(val cause: Throwable, val context: String?) : AuditResult

S1: The journal itself returned an I/O error during the verify call.