Documentation
¶
Overview ¶
Package agentanalytics owns provider-neutral evidence and rebuildable projections for agent execution. Provider transcripts remain the fact source; this package never writes conclusions back into them.
Index ¶
- Constants
- Variables
- func ChangedLineCounts(oldText, newText string) (additions, deletions int64)
- func ContentLineCount(content string) int64
- func ElapsedSeconds(startedAt, endedAt *time.Time) *float64
- func GenerationTokensPerSecond(outputTokens int64, firstTokenAt, endedAt *time.Time) *float64
- func ModelCapabilityEligible(models []string) (string, bool)
- func TokensPerSecond(outputTokens int64, startedAt, endedAt *time.Time) (rate, durationSeconds *float64)
- type ActivityDataset
- type ActivityDetailReport
- type ActivityReport
- type ActivitySummary
- type ActivityWorkItem
- type AgentAssignment
- type AgentInstance
- type ArtifactDelta
- type ArtifactKind
- type ArtifactTotals
- type AssignmentLifecycleSummary
- type AttentionClass
- type AttributionState
- type CohortProfile
- type ComparisonDecision
- type ComparisonPolicy
- type DetailAssignment
- type DetailFilter
- type DetailFilterOptions
- type DetailRequest
- type DetailTask
- type EconomicRequest
- type ExperienceSummary
- type HealthAssessment
- type HealthAxis
- type HealthReason
- type HealthState
- type InteractionEvent
- type InteractionKind
- type Interval
- type IntervalSummary
- type LifecycleStatus
- type LineTotals
- type MetricDefinition
- type ModelCostRow
- type ModelRequestRef
- type Money
- type OutcomeEvidence
- type OutcomeResolution
- type OutcomeStatus
- type PerformanceObservation
- type ProjectionObservability
- type RateEstimate
- type ReportCoverage
- type ReportObservability
- type RuntimeProfile
- type RuntimeResourceYield
- type TaskProfile
- type ToolExecution
- type ToolExecutionStatus
- type ToolExecutionSummary
- type WorkGraph
- type WorkItem
Constants ¶
const AgentHealthPolicyVersion = "agent-health.v1"
Variables ¶
var DefaultComparisonPolicy = ComparisonPolicy{
Version: "noninferiority-v1", MinimumEligibleN: 5, QualityMargin: .05, MinimumImprovement: .05,
}
Functions ¶
func ChangedLineCounts ¶
ChangedLineCounts returns deterministic gross line additions/deletions for a replacement fragment. Equal prefix/suffix lines are removed so a one-line value edit reports +1/-1, while unchanged context is not counted.
func ContentLineCount ¶
func ElapsedSeconds ¶
ElapsedSeconds projects a latency interval without pretending it is token generation. It is shared by exact provider TTFT and transcript-observed first response, whose evidence levels remain distinct in the report contract.
func ModelCapabilityEligible ¶
ModelCapabilityEligible prevents a mixed-model orchestration outcome from being credited to every model that happened to participate.
Types ¶
type ActivityDataset ¶
type ActivityDataset struct {
WorkItems []ActivityWorkItem
Assignments []AgentAssignment
Instances []AgentInstance
Requests []EconomicRequest
RequestFacts []transcript.ModelRequestUsage
Artifacts []ArtifactDelta
Tools []ToolExecution
IngestDiagnostics []string
Projection ProjectionObservability
}
type ActivityDetailReport ¶
type ActivityDetailReport struct {
SchemaVersion string `json:"schema_version"`
Report ActivityReport `json:"report"`
Filters DetailFilterOptions `json:"filters"`
Tasks []DetailTask `json:"tasks"`
NextCursor string `json:"next_cursor,omitempty"`
Metrics []MetricDefinition `json:"metrics"`
}
func BuildActivityDetail ¶
func BuildActivityDetail(dataset ActivityDataset, window, timezone string, now time.Time, filter DetailFilter) ActivityDetailReport
BuildActivityDetail applies one filter at the WorkItem grain, rebuilds every dependent section from that filtered set, and pages only the trace rows. This prevents a stale comparison/winner from surviving a cohort filter change.
type ActivityReport ¶
type ActivityReport struct {
SchemaVersion string `json:"schema_version"`
Window string `json:"window"`
Timezone string `json:"timezone"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
GeneratedAt time.Time `json:"generated_at"`
Summary ActivitySummary `json:"summary"`
RuntimeProfiles []RuntimeProfile `json:"runtime_profiles"`
TopCostModels map[string][]ModelCostRow `json:"top_cost_models"`
Artifacts ArtifactTotals `json:"artifacts"`
Tools ToolExecutionSummary `json:"tools"`
Health HealthAssessment `json:"health"`
Coverage map[string]ReportCoverage `json:"coverage"`
Observability ReportObservability `json:"observability"`
Comparisons []ComparisonDecision `json:"comparisons"`
}
func BuildActivityReport ¶
func BuildActivityReport(dataset ActivityDataset, window, timezone string, now time.Time) ActivityReport
type ActivitySummary ¶
type ActivitySummary struct {
WorkItems int `json:"work_items"`
Submitted int `json:"submitted"`
Started int `json:"started"`
Completed int `json:"completed"`
Interrupted int `json:"interrupted"`
Errors int `json:"errors"`
NeverStarted int `json:"never_started"`
Open int `json:"open"`
VerifiedPass int `json:"verified_pass"`
VerifiedFail int `json:"verified_fail"`
HumanRework int `json:"human_rework"`
CompletedUnverified int `json:"completed_unverified"`
WallSeconds float64 `json:"wall_seconds"`
CumulativeSeconds float64 `json:"cumulative_seconds"`
AverageConcurrency *float64 `json:"average_concurrency,omitempty"`
AgentInstances int `json:"agent_instances"`
AgentAssignments int `json:"agent_assignments"`
ModelRequests int `json:"model_requests"`
ToolCalls int `json:"tool_calls"`
AssignmentLifecycle AssignmentLifecycleSummary `json:"assignment_lifecycle"`
DelegatedLifecycle AssignmentLifecycleSummary `json:"delegated_lifecycle"`
}
type ActivityWorkItem ¶
type ActivityWorkItem struct {
ID string `json:"id"`
Runtime string `json:"runtime"`
Project string `json:"project,omitempty"`
TaskProfile TaskProfile `json:"task_profile"`
SourceRef string `json:"source_ref,omitempty"`
Status LifecycleStatus `json:"status"`
StartedAt *time.Time `json:"started_at,omitempty"`
EndedAt *time.Time `json:"ended_at,omitempty"`
OutputTokens int64 `json:"output_tokens"`
ToolCalls int `json:"tool_calls"`
Outcome OutcomeStatus `json:"outcome"`
}
type AgentAssignment ¶
type AgentAssignment struct {
ID string
WorkItemID string
AgentInstanceID string
// Root marks the lifecycle mirror of the WorkItem. Health only evaluates
// delegated assignments so one root failure is never counted twice.
Root bool
Attempt int
Status LifecycleStatus
SubmittedAt time.Time
StartedAt *time.Time
EndedAt *time.Time
}
type AgentInstance ¶
type ArtifactDelta ¶
type ArtifactDelta struct {
ID string `json:"id,omitempty"`
SourceToolID string `json:"source_tool_id,omitempty"`
WorkItemID string `json:"work_item_id,omitempty"`
Path string `json:"path"`
Kind ArtifactKind `json:"kind"`
Operation string `json:"operation,omitempty"`
Additions int64 `json:"additions"`
Deletions int64 `json:"deletions"`
WrittenLines int64 `json:"written_lines"`
ChangeCoverage string `json:"change_coverage,omitempty"`
Accepted *bool `json:"accepted,omitempty"`
Attribution AttributionState `json:"attribution"`
At time.Time `json:"at"`
Excluded bool `json:"excluded"`
ExcludeReason string `json:"exclude_reason,omitempty"`
Diagnostics []string `json:"diagnostics,omitempty"`
}
type ArtifactKind ¶
type ArtifactKind string
const ( ArtifactCode ArtifactKind = "code" ArtifactTest ArtifactKind = "test" ArtifactDoc ArtifactKind = "doc" ArtifactConfig ArtifactKind = "config" ArtifactAsset ArtifactKind = "asset" ArtifactOther ArtifactKind = "other" )
func ClassifyArtifact ¶
func ClassifyArtifact(path string) (ArtifactKind, bool, string)
ClassifyArtifact is intentionally conservative and deterministic. Generated, vendor and build output are excluded before any productivity projection.
type ArtifactTotals ¶
type ArtifactTotals struct {
ByKind map[ArtifactKind]LineTotals `json:"by_kind"`
Unattributed LineTotals `json:"unattributed"`
ExcludedFiles int64 `json:"excluded_files"`
Events int64 `json:"events"`
}
func AggregateArtifacts ¶
func AggregateArtifacts(deltas []ArtifactDelta) ArtifactTotals
type AttentionClass ¶
type AttentionClass string
const ( AttentionRequired AttentionClass = "required_gate" AttentionNeutral AttentionClass = "neutral_steer" AttentionAvoidable AttentionClass = "avoidable_correction" )
type AttributionState ¶
type AttributionState string
const ( AttributionProviderPatch AttributionState = "provider_patch" AttributionExclusiveBase AttributionState = "exclusive_baseline" AttributionUnknown AttributionState = "unattributed" )
type CohortProfile ¶
type CohortProfile struct {
CohortKey string `json:"cohort_key"`
Runtime string `json:"runtime"`
EligibleN int `json:"eligible_n"`
ObservedN int `json:"observed_n"`
VCR RateEstimate `json:"verified_completion_rate"`
FPR RateEstimate `json:"first_pass_rate"`
TTAVMedian *time.Duration `json:"ttav_median,omitempty"`
TTAVP75 *time.Duration `json:"ttav_p75,omitempty"`
CostPerAccepted map[string]float64 `json:"cost_per_accepted"`
AttentionPerAccepted *float64 `json:"attention_per_accepted,omitempty"`
}
func BuildCohortProfiles ¶
func BuildCohortProfiles(observations []PerformanceObservation) []CohortProfile
type ComparisonDecision ¶
type ComparisonDecision struct {
CohortKey string `json:"cohort_key"`
Candidate string `json:"candidate"`
Baseline string `json:"baseline"`
Status string `json:"status"`
Reason string `json:"reason"`
QualityDiff *float64 `json:"quality_diff,omitempty"`
QualityDiffLow *float64 `json:"quality_diff_low,omitempty"`
Recommendation string `json:"recommendation,omitempty"`
PolicyVersion string `json:"policy_version"`
}
func CompareCohorts ¶
func CompareCohorts(candidate, baseline CohortProfile, policy ComparisonPolicy) ComparisonDecision
type ComparisonPolicy ¶
type DetailAssignment ¶
type DetailAssignment struct {
ID string `json:"id"`
AgentInstanceID string `json:"agent_instance_id"`
Attempt int `json:"attempt"`
Status LifecycleStatus `json:"status"`
}
type DetailFilter ¶
type DetailFilter struct {
Project string `json:"project,omitempty"`
TaskClass string `json:"task_class,omitempty"`
Risk string `json:"risk,omitempty"`
Outcome string `json:"outcome,omitempty"`
Runtime string `json:"runtime,omitempty"`
Cursor string `json:"cursor,omitempty"`
Limit int `json:"limit,omitempty"`
}
type DetailFilterOptions ¶
type DetailRequest ¶
type DetailRequest struct {
ID string `json:"id"`
Model string `json:"model,omitempty"`
Effort string `json:"effort,omitempty"`
ServiceTier string `json:"service_tier,omitempty"`
OutputTokens int64 `json:"output_tokens"`
APIEquivalent *Money `json:"api_equivalent,omitempty"`
CostComplete bool `json:"cost_complete"`
}
type DetailTask ¶
type DetailTask struct {
ActivityWorkItem
AgentInstances int `json:"agent_instances"`
Assignments []DetailAssignment `json:"assignments"`
Requests []DetailRequest `json:"requests"`
Artifacts []ArtifactDelta `json:"artifacts"`
Diagnostics []string `json:"diagnostics,omitempty"`
}
type EconomicRequest ¶
type EconomicRequest struct {
ID string `json:"id"`
WorkItemID string `json:"work_item_id,omitempty"`
Runtime string `json:"runtime"`
Model string `json:"model,omitempty"`
Effort string `json:"effort,omitempty"`
ServiceTier string `json:"service_tier,omitempty"`
At time.Time `json:"at"`
OutputTokens int64 `json:"output_tokens"`
TokenComplete bool `json:"token_complete"`
GenerationRate *float64 `json:"generation_tokens_per_second,omitempty"`
GenerationDurationSeconds *float64 `json:"generation_duration_seconds,omitempty"`
ObservedResponseRate *float64 `json:"observed_response_tokens_per_second,omitempty"`
ObservedResponseDurationSeconds *float64 `json:"observed_response_duration_seconds,omitempty"`
TTFTSeconds *float64 `json:"ttft_seconds,omitempty"`
ObservedFirstResponseSeconds *float64 `json:"observed_first_response_seconds,omitempty"`
APIEquivalent *Money `json:"api_equivalent,omitempty"`
CostComplete bool `json:"cost_complete"`
Credits *float64 `json:"credits,omitempty"`
CreditComplete bool `json:"credit_complete"`
FastMultiplier *float64 `json:"fast_multiplier,omitempty"`
}
type ExperienceSummary ¶
type ExperienceSummary struct {
SubmitToStart *time.Duration `json:"submit_to_start,omitempty"`
FirstVisibleProgress *time.Duration `json:"first_visible_progress,omitempty"`
GrossTTAV *time.Duration `json:"gross_ttav,omitempty"`
LongestSilent *time.Duration `json:"longest_silent,omitempty"`
RequiredAttention int `json:"required_attention"`
NeutralAttention int `json:"neutral_attention"`
AvoidableAttention int `json:"avoidable_attention"`
}
func SummarizeExperience ¶
func SummarizeExperience(submitted time.Time, started, accepted *time.Time, events []InteractionEvent) ExperienceSummary
type HealthAssessment ¶
type HealthAssessment struct {
PolicyVersion string `json:"policy_version"`
State HealthState `json:"state"`
Label string `json:"label"`
Headline string `json:"headline"`
Axes []HealthAxis `json:"axes"`
Reasons []HealthReason `json:"reasons"`
}
func EvaluateHealth ¶
func EvaluateHealth(report ActivityReport) HealthAssessment
EvaluateHealth applies categorical hard gates to normalized facts. A failure cannot be averaged away by tokens, duration, calls or LOC, and an incomplete projection can never produce a false "healthy" verdict.
type HealthAxis ¶
type HealthAxis struct {
Key string `json:"key"`
Label string `json:"label"`
State HealthState `json:"state"`
Headline string `json:"headline"`
Reasons []HealthReason `json:"reasons"`
}
type HealthReason ¶
type HealthReason struct {
Code string `json:"code"`
State HealthState `json:"state"`
Message string `json:"message"`
Observed *float64 `json:"observed,omitempty"`
Unit string `json:"unit,omitempty"`
Comparator string `json:"comparator,omitempty"`
Threshold *float64 `json:"threshold,omitempty"`
MinimumN *int `json:"minimum_n,omitempty"`
EvidenceRef string `json:"evidence_ref"`
CoverageRef string `json:"coverage_ref,omitempty"`
}
HealthReason is an inspectable rule evaluation, not a score contribution. Threshold/minimum sample and coverage are carried with the conclusion so the frontend never has to recreate policy logic.
type HealthState ¶
type HealthState string
const ( HealthHealthy HealthState = "healthy" HealthAttention HealthState = "attention" HealthCritical HealthState = "critical" HealthInsufficient HealthState = "insufficient_evidence" )
type InteractionEvent ¶
type InteractionEvent struct {
WorkItemID string `json:"work_item_id"`
Kind InteractionKind `json:"kind"`
Attention AttentionClass `json:"attention"`
At time.Time `json:"at"`
Ref string `json:"ref,omitempty"`
}
type InteractionKind ¶
type InteractionKind string
const ( InteractionAck InteractionKind = "ack" InteractionProgress InteractionKind = "progress" InteractionNeedsYou InteractionKind = "needs_you" InteractionPermission InteractionKind = "permission" InteractionDecision InteractionKind = "decision" InteractionClarification InteractionKind = "clarification" InteractionSteer InteractionKind = "steer" InteractionCorrection InteractionKind = "correction" InteractionRetry InteractionKind = "retry" InteractionNotification InteractionKind = "notification" InteractionResume InteractionKind = "resume" InteractionRecovery InteractionKind = "error_recovery" )
type IntervalSummary ¶
func SummarizeIntervals ¶
func SummarizeIntervals(intervals []Interval, window Interval) IntervalSummary
SummarizeIntervals computes union wall time and sum agent time. Open or inverted intervals are excluded instead of becoming negative/zero evidence.
type LifecycleStatus ¶
type LifecycleStatus string
const ( LifecycleSubmitted LifecycleStatus = "submitted" LifecycleStarted LifecycleStatus = "started" LifecycleCompleted LifecycleStatus = "completed" LifecycleInterrupted LifecycleStatus = "interrupted" LifecycleError LifecycleStatus = "error" LifecycleNeverStarted LifecycleStatus = "never_started" LifecycleOpen LifecycleStatus = "open" )
type LineTotals ¶
type MetricDefinition ¶
type MetricDefinition struct {
ID string `json:"id"`
Grain string `json:"grain"`
Formula string `json:"formula"`
Unit string `json:"unit"`
Eligibility string `json:"eligibility"`
Timezone string `json:"timezone"`
Provenance string `json:"provenance"`
Coverage string `json:"coverage"`
Aggregation string `json:"aggregation"`
ComparisonPolicy string `json:"comparison_policy"`
}
MetricDefinition is the machine-readable metric dictionary consumed by API field documentation and UI explanations. Formula is descriptive; executable aggregation lives beside the domain types and is covered by parity tests.
func MetricRegistry ¶
func MetricRegistry() []MetricDefinition
MetricRegistry returns a defensive copy so callers cannot mutate the SSOT.
type ModelCostRow ¶
type ModelCostRow struct {
Runtime string `json:"runtime"`
Model string `json:"model"`
RequestN int `json:"request_n"`
Efforts []string `json:"efforts,omitempty"`
ServiceTiers []string `json:"service_tiers,omitempty"`
Cost *Money `json:"cost,omitempty"`
CostCoverage ReportCoverage `json:"cost_coverage"`
Credits *float64 `json:"credits,omitempty"`
CreditCoverage ReportCoverage `json:"credit_coverage"`
FastMultipliers []float64 `json:"fast_multipliers,omitempty"`
ObservedResponseTokensPerSecond *float64 `json:"observed_response_tokens_per_second,omitempty"`
ObservedResponseOutputTokens int64 `json:"observed_response_output_tokens"`
ObservedResponseDurationSeconds float64 `json:"observed_response_duration_seconds"`
ResponseSpeedCoverage ReportCoverage `json:"response_speed_coverage"`
}
type ModelRequestRef ¶
type OutcomeEvidence ¶
type OutcomeResolution ¶
type OutcomeResolution struct {
Status OutcomeStatus `json:"status"`
Evidence *OutcomeEvidence `json:"evidence,omitempty"`
Eligible bool `json:"eligible"`
Reason string `json:"reason,omitempty"`
}
func ResolveOutcome ¶
func ResolveOutcome(lifecycle LifecycleStatus, profile TaskProfile, evidence []OutcomeEvidence) OutcomeResolution
ResolveOutcome applies an explicit evidence precedence. Runtime completion is only completed_unverified; a failing applicable oracle always closes the VCR gate regardless of the runtime's optimistic lifecycle status.
type OutcomeStatus ¶
type OutcomeStatus string
OutcomeStatus is deliberately separate from runtime lifecycle. Completed is not success until an applicable oracle supplies evidence.
const ( OutcomeOpen OutcomeStatus = "open" OutcomeCompletedUnverified OutcomeStatus = "completed_unverified" OutcomeVerifiedPass OutcomeStatus = "verified_pass" OutcomeVerifiedFail OutcomeStatus = "verified_fail" OutcomeHumanAccepted OutcomeStatus = "human_accepted" OutcomeHumanRework OutcomeStatus = "human_rework" OutcomeInterrupted OutcomeStatus = "interrupted" OutcomeError OutcomeStatus = "error" )
type PerformanceObservation ¶
type ProjectionObservability ¶
type ProjectionObservability struct {
State string `json:"state"`
Mode string `json:"mode"`
RefreshedAt time.Time `json:"refreshed_at"`
SourceHighWatermark *time.Time `json:"source_high_watermark,omitempty"`
SourceFiles int `json:"source_files"`
ChangedFiles int `json:"changed_files"`
IndexSchema string `json:"index_schema,omitempty"`
Diagnostics []string `json:"diagnostics,omitempty"`
}
ProjectionObservability describes the materialized-view boundary. It keeps parser/index freshness separate from metric coverage, so a complete-looking chart can never hide a stale or partially parsed projection.
type RateEstimate ¶
type ReportCoverage ¶
type ReportObservability ¶
type ReportObservability struct {
Projection ProjectionObservability `json:"projection"`
Stages map[string]ReportCoverage `json:"stages"`
}
type RuntimeProfile ¶
type RuntimeProfile struct {
Runtime string `json:"runtime"`
WorkItems int `json:"work_items"`
Completed int `json:"completed"`
Interrupted int `json:"interrupted"`
Errors int `json:"errors"`
ActiveSeconds float64 `json:"active_seconds"`
OutputTokens int64 `json:"output_tokens"`
ModelRequests int `json:"model_requests"`
AgentInstances int `json:"agent_instances"`
ToolCalls int `json:"tool_calls"`
GenerationTokensPerSecond *float64 `json:"generation_tokens_per_second,omitempty"`
ObservedResponseTokensPerSecond *float64 `json:"observed_response_tokens_per_second,omitempty"`
TTFTMedianSeconds *float64 `json:"ttft_median_seconds,omitempty"`
ObservedFirstResponseMedianSeconds *float64 `json:"observed_first_response_median_seconds,omitempty"`
GenerationSpeedCoverage ReportCoverage `json:"generation_speed_coverage"`
ResponseSpeedCoverage ReportCoverage `json:"response_speed_coverage"`
TTFTCoverage ReportCoverage `json:"ttft_coverage"`
FirstResponseCoverage ReportCoverage `json:"first_response_coverage"`
SpeedCoverage ReportCoverage `json:"speed_coverage"` // compatibility alias for generation coverage
Artifacts ArtifactTotals `json:"artifacts"`
ArtifactCoverage ReportCoverage `json:"artifact_coverage"`
ResourceYield RuntimeResourceYield `json:"resource_yield"`
Tools ToolExecutionSummary `json:"tools"`
}
type RuntimeResourceYield ¶
type RuntimeResourceYield struct {
FormulaVersion string `json:"formula_version"`
ReviewableWrittenLines int64 `json:"reviewable_written_lines"`
RequestOutputTokens int64 `json:"request_output_tokens"`
APIEquivalent *Money `json:"api_equivalent,omitempty"`
CostCoverage ReportCoverage `json:"cost_coverage"`
TokenCoverage ReportCoverage `json:"token_coverage"`
WrittenLinesPerThousandOutputTokens *float64 `json:"written_lines_per_thousand_output_tokens,omitempty"`
WrittenLinesPerActiveHour *float64 `json:"written_lines_per_active_hour,omitempty"`
APIEquivalentPerThousandWrittenLines *Money `json:"api_equivalent_per_thousand_written_lines,omitempty"`
Diagnostics []string `json:"diagnostics"`
}
RuntimeResourceYield keeps the raw portfolio facts next to each derived ratio. It is descriptive for one runtime/window, never a capability score or a causal attribution of a request's cost to a particular file.
type TaskProfile ¶
type TaskProfile struct {
Project string `json:"project"`
TaskClass string `json:"task_class"`
ScopeBand string `json:"scope_band"`
Risk string `json:"risk"`
Oracle string `json:"oracle"`
Source string `json:"source"`
Confidence float64 `json:"confidence"`
}
func ProfileOpeningIntent ¶
func ProfileOpeningIntent(project, intent string) TaskProfile
ProfileOpeningIntent is a deliberately small pre-outcome classifier. It uses only the project and the human's opening intent; runtime duration, tokens and produced files can never leak into difficulty/cohort labels.
func (TaskProfile) CohortKey ¶
func (p TaskProfile) CohortKey() string
func (TaskProfile) Comparable ¶
func (p TaskProfile) Comparable() bool
type ToolExecution ¶
type ToolExecution struct {
ID string `json:"id"`
WorkItemID string `json:"work_item_id,omitempty"`
Runtime string `json:"runtime"`
Name string `json:"name"`
Status ToolExecutionStatus `json:"status"`
StartedAt *time.Time `json:"started_at,omitempty"`
EndedAt *time.Time `json:"ended_at,omitempty"`
DurationSeconds *float64 `json:"duration_seconds,omitempty"`
SourceRef string `json:"source_ref,omitempty"`
}
ToolExecution is a provider-neutral, immutable tool_use→tool_result fact. Open is a live append state; Unknown is a terminal run whose result evidence is missing. Neither may be mislabeled interrupted or enter latency averages.
type ToolExecutionStatus ¶
type ToolExecutionStatus string
const ( ToolExecutionOpen ToolExecutionStatus = "open" ToolExecutionCompleted ToolExecutionStatus = "completed" ToolExecutionError ToolExecutionStatus = "error" ToolExecutionInterrupted ToolExecutionStatus = "interrupted" ToolExecutionUnknown ToolExecutionStatus = "unknown" )
type ToolExecutionSummary ¶
type ToolExecutionSummary struct {
Calls int `json:"calls"`
Completed int `json:"completed"`
Errors int `json:"errors"`
Interrupted int `json:"interrupted"`
Open int `json:"open"`
Unknown int `json:"unknown"`
TotalDurationSeconds float64 `json:"total_duration_seconds"`
AverageDurationSeconds *float64 `json:"average_duration_seconds,omitempty"`
TimingCoverage ReportCoverage `json:"timing_coverage"`
}
func AggregateToolExecutions ¶
func AggregateToolExecutions(values []ToolExecution) ToolExecutionSummary
type WorkGraph ¶
type WorkGraph struct {
WorkItems []WorkItem
Assignments []AgentAssignment
Instances []AgentInstance
Requests []ModelRequestRef
}