/** * Proactive Drive Layer types (Domain D: FR-D01, FR-D02, FR-D03, FR-D04, FR-D05). * * Defines event payloads, fix task structures, and configuration * for the proactive drive layer that enhances PipelineEngine with * automatic gate triggering, spec gap detection, post-release scanning, * OKR periodic checking, and PDCA auto-drive. */ import type { StageId, KeyResult } from '../types/index.js'; import type { GapAnalysisReport } from '../stages/post-release-validation-types.js'; /** Severity of a fix task generated by gate auto-trigger. */ export type FixTaskSeverity = 'P0' | 'P1' | 'P2'; /** A structured fix task generated when a gate rejects (AC-D01.3). */ export interface FixTask { frId: string; acId: string; description: string; severity: FixTaskSeverity; } /** Gate auto-trigger result (AC-D01.6). */ export interface GateAutoTriggerRecord { /** ISO timestamp of the trigger. */ triggeredAt: string; /** The transition point (e.g. 'implement→review'). */ transitionPoint: string; /** Source stage. */ fromStage: StageId; /** Target stage. */ toStage: StageId; /** Gate type that was triggered. */ gateType: string; /** Whether the gate passed. */ passed: boolean; /** Fix tasks generated on rejection. */ fixTasks: FixTask[]; /** Raw evaluation score (0-1). */ score: number; /** Blocker messages from the gate. */ blockers: string[]; } /** Payload for the 'gate-auto-triggered' event (AC-D01.4). */ export interface GateAutoTriggeredEvent { pipelineId: string; record: GateAutoTriggerRecord; } /** An uncovered module found during spec-code alignment scan (AC-D02.2). */ export interface UncoveredModule { /** File/directory path of the uncovered module. */ path: string; /** Description of what the module does. */ description: string; /** Suggested FR text to cover this module. */ suggestedFr: string; } /** Spec Gap Report (AC-D02.2, AC-D02.3). */ export interface SpecGapReport { /** ISO timestamp of the scan. */ analyzedAt: string; /** Pipeline ID. */ pipelineId: string; /** List of uncovered modules. */ uncoveredModules: UncoveredModule[]; /** Whether any gaps were found. */ hasGaps: boolean; /** Severity is always advisory (AC-D02.5). */ severity: 'advisory'; } /** Payload for the 'spec-gap-detected' event (AC-D02.3). */ export interface SpecGapDetectedEvent { pipelineId: string; report: SpecGapReport; message: string; } /** Payload for the 'post-release-gap-found' event (AC-D03.4). */ export interface PostReleaseGapFoundEvent { pipelineId: string; report: GapAnalysisReport; fixTasks: Array<{ frId: string; description: string; }>; cycle: number; } /** Payload for the 'post-release-passed' event (AC-D03.3). */ export interface PostReleasePassedEvent { pipelineId: string; report: GapAnalysisReport; } /** Back-edge trigger record (AC-D03.7). */ export interface BackEdgeRecord { /** ISO timestamp of the back-edge trigger. */ triggeredAt: string; /** PDCA cycle number. */ cycle: number; /** Reason for the back-edge. */ reason: string; /** Fix tasks that triggered the back-edge. */ fixTasks: Array<{ frId: string; description: string; }>; } /** Payload for the 'back-edge-triggered' event (AC-D03.5). */ export interface BackEdgeTriggeredEvent { pipelineId: string; backEdge: BackEdgeRecord; cycle: number; fixTasks: Array<{ frId: string; description: string; }>; } /** OKR check interval modes (FR-D04, AC-D04.2). */ export type OkrCheckInterval = 'daily' | 'weekly' | 'on-stage-complete'; /** SMART task suggestion for an unachieved KR (FR-D04, AC-D04.3). */ export interface SmartTaskSuggestion { title: string; measure: string; deadline: string; } /** Per-KR check result with SMART suggestions (FR-D04). */ export interface KrCheckResult { krId: string; krDescription: string; status: KeyResult['status']; suggestedTasks: SmartTaskSuggestion[]; } /** OKR Check Report output (FR-D04, AC-D04.7). */ export interface OkrCheckReport { pipelineId: string; checkedAt: string; interval: OkrCheckInterval; results: KrCheckResult[]; allAchieved: boolean; } /** Payload for 'okr-check-completed' event (FR-D04, AC-D04.4). */ export interface OkrCheckCompletedEvent { pipelineId: string; report: OkrCheckReport; unachievedKrs: KrCheckResult[]; timestamp: string; } /** Payload for 'pipeline-converged' event (FR-D04, AC-D04.5). */ export interface PipelineConvergedEvent { pipelineId: string; convergedAt: string; okrCheckReport: OkrCheckReport; } /** Payload for 'pdca-cycle-started' event (FR-D05, AC-D05.3). */ export interface PdcaCycleStartedEvent { pipelineId: string; cycle: number; triggeredBy: string[]; newTasks: string[]; timestamp: string; } /** Payload for 'pdca-escalated' event (FR-D05, AC-D05.6). */ export interface PdcaEscalatedEvent { pipelineId: string; totalCycles: number; maxCycles: number; timestamp: string; } /** PDCA Summary Report (FR-D05, AC-D05.8). */ export interface PdcaSummaryReport { pipelineId: string; cycles: Array<{ cycle: number; triggeredBy: string[]; newTasks: string[]; result: string; }>; finalResult: 'converged' | 'escalated'; generatedAt: string; } /** Gate binding: maps a transition point to a gate type. */ export interface TransitionGateBinding { fromStage: StageId; toStage: StageId; gateType: string; } /** Configuration for the Proactive Drive Engine. */ export interface ProactiveDriveConfig { /** Gate bindings for FR-D01 auto-trigger. */ transitionGates: TransitionGateBinding[]; /** Whether spec gap detection is enabled (FR-D02). Default: true. */ specGapDetectionEnabled: boolean; /** Whether post-release auto scan is enabled (FR-D03). Default: true. */ postReleaseAutoScanEnabled: boolean; /** Max PDCA cycles before escalation (FR-D03/FR-D05). Default: 5. */ maxPdcaCycles: number; /** OKR check interval (FR-D04). Default: 'daily'. */ okrCheckInterval: OkrCheckInterval; } /** Default transition gate bindings per spec FR-D01. */ export declare const DEFAULT_TRANSITION_GATES: TransitionGateBinding[]; /** Default proactive drive configuration. */ export declare const DEFAULT_DRIVE_CONFIG: ProactiveDriveConfig; /** All event types emitted by the proactive drive layer. */ export type DriveEventType = 'gate-auto-triggered' | 'spec-gap-detected' | 'post-release-gap-found' | 'post-release-passed' | 'back-edge-triggered' | 'okr-check-completed' | 'pipeline-converged' | 'pdca-cycle-started' | 'pdca-escalated'; /** Simplified drive configuration consumed by OkrPeriodicChecker / PdcaAutoDriver. */ export interface DriveConfig { /** OKR check interval. Default: 'daily'. */ okrCheckInterval: OkrCheckInterval; /** Max PDCA cycles before escalation. Default: 5. */ maxPdcaCycles: number; /** Whether to auto-generate SMART suggestions. Default: true. */ smartSuggestionsEnabled: boolean; } /** Event map for typed event emission. */ export interface DriveEventMap { 'gate-auto-triggered': GateAutoTriggeredEvent; 'spec-gap-detected': SpecGapDetectedEvent; 'post-release-gap-found': PostReleaseGapFoundEvent; 'post-release-passed': PostReleasePassedEvent; 'back-edge-triggered': BackEdgeTriggeredEvent; 'okr-check-completed': OkrCheckCompletedEvent; 'pipeline-converged': PipelineConvergedEvent; 'pdca-cycle-started': PdcaCycleStartedEvent; 'pdca-escalated': PdcaEscalatedEvent; } /** Union of all drive event names. */ export type DriveEventName = keyof DriveEventMap; //# sourceMappingURL=types.d.ts.map