/** * AnalyticsService — Computes real metrics from audit event history. * * No separate storage — the audit log IS the source of truth. * Reconstructs per-task timelines from events, computes cycle time, * lead time, throughput, and blocking time. */ import type { IAuditService } from '../audit/audit-service.js'; import type { IContainerService } from '../../container/interfaces.js'; import type { ILogger } from '../../shared/logger.js'; import type { IEventBus } from '../../shared/events/index.js'; import type { MethodologyProfile } from '../../profiles/types.js'; export interface IAnalyticsService { getContainerAnalytics(waveName: string): Promise; getProjectAnalytics(options?: AnalyticsOptions): Promise; getTaskCycleTime(issueNumber: number): Promise; } export interface AnalyticsOptions { since?: string; until?: string; waveName?: string; } export interface ContainerAnalytics { waveName: string; velocity: number; avgCycleTime: number | null; avgLeadTime: number | null; throughput: number | null; avgBlockingTime: number | null; totalTransitions: number; transitionBreakdown: Record; blockedTaskCount: number; } export interface ProjectAnalytics { since: string; until: string; totalTransitions: number; tasksCompleted: number; avgCycleTime: number | null; avgLeadTime: number | null; throughput: number | null; waveBreakdown: Record; } export interface TaskCycleTime { issueNumber: number; startedAt: string | null; completedAt: string | null; cycleTimeHours: number | null; leadTimeHours: number | null; blockingTimeHours: number; blockCount: number; } export declare class AnalyticsService implements IAnalyticsService { private readonly auditService; private readonly containerService; private readonly profile; private cache; private readonly cacheTtlMs; private readonly unsubscribe; constructor(auditService: IAuditService, containerService: IContainerService, eventBus: IEventBus, _logger: ILogger, profile: MethodologyProfile); getContainerAnalytics(waveName: string): Promise; getProjectAnalytics(options?: AnalyticsOptions): Promise; getTaskCycleTime(issueNumber: number): Promise; dispose(): void; private buildTimelines; private computeTaskMetrics; /** Actions whose target state is an active state (cycle time starts here) */ private getActiveTargetActions; /** Closing transitions (task completion) */ private getClosingActions; /** Actions that transition FROM a blocked state (unblock) */ private getUnblockActions; private getCached; private setCache; } //# sourceMappingURL=analytics-service.d.ts.map