/** * Role-Stage Validator — enforces role-task matching at dispatch time. * * AC-22.1: Each stage declares requiredRole. * AC-22.2: Pre-dispatch validation of agent role vs stage requirement. * AC-22.3: Audit event generation on mismatch. * AC-22.4: Multi-agent mode blocks mismatched dispatch. * AC-22.5: Single-agent mode degrades to warning (no block). */ import type { StageId } from '../types/index.js'; import type { PipelineRole, RoleRegistry } from './role-registry.js'; /** Audit event emitted on role mismatch (AC-22.3). */ export interface RoleMismatchEvent { timestamp: string; agentId: string; stage: StageId; requiredRole: PipelineRole; actualRole: PipelineRole | null; action: 'blocked' | 'warning'; reason: string; } /** Result of a role validation check. */ export interface RoleValidationResult { allowed: boolean; mismatchEvent: RoleMismatchEvent | null; } export interface RoleStageValidatorConfig { /** Custom stage → required role overrides (AC-22.7). */ stageRoles?: Record; /** Whether the environment has multiple agents available. */ multiAgent?: boolean; } export declare class RoleStageValidator { private readonly stageRoles; private readonly multiAgent; private readonly registry; constructor(registry: RoleRegistry, config?: RoleStageValidatorConfig); /** * Get the required role for a pipeline stage (AC-22.1). * Returns 'Any' for stages without explicit role requirements. */ getRequiredRole(stageId: StageId): PipelineRole; /** * Validate whether an agent can be dispatched to a stage (AC-22.2). * * AC-22.4: In multi-agent mode, mismatch → blocked. * AC-22.5: In single-agent mode, mismatch → warning (allowed). */ validate(agentId: string, stageId: StageId): RoleValidationResult; /** * List all stage → required role mappings. */ listStageRoles(): Array<{ stageId: string; requiredRole: PipelineRole; }>; /** * Check if running in multi-agent mode. */ isMultiAgent(): boolean; } //# sourceMappingURL=role-stage-validator.d.ts.map