/** * FR-D04: OKR Achievement Periodic Checker. * * For pipelines with endStateGoal + OKR tree (FR-18), periodically checks * KR achievement status. Unachieved KRs get SMART decomposition suggestions * pushed via event bus. When all KRs are achieved, emits pipeline-converged. * * Design: * - Engine is the trigger, not the executor (Domain D principle). * - Check frequency configurable: daily / weekly / on-stage-complete. * - Single-agent mode: degrades to CLI output (AC-D04.8 non-blocking). */ import type { KeyResult, PipelineInstance } from '../types/index.js'; import type { OkrCheckInterval, OkrCheckReport, SmartTaskSuggestion, OkrCheckCompletedEvent, PipelineConvergedEvent, DriveEventType } from './types.js'; /** Adapter for emitting events to the host environment. */ export interface OkrCheckerEventSink { emit(event: DriveEventType, payload: OkrCheckCompletedEvent | PipelineConvergedEvent): void; } /** Optional LLM adapter for generating SMART suggestions. */ export interface SmartDecompositionAdapter { generateSmartTasks(kr: KeyResult): Promise; } /** CLI output adapter for single-agent degradation (AC-D04.8). */ export interface CliOutputAdapter { write(message: string): void; } export interface OkrPeriodicCheckerOptions { /** Event sink for pushing results to the host/dispatcher. */ eventSink: OkrCheckerEventSink; /** Optional LLM adapter for SMART decomposition. Falls back to template-based. */ smartAdapter?: SmartDecompositionAdapter; /** CLI output for single-agent degradation. */ cliOutput?: CliOutputAdapter; /** Override check interval. Default read from config or 'daily'. */ interval?: OkrCheckInterval; /** Clock override for testing. */ now?: () => string; } export declare class OkrPeriodicChecker { private readonly eventSink; private readonly smartAdapter?; private readonly cliOutput?; private readonly interval; private readonly now; constructor(options: OkrPeriodicCheckerOptions); /** * Check if a pipeline should have OKR periodic checks registered. * AC-D04.6: No OKR tree → no check, no events, no side effects. */ shouldCheck(pipeline: PipelineInstance): boolean; /** * Execute OKR achievement check for a pipeline instance. * * AC-D04.1: Auto-registered for pipelines with OKR tree. * AC-D04.3: Unachieved KRs get SMART suggestions. * AC-D04.4: Results pushed via okr-check-completed event. * AC-D04.5: All achieved → pipeline-converged event. * AC-D04.7: Report stored in pipeline metadata. * AC-D04.8: Non-blocking, async execution. */ check(pipeline: PipelineInstance): Promise; /** * Get the configured check interval. * AC-D04.2: Supports daily, weekly, on-stage-complete. */ getInterval(): OkrCheckInterval; /** * Generate SMART task suggestions for an unachieved KR. * Uses LLM adapter if available; falls back to template-based generation. */ private generateSmartSuggestions; /** Compute a default deadline (7 days from now). */ private computeDefaultDeadline; /** Output check results to CLI for single-agent mode (AC-D04.8 degradation). */ private outputToCli; } /** * Read DriveConfig from a raw config object. * Extracts drive-layer settings with defaults. */ export declare function readDriveConfig(config: Record): import('./types.js').DriveConfig; //# sourceMappingURL=okr-periodic-checker.d.ts.map