/** * Spawn readiness validation. * * @task T4784 * @task T894 Atomic task enforcement (worker role rejects >3 files or no file scope) * @task T1933 Universal-tier wired into spawn validator pre-flight (ADR-068 Decision 6) */ import type { AgentSpawnCapability } from '@cleocode/contracts'; import type { DataAccessor } from '../store/data-accessor.js'; export interface ValidationIssue { code: string; message: string; severity: string; } export interface SpawnValidationResult { taskId: string; title: string; ready: boolean; issues: ValidationIssue[]; } /** * Optional context for spawn validation. * * Supplying `role` enables the T894 atomicity checks (V_ATOMIC_SCOPE_MISSING * and V_ATOMIC_SCOPE_TOO_LARGE). When omitted those checks are skipped so * existing call-sites that do not yet know the spawned role remain unaffected. */ export interface SpawnValidationContext { /** * The role the task will be spawned as. * * When `'worker'` (tier 0), the validator enforces: * - `files` field is present and non-empty → `V_ATOMIC_SCOPE_MISSING` * - `files` count ≤ {@link MAX_WORKER_FILES} → `V_ATOMIC_SCOPE_TOO_LARGE` * * Orchestrator and lead roles bypass the file-scope gate — they are * permitted inherently broader scope. Epic-type tasks are also exempt * regardless of role. */ role?: AgentSpawnCapability; /** * Override path for the `packagedSeedDir` option passed to the agent * resolver during the pre-flight agent-existence check (T1933). When * omitted, the resolver derives the default from `@cleocode/agents/templates/`. * Tests can pin this to an isolated fixture directory. */ packagedSeedDir?: string; /** * Override path for the universal-base `.cant` file passed to the agent * resolver during the pre-flight agent-existence check (T1933). When * omitted, the resolver derives the default from `@cleocode/agents/cleo-subagent.cant`. * Tests can pin this to a fixture file; passing a path that does not exist * disables the universal tier (catastrophic-state simulation). */ universalBasePath?: string; } /** Validate spawn readiness for a task. */ export declare function validateSpawnReadiness(taskId: string, cwd?: string, accessor?: DataAccessor, context?: SpawnValidationContext): Promise; //# sourceMappingURL=validate-spawn.d.ts.map