export declare function loopDirname(loopID: string, goal: string): string; export type LoopPhase = 'executing' | 'verifying' | 'done' | 'escalated' | 'cancelled'; export type ExecuteAgent = 'fixer' | 'designer' | 'explorer' | 'librarian'; export type VerifyAgent = 'oracle' | 'observer' | 'test'; export type SuccessCriterion = { type: 'test'; command: string; } | { type: 'build'; command: string; } | { type: 'lint'; command: string; } | { type: 'fileExists'; path: string; } | { type: 'command'; command: string; expectExitCode?: number; } | { type: 'oracle'; } | { type: 'observer'; } | { type: 'manual'; }; export interface LoopDefinition { goal: string; successCriteria: string; success: SuccessCriterion; maxAttempts: number; executeAgent: ExecuteAgent; verifyAgent: VerifyAgent; contextFiles?: string[]; parentSessionID?: string; } export type VerificationResult = { passed: true; reason: string; } | { passed: false; reason: string; suggestedFix?: string; }; export interface AttemptRecord { attemptNumber: number; executionResult: string; verificationResult: VerificationResult; artifactPaths?: string[]; } export interface LoopSession { loopID: string; definition: LoopDefinition; currentPhase: LoopPhase; attempts: number; activeJobID?: string; history: AttemptRecord[]; historyDir: string; manualReviewPending: boolean; } export declare function createLoopSession(definition: LoopDefinition, loopID: string): LoopSession; export declare function compactAttempt(attempt: AttemptRecord): string; export declare function writeHistoryFile(session: LoopSession): void;