model

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 18, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package model defines the target-neutral lifecycle journal contract.

Index

Constants

View Source
const (
	MaxPageSize           = 256
	MaxQueryFilterValues  = 64
	MaxNativePayloadBytes = 1 << 20
)

Variables

This section is empty.

Functions

func EncodeCursor

func EncodeCursor(cursor Cursor) (string, error)

func IsEnvelopeDefinitionKind added in v0.0.21

func IsEnvelopeDefinitionKind(kind DefinitionKind) bool

IsEnvelopeDefinitionKind is the closed new-writer admission set. Metamodel activation retains its separate legacy owner and operation recipe.

func ValidateBindingText

func ValidateBindingText(field, value string) error

func ValidateHostVersionSource added in v0.0.9

func ValidateHostVersionSource(source HostVersionSource) error

ValidateHostVersionSource is the shared closed-set authority for both the handler and receipt writer. It makes no version admission or policy decision.

func ValidateNativeBinding

func ValidateNativeBinding(binding NativeBinding) error

func ValidateOccurrenceEnvelope added in v0.0.21

func ValidateOccurrenceEnvelope(envelope OccurrenceEnvelopeRef) error

ValidateOccurrenceEnvelope proves an occurrence envelope is structurally complete: four nonzero refs with the exact owner kind per slot. Resolution (body, digest, slot, state) is enforced at the receipt and read boundaries.

func ValidateSemanticEnvelope added in v0.0.21

func ValidateSemanticEnvelope(envelope SemanticEnvelopeRef) error

ValidateSemanticEnvelope proves an envelope is structurally complete: five nonzero refs with the exact owner kind per slot. A resolving boundary must additionally prove every ref owner-resolvable and the three shared refs exactly equal to the associated occurrence envelope.

Types

type CapabilityID

type CapabilityID provenance.JournalID

func (CapabilityID) JournalID

func (id CapabilityID) JournalID() provenance.JournalID

type CapabilityStateID

type CapabilityStateID provenance.JournalID

func (CapabilityStateID) JournalID

func (id CapabilityStateID) JournalID() provenance.JournalID

type CaptureCause added in v0.0.9

type CaptureCause struct {
	// contains filtered or unexported fields
}

CaptureCause is transient parser evidence, not a journal field. Its zero value means the adapter supplied no further diagnosis. No host value is held.

func JSONCaptureCause added in v0.0.9

func JSONCaptureCause(raw []byte, disposition CaptureDisposition) CaptureCause

JSONCaptureCause refines only the shared malformed disposition. Duplicate members and invalid UTF-8 retain their own earlier validation priority.

func NewCaptureCause added in v0.0.9

func NewCaptureCause(kind CaptureCauseKind, field string, required JSONKind, disposition CaptureDisposition) CaptureCause

NewCaptureCause rejects invalid metadata rather than rendering a guessed explanation. The disposition stays the adapter's existing admission result.

func (CaptureCause) Advice added in v0.0.9

func (c CaptureCause) Advice(disposition CaptureDisposition) (reason, fix string, err error)

Advice is the sole cause-to-prose mapping. Field names are quoted so a host key cannot inject terminal lines. Values and decoder error text never enter it.

func (CaptureCause) Check added in v0.0.9

func (c CaptureCause) Check(disposition CaptureDisposition) error

Check also guards the boundary where an adapter's cause meets its result. An unchanged adapter can omit a cause, including on a valid capture.

func (CaptureCause) Field added in v0.0.9

func (c CaptureCause) Field() string

func (CaptureCause) Kind added in v0.0.9

func (c CaptureCause) Kind() CaptureCauseKind

func (CaptureCause) RequiredKind added in v0.0.9

func (c CaptureCause) RequiredKind() JSONKind

type CaptureCauseKind added in v0.0.9

type CaptureCauseKind uint8
const (
	CauseUnknown CaptureCauseKind = iota
	CauseMalformedJSON
	CauseNonObject
	CauseMissingMember
	CauseWrongKind
	CauseEmptyIdentity
	CauseOverlengthIdentity
	CauseUnusableIdentity
	CauseEventMismatch
)

type CaptureDisposition

