Versions in this module Expand all Collapse all v0 v0.22.0 Jul 24, 2026 Changes in this version + func BuildCausalOrder(events []EventEnvelope) (*CausalOrder, []IntegrityIssue) + func DescriptorBytes() []byte + func DescriptorSHA256() string + func ParseSelectorTime(value string) (time.Time, error) + func ProjectTypeScript() string + func RenderDoctorHuman(out io.Writer, result DoctorResult) error + func RenderMetricsHuman(out io.Writer, result MetricsResult) error + func SelectNormalizedEvents(reads []EffortRead, selector Selector) ([]json.RawMessage, error) + func ValidateSelector(selector Selector) error + type AbandonLifecycleRequest struct + Reason BoundedCategory + type Activity string + type AppendResult struct + Event EventEnvelope + Idempotent bool + type AssociateLifecycleRequest struct + AssociationOrigin AssociationOrigin + HandoffEventID string + TrajectoryID string + type Association struct + AssociationOrigin AssociationOrigin + EffortID string + SessionID string + TrajectoryID string + type AssociationOrigin string + type BoundedCategory string + type CausalOrder struct + func (o *CausalOrder) Comparable(left, right string) bool + func (o *CausalOrder) Concurrent(left, right string) bool + func (o *CausalOrder) HappensBefore(left, right string) bool + type CompactionObservedPayload struct + Count uint64 + type Counters struct + Compactions uint64 + GateFailures uint64 + Handoffs uint64 + ImplementationRework uint64 + SubagentInvocations uint64 + ToolFailures uint64 + type CreateLifecycleRequest struct + CreationMode CreationMode + Origin *OriginMetadata + type CreationMode string + type DetachLifecycleRequest struct + Reason DetachReason + type DetachReason string + type DiagnosticRuleCode string + type DoctorResult struct + Findings []Finding + GeneratedAt time.Time + Integrity []IntegrityNotice + ProtocolMajor int + SchemaVersion int + Selector Selector + func Diagnose(reads []EffortRead, selector Selector, options HeuristicOptions, ...) (DoctorResult, error) + func DiagnoseExact(reads []EffortRead, selector Selector, generatedAt time.Time) (DoctorResult, error) + type EffortAbandonedPayload struct + Reason BoundedCategory + TerminalEpoch uint64 + type EffortCreatedPayload struct + CreationMode CreationMode + OriginAnchorID string + OriginEffortID string + OriginTrajectoryID string + type EffortMetadata struct + CreatedAt string + CreationMode CreationMode + EffortID string + Origin *OriginMetadata + type EffortProjection struct + ActiveTrajectoryID string + AllWork ScopeProjection + CurrentPath ScopeProjection + DerivedEffortIDs []string + EffortID string + Integrity []IntegrityNotice + Origin *OriginMetadata + Phases []ScopeProjection + Route string + Sessions []ScopeProjection + State string + Trajectories []ScopeProjection + type EffortRead struct + EffectApplied map[string]bool + Events []EventEnvelope + Integrity []IntegrityIssue + Metadata EffortMetadata + Records []LedgerRecord + RejectedEffects map[string]bool + type EffortReopenedPayload struct + AnchorID string + TerminalEpoch uint64 + TrajectoryID string + type EffortState string + const EffortAbandoned + const EffortActive + const EffortCompleted + const EffortDiscovery + type EffortTerminalPayload struct + TerminalEpoch uint64 + type ErrorCategory string + type EventEnvelope struct + EffortID string + EnvelopeExtensions map[string]json.RawMessage + EventID string + ForkAnchorID string + IdempotencyKey string + Kind EventKind + ObservationID string + ParentTrajectoryID string + Payload json.RawMessage + PayloadExtensions map[string]json.RawMessage + PiAnchorID string + Predecessors []string + SessionID string + Timestamp string + TrajectoryID string + Version ProtocolVersion + func ValidateEvent(raw json.RawMessage) (EventEnvelope, error) + type EventKind string + type Finding struct + Baseline *FindingBaseline + Code string + Confidence string + EffortID string + Evidence FindingEvidence + Explanation string + NextAction string + Reconciliation *ReconciliationProposal + Scope string + Severity string + Threshold *FindingThreshold + Type string + Waived bool + func DiagnoseHeuristics(reads []EffortRead, selector Selector, options HeuristicOptions) ([]Finding, error) + type FindingBaseline struct + Percentile int + Route string + RuleVersion int + SampleCount int + Unit string + Value float64 + type FindingEvidence struct + CounterIDs []string + EventIDs []string + ObservedValue *float64 + Unit string + type FindingThreshold struct + Comparator string + Kind string + Unit string + Value float64 + type FindingWaivedPayload struct + EvidenceIDs []string + ReasonCode WaiverReasonCode + RuleCode DiagnosticRuleCode + Scope BoundedCategory + type FinishPhaseLifecycleRequest struct + Outcome Outcome + Phase Phase + StartEventID string + type ForkTrajectoryLifecycleRequest struct + ForkAnchorID string + ParentTrajectoryID string + TrajectoryID string + type GateMode string + type HandoffObservedPayload struct + DurationMS uint64 + ErrorCategory ErrorCategory + Outcome Outcome + TargetSessionID string + type HeuristicOptions struct + BaselinePercentile int + Enabled bool + MinimumBaselineSamples int + Thresholds HeuristicThresholds + type HeuristicThresholds struct + CacheReadPercentBelow int + CompactionCount int + GateFailureCount int + HandoffCount int + ImplementationReworkCount int + PhaseDurationSeconds int + PhaseReentryCount int + PhaseTokens int + SubagentQueueWaitSeconds int + ToolFailureCount int + type IntegrityIssue struct + Code string + Detail string + EventIDs []string + Line int + Scope string + type IntegrityNotice struct + Code string + EventIDs []string + Explanation string + Scope string + Severity string + type Ledger struct + func NewLedger(root string) (*Ledger, error) + func OpenLedger(root string) (*Ledger, error) + func (l *Ledger) Append(ctx context.Context, raw json.RawMessage) (AppendResult, error) + func (l *Ledger) ApplyLifecycle(ctx context.Context, request LifecycleRequest) (AppendResult, error) + func (l *Ledger) CreateEffort(metadata EffortMetadata, first json.RawMessage) (AppendResult, error) + func (l *Ledger) Purge(ctx context.Context, effortID string, confirmed bool) (RetentionResult, error) + func (l *Ledger) ReadAllEfforts() ([]EffortRead, error) + func (l *Ledger) ReadEffort(effortID string) (EffortRead, error) + func (l *Ledger) Recover() (RecoveryReport, error) + func (l *Ledger) Retain(ctx context.Context, policy RetentionPolicy, dryRun bool) (RetentionResult, error) + type LedgerRecord struct + Applied bool + Event *EventEnvelope + Line int + Raw json.RawMessage + SessionID string + type LifecycleProjection struct + ActiveTrajectoryID string + AppliedEventIDs []string + Associations map[string]Association + EffectApplied map[string]bool + Invalid []IntegrityIssue + OpenPhases map[string]PhaseInterval + PhaseIntervals []PhaseInterval + Repairs []RepairState + Route Route + RouteHistory []RouteSelection + State EffortState + SupersededEventIDs map[string]string + TerminalEpoch uint64 + Trajectories map[string]TrajectoryNode + Waivers []WaiverState + func ProjectLifecycle(events []EventEnvelope) LifecycleProjection + type LifecycleRequest interface + func DecodeLifecycleRequest(raw json.RawMessage) (LifecycleRequest, error) + type LifecycleRequestBase struct + Action string + EffortID string + EventID string + IdempotencyKey string + Predecessors []string + SessionID string + Timestamp string + type MetricsOptions struct + GeneratedAt time.Time + LastRunAt *time.Time + Retention RetentionPolicy + type MetricsResult struct + Efforts []EffortProjection + GeneratedAt time.Time + Integrity []IntegrityNotice + ProtocolMajor int + Retention RetentionState + SchemaVersion int + Selector Selector + func AggregateMetrics(reads []EffortRead, selector Selector, options MetricsOptions) (MetricsResult, error) + type ModelName string + type OriginMetadata struct + AnchorID string + EffortID string + TrajectoryID string + type Outcome string + type Phase string + type PhaseFinishedPayload struct + Outcome Outcome + Phase Phase + StartEventID string + type PhaseInterval struct + FinishEventID string + Phase Phase + StartEventID string + TerminalEpoch uint64 + TrajectoryID string + type PhaseStartedPayload struct + Activity Activity + ImplementationMode BoundedCategory + Phase Phase + type PhaseTransitionedPayload struct + Activity Activity + ImplementationMode BoundedCategory + NextPhase Phase + Outcome Outcome + Phase Phase + Route Route + RouteAction RouteAction + StartEventID string + type ProposalKind string + type ProtocolVersion struct + Major uint16 + Minor uint16 + type ReconciliationProposal struct + Kind string + Replacement RepairReplacement + SourceEventIDs []string + type RecoveryReport struct + Ambiguous []IntegrityIssue + Recovered []string + type ReopenLifecycleRequest struct + AnchorID string + TrajectoryID string + type RepairAppliedPayload struct + ProposalKind ProposalKind + Replacement RepairReplacement + SourceEventIDs []string + type RepairLifecycleRequest struct + Proposal RepairProposal + type RepairProposal struct + Kind ProposalKind + Replacement RepairReplacement + SourceEventIDs []string + type RepairReplacement struct + EventKind EventKind + Payload json.RawMessage + type RepairState struct + EventID string + ProposalKind ProposalKind + Replacement RepairReplacement + SourceEventIDs []string + type RetentionPolicy struct + MaxCompletedEffortAgeDays int + MaxCompletedEffortCount int + type RetentionResult struct + Candidates []string + Pruned []string + Skipped []string + type RetentionState struct + Candidates []string + LastRunAt *time.Time + MaxAgeDays int + MaxCount int + TerminalEffortCount int + type Route string + type RouteAction string + type RouteLifecycleRequest struct + Route Route + type RoutePayload struct + Route Route + type RouteSelection struct + EventID string + Route Route + type ScopeProjection struct + Counters Counters + EventIDs []string + ScopeID string + Usage UsageTotals + type Selector struct + EffortID *string + Phase *string + SessionID *string + Since *time.Time + Until *time.Time + type SessionAssociatedPayload struct + AssociationOrigin AssociationOrigin + HandoffEventID string + TrajectoryID string + type SessionDetachedPayload struct + Reason DetachReason + type SessionObservedPayload struct + DurationMS uint64 + ErrorCategory ErrorCategory + Outcome Outcome + type ShellClassification string + type ShellObservedPayload struct + Classification ShellClassification + GateMode GateMode + Outcome Outcome + type StartPhaseLifecycleRequest struct + Activity Activity + ImplementationMode BoundedCategory + Phase Phase + type StopReason string + type SubagentObservedPayload struct + CacheReadTokens uint64 + CacheWriteTokens uint64 + CostUSD float64 + ErrorCategory ErrorCategory + InputTokens uint64 + Outcome Outcome + OutputTokens uint64 + QueueDurationMS uint64 + RequestedModel ModelName + ResolvedModel ModelName + Role BoundedCategory + RunDurationMS uint64 + StopReason StopReason + ThinkingLevel BoundedCategory + ToolCount uint64 + ToolFailureCount uint64 + type TerminalLifecycleRequest struct + type TerminalOutcome string + type ToolName string + type ToolObservedPayload struct + DurationMS uint64 + ErrorCategory ErrorCategory + Outcome Outcome + Tool ToolName + type TrajectoryForkedPayload struct + ForkAnchorID string + ParentTrajectoryID string + TrajectoryID string + type TrajectoryLifecycleRequest struct + AnchorID string + Reason BoundedCategory + TrajectoryID string + type TrajectoryNode struct + EventID string + ForkAnchorID string + ID string + ParentTrajectoryID string + type TrajectoryPayload struct + AnchorID string + Reason BoundedCategory + TrajectoryID string + type TrajectoryProjection struct + Discarded bool + EventIDs []string + ForkAnchorID string + ParentTrajectoryID string + TrajectoryID string + type TransitionPhaseLifecycleRequest struct + Activity Activity + ImplementationMode BoundedCategory + NextPhase Phase + Outcome Outcome + Phase Phase + Route Route + RouteAction RouteAction + StartEventID string + type UsageObservedPayload struct + Activity Activity + CacheReadTokens uint64 + CacheWriteTokens uint64 + CostUSD float64 + DurationMS uint64 + InputTokens uint64 + Model ModelName + OutputTokens uint64 + Phase Phase + type UsageTotals struct + CacheReadTokens uint64 + CacheWriteTokens uint64 + CostUSD float64 + DurationMS uint64 + InputTokens uint64 + OutputTokens uint64 + type WaiveLifecycleRequest struct + EvidenceIDs []string + ReasonCode WaiverReasonCode + RuleCode DiagnosticRuleCode + Scope BoundedCategory + type WaiverReasonCode string + type WaiverState struct + EventID string + EvidenceIDs []string + ReasonCode WaiverReasonCode + RuleCode DiagnosticRuleCode + Scope string + type WorkflowProjection struct + ActiveAncestry []string + AllWorkEventIDs []string + CurrentPathEventIDs []string + DerivedEffortIDs []string + DiscardedEventIDs []string + EffectApplied map[string]bool + EvidenceEventIDs []string + Integrity []IntegrityIssue + Lifecycle LifecycleProjection + Metadata EffortMetadata + Origin *OriginMetadata + Trajectories []TrajectoryProjection + func GroupDerivedFamilies(projections []WorkflowProjection) []WorkflowProjection + func ProjectWorkflow(read EffortRead) WorkflowProjection