/** * Analytics event type definitions for metrics collection. * * Event types capture review findings, fix actions, step results, and routing decisions * for local-only analysis when analytics.enabled = true. */ /** Status of a review finding across iterations */ export type FindingStatus = 'new' | 'persists' | 'resolved' | 'reopened' | 'waived' | 'invalidated' | 'superseded' | 'dismissed'; /** Severity level of a review finding */ export type FindingSeverity = 'error' | 'warning'; /** Decision taken on a finding */ export type FindingDecision = 'reject' | 'approve'; /** Action taken to address a finding */ export type FixActionType = 'fixed' | 'rebutted' | 'not_applicable'; /** Review finding event — emitted per finding during review steps */ export interface ReviewFindingEvent { type: 'review_finding'; findingId: string; status: FindingStatus; ruleId: string; severity: FindingSeverity; decision: FindingDecision; file: string; line: number; iteration: number; workflowName: string; scopeIdentity: string; runId: string; timestamp: string; } /** Fix action event — emitted per finding addressed during fix steps */ export interface FixActionEvent { type: 'fix_action'; findingId: string; action: FixActionType; changedFiles?: string[]; testCommand?: string; testResult?: string; iteration: number; workflowName: string; scopeIdentity: string; runId: string; timestamp: string; } /** Step result event — emitted after each step completes */ export interface StepResultEvent { type: 'step_result'; step: string; provider: string; model: string; decisionTag: string; iteration: number; workflowName: string; scopeIdentity: string; runId: string; timestamp: string; } /** Auto routing decision event — emitted without prompt, path, repository content, or task-derived run slug */ export interface RoutingDecisionEvent { type: 'routing_decision'; stepName: string; stepTags: string[]; personaKey: string; workflowName: string; stepType: 'normal' | 'parallel' | 'agent'; instructionTokenCount: number; phaseCount: number; provider: string; model: string; selectedCategory: string; selectedRoutingTier: 'high' | 'medium' | 'low'; requiredRoutingTier: 'high' | 'medium' | 'low'; reasonCodes?: string[]; fallbackReason?: string; fingerprintChanged?: boolean; retryReason?: 'failed-without-progress' | 'no-progress'; estimatorDurationMs?: number; inputTokenBucket?: 'small' | 'medium' | 'large'; candidateCount: number; strategy: 'cost' | 'balanced' | 'performance'; resolutionSource: string; stepSuccess: boolean; durationMs: number; inputTokens?: number; outputTokens?: number; taktVersion: string; iteration: number; runId: string; timestamp: string; } interface CompanionAnalyticsEventBase { type: 'companion'; step: string; companion?: string; selected?: string[]; rationale?: string; severity?: 'must_fix' | 'should_fix' | 'nit'; sequence?: number; findingCount?: number; completionSettled?: boolean; completionFailure?: boolean; followUpRounds?: number; reason?: string; digest?: string; changedLines?: number; replaced?: { trigger: 'quiet' | 'forced' | 'completion' | 'commit'; digest: string; changedLines: number; observedGeneration: number; }; replacement?: { trigger: 'quiet' | 'forced' | 'completion' | 'commit'; digest: string; changedLines: number; observedGeneration: number; }; runId: string; timestamp: string; } export interface CompanionReviewRoundAnalyticsEvent { type: 'companion'; action: 'review_round'; step: string; companion: string; reviewMode: 'completion' | 'live'; trigger: 'quiet' | 'forced' | 'completion' | 'commit'; digest: string; changedLines: number; findingCount: number; runPathNamespace?: readonly string[]; runId: string; timestamp: string; } export type CompanionReviewRoundAnalyticsPayload = Omit; export type CompanionAnalyticsEvent = (CompanionAnalyticsEventBase & { action: 'start'; reviewMode: 'completion' | 'live'; }) | (CompanionAnalyticsEventBase & { action: 'pool_selected' | 'finding' | 'fix_round' | 'complete' | 'queue_coalesced'; }) | CompanionReviewRoundAnalyticsEvent; /** Union of all analytics event types */ export type AnalyticsEvent = ReviewFindingEvent | FixActionEvent | StepResultEvent | RoutingDecisionEvent | CompanionAnalyticsEvent; export {}; //# sourceMappingURL=events.d.ts.map