type CaptureDisposition uint8
const (
	CaptureValid CaptureDisposition = iota + 1
	CaptureMalformed
	CaptureDuplicateField
	CaptureInvalidUTF8
	CaptureTruncated
	CaptureOverLimit
	CaptureUnsupportedSchema
	CaptureEventMismatch
)

type Clock

type Clock interface{ Now() time.Time }

type Confidence

type Confidence uint8
const (
	ConfidenceObserved Confidence = iota + 1
	ConfidenceCorrelated
	ConfidenceVerified
)

type ContentIdentity

type ContentIdentity [32]byte

type ContextPacketSchemaRef

type ContextPacketSchemaRef struct {
	Definition DefinitionRef
	// contains filtered or unexported fields
}

type ContextPolicyDefinitionRef

type ContextPolicyDefinitionRef struct {
	Definition DefinitionRef
	// contains filtered or unexported fields
}

type ContractEventKind

type ContractEventKind uint16

type Cursor

type Cursor struct {
	SnapshotJournalID provenance.JournalID
	LastJournalID     provenance.JournalID
	QueryFingerprint  QueryFingerprint
	// contains filtered or unexported fields
}

func DecodeCursor

func DecodeCursor(encoded string) (*Cursor, error)

type CursorErrorKind

type CursorErrorKind uint8
const (
	CursorInvalidPageSize CursorErrorKind = iota + 1
	CursorQueryMismatch
	CursorSnapshotFuture
	CursorStale
	CursorTampered
	CursorUnsupportedVersion
	CursorInvalidLineageBounds
)

type DefinitionCodec

type DefinitionCodec uint8
const DefinitionCanonicalJSON DefinitionCodec = 1

type DefinitionID

type DefinitionID string

type DefinitionJournalID

type DefinitionJournalID provenance.JournalID

func (DefinitionJournalID) JournalID

func (id DefinitionJournalID) JournalID() provenance.JournalID

type DefinitionKind

type DefinitionKind uint8
const (
	DefinitionRuntimeContract DefinitionKind = iota + 1
	DefinitionLifecycleSchema
	DefinitionMetamodel
	DefinitionInterpreter
	DefinitionEpochImplementation
	DefinitionContextPolicy
	DefinitionContextPacketSchema
	DefinitionRetentionPolicy
)

type DefinitionLifecycleEvent

type DefinitionLifecycleEvent uint8
const (
	DefinitionActivated DefinitionLifecycleEvent = iota + 1
	DefinitionRetiredEvent
)

type DefinitionRef

type DefinitionRef struct {
	Definition DefinitionJournalID
	Kind       DefinitionKind
	Content    ContentIdentity
	// contains filtered or unexported fields
}

type DefinitionSnapshot

type DefinitionSnapshot struct {
	Ref     DefinitionRef
	ID      DefinitionID
	Version uint32
	Codec   DefinitionCodec
	// contains filtered or unexported fields
}

func NewDefinitionSnapshot added in v0.0.21

func NewDefinitionSnapshot(ref DefinitionRef, id DefinitionID, version uint32, codec DefinitionCodec, body []byte) (DefinitionSnapshot, error)

NewDefinitionSnapshot owns defensive body construction after evidence resolution.

func (DefinitionSnapshot) Body

func (s DefinitionSnapshot) Body() []byte

type DefinitionStateFact

type DefinitionStateFact struct {
	StateID    DefinitionStateID
	Definition DefinitionJournalID
	Event      DefinitionLifecycleEvent
	RecordedAt time.Time
}

type DefinitionStateID

type DefinitionStateID provenance.JournalID

func (DefinitionStateID) JournalID

func (id DefinitionStateID) JournalID() provenance.JournalID

type DefinitionStateRecord

type DefinitionStateRecord struct {
	Ref               DefinitionRef
	ID                DefinitionID
	Version           uint32
	Status            DefinitionStatus
	LatestState       DefinitionStateID
	LatestFact        DefinitionStateFact
	SnapshotJournalID provenance.JournalID
}

func NewDefinitionStateRecord added in v0.0.21

func NewDefinitionStateRecord(snapshot DefinitionSnapshot, fact DefinitionStateFact, watermark provenance.JournalID) (DefinitionStateRecord, error)

type DefinitionStatus

type DefinitionStatus uint8
const (
	DefinitionStatusActive DefinitionStatus = iota + 1
	DefinitionStatusRetired
)

