/** * ComplianceService — Deterministic governance compliance scoring. * * Computes a reproducible 0-100 compliance score from audit trail data. * No separate storage — the audit log IS the source of truth. * * Phase 3: Lifecycle and weights are now profile-driven. */ import type { IAuditService } from '../audit/audit-service.js'; import type { IAnalyticsService } from '../analytics/analytics-service.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 IComplianceService { computeComplianceScore(options?: ComplianceScoreOptions): Promise; } export interface ComplianceScoreOptions { /** ISO-8601 start of compliance period */ since?: string; /** ISO-8601 end of compliance period */ until?: string; /** Scope compliance to a specific container */ containerName?: string; /** Scope compliance to a specific actor */ actorId?: string; } export interface ComplianceScore { /** Overall compliance score: 0-100 */ score: number; /** Letter grade derived from score */ grade: 'A' | 'B' | 'C' | 'D' | 'F'; /** Time period this score covers */ period: { since: string; until: string; }; /** Per-category breakdown */ categories: { brePassRate: CategoryScore; qualityGates: CategoryScore; processAdherence: CategoryScore; containerIntegrity: CategoryScore; flowEfficiency: CategoryScore; }; /** Human-readable summary sentence */ summary: string; /** Actionable improvement recommendations */ recommendations: string[]; /** Computation metadata */ metadata: { totalTransitions: number; totalTasks: number; computedAt: string; }; } export interface CategoryScore { /** Category score: 0-100 */ score: number; /** Category weight: 0-1 */ weight: number; /** Weighted contribution to final score: score × weight */ contribution: number; /** Human-readable explanation */ detail: string; } export declare class ComplianceService implements IComplianceService { private readonly auditService; private readonly analyticsService; private cache; private readonly cacheTtlMs; private readonly unsubscribe; private readonly lifecycle; private readonly alternateLifecycles; private readonly weights; private readonly closingTransitions; constructor(auditService: IAuditService, analyticsService: IAnalyticsService, eventBus: IEventBus, _logger: ILogger, profile: MethodologyProfile); computeComplianceScore(options?: ComplianceScoreOptions): Promise; dispose(): void; /** Lookup weight by key, with fallback to 0 for profiles missing a category */ private w; private computeBrePassRate; private computeQualityGates; private computeProcessAdherence; /** * Resolve which lifecycle to evaluate a task against based on its closing transition. * - If the closing transition is the last step in the primary lifecycle → use primary * - If it matches a key in alternateLifecycles → use that alternate * - Otherwise → null (exclude from evaluation) */ private resolveLifecycle; private computeContainerIntegrity; private computeFlowEfficiency; private fetchTransitionEvents; private fetchContainerAssignmentEvents; private filterByContainer; private buildEmptyReport; private generateRecommendations; private buildSummary; private getCached; private setCache; } //# sourceMappingURL=compliance-service.d.ts.map