observability

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package observability provides the read-side surface for the Phase 7 observability contract: every execution exposes a full correlation chain (Workflow → Step → Task → Run → Attempt → Model/Tool Call → Memory → Result) plus the core metrics the platform guarantees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Percentile

func Percentile(values []float64, p float64) float64

Percentile computes the p-th percentile of sorted values (0 ≤ p ≤ 100).

func ValidateCorrelation

func ValidateCorrelation(c ExecutionCorrelation) []string

ValidateCorrelation asserts the chain invariants: every step's task exists among the tasks; every attempt's task exists; every model/tool call links to a task; every memory record links to a task or attempt. Returns a list of broken invariants (empty = valid).

Types

type AttemptNode

type AttemptNode struct {
	TaskID, RunID                                       string
	Ordinal, RunOrdinal                                 int
	Phase, RuntimeClass, RuntimeInstanceID, FailureCode string
	FencingToken                                        int64
	CreatedAt                                           time.Time
}

type AuditNode

type AuditNode struct {
	EventType, ResourceType, ResourceID, Actor, Details string
	OccurredAt                                          time.Time
}

type ExecutionCorrelation

type ExecutionCorrelation struct {
	Workflow    WorkflowNode
	Steps       []StepNode
	Tasks       []TaskNode
	Attempts    []AttemptNode
	ModelCalls  []ModelCallNode
	ToolCalls   []ToolCallNode
	Memories    []MemoryNode
	AuditEvents []AuditNode

	RuntimeOperationReceipts int
}

ExecutionCorrelation is the full trace of one workflow execution.

type MemoryNode

type MemoryNode struct {
	Namespace, Key                string
	SourceTaskID, SourceAttemptID string
}

type Metrics

type Metrics struct {
	WorkflowCount, WorkflowSucceeded, WorkflowFailed int
	TaskCount, TaskSucceeded, TaskFailed             int
	ModelCalls, ToolCalls, MemoryRecords             int
	AuditEvents, Receipts                            int

	WorkflowSuccessRate, TaskSuccessRate float64
	SchedulingLatencyMillis              Percentiles
	RetryRate, RecoveryRate              float64

	BudgetDrift           bool // reserved != settled tokens
	CapacityDrift         int  // ACTIVE reservations remaining
	DuplicateSideEffects  int  // tool_calls EXECUTED more than once for the same (task, tool, args)
	CrossTenantViolations int  // rows in other tenants referencing this workflow's resources
}

Metrics is the aggregated platform health surface (§Phase-7 core metrics).

type ModelCallNode

type ModelCallNode struct {
	TaskID, RunID, AttemptID, ModelRef, Status string
}

type Percentiles

type Percentiles struct {
	P50, P95, P99 float64
}

type StepNode

type StepNode struct {
	Name, Status, TaskID, FailureCode string
	AttemptCount                      int
}

type TaskNode

type TaskNode struct {
	ID, AgentVersionRef, Phase, ResultRef string
	CreatedAt                             time.Time
}

type ToolCallNode

type ToolCallNode struct {
	TaskID, RunID, AttemptID, ToolName, Action, Status string
}

type WorkflowNode

type WorkflowNode struct {
	ID, Status, Goal       string
	CreatedAt, CompletedAt time.Time
}

Jump to

Keyboard shortcuts

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