type DisclosureAttemptFact

type DisclosureAttemptFact struct {
	AttemptID  DisclosureAttemptID
	RecordedAt time.Time
}

DisclosureAttemptFact records WHEN a context disclosure was recorded (D7). It is committed together with its plan and result in one gated operation and is classified ImmutableFact: the recorded-at instant is fixed at commit and never changes.

func (DisclosureAttemptFact) IsValid

func (f DisclosureAttemptFact) IsValid() bool

IsValid reports whether the attempt fact carries a real recorded-at instant.

type DisclosureAttemptID

type DisclosureAttemptID provenance.JournalID

func (DisclosureAttemptID) JournalID

func (id DisclosureAttemptID) JournalID() provenance.JournalID

type DisclosureDisposition

type DisclosureDisposition uint8

DisclosureDisposition is the closed set of context-disclosure result dispositions.

DisclosureReleased is the MAXIMAL honest disposition (Stage-3 M5, ratified UAT resolution 6): the pure projection was durably recorded and released to the stdout boundary. Pasture commits before it prints, so the durable trail is intact once the projection reaches stdout, but Pasture CANNOT observe host or operator consumption of the released bytes — no "consumed" or "acknowledged" disposition is representable, because none could be honestly proven. The zero value is deliberately invalid so an unset disposition can never be committed.

const (
	// DisclosureReleased records that the disclosure projection was durably
	// committed and then released to the stdout boundary. It is the only
	// disposition M5 can honestly claim.
	DisclosureReleased DisclosureDisposition = iota + 1
)

func (DisclosureDisposition) IsValid

func (d DisclosureDisposition) IsValid() bool

IsValid reports whether d is one of the enumerated dispositions.

func (DisclosureDisposition) String

func (d DisclosureDisposition) String() string

String returns the stable lowercase spelling used in durable evidence and diagnostics. An out-of-range value renders its numeric form so a diagnostic never silently drops it.

type DisclosurePlanFact

type DisclosurePlanFact struct {
	PlanID     DisclosurePlanID
	Scope      ContentIdentity
	Projection ContentIdentity
	Policy     string
}

DisclosurePlanFact is the durable record of WHAT a context disclosure released (Stage-3 M5, D7). It is one of the three facts a single gated disclosure operation commits, classified ImmutableFact in the lifecycle guard map (the classification entry is pre-landed by the write-gate slice per IP-4): a plan is committed once per disclosure invocation and never mutated.

Scope is the fingerprint of the bounded selection (the OccurrenceQuery the operator disclosed), so two disclosures over the same selection share one scope. Projection is the sha256 content digest of the exact canonical projection released to stdout, so the durable record binds the released bytes without retaining them. Policy names the single static M5 disclosure policy (there is no alternate policy to select; ContextPolicyDefinitionRef stays a staked seam).

func (DisclosurePlanFact) IsValid

func (f DisclosurePlanFact) IsValid() bool

IsValid reports whether the plan fact is well-formed: a nonzero scope fingerprint, a nonzero projection content digest, and a non-empty policy note. The PlanID is assigned only when the fact is committed, so it is not required for a constructor-side plan.

type DisclosurePlanID

type DisclosurePlanID provenance.JournalID

func (DisclosurePlanID) JournalID

func (id DisclosurePlanID) JournalID() provenance.JournalID

type DisclosureResultFact

type DisclosureResultFact struct {
	ResultID    DisclosureResultID
	Disposition DisclosureDisposition
}

DisclosureResultFact records the DISPOSITION of a context disclosure (D7). It is committed with its plan and attempt in one gated operation and classified ImmutableFact. At M5 the only honest disposition is DisclosureReleased.

func (DisclosureResultFact) IsValid

func (f DisclosureResultFact) IsValid() bool

IsValid reports whether the result fact carries an enumerated disposition.

type DisclosureResultID

type DisclosureResultID provenance.JournalID

func (DisclosureResultID) JournalID

func (id DisclosureResultID) JournalID() provenance.JournalID

type EpochImplementationRef

type EpochImplementationRef struct {
	Definition DefinitionRef
	// contains filtered or unexported fields
}

type EvidencePayloadRef

