Documentation
¶
Index ¶
- Constants
- func OverviewAttentionScope(query OverviewQuery) attention.Scope
- func ValidateUsageWindowDays(days int) error
- type AgentProbeTargetSource
- type CostCatalog
- type FailureHealth
- type Health
- type HookCatalogSource
- type HookRunStore
- type HookStoreOpener
- type LatencyMetric
- type MemoryEventSource
- type Observer
- func (o *Observer) AcknowledgeAttentionSnapshot(ctx context.Context, scope attention.Scope, snapshot, occurrence string) error
- func (o *Observer) AttachHooks(source HookCatalogSource)
- func (o *Observer) CaptureAttentionSnapshot(ctx context.Context, scope attention.Scope, ids []string) (string, []string, error)
- func (o *Observer) Close(ctx context.Context) error
- func (o *Observer) Health(ctx context.Context) (Health, error)
- func (o *Observer) OnAgentEvent(ctx context.Context, sessionID string, payload any)
- func (o *Observer) OnAgentEventForSession(ctx context.Context, sess *session.Session, payload any)
- func (o *Observer) OnSessionCreated(ctx context.Context, sess *session.Session)
- func (o *Observer) OnSessionStopped(_ context.Context, sess *session.Session)
- func (o *Observer) QueryEvents(ctx context.Context, query store.EventSummaryQuery) ([]store.EventSummary, error)
- func (o *Observer) QueryHookCatalog(ctx context.Context, filter hookspkg.CatalogFilter) ([]hookspkg.CatalogEntry, error)
- func (o *Observer) QueryHookEvents(_ context.Context, filter hookspkg.EventFilter) ([]hookspkg.EventDescriptor, error)
- func (o *Observer) QueryHookRuns(ctx context.Context, query store.HookRunQuery) (records []hookspkg.HookRunRecord, err error)
- func (o *Observer) QueryObserveOverview(ctx context.Context, query OverviewQuery) (OverviewView, error)
- func (o *Observer) QueryPermissionLog(ctx context.Context, query store.PermissionLogQuery) ([]store.PermissionLogEntry, error)
- func (o *Observer) QueryTaskDashboard(ctx context.Context, query TaskDashboardQuery) (TaskDashboardView, error)
- func (o *Observer) QueryTaskInbox(ctx context.Context, query TaskInboxQuery, actor taskpkg.ActorIdentity) (TaskInboxView, error)
- func (o *Observer) QueryTaskMetrics(ctx context.Context, query TaskMetricsQuery) (TaskMetrics, error)
- func (o *Observer) QueryTaskSummary(ctx context.Context, query TaskSummaryQuery) (Summary, error)
- func (o *Observer) QueryTokenStats(ctx context.Context, query store.TokenStatsQuery) ([]store.TokenStats, error)
- func (o *Observer) Reconcile(ctx context.Context) (store.ReconcileResult, error)
- func (o *Observer) ShutdownRetention(ctx context.Context) error
- func (o *Observer) StartRetention(ctx context.Context) error
- func (o *Observer) SweepRetention(ctx context.Context) (RetentionHealth, error)
- func (o *Observer) TaskAttentionItems(ctx context.Context, query OverviewQuery) ([]OverviewAttentionItem, error)
- func (o *Observer) WriteHookRecord(ctx context.Context, sessionID string, record hookspkg.HookRunRecord) (err error)
- type Option
- func WithAgentProbeSource(source AgentProbeTargetSource, timeout time.Duration) Option
- func WithAgentResolver(resolver session.AgentResolver) Option
- func WithCostCatalog(catalog CostCatalog) Option
- func WithHomePaths(homePaths compozyconfig.HomePaths) Option
- func WithHookCatalogSource(source HookCatalogSource) Option
- func WithHookStoreOpener(opener HookStoreOpener) Option
- func WithLogger(logger *slog.Logger) Option
- func WithMemoryEventSource(source MemoryEventSource) Option
- func WithNow(now func() time.Time) Option
- func WithObservabilityConfig(cfg compozyconfig.ObservabilityConfig) Option
- func WithProviderAuthModeResolver(resolver ProviderAuthModeResolver) Option
- func WithRegistry(registry Registry) Option
- func WithRetentionConfig(cfg RetentionConfig) Option
- func WithSessionSource(source SessionSource) Option
- func WithStartTime(startedAt time.Time) Option
- func WithTaskDashboardConfig(cfg TaskDashboardConfig) Option
- func WithTaskHealthConfig(cfg TaskHealthConfig) Option
- func WithVersionSource(source VersionSource) Option
- func WithWorkspaceResolver(resolver workspacepkg.RuntimeResolver) Option
- type OverviewAgentShare
- type OverviewAttention
- type OverviewAttentionItem
- type OverviewLongestSession
- type OverviewOutcomes
- type OverviewProfileUsage
- type OverviewPulse
- type OverviewQuery
- type OverviewStore
- type OverviewSystem
- type OverviewToday
- type OverviewUsage
- type OverviewView
- type PersistenceHealth
- type ProviderAuthModeResolver
- type Registry
- type RetentionConfig
- type RetentionHealth
- type SessionActivityHealth
- type SessionFailureHealth
- type SessionSource
- type StuckTaskRun
- type Summary
- type TaskCancelRequestTotal
- type TaskDashboardActiveRun
- type TaskDashboardActiveRuns
- type TaskDashboardBlockedCard
- type TaskDashboardCards
- type TaskDashboardConfig
- type TaskDashboardFailedCard
- type TaskDashboardFreshness
- type TaskDashboardHealth
- type TaskDashboardInProgressCard
- type TaskDashboardLatencyCard
- type TaskDashboardQuery
- type TaskDashboardQueue
- type TaskDashboardStatusBreakdown
- type TaskDashboardTotals
- type TaskDashboardView
- type TaskHealth
- type TaskHealthConfig
- type TaskInboxItem
- type TaskInboxLane
- type TaskInboxLaneGroup
- type TaskInboxQuery
- type TaskInboxView
- type TaskMetrics
- type TaskMetricsQuery
- type TaskOriginTotal
- type TaskOwnerTotal
- type TaskQueueDepth
- type TaskRecoveryTotals
- type TaskRunTotal
- type TaskStatusTotal
- type TaskSummaryQuery
- type VersionSource
Constants ¶
const ( // OverviewAttentionKindApproval marks items waiting for an approval decision. OverviewAttentionKindApproval = "approval" // OverviewAttentionKindNeedsInput marks items escalated for operator attention. OverviewAttentionKindNeedsInput = "needs_input" // OverviewAttentionKindFailure marks items whose latest execution failed. OverviewAttentionKindFailure = "failure" // OverviewActionApprove approves an approval-gated task. OverviewActionApprove = "approve" // OverviewActionReject rejects an approval-gated task. OverviewActionReject = "reject" // OverviewActionRetry retries the failed run behind an attention item. OverviewActionRetry = "retry" // OverviewActionOpen opens the attention item's owning entity. OverviewActionOpen = "open" )
const ( TaskInboxLaneMyWork = taskpkg.InboxLaneMyWork TaskInboxLaneApprovals = taskpkg.InboxLaneApprovals TaskInboxLaneFailedRuns = taskpkg.InboxLaneFailedRuns TaskInboxLaneBlocked = taskpkg.InboxLaneBlocked TaskInboxLaneArchived = taskpkg.InboxLaneArchived )
Variables ¶
This section is empty.
Functions ¶
func OverviewAttentionScope ¶
func OverviewAttentionScope(query OverviewQuery) attention.Scope
OverviewAttentionScope binds Home's snapshot to its selected read population.
func ValidateUsageWindowDays ¶
ValidateUsageWindowDays reports whether days is an accepted overview usage window. It is the single allowlist shared by the daemon, API, and CLI.
Types ¶
type AgentProbeTargetSource ¶
type AgentProbeTargetSource func(ctx context.Context) ([]acp.ProbeTarget, error)
AgentProbeTargetSource resolves the currently configured ACP-compatible agent/provider commands that should be checked in observe health.
type CostCatalog ¶
type CostCatalog interface {
ListModels(context.Context, modelcatalog.ListOptions) ([]modelcatalog.Model, error)
}
CostCatalog is the merged model projection consumed by usage estimation.
type FailureHealth ¶
type FailureHealth struct {
Status string `json:"status"`
Total int `json:"total"`
ByKind map[store.FailureKind]int `json:"by_kind,omitempty"`
Recent []SessionFailureHealth `json:"recent,omitempty"`
}
FailureHealth summarizes persisted lifecycle failures across indexed sessions.
type Health ¶
type Health struct {
Status string `json:"status"`
UptimeSeconds int64 `json:"uptime_seconds"`
ActiveSessions int `json:"active_sessions"`
ActiveAgents int `json:"active_agents"`
GlobalDBSizeBytes int64 `json:"global_db_size_bytes"`
SessionDBSizeBytes int64 `json:"session_db_size_bytes"`
Persistence PersistenceHealth `json:"persistence"`
Retention RetentionHealth `json:"retention"`
Failures FailureHealth `json:"failures"`
AgentProbes []acp.ProbeResult `json:"agent_probes,omitempty"`
Tasks TaskHealth `json:"tasks"`
Activities []SessionActivityHealth `json:"activities,omitempty"`
Version string `json:"version"`
}
Health is the daemon-local observability health snapshot.
type HookCatalogSource ¶
type HookCatalogSource interface {
Catalog(filter hookspkg.CatalogFilter) ([]hookspkg.CatalogEntry, error)
}
HookCatalogSource provides resolved hook catalog views from the live runtime.
type HookRunStore ¶
type HookRunStore interface {
RecordHookRun(context.Context, hookspkg.HookRunRecord) error
QueryHookRuns(context.Context, store.HookRunQuery) ([]hookspkg.HookRunRecord, error)
Close(context.Context) error
}
HookRunStore is the session-scoped storage surface used for hook run audits.
type HookStoreOpener ¶
type HookStoreOpener func(ctx context.Context, owner store.SessionDBOwner, path string) (HookRunStore, error)
HookStoreOpener opens the per-session store for the exact immutable owner. Implementations must forward both owner fields unchanged.
type LatencyMetric ¶
type LatencyMetric struct {
Samples int `json:"samples"`
AverageMillis int64 `json:"average_ms"`
MaximumMillis int64 `json:"maximum_ms"`
}
LatencyMetric summarizes one task-run latency family in milliseconds.
type MemoryEventSource ¶
type MemoryEventSource interface {
ListMemoryEventSummaries(
ctx context.Context,
workspaces []string,
query store.EventSummaryQuery,
) ([]store.EventSummary, error)
}
MemoryEventSource exposes canonical memory events across all memory DB authorities.
type Observer ¶
type Observer struct {
// contains filtered or unexported fields
}
Observer implements session.Notifier and exposes query/health helpers for global observability.
func (*Observer) AcknowledgeAttentionSnapshot ¶
func (*Observer) AttachHooks ¶
func (o *Observer) AttachHooks(source HookCatalogSource)
AttachHooks swaps in the live hook catalog source after the hook runtime is built.
func (*Observer) CaptureAttentionSnapshot ¶
func (*Observer) OnAgentEvent ¶
OnAgentEvent records one lightweight cross-session event summary and any derived aggregates.
func (*Observer) OnAgentEventForSession ¶
OnAgentEventForSession records event summaries for the active session.
func (*Observer) OnSessionCreated ¶
OnSessionCreated tracks the live session snapshot used by observability reads.
func (*Observer) OnSessionStopped ¶
OnSessionStopped removes the live snapshot after the manager persists lifecycle state.
func (*Observer) QueryEvents ¶
func (o *Observer) QueryEvents(ctx context.Context, query store.EventSummaryQuery) ([]store.EventSummary, error)
QueryEvents returns cross-session event summaries ordered for CLI/API consumption.
func (*Observer) QueryHookCatalog ¶
func (o *Observer) QueryHookCatalog( ctx context.Context, filter hookspkg.CatalogFilter, ) ([]hookspkg.CatalogEntry, error)
QueryHookCatalog returns the resolved hook catalog for the supplied filter.
func (*Observer) QueryHookEvents ¶
func (o *Observer) QueryHookEvents(_ context.Context, filter hookspkg.EventFilter) ([]hookspkg.EventDescriptor, error)
QueryHookEvents returns the supported hook taxonomy metadata.
func (*Observer) QueryHookRuns ¶
func (o *Observer) QueryHookRuns( ctx context.Context, query store.HookRunQuery, ) (records []hookspkg.HookRunRecord, err error)
QueryHookRuns returns persisted per-session hook execution records.
func (*Observer) QueryObserveOverview ¶
func (o *Observer) QueryObserveOverview(ctx context.Context, query OverviewQuery) (OverviewView, error)
QueryObserveOverview composes the home overview read model (global by default, optionally workspace-scoped).
func (*Observer) QueryPermissionLog ¶
func (o *Observer) QueryPermissionLog( ctx context.Context, query store.PermissionLogQuery, ) ([]store.PermissionLogEntry, error)
QueryPermissionLog returns permission audit rows.
func (*Observer) QueryTaskDashboard ¶
func (o *Observer) QueryTaskDashboard(ctx context.Context, query TaskDashboardQuery) (TaskDashboardView, error)
QueryTaskDashboard returns the observer-backed aggregate task dashboard view.
func (*Observer) QueryTaskInbox ¶
func (o *Observer) QueryTaskInbox( ctx context.Context, query TaskInboxQuery, actor taskpkg.ActorIdentity, ) (TaskInboxView, error)
QueryTaskInbox returns one bounded actor-scoped inbox page.
func (*Observer) QueryTaskMetrics ¶
func (o *Observer) QueryTaskMetrics(ctx context.Context, query TaskMetricsQuery) (TaskMetrics, error)
QueryTaskMetrics returns task-domain counters and latency summaries derived from durable state and audit rows.
func (*Observer) QueryTaskSummary ¶
QueryTaskSummary returns the current task summary buckets filtered by the supplied view.
func (*Observer) QueryTokenStats ¶
func (o *Observer) QueryTokenStats(ctx context.Context, query store.TokenStatsQuery) ([]store.TokenStats, error)
QueryTokenStats returns aggregated per-session token usage rows.
func (*Observer) Reconcile ¶
Reconcile scans the sessions directory and reconciles the global session index.
func (*Observer) ShutdownRetention ¶
ShutdownRetention stops the owned retention sweep loop and waits for it to exit.
func (*Observer) StartRetention ¶
StartRetention starts the owned retention sweep loop.
func (*Observer) SweepRetention ¶
func (o *Observer) SweepRetention(ctx context.Context) (RetentionHealth, error)
SweepRetention runs one deterministic retention sweep using the observer clock.
func (*Observer) TaskAttentionItems ¶
func (o *Observer) TaskAttentionItems(ctx context.Context, query OverviewQuery) ([]OverviewAttentionItem, error)
TaskAttentionItems reuses inbox visibility and triage before building a complete attention snapshot.
func (*Observer) WriteHookRecord ¶
func (o *Observer) WriteHookRecord(ctx context.Context, sessionID string, record hookspkg.HookRunRecord) (err error)
WriteHookRecord persists one hook execution record when the session database already exists.
type Option ¶
type Option func(*Observer)
Option customizes Observer construction.
func WithAgentProbeSource ¶
func WithAgentProbeSource(source AgentProbeTargetSource, timeout time.Duration) Option
WithAgentProbeSource injects the downstream ACP command source used by health.
func WithAgentResolver ¶
func WithAgentResolver(resolver session.AgentResolver) Option
WithAgentResolver injects the daemon-authoritative agent catalog used by provider-auth snapshot resolution.
func WithCostCatalog ¶
func WithCostCatalog(catalog CostCatalog) Option
WithCostCatalog injects the merged model catalog used for silent-agent estimation.
func WithHomePaths ¶
func WithHomePaths(homePaths compozyconfig.HomePaths) Option
WithHomePaths overrides the Compozy home layout used by observe/.
func WithHookCatalogSource ¶
func WithHookCatalogSource(source HookCatalogSource) Option
WithHookCatalogSource injects the runtime hook catalog source used by hook introspection.
func WithHookStoreOpener ¶
func WithHookStoreOpener(opener HookStoreOpener) Option
WithHookStoreOpener overrides the per-session hook run store opener, mainly for tests.
func WithLogger ¶
WithLogger injects the logger used for best-effort observer failures.
func WithMemoryEventSource ¶
func WithMemoryEventSource(source MemoryEventSource) Option
WithMemoryEventSource injects the Memory v2 canonical event aggregation source.
func WithObservabilityConfig ¶
func WithObservabilityConfig(cfg compozyconfig.ObservabilityConfig) Option
WithObservabilityConfig applies observability settings that affect observer-owned background work.
func WithProviderAuthModeResolver ¶
func WithProviderAuthModeResolver(resolver ProviderAuthModeResolver) Option
WithProviderAuthModeResolver overrides provider auth resolution for session snapshots.
func WithRegistry ¶
WithRegistry injects the global registry implementation used by observe/.
func WithRetentionConfig ¶
func WithRetentionConfig(cfg RetentionConfig) Option
WithRetentionConfig overrides retention behavior, mainly for tests.
func WithSessionSource ¶
func WithSessionSource(source SessionSource) Option
WithSessionSource injects the active session source used for health metrics.
func WithStartTime ¶
WithStartTime overrides the recorded daemon start time.
func WithTaskDashboardConfig ¶
func WithTaskDashboardConfig(cfg TaskDashboardConfig) Option
WithTaskDashboardConfig overrides the dashboard thresholds and active-run list sizing used by the observer task dashboard view.
func WithTaskHealthConfig ¶
func WithTaskHealthConfig(cfg TaskHealthConfig) Option
WithTaskHealthConfig overrides the task-run stuck thresholds used by the observer health view.
func WithVersionSource ¶
func WithVersionSource(source VersionSource) Option
WithVersionSource overrides the build metadata source.
func WithWorkspaceResolver ¶
func WithWorkspaceResolver(resolver workspacepkg.RuntimeResolver) Option
WithWorkspaceResolver injects workspace resolution for config lookups that need a filesystem root.
type OverviewAgentShare ¶
type OverviewAgentShare struct {
}
OverviewAgentShare is one agent's fraction of window token usage.
type OverviewAttention ¶
type OverviewAttention struct {
Snapshot string
Total int
ByKind map[string]int
Items []OverviewAttentionItem
}
OverviewAttention lists everything currently waiting on the user.
type OverviewAttentionItem ¶
type OverviewAttentionItem struct {
NotificationID string
WorkspaceID string
Kind string
Title string
Detail string
TaskID string
RunID string
SessionID string
OccurredAt time.Time
Actions []string
}
OverviewAttentionItem is one actionable attention row.
type OverviewLongestSession ¶
type OverviewLongestSession struct {
SessionID string
AgentName string
DurationSeconds int64
Date string
}
OverviewLongestSession is the longest user session inside the pulse window.
type OverviewOutcomes ¶
type OverviewOutcomes struct {
WindowDays int
Days []store.TaskRunOutcomeDay
Completed int
Failed int
Canceled int
SuccessPct float64
}
OverviewOutcomes summarizes terminal run outcomes across the fixed window.
type OverviewProfileUsage ¶
type OverviewProfileUsage struct {
ProfileID string
ProfileName string
Color string
Icon string
Emoji string
Archived bool
Tokens int64
}
OverviewProfileUsage is one owner-labeled usage bucket.
type OverviewPulse ¶
type OverviewPulse struct {
WindowDays int
Buckets []store.EventHourWeekdayBucket
Busiest *store.EventHourWeekdayBucket
LongestSession *OverviewLongestSession
}
OverviewPulse summarizes hour-by-weekday activity plus derived insights.
type OverviewQuery ¶
type OverviewQuery struct {
AcknowledgementProfileID string
ReadScope store.ReadScope
WorkspaceID string
TaskScope taskpkg.CatalogScope
UsageWindowDays int
Actor taskpkg.ActorIdentity
}
OverviewQuery bounds one home overview read within an explicit profile scope or an intentional all-profiles aggregate.
func (*OverviewQuery) Validate ¶
func (q *OverviewQuery) Validate() error
Validate normalizes the usage window and rejects unsupported values.
type OverviewStore ¶
type OverviewStore interface {
UpsertTokenUsageDaily(ctx context.Context, update store.TokenUsageDailyUpdate) error
ListTokenUsageByDay(ctx context.Context, query store.OverviewDayQuery) ([]store.TokenUsageDay, error)
ListTokenUsageByAgent(ctx context.Context, query store.OverviewDayQuery) ([]store.TokenUsageAgentTotal, error)
ListTokenUsageByProfile(ctx context.Context, query store.OverviewDayQuery) ([]store.TokenUsageProfileTotal, error)
SumTokenUsageCost(ctx context.Context, query store.OverviewDayQuery) ([]store.TokenUsageCostGroup, error)
CountTaskRunOutcomesByDay(ctx context.Context, query store.OverviewSinceQuery) ([]store.TaskRunOutcomeDay, error)
CountTasksClosedByDay(ctx context.Context, query store.OverviewSinceQuery) ([]store.TaskClosedDay, error)
CountEventsByHourWeekday(
ctx context.Context,
query store.OverviewSinceQuery,
) ([]store.EventHourWeekdayBucket, error)
LatestEventSummaryAt(ctx context.Context, query store.OverviewWorkspaceQuery) (time.Time, error)
CountHookDispatchesSince(ctx context.Context, query store.OverviewSinceQuery) (store.HookDispatchCounts, error)
LongestUserSessionSince(ctx context.Context, query store.OverviewSinceQuery) (*store.LongestSessionSample, error)
}
OverviewStore is the aggregate persistence capability behind the home overview.
type OverviewSystem ¶
OverviewSystem carries today-windowed system counters plus retention truth.
type OverviewToday ¶
OverviewToday summarizes today's terminal work.
type OverviewUsage ¶
type OverviewUsage struct {
WindowDays int
RetentionDays int
Truncated bool
TotalTokens int64
EstimatedCost *float64
CostCurrency string
CostStatus string
Days []store.TokenUsageDay
Profiles []OverviewProfileUsage
}
OverviewUsage summarizes token usage and estimated cost for the selected window.
type OverviewView ¶
type OverviewView struct {
GeneratedAt time.Time
Attention OverviewAttention
Today OverviewToday
Outcomes OverviewOutcomes
Usage OverviewUsage
Pulse OverviewPulse
System OverviewSystem
Freshness TaskDashboardFreshness
}
OverviewView is the composed home overview read model.
type PersistenceHealth ¶
type PersistenceHealth struct {
Status string `json:"status"`
GlobalDBSizeBytes int64 `json:"global_db_size_bytes"`
SessionDBSizeBytes int64 `json:"session_db_size_bytes"`
}
PersistenceHealth captures store health that later hardening tracks can extend without overloading unrelated API payloads.
type ProviderAuthModeResolver ¶
type ProviderAuthModeResolver func( ctx context.Context, agentName string, provider string, model string, workspaceID string, ) (compozyconfig.ProviderAuthMode, error)
ProviderAuthModeResolver resolves the effective auth owner for one session runtime.
type Registry ¶
type Registry interface {
RegisterSession(ctx context.Context, session store.SessionInfo) error
ListSessions(ctx context.Context, query store.SessionListQuery) ([]store.SessionInfo, error)
ReconcileSessions(ctx context.Context, sessions []store.SessionInfo) (store.ReconcileResult, error)
WriteEventSummary(ctx context.Context, summary store.EventSummary) error
ListEventSummaries(ctx context.Context, query store.EventSummaryQuery) ([]store.EventSummary, error)
RecordTokenUsage(ctx context.Context, stats store.TokenStatsUpdate, daily store.TokenUsageDailyUpdate) error
ListTokenStats(ctx context.Context, query store.TokenStatsQuery) ([]store.TokenStats, error)
WritePermissionLog(ctx context.Context, entry store.PermissionLogEntry) error
ListPermissionLog(ctx context.Context, query store.PermissionLogQuery) ([]store.PermissionLogEntry, error)
ListTasks(ctx context.Context, query taskpkg.Query) ([]taskpkg.Summary, error)
CountDependencies(ctx context.Context, taskID string) (int, error)
ListTaskRuns(ctx context.Context, query taskpkg.RunQuery) ([]taskpkg.Run, error)
ListTaskEvents(ctx context.Context, query taskpkg.EventQuery) ([]taskpkg.Event, error)
ListTaskTriageStates(ctx context.Context, actor taskpkg.ActorIdentity) ([]taskpkg.TriageState, error)
Path() string
Close(ctx context.Context) error
}
Registry is the narrowed global persistence surface consumed by observe/.
type RetentionConfig ¶
RetentionConfig controls observer retention sweeps.
func RetentionConfigFromObservability ¶
func RetentionConfigFromObservability(cfg compozyconfig.ObservabilityConfig) RetentionConfig
RetentionConfigFromObservability maps daemon configuration into observer retention settings.
type RetentionHealth ¶
type RetentionHealth struct {
Enabled bool `json:"enabled"`
RetentionDays int `json:"retention_days"`
SweepIntervalSeconds int64 `json:"sweep_interval_seconds"`
LastSweepStatus string `json:"last_sweep_status"`
LastSweepAt *time.Time `json:"last_sweep_at,omitempty"`
LastCutoffAt *time.Time `json:"last_cutoff_at,omitempty"`
LastSweepError string `json:"last_sweep_error,omitempty"`
DeletedEventSummaries int64 `json:"deleted_event_summaries"`
DeletedTokenStats int64 `json:"deleted_token_stats"`
DeletedTokenUsageDaily int64 `json:"deleted_token_usage_daily"`
DeletedPermissionLogRows int64 `json:"deleted_permission_log_rows"`
}
RetentionHealth captures the operator-visible state of observability retention.
type SessionActivityHealth ¶
type SessionActivityHealth struct {
SessionID string `json:"session_id"`
TurnID string `json:"turn_id,omitempty"`
TurnSource string `json:"turn_source,omitempty"`
TurnStartedAt *time.Time `json:"turn_started_at,omitempty"`
LastActivityAt *time.Time `json:"last_activity_at,omitempty"`
LastActivityKind string `json:"last_activity_kind,omitempty"`
LastActivityDetail string `json:"last_activity_detail,omitempty"`
CurrentTool string `json:"current_tool,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
LastProgressAt *time.Time `json:"last_progress_at,omitempty"`
IterationCurrent int `json:"iteration_current,omitempty"`
IterationMax int `json:"iteration_max,omitempty"`
IdleSeconds int64 `json:"idle_seconds,omitempty"`
ElapsedSeconds int64 `json:"elapsed_seconds,omitempty"`
Status string `json:"status"`
StallState string `json:"stall_state,omitempty"`
StallReason string `json:"stall_reason,omitempty"`
}
SessionActivityHealth captures the active runtime supervision state exposed through the daemon health view.
type SessionFailureHealth ¶
type SessionFailureHealth struct {
SessionID string `json:"session_id"`
AgentName string `json:"agent_name,omitempty"`
Provider string `json:"provider,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
State string `json:"state,omitempty"`
FailureKind store.FailureKind `json:"failure_kind"`
Summary string `json:"summary,omitempty"`
CrashBundlePath string `json:"crash_bundle_path,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
SessionFailureHealth is a compact, redacted lifecycle failure row.
type SessionSource ¶
SessionSource reports the currently active in-memory sessions.
type StuckTaskRun ¶
type StuckTaskRun struct {
TaskID string `json:"task_id"`
RunID string `json:"run_id"`
Status taskpkg.RunStatus `json:"status"`
OriginKind taskpkg.OriginKind `json:"origin_kind"`
SessionID string `json:"session_id,omitempty"`
AgeMillis int64 `json:"age_ms"`
}
StuckTaskRun reports one run that exceeded the configured claimed/starting/running threshold.
type Summary ¶
type Summary struct {
TotalTasks int `json:"total_tasks"`
TotalRuns int `json:"total_runs"`
TaskTotals []TaskStatusTotal `json:"task_totals,omitempty"`
TaskOrigins []TaskOriginTotal `json:"task_origins,omitempty"`
RunTotals []TaskRunTotal `json:"run_totals,omitempty"`
OwnerTotals []TaskOwnerTotal `json:"owner_totals,omitempty"`
QueueDepth []TaskQueueDepth `json:"queue_depth,omitempty"`
}
Summary exposes the current read-side task summary buckets.
type TaskCancelRequestTotal ¶
type TaskCancelRequestTotal struct {
OriginKind taskpkg.OriginKind `json:"origin_kind"`
Count int `json:"count"`
}
TaskCancelRequestTotal reports cancellation requests grouped by origin.
type TaskDashboardActiveRun ¶
type TaskDashboardActiveRun struct {
TaskID string `json:"task_id"`
TaskIdentifier string `json:"task_identifier,omitempty"`
TaskTitle string `json:"task_title"`
TaskStatus taskpkg.Status `json:"task_status"`
TaskPriority taskpkg.Priority `json:"task_priority,omitempty"`
TaskOwner *taskpkg.Ownership `json:"task_owner,omitempty"`
Scope taskpkg.Scope `json:"scope"`
WorkspaceID string `json:"workspace_id,omitempty"`
LatestEventSeq int64 `json:"latest_event_seq"`
RunID string `json:"run_id"`
RunStatus taskpkg.RunStatus `json:"run_status"`
Attempt int `json:"attempt"`
MaxAttempts int `json:"max_attempts"`
SessionID string `json:"session_id,omitempty"`
LastActivityAt time.Time `json:"last_activity_at"`
AgeMilli int64 `json:"age_ms"`
HealthStatus string `json:"health_status"`
Stuck bool `json:"stuck"`
Error string `json:"error,omitempty"`
}
TaskDashboardActiveRun exposes one recent active-run card payload.
type TaskDashboardActiveRuns ¶
type TaskDashboardActiveRuns struct {
Total int `json:"total"`
Running int `json:"running"`
Starting int `json:"starting"`
Claimed int `json:"claimed"`
Queued int `json:"queued"`
Items []TaskDashboardActiveRun `json:"items,omitempty"`
}
TaskDashboardActiveRuns summarizes the currently active run set and exposes recent cards.
type TaskDashboardBlockedCard ¶
type TaskDashboardBlockedCard struct {
Tasks int `json:"tasks"`
AwaitingApproval int `json:"awaiting_approval"`
AwaitingDependencies int `json:"awaiting_dependencies"`
HealthStatus string `json:"health_status"`
}
TaskDashboardBlockedCard summarizes blocked work and approval/dependency pressure.
type TaskDashboardCards ¶
type TaskDashboardCards struct {
InProgress TaskDashboardInProgressCard `json:"in_progress"`
Blocked TaskDashboardBlockedCard `json:"blocked"`
Failed TaskDashboardFailedCard `json:"failed"`
Latency TaskDashboardLatencyCard `json:"latency"`
}
TaskDashboardCards exposes dashboard-ready card values without leaking raw summary buckets.
type TaskDashboardConfig ¶
type TaskDashboardConfig struct {
ActiveRunLimit int
BacklogWarnAfter time.Duration
StaleAfter time.Duration
}
TaskDashboardConfig controls task dashboard freshness/backlog thresholds and active-run list size.
type TaskDashboardFailedCard ¶
type TaskDashboardFailedCard struct {
Tasks int `json:"tasks"`
FailedRuns int `json:"failed_runs"`
ForcedStops int `json:"forced_stops"`
HealthStatus string `json:"health_status"`
}
TaskDashboardFailedCard summarizes failed work and disruptive run outcomes.
type TaskDashboardFreshness ¶
type TaskDashboardFreshness struct {
ObservedAt time.Time `json:"observed_at"`
LatestActivityAt time.Time `json:"latest_activity_at"`
AgeMilli int64 `json:"age_ms"`
StaleAfterMilli int64 `json:"stale_after_ms"`
HasLiveWork bool `json:"has_live_work"`
Status string `json:"status"`
Stale bool `json:"stale"`
}
TaskDashboardFreshness exposes the recency and stale-warning state of the dashboard snapshot.
type TaskDashboardHealth ¶
type TaskDashboardHealth struct {
Status string `json:"status"`
StuckRuns int `json:"stuck_runs"`
ActiveOrphanRuns int `json:"active_orphan_runs"`
QueueBacklog bool `json:"queue_backlog"`
}
TaskDashboardHealth reports warning-oriented dashboard health indicators.
type TaskDashboardInProgressCard ¶
type TaskDashboardInProgressCard struct {
Tasks int `json:"tasks"`
ActiveRuns int `json:"active_runs"`
RunningRuns int `json:"running_runs"`
StartingRuns int `json:"starting_runs"`
ClaimedRuns int `json:"claimed_runs"`
QueuedRuns int `json:"queued_runs"`
HealthStatus string `json:"health_status"`
}
TaskDashboardInProgressCard summarizes active work and live run pressure.
type TaskDashboardLatencyCard ¶
type TaskDashboardLatencyCard struct {
ClaimLatencyMillis LatencyMetric `json:"claim_latency_ms"`
StartLatencyMillis LatencyMetric `json:"start_latency_ms"`
}
TaskDashboardLatencyCard exposes current run-queue latency summaries for operator cards.
type TaskDashboardQuery ¶
type TaskDashboardQuery struct {
ReadScope store.ReadScope `json:"-"`
Scope taskpkg.Scope `json:"scope,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
WorktreeID string `json:"worktree_id,omitempty"`
OwnerKind taskpkg.OwnerKind `json:"owner_kind,omitempty"`
OwnerRef string `json:"owner_ref,omitempty"`
OriginKind taskpkg.OriginKind `json:"origin_kind,omitempty"`
ExcludeCreatedBy []taskpkg.ActorRef `json:"exclude_created_by,omitempty"`
}
TaskDashboardQuery filters the observer-backed task dashboard read model.
func (TaskDashboardQuery) Validate ¶
func (q TaskDashboardQuery) Validate() error
Validate ensures the dashboard query uses supported filters.
type TaskDashboardQueue ¶
type TaskDashboardQueue struct {
Total int `json:"total"`
Depth []TaskQueueDepth `json:"depth,omitempty"`
OldestQueuedAt time.Time `json:"oldest_queued_at"`
OldestQueueAgeMilli int64 `json:"oldest_queue_age_ms"`
BacklogWarning bool `json:"backlog_warning"`
BacklogStatus string `json:"backlog_status"`
BacklogThresholdMilli int64 `json:"backlog_threshold_ms"`
}
TaskDashboardQueue reports backlog state for queued task work.
type TaskDashboardStatusBreakdown ¶
type TaskDashboardStatusBreakdown struct {
Status taskpkg.Status `json:"status"`
Count int `json:"count"`
}
TaskDashboardStatusBreakdown reports one aggregated task status bucket for chart rendering.
type TaskDashboardTotals ¶
type TaskDashboardTotals struct {
TasksTotal int `json:"tasks_total"`
RunsTotal int `json:"runs_total"`
DraftTasks int `json:"draft_tasks"`
PendingTasks int `json:"pending_tasks"`
ReadyTasks int `json:"ready_tasks"`
InProgressTasks int `json:"in_progress_tasks"`
BlockedTasks int `json:"blocked_tasks"`
CompletedTasks int `json:"completed_tasks"`
FailedTasks int `json:"failed_tasks"`
CanceledTasks int `json:"canceled_tasks"`
AwaitingApprovalTasks int `json:"awaiting_approval_tasks"`
DependencyBlockedTasks int `json:"dependency_blocked_tasks"`
QueuedRuns int `json:"queued_runs"`
ClaimedRuns int `json:"claimed_runs"`
StartingRuns int `json:"starting_runs"`
RunningRuns int `json:"running_runs"`
CompletedRuns int `json:"completed_runs"`
FailedRuns int `json:"failed_runs"`
CanceledRuns int `json:"canceled_runs"`
ActiveRuns int `json:"active_runs"`
}
TaskDashboardTotals collapses the current task and run totals into chart-friendly counters.
type TaskDashboardView ¶
type TaskDashboardView struct {
Totals TaskDashboardTotals `json:"totals"`
Cards TaskDashboardCards `json:"cards"`
StatusBreakdown []TaskDashboardStatusBreakdown `json:"status_breakdown,omitempty"`
Queue TaskDashboardQueue `json:"queue"`
Health TaskDashboardHealth `json:"health"`
ActiveRuns TaskDashboardActiveRuns `json:"active_runs"`
Freshness TaskDashboardFreshness `json:"freshness"`
}
TaskDashboardView exposes the observer-owned aggregate payload for the Paper task dashboard.
type TaskHealth ¶
type TaskHealth struct {
Status string `json:"status"`
QueueDepthTotal int `json:"queue_depth_total"`
OldestQueuedAt time.Time `json:"oldest_queued_at"`
OldestQueueAgeMilli int64 `json:"oldest_queue_age_ms"`
QueueDepth []TaskQueueDepth `json:"queue_depth,omitempty"`
StuckRuns []StuckTaskRun `json:"stuck_runs,omitempty"`
ActiveOrphanRuns int `json:"active_orphan_runs"`
TaskTotals []TaskStatusTotal `json:"task_totals,omitempty"`
RunTotals []TaskRunTotal `json:"run_totals,omitempty"`
OwnerTotals []TaskOwnerTotal `json:"owner_totals,omitempty"`
ForcedStopsSinceStart int `json:"forced_stops_since_start"`
RecoverySinceStart TaskRecoveryTotals `json:"recovery_since_start"`
}
TaskHealth exposes the current operational task-health view.
type TaskHealthConfig ¶
type TaskHealthConfig struct {
ClaimedStuckAfter time.Duration
StartingStuckAfter time.Duration
RunningStuckAfter time.Duration
}
TaskHealthConfig controls task-run stuck detection in the read-side health view.
type TaskInboxItem ¶
type TaskInboxLane ¶
type TaskInboxLaneGroup ¶
type TaskInboxLaneGroup = taskpkg.InboxLaneGroup
type TaskInboxQuery ¶
type TaskInboxQuery = taskpkg.InboxQuery
type TaskInboxView ¶
type TaskMetrics ¶
type TaskMetrics struct {
TasksTotal []TaskStatusTotal `json:"tasks_total,omitempty"`
TaskRunsTotal []TaskRunTotal `json:"task_runs_total,omitempty"`
TaskQueueDepth []TaskQueueDepth `json:"task_queue_depth,omitempty"`
TaskCancelRequestsTotal []TaskCancelRequestTotal `json:"task_cancel_requests_total,omitempty"`
TaskForcedStopsTotal int `json:"task_forced_stops_total"`
TaskClaimLatencyMillis LatencyMetric `json:"task_claim_latency_ms"`
TaskStartLatencyMillis LatencyMetric `json:"task_start_latency_ms"`
RecoveryTotals TaskRecoveryTotals `json:"recovery_totals"`
}
TaskMetrics exposes current counters and latency summaries for the task domain.
type TaskMetricsQuery ¶
type TaskMetricsQuery struct {
ReadScope store.ReadScope `json:"-"`
Since time.Time `json:"since"`
OriginKind taskpkg.OriginKind `json:"origin_kind,omitempty"`
}
TaskMetricsQuery filters audit-derived metrics and current queue metrics.
func (TaskMetricsQuery) Validate ¶
func (q TaskMetricsQuery) Validate() error
Validate ensures the metrics query uses supported filters.
type TaskOriginTotal ¶
type TaskOriginTotal struct {
OriginKind taskpkg.OriginKind `json:"origin_kind"`
Count int `json:"count"`
}
TaskOriginTotal reports one current task-origin bucket.
type TaskOwnerTotal ¶
type TaskOwnerTotal struct {
OwnerKind taskpkg.OwnerKind `json:"owner_kind"`
OwnerRef string `json:"owner_ref"`
Count int `json:"count"`
}
TaskOwnerTotal reports one current ownership bucket.
type TaskQueueDepth ¶
type TaskQueueDepth struct {
Count int `json:"count"`
OldestQueuedAt time.Time `json:"oldest_queued_at"`
OldestQueueAgeMilli int64 `json:"oldest_queue_age_ms"`
}
TaskQueueDepth reports the aggregate queued workload.
type TaskRecoveryTotals ¶
type TaskRecoveryTotals struct {
Requeued int `json:"requeued"`
MarkedRunning int `json:"marked_running"`
Failed int `json:"failed"`
}
TaskRecoveryTotals reports boot-recovery outcomes grouped by manager action.
type TaskRunTotal ¶
type TaskRunTotal struct {
Status taskpkg.RunStatus `json:"status"`
OriginKind taskpkg.OriginKind `json:"origin_kind"`
Count int `json:"count"`
}
TaskRunTotal reports one current task-run bucket.
type TaskStatusTotal ¶
type TaskStatusTotal struct {
Scope taskpkg.Scope `json:"scope"`
Status taskpkg.Status `json:"status"`
Count int `json:"count"`
}
TaskStatusTotal reports one current task-count bucket.
type TaskSummaryQuery ¶
type TaskSummaryQuery struct {
ReadScope store.ReadScope `json:"-"`
Scope taskpkg.Scope `json:"scope,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
WorktreeID string `json:"worktree_id,omitempty"`
OwnerKind taskpkg.OwnerKind `json:"owner_kind,omitempty"`
OwnerRef string `json:"owner_ref,omitempty"`
OriginKind taskpkg.OriginKind `json:"origin_kind,omitempty"`
Search string `json:"search,omitempty"`
ExcludeCreatedBy []taskpkg.ActorRef `json:"exclude_created_by,omitempty"`
}
TaskSummaryQuery filters the current task summary view.
func (TaskSummaryQuery) Validate ¶
func (q TaskSummaryQuery) Validate() error
Validate ensures the summary query uses supported filters.
type VersionSource ¶
VersionSource returns the current daemon build metadata.
Source Files
¶
- agent_resolution.go
- attention_acknowledgements.go
- cost_estimation.go
- event_content.go
- freshness.go
- health.go
- observer.go
- observer_event_persistence.go
- observer_hooks.go
- observer_session_events.go
- observer_session_metadata.go
- observer_session_tracking.go
- observer_summary.go
- overview.go
- overview_attention.go
- overview_helpers.go
- overview_needs_input.go
- overview_types.go
- overview_usage.go
- query.go
- reconcile.go
- reconcile_owner.go
- retention.go
- session_projection.go
- task_inbox.go
- task_snapshot_index.go
- task_status_summaries.go
- tasks.go
- tasks_dashboard.go
- tasks_dashboard_helpers.go
- tasks_filters.go
- tasks_metrics.go
- tasks_snapshot.go