Documentation
¶
Index ¶
- 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
- type Activity
- type AppendResult
- type AssociateLifecycleRequest
- type Association
- type AssociationOrigin
- type BoundedCategory
- type CausalOrder
- type CompactionObservedPayload
- type Counters
- type CreateLifecycleRequest
- type CreationMode
- type DetachLifecycleRequest
- type DetachReason
- type DiagnosticRuleCode
- type DoctorResult
- type EffortAbandonedPayload
- type EffortCreatedPayload
- type EffortMetadata
- type EffortProjection
- type EffortRead
- type EffortReopenedPayload
- type EffortState
- type EffortTerminalPayload
- type ErrorCategory
- type EventEnvelope
- type EventKind
- type Finding
- type FindingBaseline
- type FindingEvidence
- type FindingThreshold
- type FindingWaivedPayload
- type FinishPhaseLifecycleRequest
- type ForkTrajectoryLifecycleRequest
- type GateMode
- type HandoffObservedPayload
- type HeuristicOptions
- type HeuristicThresholds
- type IntegrityIssue
- type IntegrityNotice
- type Ledger
- 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
- type LifecycleProjection
- type LifecycleRequest
- type LifecycleRequestBase
- type MetricsOptions
- type MetricsResult
- type ModelName
- type OriginMetadata
- type Outcome
- type Phase
- type PhaseFinishedPayload
- type PhaseInterval
- type PhaseStartedPayload
- type PhaseTransitionedPayload
- type ProposalKind
- type ProtocolVersion
- type ReconciliationProposal
- type RecoveryReport
- type ReopenLifecycleRequest
- type RepairAppliedPayload
- type RepairLifecycleRequest
- type RepairProposal
- type RepairReplacement
- type RepairState
- type RetentionPolicy
- type RetentionResult
- type RetentionState
- type Route
- type RouteAction
- type RouteLifecycleRequest
- type RoutePayload
- type RouteSelection
- type ScopeProjection
- type Selector
- type SessionAssociatedPayload
- type SessionDetachedPayload
- type SessionObservedPayload
- type ShellClassification
- type ShellObservedPayload
- type StartPhaseLifecycleRequest
- type StopReason
- type SubagentObservedPayload
- type TerminalLifecycleRequest
- type TerminalOutcome
- type ToolName
- type ToolObservedPayload
- type TrajectoryForkedPayload
- type TrajectoryLifecycleRequest
- type TrajectoryNode
- type TrajectoryPayload
- type TrajectoryProjection
- type TransitionPhaseLifecycleRequest
- type UsageObservedPayload
- type UsageTotals
- type WaiveLifecycleRequest
- type WaiverReasonCode
- type WaiverState
- type WorkflowProjection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCausalOrder ¶
func BuildCausalOrder(events []EventEnvelope) (*CausalOrder, []IntegrityIssue)
func DescriptorBytes ¶
func DescriptorBytes() []byte
func DescriptorSHA256 ¶
func DescriptorSHA256() string
func ParseSelectorTime ¶
ParseSelectorTime accepts the canonical CLI timestamp forms.
func ProjectTypeScript ¶
func ProjectTypeScript() string
ProjectTypeScript projects the normative descriptor into the generated Pi runtime. The descriptor remains the sole vocabulary and shape authority.
func RenderDoctorHuman ¶
func RenderDoctorHuman(out io.Writer, result DoctorResult) error
RenderDoctorHuman renders only the stable DoctorResult model. Findings are advisory output and do not imply a process exit status.
func RenderMetricsHuman ¶
func RenderMetricsHuman(out io.Writer, result MetricsResult) error
RenderMetricsHuman renders only the stable MetricsResult model. It never reads storage or recomputes projection state.
func SelectNormalizedEvents ¶
func SelectNormalizedEvents(reads []EffortRead, selector Selector) ([]json.RawMessage, error)
SelectNormalizedEvents returns selected, validated events in canonical effort/session/stream-sequence order. Corrupt raw records are never returned.
func ValidateSelector ¶
ValidateSelector validates closed values and the inclusive/exclusive window.
Types ¶
type AbandonLifecycleRequest ¶
type AbandonLifecycleRequest struct {
LifecycleRequestBase
Reason BoundedCategory `json:"reason,omitempty"`
}
type AppendResult ¶
type AppendResult struct {
Event EventEnvelope
Idempotent bool
}
type AssociateLifecycleRequest ¶
type AssociateLifecycleRequest struct {
LifecycleRequestBase
TrajectoryID string `json:"trajectoryId"`
AssociationOrigin AssociationOrigin `json:"associationOrigin"`
HandoffEventID string `json:"handoffEventId,omitempty"`
}
type Association ¶
type Association struct {
EffortID string `json:"effortId"`
SessionID string `json:"sessionId"`
TrajectoryID string `json:"trajectoryId"`
AssociationOrigin AssociationOrigin `json:"associationOrigin"`
}
type AssociationOrigin ¶
type AssociationOrigin string
type BoundedCategory ¶
type BoundedCategory string
type CausalOrder ¶
type CausalOrder struct {
// contains filtered or unexported fields
}
CausalOrder is the protocol partial order. It deliberately has no timestamp edge: timestamps measure causally linked intervals but never order writers.
func (*CausalOrder) Comparable ¶
func (o *CausalOrder) Comparable(left, right string) bool
func (*CausalOrder) Concurrent ¶
func (o *CausalOrder) Concurrent(left, right string) bool
func (*CausalOrder) HappensBefore ¶
func (o *CausalOrder) HappensBefore(left, right string) bool
type CompactionObservedPayload ¶
type CompactionObservedPayload struct {
Count uint64 `json:"count"`
}
type CreateLifecycleRequest ¶
type CreateLifecycleRequest struct {
LifecycleRequestBase
CreationMode CreationMode `json:"creationMode"`
Origin *OriginMetadata `json:"origin,omitempty"`
}
type CreationMode ¶
type CreationMode string
type DetachLifecycleRequest ¶
type DetachLifecycleRequest struct {
LifecycleRequestBase
Reason DetachReason `json:"reason"`
}
type DetachReason ¶
type DetachReason string
type DiagnosticRuleCode ¶
type DiagnosticRuleCode string
type DoctorResult ¶
type DoctorResult struct {
SchemaVersion int `json:"schemaVersion"`
ProtocolMajor int `json:"protocolMajor"`
GeneratedAt time.Time `json:"generatedAt"`
Selector Selector `json:"selector"`
Findings []Finding `json:"findings"`
Integrity []IntegrityNotice `json:"integrity"`
}
func Diagnose ¶
func Diagnose(reads []EffortRead, selector Selector, options HeuristicOptions, generatedAt time.Time) (DoctorResult, error)
Diagnose evaluates exact diagnostics and, when enabled, version-one heuristics against comparable completed-effort baselines.
func DiagnoseExact ¶
func DiagnoseExact(reads []EffortRead, selector Selector, generatedAt time.Time) (DoctorResult, error)
DiagnoseExact evaluates the closed WFV1 exact rule set without mutating the ledger. Callers may combine its stable result with separately evaluated heuristic findings.
type EffortAbandonedPayload ¶
type EffortAbandonedPayload struct {
TerminalEpoch uint64 `json:"terminalEpoch"`
Reason BoundedCategory `json:"reason,omitempty"`
}
type EffortCreatedPayload ¶
type EffortCreatedPayload struct {
CreationMode CreationMode `json:"creationMode"`
OriginEffortID string `json:"originEffortId,omitempty"`
OriginTrajectoryID string `json:"originTrajectoryId,omitempty"`
OriginAnchorID string `json:"originAnchorId,omitempty"`
}
type EffortMetadata ¶
type EffortMetadata struct {
EffortID string `json:"effortId"`
CreatedAt string `json:"createdAt"`
CreationMode CreationMode `json:"creationMode"`
Origin *OriginMetadata `json:"origin,omitempty"`
}
type EffortProjection ¶
type EffortProjection struct {
EffortID string `json:"effortId"`
State string `json:"state"`
Route string `json:"route"`
ActiveTrajectoryID string `json:"activeTrajectoryId"`
CurrentPath ScopeProjection `json:"currentPath"`
AllWork ScopeProjection `json:"allWork"`
Sessions []ScopeProjection `json:"sessions"`
Phases []ScopeProjection `json:"phases"`
Trajectories []ScopeProjection `json:"trajectories"`
DerivedEffortIDs []string `json:"derivedEffortIds"`
Origin *OriginMetadata `json:"origin,omitempty"`
Integrity []IntegrityNotice `json:"integrity"`
}
type EffortRead ¶
type EffortRead struct {
Metadata EffortMetadata
Events []EventEnvelope
EffectApplied map[string]bool
RejectedEffects map[string]bool
Records []LedgerRecord
Integrity []IntegrityIssue
}
type EffortReopenedPayload ¶
type EffortState ¶
type EffortState string
const ( EffortDiscovery EffortState = "discovery" EffortActive EffortState = "active" EffortCompleted EffortState = "completed" EffortAbandoned EffortState = "abandoned" )
type EffortTerminalPayload ¶
type EffortTerminalPayload struct {
TerminalEpoch uint64 `json:"terminalEpoch"`
}
type ErrorCategory ¶
type ErrorCategory string
type EventEnvelope ¶
type EventEnvelope struct {
Version ProtocolVersion `json:"version"`
EventID string `json:"eventId"`
IdempotencyKey string `json:"idempotencyKey,omitempty"`
ObservationID string `json:"observationId,omitempty"`
EffortID string `json:"effortId"`
SessionID string `json:"sessionId"`
TrajectoryID string `json:"trajectoryId,omitempty"`
ParentTrajectoryID string `json:"parentTrajectoryId,omitempty"`
PiAnchorID string `json:"piAnchorId,omitempty"`
ForkAnchorID string `json:"forkAnchorId,omitempty"`
Timestamp string `json:"timestamp"`
Kind EventKind `json:"kind"`
Predecessors []string `json:"predecessors"`
Payload json.RawMessage `json:"payload"`
EnvelopeExtensions map[string]json.RawMessage `json:"-"`
PayloadExtensions map[string]json.RawMessage `json:"-"`
}
func ValidateEvent ¶
func ValidateEvent(raw json.RawMessage) (EventEnvelope, error)
type Finding ¶
type Finding struct {
EffortID string `json:"effortId"`
Code string `json:"code"`
Type string `json:"type"`
Severity string `json:"severity"`
Scope string `json:"scope"`
Evidence FindingEvidence `json:"evidence"`
Threshold *FindingThreshold `json:"threshold,omitempty"`
Baseline *FindingBaseline `json:"baseline,omitempty"`
Confidence string `json:"confidence"`
Explanation string `json:"explanation"`
NextAction string `json:"nextAction"`
Reconciliation *ReconciliationProposal `json:"reconciliation,omitempty"`
Waived bool `json:"waived"`
}
func DiagnoseHeuristics ¶
func DiagnoseHeuristics(reads []EffortRead, selector Selector, options HeuristicOptions) ([]Finding, error)
DiagnoseHeuristics evaluates only the version-one heuristic rule set.
type FindingBaseline ¶
type FindingEvidence ¶
type FindingThreshold ¶
type FindingWaivedPayload ¶
type FindingWaivedPayload struct {
RuleCode DiagnosticRuleCode `json:"ruleCode"`
Scope BoundedCategory `json:"scope"`
EvidenceIDs []string `json:"evidenceIds"`
ReasonCode WaiverReasonCode `json:"reasonCode"`
}
type FinishPhaseLifecycleRequest ¶
type FinishPhaseLifecycleRequest struct {
LifecycleRequestBase
Phase Phase `json:"phase"`
StartEventID string `json:"startEventId"`
Outcome Outcome `json:"outcome,omitempty"`
}
type ForkTrajectoryLifecycleRequest ¶
type ForkTrajectoryLifecycleRequest struct {
LifecycleRequestBase
TrajectoryID string `json:"trajectoryId"`
ParentTrajectoryID string `json:"parentTrajectoryId"`
ForkAnchorID string `json:"forkAnchorId"`
}
type HandoffObservedPayload ¶
type HandoffObservedPayload struct {
Outcome Outcome `json:"outcome"`
TargetSessionID string `json:"targetSessionId"`
DurationMS uint64 `json:"durationMs,omitempty"`
ErrorCategory ErrorCategory `json:"errorCategory,omitempty"`
}
type HeuristicOptions ¶
type HeuristicOptions struct {
Enabled bool
MinimumBaselineSamples int
BaselinePercentile int
Thresholds HeuristicThresholds
}
HeuristicOptions controls optional heuristic diagnosis. Exact diagnosis is independent of Enabled.
type HeuristicThresholds ¶
type HeuristicThresholds struct {
PhaseReentryCount int
PhaseDurationSeconds int
PhaseTokens int
CompactionCount int
HandoffCount int
ToolFailureCount int
GateFailureCount int
CacheReadPercentBelow int
SubagentQueueWaitSeconds int
ImplementationReworkCount int
}
HeuristicThresholds are the absolute version-one diagnostic thresholds.
type IntegrityIssue ¶
type IntegrityNotice ¶
type Ledger ¶
type Ledger struct {
// contains filtered or unexported fields
}
func OpenLedger ¶
OpenLedger opens existing resident telemetry without creating or recovering any path. It is the read-only constructor for metrics and doctor queries.
func (*Ledger) Append ¶
func (l *Ledger) Append(ctx context.Context, raw json.RawMessage) (AppendResult, error)
func (*Ledger) ApplyLifecycle ¶
func (l *Ledger) ApplyLifecycle(ctx context.Context, request LifecycleRequest) (AppendResult, error)
func (*Ledger) CreateEffort ¶
func (l *Ledger) CreateEffort(metadata EffortMetadata, first json.RawMessage) (AppendResult, error)
func (*Ledger) Purge ¶
func (l *Ledger) Purge(ctx context.Context, effortID string, confirmed bool) (RetentionResult, error)
Purge performs the only explicitly confirmed recursive removal of a named resident effort. Discovery, active, missing, and already-pruned efforts are refused.
func (*Ledger) ReadAllEfforts ¶
func (l *Ledger) ReadAllEfforts() ([]EffortRead, error)
ReadAllEfforts reads every resident effort in stable effort-ID order. An unexpected entry is an integrity failure rather than an object to skip.
func (*Ledger) ReadEffort ¶
func (l *Ledger) ReadEffort(effortID string) (EffortRead, error)
func (*Ledger) Recover ¶
func (l *Ledger) Recover() (RecoveryReport, error)
func (*Ledger) Retain ¶
func (l *Ledger) Retain(ctx context.Context, policy RetentionPolicy, dryRun bool) (RetentionResult, error)
Retain selects repository-wide terminal efforts and, unless dryRun is true, prunes them oldest first.
type LedgerRecord ¶
type LedgerRecord struct {
SessionID string
Line int
Raw json.RawMessage
Event *EventEnvelope
Applied bool
}
type LifecycleProjection ¶
type LifecycleProjection struct {
State EffortState
Route Route
RouteHistory []RouteSelection
TerminalEpoch uint64
ActiveTrajectoryID string
Associations map[string]Association
OpenPhases map[string]PhaseInterval
PhaseIntervals []PhaseInterval
Trajectories map[string]TrajectoryNode
Waivers []WaiverState
Repairs []RepairState
SupersededEventIDs map[string]string
AppliedEventIDs []string
EffectApplied map[string]bool
Invalid []IntegrityIssue
// contains filtered or unexported fields
}
func ProjectLifecycle ¶
func ProjectLifecycle(events []EventEnvelope) LifecycleProjection
type LifecycleRequest ¶
type LifecycleRequest interface {
// contains filtered or unexported methods
}
func DecodeLifecycleRequest ¶
func DecodeLifecycleRequest(raw json.RawMessage) (LifecycleRequest, error)
type LifecycleRequestBase ¶
type MetricsOptions ¶
type MetricsOptions struct {
GeneratedAt time.Time
Retention RetentionPolicy
LastRunAt *time.Time
}
MetricsOptions supplies repository-wide state which is not encoded in an effort stream.
type MetricsResult ¶
type MetricsResult struct {
SchemaVersion int `json:"schemaVersion"`
ProtocolMajor int `json:"protocolMajor"`
GeneratedAt time.Time `json:"generatedAt"`
Selector Selector `json:"selector"`
Efforts []EffortProjection `json:"efforts"`
Retention RetentionState `json:"retention"`
Integrity []IntegrityNotice `json:"integrity"`
}
func AggregateMetrics ¶
func AggregateMetrics(reads []EffortRead, selector Selector, options MetricsOptions) (MetricsResult, error)
AggregateMetrics builds the canonical, deterministically ordered metrics projection from validated effort reads.
type OriginMetadata ¶
type PhaseFinishedPayload ¶
type PhaseInterval ¶
type PhaseStartedPayload ¶
type PhaseStartedPayload struct {
Phase Phase `json:"phase"`
Activity Activity `json:"activity,omitempty"`
ImplementationMode BoundedCategory `json:"implementationMode,omitempty"`
}
type PhaseTransitionedPayload ¶
type PhaseTransitionedPayload struct {
Phase Phase `json:"phase"`
StartEventID string `json:"startEventId"`
NextPhase Phase `json:"nextPhase"`
Outcome Outcome `json:"outcome,omitempty"`
Activity Activity `json:"activity,omitempty"`
ImplementationMode BoundedCategory `json:"implementationMode,omitempty"`
RouteAction RouteAction `json:"routeAction,omitempty"`
Route Route `json:"route,omitempty"`
}
type ProposalKind ¶
type ProposalKind string
type ProtocolVersion ¶
type ReconciliationProposal ¶
type ReconciliationProposal struct {
Kind string `json:"kind"`
SourceEventIDs []string `json:"sourceEventIds"`
Replacement RepairReplacement `json:"replacement"`
}
type RecoveryReport ¶
type RecoveryReport struct {
Recovered []string
Ambiguous []IntegrityIssue
}
type ReopenLifecycleRequest ¶
type ReopenLifecycleRequest struct {
LifecycleRequestBase
TrajectoryID string `json:"trajectoryId"`
AnchorID string `json:"anchorId"`
}
type RepairAppliedPayload ¶
type RepairAppliedPayload struct {
ProposalKind ProposalKind `json:"proposalKind"`
SourceEventIDs []string `json:"sourceEventIds"`
Replacement RepairReplacement `json:"replacement"`
}
type RepairLifecycleRequest ¶
type RepairLifecycleRequest struct {
LifecycleRequestBase
Proposal RepairProposal `json:"proposal"`
}
type RepairProposal ¶
type RepairProposal struct {
Kind ProposalKind `json:"kind"`
SourceEventIDs []string `json:"sourceEventIds"`
Replacement RepairReplacement `json:"replacement"`
}
type RepairReplacement ¶
type RepairReplacement struct {
EventKind EventKind `json:"eventKind"`
Payload json.RawMessage `json:"payload"`
}
type RepairState ¶
type RepairState struct {
EventID string
ProposalKind ProposalKind
SourceEventIDs []string
Replacement RepairReplacement
}
type RetentionPolicy ¶
RetentionPolicy bounds terminal effort history. A zero value disables that dimension independently.
type RetentionResult ¶
RetentionResult reports deterministic prune-order candidates and completed removals. Skipped contains candidates which became active before their prune lease was acquired.
type RetentionState ¶
type RouteAction ¶
type RouteAction string
type RouteLifecycleRequest ¶
type RouteLifecycleRequest struct {
LifecycleRequestBase
Route Route `json:"route"`
}
type RoutePayload ¶
type RoutePayload struct {
Route Route `json:"route"`
}
type RouteSelection ¶
type ScopeProjection ¶
type ScopeProjection struct {
ScopeID string `json:"scopeId"`
Usage UsageTotals `json:"usage"`
Counters Counters `json:"counters"`
EventIDs []string `json:"eventIds"`
}
type Selector ¶
type Selector struct {
EffortID *string `json:"effortId,omitempty"`
SessionID *string `json:"sessionId,omitempty"`
Phase *string `json:"phase,omitempty"`
Since *time.Time `json:"since,omitempty"`
Until *time.Time `json:"until,omitempty"`
}
Selector is the shared metrics and diagnosis event selector. Since is inclusive and Until is exclusive.
type SessionAssociatedPayload ¶
type SessionAssociatedPayload struct {
AssociationOrigin AssociationOrigin `json:"associationOrigin"`
TrajectoryID string `json:"trajectoryId"`
HandoffEventID string `json:"handoffEventId,omitempty"`
}
type SessionDetachedPayload ¶
type SessionDetachedPayload struct {
Reason DetachReason `json:"reason"`
}
type SessionObservedPayload ¶
type SessionObservedPayload struct {
Outcome Outcome `json:"outcome"`
DurationMS uint64 `json:"durationMs,omitempty"`
ErrorCategory ErrorCategory `json:"errorCategory,omitempty"`
}
type ShellClassification ¶
type ShellClassification string
type ShellObservedPayload ¶
type ShellObservedPayload struct {
Classification ShellClassification `json:"classification"`
Outcome Outcome `json:"outcome"`
GateMode GateMode `json:"gateMode,omitempty"`
}
type StartPhaseLifecycleRequest ¶
type StartPhaseLifecycleRequest struct {
LifecycleRequestBase
Phase Phase `json:"phase"`
Activity Activity `json:"activity,omitempty"`
ImplementationMode BoundedCategory `json:"implementationMode,omitempty"`
}
type StopReason ¶
type StopReason string
type SubagentObservedPayload ¶
type SubagentObservedPayload struct {
Role BoundedCategory `json:"role"`
RequestedModel ModelName `json:"requestedModel"`
ResolvedModel ModelName `json:"resolvedModel"`
ThinkingLevel BoundedCategory `json:"thinkingLevel"`
QueueDurationMS uint64 `json:"queueDurationMs"`
RunDurationMS uint64 `json:"runDurationMs"`
InputTokens uint64 `json:"inputTokens"`
OutputTokens uint64 `json:"outputTokens"`
CacheReadTokens uint64 `json:"cacheReadTokens"`
CacheWriteTokens uint64 `json:"cacheWriteTokens"`
CostUSD float64 `json:"costUsd"`
Outcome Outcome `json:"outcome"`
StopReason StopReason `json:"stopReason"`
ToolCount uint64 `json:"toolCount"`
ToolFailureCount uint64 `json:"toolFailureCount"`
ErrorCategory ErrorCategory `json:"errorCategory,omitempty"`
}
type TerminalLifecycleRequest ¶
type TerminalLifecycleRequest struct {
LifecycleRequestBase
}
type TerminalOutcome ¶
type TerminalOutcome string
type ToolObservedPayload ¶
type ToolObservedPayload struct {
Tool ToolName `json:"tool"`
Outcome Outcome `json:"outcome"`
DurationMS uint64 `json:"durationMs"`
ErrorCategory ErrorCategory `json:"errorCategory,omitempty"`
}
type TrajectoryForkedPayload ¶
type TrajectoryLifecycleRequest ¶
type TrajectoryLifecycleRequest struct {
LifecycleRequestBase
TrajectoryID string `json:"trajectoryId"`
AnchorID string `json:"anchorId"`
Reason BoundedCategory `json:"reason,omitempty"`
}
type TrajectoryNode ¶
type TrajectoryPayload ¶
type TrajectoryPayload struct {
TrajectoryID string `json:"trajectoryId"`
AnchorID string `json:"anchorId"`
Reason BoundedCategory `json:"reason,omitempty"`
}
type TrajectoryProjection ¶
type TransitionPhaseLifecycleRequest ¶
type TransitionPhaseLifecycleRequest struct {
LifecycleRequestBase
Phase Phase `json:"phase"`
StartEventID string `json:"startEventId"`
NextPhase Phase `json:"nextPhase"`
Outcome Outcome `json:"outcome,omitempty"`
Activity Activity `json:"activity,omitempty"`
ImplementationMode BoundedCategory `json:"implementationMode,omitempty"`
RouteAction RouteAction `json:"routeAction,omitempty"`
Route Route `json:"route,omitempty"`
}
type UsageObservedPayload ¶
type UsageObservedPayload struct {
Model ModelName `json:"model"`
InputTokens uint64 `json:"inputTokens"`
OutputTokens uint64 `json:"outputTokens"`
CacheReadTokens uint64 `json:"cacheReadTokens"`
CacheWriteTokens uint64 `json:"cacheWriteTokens"`
CostUSD float64 `json:"costUsd"`
DurationMS uint64 `json:"durationMs"`
Phase Phase `json:"phase,omitempty"`
Activity Activity `json:"activity,omitempty"`
}
type UsageTotals ¶
type WaiveLifecycleRequest ¶
type WaiveLifecycleRequest struct {
LifecycleRequestBase
RuleCode DiagnosticRuleCode `json:"ruleCode"`
Scope BoundedCategory `json:"scope"`
EvidenceIDs []string `json:"evidenceIds"`
ReasonCode WaiverReasonCode `json:"reasonCode"`
}
type WaiverReasonCode ¶
type WaiverReasonCode string
type WaiverState ¶
type WaiverState struct {
EventID string
RuleCode DiagnosticRuleCode
Scope string
EvidenceIDs []string
ReasonCode WaiverReasonCode
}
type WorkflowProjection ¶
type WorkflowProjection struct {
Metadata EffortMetadata
Lifecycle LifecycleProjection
ActiveAncestry []string
EvidenceEventIDs []string
EffectApplied map[string]bool
CurrentPathEventIDs []string
AllWorkEventIDs []string
DiscardedEventIDs []string
Trajectories []TrajectoryProjection
DerivedEffortIDs []string
Origin *OriginMetadata
Integrity []IntegrityIssue
}
func GroupDerivedFamilies ¶
func GroupDerivedFamilies(projections []WorkflowProjection) []WorkflowProjection
GroupDerivedFamilies annotates derived descendants. Each effort remains a separate projection, so callers can group lineage without adding parent work to a child and double-counting its totals.
func ProjectWorkflow ¶
func ProjectWorkflow(read EffortRead) WorkflowProjection