type EvidencePayloadRef struct {
	Digest    digest.Digest
	Retention RetentionPolicyDefinitionRef
	// contains filtered or unexported fields
}

EvidencePayloadRef identifies a body in the content-addressed SQLite blob store. Every occurrence has one. Its digest is body identity, never occurrence identity; repeated deliveries may therefore share this value.

type HostVersionSource added in v0.0.9

type HostVersionSource string

HostVersionSource describes how ingress obtained HostVersion, not the identity or version of a running host process. Zero is unspecified legacy provenance; it is not an assertion that the caller supplied the version.

const (
	HostVersionCallerSupplied  HostVersionSource = "caller-supplied"
	HostVersionExecutableQuery HostVersionSource = "executable-query"
)

type IngressContentionError

type IngressContentionError struct {
	Elapsed time.Duration
	Cause   error
	// contains filtered or unexported fields
}

func (IngressContentionError) Error

func (e IngressContentionError) Error() string

func (IngressContentionError) Unwrap

func (e IngressContentionError) Unwrap() error

type IngressDeadlineError

type IngressDeadlineError struct {
	Deadline time.Duration
	Elapsed  time.Duration
	// contains filtered or unexported fields
}

func (IngressDeadlineError) Error

func (e IngressDeadlineError) Error() string

type InterpretationID

type InterpretationID provenance.JournalID

func (InterpretationID) JournalID

func (id InterpretationID) JournalID() provenance.JournalID

type InterpretedRecord

type InterpretedRecord struct {
	InterpretationID InterpretationID
	OccurrenceID     OccurrenceID
	// contains filtered or unexported fields
}

func NewInterpretedRecord

func NewInterpretedRecord(id InterpretationID, occurrence OccurrenceID, semantic runtime.EventSemantic, identities []waist.SemanticIdentity, unresolved []waist.UnresolvedFact, contract ir.RuntimeContractID) (InterpretedRecord, error)

func NewInterpretedRecordWithEnvelope added in v0.0.21

func NewInterpretedRecordWithEnvelope(id InterpretationID, occurrence OccurrenceID, semantic runtime.EventSemantic, identities []waist.SemanticIdentity, unresolved []waist.UnresolvedFact, contract ir.RuntimeContractID, manifest LifecycleMetamodelManifest, envelope SemanticEnvelopeRef) (InterpretedRecord, error)

NewInterpretedRecordWithEnvelope constructs an interpreted.v3 record that carries the complete five-reference semantic envelope it was finalized against. The envelope must be structurally complete: all five refs carry a positive journal coordinate, their owner kind, and a nonzero content identity. Owner resolution (body, digest, slot, state) and cross-envelope equality with the associated occurrence are enforced at the receipt and read boundaries, not here, so this constructor stays pure.

func NewInterpretedRecordWithMetamodel

func NewInterpretedRecordWithMetamodel(id InterpretationID, occurrence OccurrenceID, semantic runtime.EventSemantic, identities []waist.SemanticIdentity, unresolved []waist.UnresolvedFact, contract ir.RuntimeContractID, manifest LifecycleMetamodelManifest) (InterpretedRecord, error)

NewInterpretedRecordWithMetamodel constructs an interpreted.v2 record that carries the metamodel coordinate it was interpreted against (D2). It is the decode counterpart for interpreted.v2 evidence; the coordinate must be valid. Committed interpreted.v1 records decode through NewInterpretedRecord and have no coordinate — Metamodel() reports false for them so the read surface can disclose "metamodel unresolved (pre-M5)" rather than inventing one.

func (InterpretedRecord) Contract

func (r InterpretedRecord) Contract() ir.RuntimeContractID

func (InterpretedRecord) Identities

func (r InterpretedRecord) Identities() []waist.SemanticIdentity

func (InterpretedRecord) IsValid

func (r InterpretedRecord) IsValid() bool

func (InterpretedRecord) JournalID

func (r InterpretedRecord) JournalID() provenance.JournalID

func (InterpretedRecord) Metamodel

Metamodel returns the metamodel coordinate this interpretation was produced against and whether one is present. It is false for decoded interpreted.v1 records, which predate the metamodel producer (M5).

func (InterpretedRecord) Semantic

func (InterpretedRecord) SemanticEnvelope added in v0.0.21

