/** * Assessor Registry * * Central registry for managing assessor instances with metadata. * Provides phase-ordered execution, Claude bridge wiring, and test count aggregation. * * @module assessment/registry/AssessorRegistry * @see GitHub Issue #91 */ import type { AssessmentConfiguration } from "../../../lib/assessment/configTypes.js"; import type { MCPDirectoryAssessment } from "../../../lib/assessment/resultTypes.js"; import type { BaseAssessor } from "../modules/BaseAssessor.js"; import type { AssessmentContext } from "../AssessmentOrchestrator.js"; import type { ClaudeCodeBridge } from "../lib/claudeCodeBridge.js"; import { type AssessorDefinition, type RegisteredAssessor, AssessmentPhase } from "./types.js"; /** * AssessorRegistry manages assessor instances and their execution. * * Key responsibilities: * 1. Lazy instantiation based on configuration flags * 2. Phase-ordered execution with Phase 0 always first and sequential * 3. Claude bridge wiring to supporting assessors * 4. Test count aggregation from all assessors * 5. Backward-compatible property access via getAssessor() */ /** * Information about a failed assessor registration. */ export interface FailedRegistration { id: string; error: string; } export declare class AssessorRegistry { private config; private logger; private assessors; private claudeBridge?; private failedRegistrations; constructor(config: AssessmentConfiguration); /** * Register all enabled assessors based on configuration. * Called during orchestrator initialization. */ registerAll(definitions?: AssessorDefinition[]): void; /** * Register a single assessor. */ private register; /** * Check if an assessor should be enabled based on configuration. * Implements OR logic for backward-compatible deprecated flags. */ isEnabled(definition: AssessorDefinition): boolean; /** * Check a single config flag value. * If defaultEnabled is true, returns true unless flag is explicitly false. * If defaultEnabled is false, returns true only if flag is explicitly true. */ private checkFlag; /** * Get a registered assessor by ID. * Returns undefined if not registered or disabled. */ getAssessor(id: string): T | undefined; /** * Get all registered assessors for a specific phase. */ getByPhase(phase: AssessmentPhase): RegisteredAssessor[]; /** * Set Claude bridge for all supporting assessors. * Called when Claude Code is enabled. */ setClaudeBridge(bridge: ClaudeCodeBridge): void; /** * Wire Claude bridge to a single assessor. */ private wireClaudeBridge; /** * Execute all assessors in phase order. * Phase 0 (PRE) always runs first and sequentially. * Other phases run based on parallelTesting config. * * @returns Partial MCPDirectoryAssessment with results from all assessors */ executeAll(context: AssessmentContext): Promise>; /** * Execute all assessors in a single phase. */ private executePhase; /** * Execute assessors in parallel with graceful degradation. * Uses Promise.allSettled to continue execution even if some assessors fail. */ private executeParallel; /** * Execute assessors sequentially. */ private executeSequential; /** * Extract status string from assessment result. * Most results have a 'status' property. */ private extractStatus; /** * Get tool count from context (respects selectedToolsForTesting config). */ private getToolCountForContext; /** * Get total test count from all registered assessors. */ getTotalTestCount(): number; /** * Get test count for a specific assessor. */ getTestCount(id: string): number; /** * Get all registered assessor IDs. */ getRegisteredIds(): string[]; /** * Check if a specific assessor is registered. */ isRegistered(id: string): boolean; /** * Get the count of registered assessors. */ get size(): number; /** * Update configuration for future operations. * * **Important**: This does NOT re-register assessors. Assessors are registered * once during construction based on the initial config. To change which * assessors are enabled, create a new AssessorRegistry instance. * * @param config - New configuration to use */ updateConfig(config: AssessmentConfiguration): void; /** * Reset test counts for all registered assessors. * Called at the start of each assessment run. */ resetAllTestCounts(): void; /** * Get list of assessors that failed to register. * Useful for reporting partial assessment results. * * @returns Array of failed registration info (id and error message) */ getFailedRegistrations(): FailedRegistration[]; /** * Check if any assessors failed to register. * * @returns true if at least one assessor failed registration */ hasFailedRegistrations(): boolean; } //# sourceMappingURL=AssessorRegistry.d.ts.map