import type { Logger } from './logger.js'; export interface LoopConfig { /** Workflow name to use for step ordering (opt-in). When set, the loop delegates to the workflow engine. */ workflowName?: string; /** Variables to pass to the workflow (e.g., model, sprint_id) */ workflowVariables?: Record; modelLocal: string; modelApi: string; ollamaApiBase: string; ollamaFlashAttention: boolean; ollamaKvCacheType: string; modelApiTimeout: number; modelLocalTimeout: number; escalateOnFail: boolean; agentGuideMaxWords: number; modelRegenThreshold: number; loopTestCmd: string; backlogPath: string; resultsDir: string; logDir: string; agentGuide: string; sprintHistory: string; forcePlannerExecutor: boolean; /** Max sprint-level retries on full failure (default 0 — no retry) */ maxRetries: number; /** Retry strategy: 'model' escalates all tickets to API, 'replan' regenerates plans */ retryStrategy: 'none' | 'model' | 'replan'; } export declare const DEFAULT_LOOP_CONFIG: LoopConfig; export declare const ENV_VAR_MAP: Record; /** Source of a config value (for --show display) */ export type ConfigSource = 'env' | 'file' | 'default'; export interface ConfigWithSources { config: LoopConfig; sources: Record; } export interface BacklogFile { generated_at: string; _enrichMeta?: { version: number; }; sprints: BacklogSprint[]; } export interface BacklogSprint { id: string; title: string; strategy: 'hardening' | 'testing' | 'cleanup' | 'documentation' | 'hardening-overflow' | 'roadmap'; par: number; slope: number; type: 'feature' | 'bugfix' | 'chore'; tickets: BacklogTicket[]; /** Sprint IDs that must complete before this sprint can run */ depends_on?: string[]; } export interface BacklogTicket { key: string; title: string; club: Club; description: string; acceptance_criteria: string[]; modules: string[]; max_files: number; estimated_tokens?: number; files?: { primary: string[]; }; /** Execution likelihood score 0-1 (higher = more likely to succeed). Computed by analyze-scorecards. */ quality_score?: number; } export type Club = 'putter' | 'wedge' | 'short_iron' | 'long_iron' | 'driver'; export interface TicketResult { ticket: string; title: string; club: string; max_files: number; primary_model: string; final_model: string; escalated: boolean; tests_passing: boolean; noop: boolean; strategy?: BacklogSprint['strategy']; sprint_type?: BacklogSprint['type']; tokens_in?: number; tokens_out?: number; cost_usd?: number; duration_s?: number; transcript?: TranscriptEvent[]; } /** Which executor backend to use */ export type ExecutorId = 'aider' | 'slope'; /** Structured record of a single tool call during execution */ export interface TranscriptEvent { timestamp: string; tool: string; input: Record; output?: string; duration_ms?: number; guard_warning?: string; } /** Result from a single executor run (one model attempt on one ticket) */ export interface ExecutionResult { outcome: 'completed' | 'stuck' | 'error' | 'timeout'; noop: boolean; tokens_in: number; tokens_out: number; cost_usd: number; duration_s: number; transcript: TranscriptEvent[]; files_changed: string[]; /** If true, the executor's inner guards (typecheck + tests) passed and no * additional changes were made after verification. Outer guards can be skipped. */ innerGuardsPassed?: boolean; } /** Context passed to an executor for a single ticket attempt */ export interface ExecutionContext { ticketKey: string; model: string; timeout: number; prompt: string; ticket: BacklogTicket; preSha: string; } /** Adapter interface — both AiderExecutor and SlopeExecutor implement this */ export interface ExecutorAdapter { readonly id: ExecutorId; execute(ctx: ExecutionContext, config: LoopConfig, cwd: string, log: Logger): Promise; } export interface SprintResult { sprint_id: string; title: string; strategy: string; completed_at: string; branch: string; tickets_total: number; tickets_passing: number; tickets_noop: number; tickets: TicketResult[]; pr_number?: number; merge_status?: 'merged' | 'blocked' | 'skipped'; merge_block_reason?: string; handicap_delta?: number; /** Number of sprint-level retries attempted */ retries?: number; } export interface ExecutionPlan { ticket: string; title: string; files: PlanFileEntry[]; testFiles: string[]; approach: string; generated: 'enriched' | 'modules' | 'grep' | 'generic'; } export interface PlanFileEntry { path: string; action: string; reason: string; } export interface PlannedTicket { key: string; title: string; club: Club; description: string; acceptance_criteria: string[]; modules: string[]; max_files: number; } export interface PlannedSprint { id: string; theme: string; par: number; slope: number; type: 'feature' | 'bugfix' | 'chore'; tickets: PlannedTicket[]; } export interface ModelConfig { generated_at: string; ticket_count: number; escalation_save_rate: number; success_rates: Record; /** Cross-dimensional rates: "club:strategy" → stats */ success_rates_by_strategy?: Record; /** Cross-dimensional rates: "club:sprint_type" → stats */ success_rates_by_type?: Record; cost_per_success: Record; /** Cost-adjusted scores: higher is better (success_rate / cost) */ cost_adjusted_scores?: Record; recommendations: Record; /** Cross-dimensional recommendations: "club:sprint_type" or "club:strategy" → model */ recommendations_by_type?: Record; recommendations_by_strategy?: Record; /** Minimum sample count used for cross-dimensional recommendations */ min_samples?: number; notes: string[]; } //# sourceMappingURL=types.d.ts.map