func (r InterpretedRecord) SemanticEnvelope() (SemanticEnvelopeRef, bool)

SemanticEnvelope returns the complete five-reference envelope this interpretation was finalized against and whether one is present. It is false for decoded legacy interpreted.v1/v2 records, which predate the semantic envelope: no envelope is inferred for historical reads.

func (InterpretedRecord) UnresolvedFacts

func (r InterpretedRecord) UnresolvedFacts() []waist.UnresolvedFact

type InterpreterDefinitionRef

type InterpreterDefinitionRef struct {
	Definition DefinitionRef
	// contains filtered or unexported fields
}

type IssuedRequestID

type IssuedRequestID provenance.JournalID

func (IssuedRequestID) JournalID

func (id IssuedRequestID) JournalID() provenance.JournalID

type JSONKind added in v0.0.9

type JSONKind uint8
const (
	JSONKindUnknown JSONKind = iota
	JSONString
	JSONObject
)

func (JSONKind) String added in v0.0.9

func (k JSONKind) String() string

type LifecycleFactID

type LifecycleFactID provenance.JournalID

func (LifecycleFactID) JournalID

func (id LifecycleFactID) JournalID() provenance.JournalID

type LifecycleLinkID

type LifecycleLinkID provenance.JournalID

func (LifecycleLinkID) JournalID

func (id LifecycleLinkID) JournalID() provenance.JournalID

type LifecycleMetamodelManifest

type LifecycleMetamodelManifest struct {

	// ID is the stable definition identity of the metamodel document
	// ("pasture.lifecycle.metamodel"). It does not change across versions.
	ID DefinitionID
	// Version is the metamodel document version. It is 1 at M5 and bumps only
	// when the canonical body content changes.
	Version uint32
	// Content is the sha256 over the canonical metamodel body — the
	// content-address that makes the coordinate self-verifying and lets
	// concurrent first deliveries collapse to one deterministic activation.
	Content ContentIdentity
	// contains filtered or unexported fields
}

LifecycleMetamodelManifest is the journal-independent versioned interpretation identity embedded in interpreted evidence payloads (D2). It names WHICH interpretation vocabulary (the metamodel document) an interpreted record was produced against, so a reader can resolve the record's meaning to a journaled definition rather than to whatever the current binary happens to believe.

It embeds nonJournalValue: a coordinate is a value stamped INTO durable evidence, never itself a journal row, so it is mechanically non-journal and carries no guard classification entry.

func (LifecycleMetamodelManifest) IsValid

func (c LifecycleMetamodelManifest) IsValid() bool

IsValid reports whether the coordinate names a nonzero definition id, version, and content identity. A zero coordinate can never be stamped onto an interpreted record or presented to the write gate.

type LifecycleMetamodelRef

type LifecycleMetamodelRef struct {
	Definition DefinitionRef
	// contains filtered or unexported fields
}

type LifecyclePage

type LifecyclePage struct {
	Items []LifecycleRecord
	State PageState
	// contains filtered or unexported fields
}

func (LifecyclePage) Records

func (p LifecyclePage) Records() []LifecycleRecord

type LifecycleReader

type LifecycleReader interface {
	Occurrences(context.Context, OccurrenceQuery) (OccurrencePage, error)
	Records(context.Context, OccurrenceQuery) (LifecyclePage, error)
	Payload(context.Context, digest.Digest) ([]byte, error)
}

LifecycleReader exposes bounded occurrence history. Blob bodies are resolved separately by their EvidencePayloadRef, so a reader never implies atomicity between the idempotent blob write and the later occurrence commit.

type LifecycleRecord

type LifecycleRecord struct {
	Occurrence OccurrenceRecord
	// contains filtered or unexported fields
}

func NewLifecycleRecord

func NewLifecycleRecord(occurrence OccurrenceRecord, interpreted []InterpretedRecord) (LifecycleRecord, error)

func (LifecycleRecord) Interpreted

func (r LifecycleRecord) Interpreted() []InterpretedRecord

type LifecycleSchemaDefinitionRef

type LifecycleSchemaDefinitionRef struct {
	Definition DefinitionRef
	// contains filtered or unexported fields
}

type LinkRecord

