Versions in this module Expand all Collapse all v0 v0.18.0 Oct 22, 2026 Changes in this version + const ABIVersion + const CanonicalVersion + const DefaultCheckpointBlobLimit + const RootWitnessRef + const RootWitnessSchemaRef + const SchemaExecutionCompleted + const SchemaExecutionCreated + const SchemaExecutionFailed + const SchemaExecutionRelation + const SchemaExecutionStarted + const SchemaRuntimePublishedFact + const WitnessSchemaRef + var ErrProjectionMode = errors.New("goatherd: projection mode incompatible") + var ErrUnknownFrontier = errors.New("unknown frontier") + var ExecutionProjection = ProjectionSpec + var ExecutionRelationProjection = ProjectionSpec + var ExecutionRelationSchemaLibrary = &StaticSchemaLibrary + var ExecutionSchemaLibrary = &StaticSchemaLibrary + var TrustedAppendContext = AppendContext + var TrustedReadContext = ReadContext + func CanonicalDigest(v any) (string, error) + func CanonicalJSONASCIIBytes(v any) ([]byte, error) + func CanonicalJSONBytes(v any) ([]byte, error) + func CanonicalRecordInput(schemaRef string, mode RecordMode, body map[string]any, causedBy []string, ...) (map[string]any, error) + func CanonicalWitnessInput(schemaRef string, body map[string]any) (map[string]any, error) + func CheckpointBlobLimitOrDefault(store *SQLiteTraceStore) int64 + func CopyMap(m map[string]any) map[string]any + func DeleteCheckpointBlob(gctx context.Context, store *SQLiteTraceStore, checkpointID string) error + func DeleteMaterializationIntent(gctx context.Context, store *SQLiteTraceStore, intentID string) error + func EnsureProjectionCompatible(slice Slice, spec ProjectionSpec) error + func ExecutionIDFor(appendIntentID, localRef string) string + func NonNilAnchors(anchors []map[string]any) []map[string]any + func NonNilMap(m map[string]any) map[string]any + func NonNilStrings(ss []string) []string + func PersistCheckpointBlob(gctx context.Context, store *SQLiteTraceStore, checkpointID, scopeID string, ...) error + func RecordCompletedMaterialization(store *SQLiteTraceStore, intentID, digest string, ...) error + func RecordDigest(schemaRef string, mode RecordMode, body map[string]any, causedBy []string, ...) (string, error) + func RelationIDFor(appendIntentID, localRef string) string + func RootWitnessBody() map[string]any + func RootWitnessBodyDigest() (string, error) + func RootWitnessRecordID() (string, error) + func RootWitnessRecordIDMust() string + func ValidateMode(mode RecordMode) error + func ValidateRootWitnessRecord(schemaRef string, mode RecordMode, body map[string]any, causedBy []string, ...) error + func ValidateSchemaRef(schemaRef string) error + func ValidateWitnessBody(schemaRef string, body map[string]any) error + func ValidateWitnessRef(witness string) error + func WitnessBodyDigest(schemaRef string, body map[string]any) (string, error) + type AppendBatch struct + AppendIntentID string + Groups []AppendGroup + func CompleteExecutionBatch(appendIntentID, executionID string, outputs map[string]any, causedBy []string) AppendBatch + func CreateExecutionBatch(appendIntentID, executionID, taskRef string, inputs map[string]any, ...) AppendBatch + func CreateExecutionRelationBatch(appendIntentID, relationID string, kind RelationKind, ...) AppendBatch + func FailExecutionBatch(appendIntentID, executionID, errMsg string, causedBy []string) AppendBatch + type AppendContext struct + ActorRef string + PresentedWitnessRefs []string + SchemaVersionSet string + TrustMode string + func (c AppendContext) ToOperationContext(op OperationKind) OperationContext + type AppendGroup struct + CausalParents []string + FactDrafts []RecordDraft + RetainedContext *RetainedContext + TraceOwnerID string + type AppendIntentConflictError struct + func NewAppendIntentConflictError(msg string) *AppendIntentConflictError + func (e *AppendIntentConflictError) Error() string + type AppendReceipt struct + AppendIntentID string + CausalEdges [][2]string + CommitReceipts []string + ContextReceipts []string + FactIDs []string + OwnerRanges map[string][2]int + type Containment string + const ContainBuffered + const ContainContained + const ContainFull + const ContainUncontained + type ContextAnchor struct + ContextID string + HiddenReason string + VisibleShape map[string]any + type EffectBus struct + func NewEffectBus(bufferSize int) *EffectBus + func (b *EffectBus) Close() + func (b *EffectBus) Publish(event EffectEvent) + func (b *EffectBus) Subscribe(id string) <-chan EffectEvent + func (b *EffectBus) SubscriberCount() int + func (b *EffectBus) Unsubscribe(id string) + type EffectEvent struct + CausalParents []string + IntentID string + KindLabel string + Mode RecordMode + Payload map[string]any + RecordID string + SchemaRef string + Timestamp time.Time + TraceOwnerID string + type EffectiveChild struct + Execution Execution + Relation ExecutionRelation + type EffectiveHistory struct + Children []EffectiveChild + PublishedFacts []PublishedFact + Relations []ExecutionRelation + Root Execution + func ProjectEffectiveHistory(rootSlice Slice, rootTraceOwnerID string, childSlices []Slice) (*EffectiveHistory, error) + func ProjectEffectiveHistoryFromStore(ctx context.Context, store *SQLiteTraceStore, readContext ReadContext, ...) (*EffectiveHistory, error) + type Execution struct + Cutoff Frontier + Error string + ExecutionID string + Inputs map[string]any + Outputs map[string]any + ParentExecutionID string + StartedFactID string + Status ExecutionStatus + TaskRef string + TerminalFactID string + func ProjectExecution(traceSlice Slice, targetTraceOwnerID string, cutoff *Frontier) (*Execution, error) + func ProjectExecutionFromStore(ctx context.Context, store *SQLiteTraceStore, readContext ReadContext, ...) (*Execution, error) + type ExecutionRelation struct + ChildExecutionID string + ChildFrontierID string + CreatedFactID string + ParentExecutionID string + RelationID string + RelationKind RelationKind + func ExecutionRelationFromFact(fact Record) (ExecutionRelation, error) + func ProjectExecutionRelations(traceSlice Slice, parentTraceOwnerID string) ([]ExecutionRelation, error) + func ProjectExecutionRelationsFromStore(ctx context.Context, store *SQLiteTraceStore, readContext ReadContext, ...) ([]ExecutionRelation, error) + type ExecutionStatus string + const ExecutionFailed + const ExecutionPending + const ExecutionRunning + const ExecutionSucceeded + type ExternalAnchor struct + AnchorKind string + HiddenReason string + Ref string + VisibleShape map[string]any + type Frontier struct + CreatedByFactID string + FrontierID string + PublisherOwnerID string + TargetTraceOwnerID string + ThroughFactID string + ThroughOwnerOrdinal int + func PublishExecutionFrontier(ctx context.Context, store *SQLiteTraceStore, auth AppendContext, ...) (Frontier, error) + type FrontierSpec struct + AppendIntentID string + CausedBy []string + FrontierID string + PublisherOwnerID string + TargetTraceOwnerID string + ThroughFactID string + type MaterializationOutcome string + const MaterializationCleanFailure + const MaterializationSplitState + const MaterializationSuccess + type MaterializationReceipt struct + FailureReason string + Outcome MaterializationOutcome + ProducedRecordIDs []string + SubstrateRef string + TargetRecordIDs []string + WorldSideAnchors []map[string]any + func ReadCompletedMaterialization(store *SQLiteTraceStore, intentID string) (string, MaterializationReceipt, bool, error) + type MaterializationResult struct + CaptureDrafts []RecordDraft + FailureReason string + Outcome MaterializationOutcome + WorldSideAnchors []map[string]any + type ModeFilter string + const ModeBoth + const ModeCapturesOnly + const ModeDeclarationsOnly + type OperationContext struct + ActorRef string + Operation OperationKind + PresentedAuthorityRefs []string + SchemaEnvironmentRef string + TrustMode string + VisibilityProfile VisibilityProfile + type OperationKind string + const OpAppend + const OpMaterialize + const OpObserve + const OpPublishCut + const OpRead + type ProjectionModeRequirement string + const ProjectionAcceptsAny + const ProjectionRequiresBoth + const ProjectionRequiresCaptures + const ProjectionRequiresDeclarations + type ProjectionSpec struct + AcceptsAnchors bool + ModeRequirement ProjectionModeRequirement + Name string + RequiresPayload bool + type PublishedFact struct + Data map[string]any + FactID string + Kind string + type ReadContext struct + ActorRef string + PresentedWitnessRefs []string + VisibilityProfile VisibilityProfile + func (c ReadContext) ToOperationContext() OperationContext + type Record struct + Body RecordBody + Envelope RecordEnvelope + View *RecordView + func (r Record) GetEnvelope() RecordEnvelope + func (r Record) GetView() *RecordView + type RecordBody struct + Payload map[string]any + type RecordDraft struct + AppendLocalID string + CausedByFactIDs []string + CausedByLocalRefs []string + KindLabel string + Mode RecordMode + Payload map[string]any + SchemaRef string + func ExecutionCompletedDraft(executionID string, outputs map[string]any) RecordDraft + func ExecutionCreatedDraft(executionID, taskRef string, inputs map[string]any, parentExecutionID string) RecordDraft + func ExecutionFailedDraft(executionID, errMsg string) RecordDraft + func ExecutionStartedDraft(executionID string) RecordDraft + type RecordEnvelope struct + CausedByIDs []string + Digest string + Mode RecordMode + RecordID string + SchemaRef string + WitnessRef string + type RecordMode string + const Capture + const Declaration + type RecordShape struct + Envelope RecordEnvelope + HiddenReason string + View *RecordView + func (r RecordShape) GetEnvelope() RecordEnvelope + func (r RecordShape) GetView() *RecordView + type RecordView struct + ContextRef string + KindLabel string + OwnerOrdinal int + TraceOwnerID string + type RecoveredCheckpointBlob struct + CheckpointID string + CreatedAt time.Time + ScopeID string + Seq uint64 + Snapshot []byte + State WorkspaceState + func LoadCheckpointBlobs(gctx context.Context, store *SQLiteTraceStore) ([]RecoveredCheckpointBlob, []string, error) + type RelationKind string + const RelationAbandoned + const RelationAdopted + const RelationSpawned + type RetainedContext struct + ActiveBindingRefs []string + CapabilityWitnessRefs []string + Containment Containment + ContextID string + SemanticEnvironmentRefs []string + SubstrateRef string + VisibilityPolicyRefs []string + type SQLiteTraceStore struct + func NewSQLiteTraceStore(path string) (*SQLiteTraceStore, error) + func OpenSQLiteTraceStoreReadOnly(path string) (*SQLiteTraceStore, error) + func (s *SQLiteTraceStore) Append(ctx context.Context, auth AppendContext, batch AppendBatch) (AppendReceipt, error) + func (s *SQLiteTraceStore) Close(ctx context.Context) error + func (s *SQLiteTraceStore) ContextCount(ctx context.Context) (int, error) + func (s *SQLiteTraceStore) FactCount(ctx context.Context) (int, error) + func (s *SQLiteTraceStore) PreviewRecordIDs(ctx context.Context, auth AppendContext, batch AppendBatch) ([]string, error) + func (s *SQLiteTraceStore) PublishCut(ctx context.Context, auth AppendContext, spec FrontierSpec) (Frontier, error) + func (s *SQLiteTraceStore) PublishFrontier(ctx context.Context, auth AppendContext, spec FrontierSpec) (Frontier, error) + func (s *SQLiteTraceStore) ReadCausalClosure(ctx context.Context, auth ReadContext, roots []string, modeFilter ModeFilter, ...) (Slice, error) + func (s *SQLiteTraceStore) ReadFact(ctx context.Context, auth ReadContext, factID string) (VisibleRecord, error) + func (s *SQLiteTraceStore) ReadOwnerCutoff(ctx context.Context, frontierID string) (Frontier, error) + func (s *SQLiteTraceStore) ReadOwnerPrefix(ctx context.Context, auth ReadContext, ownerID string, through int, ...) (Slice, error) + func (s *SQLiteTraceStore) ReadPathPrefix(ctx context.Context, auth ReadContext, pathRef string, through int, ...) (Slice, error) + func (s *SQLiteTraceStore) ResolveCut(ctx context.Context, auth ReadContext, cutID string, modeFilter ModeFilter) (Slice, error) + func (s *SQLiteTraceStore) ResolveFrontier(ctx context.Context, auth ReadContext, frontierID string, ...) (Slice, error) + func (s *SQLiteTraceStore) WithBus(bus *EffectBus) *SQLiteTraceStore + func (s *SQLiteTraceStore) WithCheckpointBlobLimit(limit int64) *SQLiteTraceStore + type ScannedRecord struct + OwnerID string + Payload map[string]any + RecordID string + SchemaRef string + func ScanRecordsBySchema(gctx context.Context, store *SQLiteTraceStore, schemaRefs ...string) ([]ScannedRecord, error) + type SchemaLibrary interface + Name func() string + ProjectionSpecs func() []ProjectionSpec + SchemaRefs func() []string + type Slice struct + CausalEdges [][2]string + ContextAnchors []ContextAnchor + ContextsByID map[string]RetainedContext + ExternalAnchors []ExternalAnchor + FactsByID map[string]VisibleRecord + Frontier *Frontier + ModeFilter ModeFilter + OwnerPathOrder []string + OwnerPaths map[string][]string + VisibilityProfile VisibilityProfile + WitnessAnchors []WitnessAnchor + WitnessesByID map[string]VisibleRecord + func (s Slice) FactIDs() []string + type StaticSchemaLibrary struct + LibraryName string + Refs []string + Specs []ProjectionSpec + func ShepherdSchemas() *StaticSchemaLibrary + func (l *StaticSchemaLibrary) Name() string + func (l *StaticSchemaLibrary) ProjectionSpecs() []ProjectionSpec + func (l *StaticSchemaLibrary) SchemaRefs() []string + type TraceStoreError struct + func NewTraceStoreError(msg string) *TraceStoreError + func (e *TraceStoreError) Error() string + type UnknownFactError struct + func (e *UnknownFactError) Error() string + type VisibilityProfile string + const VisibilityFullInternal + const VisibilityPayload + const VisibilityShapeOnly + type VisibleRecord interface + GetEnvelope func() RecordEnvelope + GetView func() *RecordView + type WitnessAnchor struct + HiddenReason string + VisibleShape map[string]any + WitnessRef string + type WitnessBody struct + ActiveBindingRefs []string + ActorRef string + AuthorityRefs []string + Containment Containment + ProvenancePolicyRefs []string + SemanticEnvironmentRefs []string + SubstrateRef string + VisibilityPolicyRefs []string + type WorkspaceState struct + Backend string + Data map[string]any + Revision string + func (ws WorkspaceState) Digest() (string, error)