Bitemporal facts, interval supersession evidence and decision review
moon add yyyt0807/moonbitemporal@0.2.0import {
"yyyt0807/moonbitemporal" @temporal,
}moon run examples/decision_review --target wasm-gc
moon run examples/access_review --target wasm-gc
moon run examples/correction_evidence --target wasm-gcpub(all) suberror TemporalError {
InvalidSpan(String)
EmptyKey
EmptyBatch
KnowledgeTimeNotIncreasing(previous~ : Int64, proposed~ : Int64)
OverlappingBatchChanges(key~ : String, first~ : Int, second~ : Int)
TooManyRevisions(maximum~ : Int)
TooManySegments(maximum~ : Int)
InvalidInstant(String)
InvalidArchive(String)
InvalidRevisionIndex(Int)
DuplicateArchiveKey
UnboundedDuration
DurationOverflow
TooManyKeys(maximum~ : Int)
InvalidPage(String)
DivergentHistory(index~ : Int)
TooManyCells(maximum~ : Int)
InvalidDecision(String)
TooManyDecisions(maximum~ : Int)
}pub struct ChangeReport {
entries : Array[KeyChangeReport]
keys_examined : Int
fragments : Int
bounds : Span
before_known : Int64
after_known : Int64
}pub struct Coverage {
total : Int64
assigned : Int64
withdrawn : Int64
unclaimed : Int64
values : Array[ValueDuration]
}pub struct DecisionEvidence {
id : String
key : String
valid_at : Int64
known_at : Int64
source : Revision?
}fn Ledger::append_json_string(self : Ledger, text : String, max_chars? : Int) -> Ledger raise TemporalErrorfn Ledger::audit_decisions(self : Ledger, decisions : Array[DecisionEvidence], review_known : Int64, max_decisions? : Int) -> Array[DecisionAudit] raise TemporalErrorfn Ledger::batches_since(self : Ledger, known_after : Int64?, max_batches? : Int, max_revisions? : Int) -> BatchPage raise TemporalErrorfn Ledger::capture_decision(self : Ledger, id : String, key : String, valid_at : Int64, known_at : Int64) -> DecisionEvidence raise TemporalErrorfn Ledger::change_report(self : Ledger, bounds : Span, before_known : Int64, after_known : Int64, max_keys? : Int, max_fragments? : Int) -> ChangeReport raise TemporalErrorfn Ledger::commit_with_report(self : Ledger, known_at : Int64, changes : Array[Change], max_impacts? : Int) -> CommitReport raise TemporalErrorfn Ledger::coverage(self : Ledger, key : String, bounds : Span, known_at : Int64, max_segments? : Int) -> Coverage raise TemporalErrorfn Ledger::diff_knowledge(self : Ledger, valid_at : Int64, before_at : Int64, after_at : Int64) -> Array[ValueChange]fn Ledger::diff_timeline(self : Ledger, key : String, bounds : Span, before_known : Int64, after_known : Int64, max_segments? : Int) -> Array[WindowChange] raise TemporalErrorfn Ledger::diff_valid(self : Ledger, before_at : Int64, after_at : Int64, known_at : Int64) -> Array[ValueChange]fn Ledger::from_json_string(text : String, maximum? : Int, max_chars? : Int) -> Ledger raise TemporalErrorfn Ledger::history_page(self : Ledger, key : String, offset : Int, max_items : Int) -> RevisionPage raise TemporalErrorfn Ledger::impact_of_revision(self : Ledger, index : Int, max_segments? : Int) -> Array[Impact] raise TemporalErrorfn Ledger::knowledge_timeline(self : Ledger, key : String, valid_at : Int64, bounds : Span, max_segments? : Int) -> Array[KnowledgeSegment] raise TemporalErrorfn Ledger::matching_spans(self : Ledger, key : String, bounds : Span, known_at : Int64, filter : SpanFilter, max_segments? : Int) -> Array[Span] raise TemporalErrorfn Ledger::sample_matrix(self : Ledger, key : String, valid_samples : Array[Int64], knowledge_samples : Array[Int64], max_cells? : Int) -> TemporalMatrix raise TemporalErrorfn Ledger::snapshot_timeline(self : Ledger, keys : Array[String], bounds : Span, known_at : Int64, max_keys? : Int, max_segments? : Int) -> Array[SnapshotSegment] raise TemporalErrorfn Ledger::supersession_fragments(self : Ledger, index : Int, max_fragments? : Int) -> Array[SupersessionFragment] raise TemporalErrorfn Ledger::trace(self : Ledger, key : String, valid_at : Int64, known_at : Int64, max_candidates? : Int) -> DecisionTrace raise TemporalErrorfn LedgerBuilder::append(self : LedgerBuilder, known_at : Int64, changes : Array[Change]) -> Unit raise TemporalErrorfn LedgerBuilder::get(self : LedgerBuilder, key : String, valid_at : Int64, known_at : Int64) -> String?fn LedgerBuilder::observe(self : LedgerBuilder, key : String, valid_at : Int64, known_at : Int64) -> Revision?pub struct LedgerStats {
revisions : Int
keys : Int
batches : Int
tombstones : Int
open_valid_spans : Int
most_revised_key : String?
most_revisions_for_key : Int
first_knowledge_time : Int64?
latest_knowledge_time : Int64?
}pub struct Span {
start : Int64
end : Int64?
}pub(all) enum SpanFilter {
Assigned
Equals(String)
Withdrawn
Unclaimed
}pub struct TemporalMatrix {
key : String
valid_samples : Array[Int64]
knowledge_samples : Array[Int64]
cells : Array[MatrixCell]
}fn TemporalMatrix::changed_rows(self : TemporalMatrix, before_column : Int, after_column : Int) -> Intpub struct ValueDuration {
value : String
duration : Int64
}fn compare_all_keys(before : Ledger, after : Ledger, bounds : Span, before_known : Int64, after_known : Int64, max_keys? : Int, max_fragments? : Int) -> ChangeReport raise TemporalErrorfn compare_ledgers(before_ledger : Ledger, after_ledger : Ledger, key : String, bounds : Span, before_known : Int64, after_known : Int64, max_segments? : Int) -> Array[WindowChange] raise TemporalErrorInstall
Download zipBitemporal facts, interval supersession evidence and decision review