type LinkRecord struct {
	// LinkID is the journal identity of this committed link.
	LinkID LifecycleLinkID
	// Harness is the enabled host family whose occurrence chain this edge
	// belongs to. Chains are per host, so an edge never crosses harnesses.
	Harness ir.HarnessID
	// Kind is the native identity kind shared by the two linked occurrences
	// (session, turn, request, tool-call, agent, message).
	Kind runtime.NativeIdentityKind
	// Value is the native identity value shared by the two linked occurrences.
	Value string
	// From is the immediately preceding occurrence carrying (Kind, Value).
	From OccurrenceID
	// To is the succeeding occurrence carrying (Kind, Value); this edge records
	// that From directly precedes To in the per-host identity chain.
	To OccurrenceID
}

LinkRecord is a committed, read-side occurrence lineage edge: a durable predecessor link between two occurrences that carry the same native identity (Kind, Value) on one harness. It is classified as an ImmutableSnapshot in the lifecycle guard map (the classification entry is pre-landed by the write-gate slice, per the Stage-3 IP-4 integration point) because a link is committed once and never mutated: re-materialization is idempotent against the set of already-committed links, not an in-place update.

Chains are reconstructed PER HOST (Harness): asymmetric chain depth across harnesses is expected and accepted, because only enabled events on each harness produce occurrences. LinkRecord carries only correlation data owned by the native harness (Kind, Value); it is not a Pasture actor, authority, decision, or review-evidence identity.

The field set is the IP-3 export contract consumed by the context-disclosure slice (its chain summaries read committed LinkRecords). Its shape is fixed at L1 and must not change without coordinating the consuming slice.

func (LinkRecord) IsValid

func (r LinkRecord) IsValid() bool

IsValid reports whether the link record is well-formed: a journaled link over an enabled harness and a declared native identity kind, with a non-empty value and two distinct occurrence endpoints. A self-edge (From == To) is invalid because a link records that one occurrence precedes another.

func (LinkRecord) JournalID

func (r LinkRecord) JournalID() provenance.JournalID

JournalID returns the committed link's journal identity, satisfying the journal-record convention used across the lifecycle model.

type NativeBinding

type NativeBinding struct {
	Kind       NativeBindingKind
	NativeName string
	Value      string
	// contains filtered or unexported fields
}

type NativeBindingKind

type NativeBindingKind uint8
const (
	BindingSession NativeBindingKind = iota + 1
	BindingTurn
	BindingRequest
	BindingToolCall
	BindingAgent
	BindingMessage
	BindingTask
	BindingWorktree
)

func ParseNativeBindingKind

func ParseNativeBindingKind(token string) (NativeBindingKind, error)

func (NativeBindingKind) IsValid

func (k NativeBindingKind) IsValid() bool

func (NativeBindingKind) String

func (k NativeBindingKind) String() string

type NativeFieldID

type NativeFieldID uint16

type OccurrenceEnvelopeRef

type OccurrenceEnvelopeRef struct {
	Runtime RuntimeContractDefinitionRef
	// HostVersion records the version observed at ingress. It is provenance,
	// not an admission check; payloads are retained even when this value falls
	// outside the currently described range.
	HostVersion string
	// HostVersionSource is optional provenance, never running-process
	// attestation. Omission preserves the exact encoding of legacy envelopes.
	HostVersionSource HostVersionSource `json:"hostVersionSource,omitempty"`
	Schema            LifecycleSchemaDefinitionRef
	Implementation    EpochImplementationRef
	Retention         RetentionPolicyDefinitionRef
	// Origin records the capture provenance origin of the occurrence (M4 raw
	// ingestion carrier). It is provenance-only: the write gate never observes
	// it. The empty value means the native sentinel (authentic-capture) for
	// records committed before origin marking; the member is omitted from the
	// JSON encoding when unset so pre-origin envelopes stay byte-identical.
	Origin origin.CaptureOrigin `json:"origin,omitempty"`
	// contains filtered or unexported fields
}

type OccurrenceID

type OccurrenceID provenance.JournalID

func (OccurrenceID) JournalID

func (id OccurrenceID) JournalID() provenance.JournalID

type OccurrencePage

type OccurrencePage struct {
	Items []OccurrenceRecord
	State PageState
	// contains filtered or unexported fields
}

func (OccurrencePage) Records

func (p OccurrencePage) Records() []OccurrenceRecord

type OccurrenceQuery

type OccurrenceQuery struct {
	Contracts []ir.RuntimeContractID
	Events    []ContractEventKind
	Bindings  []NativeBinding
	Page      PageRequest
	// contains filtered or unexported fields
}

func (OccurrenceQuery) BindingFilter

func (q OccurrenceQuery) BindingFilter() []NativeBinding

func (OccurrenceQuery) ContractFilter

func (q OccurrenceQuery) ContractFilter() []ir.RuntimeContractID

func (OccurrenceQuery) EventFilter

func (q OccurrenceQuery) EventFilter() []ContractEventKind

type OccurrenceRecord

type OccurrenceRecord struct {
	OccurrenceID    OccurrenceID
	Kind            ContractEventKind
	RuntimeContract ir.RuntimeContractID
	Envelope        OccurrenceEnvelopeRef
	ReceivedAt      time.Time
	Actor           provenance.AgentID

	Capture CaptureDisposition
	Payload EvidencePayloadRef
	// contains filtered or unexported fields
}

func NewOccurrenceRecord

func NewOccurrenceRecord(id OccurrenceID, kind ContractEventKind, contract ir.RuntimeContractID, envelope OccurrenceEnvelopeRef, receivedAt time.Time, actor provenance.AgentID, bindings []NativeBinding, capture CaptureDisposition, payload EvidencePayloadRef) OccurrenceRecord

NewOccurrenceRecord constructs the immutable public view used by replay projections. Bindings are defensively copied at the boundary.

func (OccurrenceRecord) Bindings

func (r OccurrenceRecord) Bindings() []NativeBinding

func (OccurrenceRecord) JournalID

func (r OccurrenceRecord) JournalID() provenance.JournalID

type OperationIDSource

type OperationIDSource interface {
	NewOperationID() (provenance.OperationID, error)
}

type PageRequest

type PageRequest struct {
	Size   PageSize
	Cursor *Cursor
	// contains filtered or unexported fields
}

type PageSize

type PageSize uint16

func NewPageSize

func NewPageSize(size uint16) (PageSize, error)

type PageState

type PageState struct {
	Next      *Cursor
	Truncated bool
	Reason    TruncationReason
	// contains filtered or unexported fields
}

type PhaseStateID

type PhaseStateID provenance.JournalID

func (PhaseStateID) JournalID

func (id PhaseStateID) JournalID() provenance.JournalID

type QueryFingerprint

type QueryFingerprint [32]byte

type RetentionPolicyDefinitionRef

type RetentionPolicyDefinitionRef struct {
	Definition DefinitionRef
	// contains filtered or unexported fields
}

RetentionPolicyDefinitionRef identifies the versioned store-all SQLite policy. The MVP has no alternate retention mode.

type RuntimeContractDefinitionRef

type RuntimeContractDefinitionRef struct {
	Definition DefinitionRef
	Contract   ir.RuntimeContractID
	// contains filtered or unexported fields
}

type SemanticEnvelopeRef

type SemanticEnvelopeRef struct {
	Runtime        RuntimeContractDefinitionRef
	Schema         LifecycleSchemaDefinitionRef
	Metamodel      LifecycleMetamodelRef
	Interpreter    InterpreterDefinitionRef
	Implementation EpochImplementationRef
	// contains filtered or unexported fields
}

func (SemanticEnvelopeRef) SharedRefsEqual added in v0.0.21

func (s SemanticEnvelopeRef) SharedRefsEqual(occurrence OccurrenceEnvelopeRef) bool

SharedRefsEqual reports whether the three refs the semantic envelope shares with its associated occurrence envelope are exactly equal. Individually valid but different paired refs fail the pair.

type TransitionCandidateID

type TransitionCandidateID provenance.JournalID

func (TransitionCandidateID) JournalID

type TruncationReason

type TruncationReason uint8
const (
	TruncatedPageSize TruncationReason = iota + 1
	TruncatedDepthLimit
	TruncatedNodeLimit
	TruncatedEdgeLimit
	TruncatedHistoryBound
)

type UnresolvedFactID

type UnresolvedFactID provenance.JournalID

func (UnresolvedFactID) JournalID

func (id UnresolvedFactID) JournalID() provenance.JournalID

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL