import { BaseAgent, AgentContext, AgentResult } from "./base.js"; export class ChallengerAgent extends BaseAgent { readonly name = "challenger"; readonly description = "Stress-tests plans with binding verdicts. Only escalates when confidence < 0.60."; readonly workflow = "plan"; async execute(context: AgentContext): Promise { const start = Date.now(); this.log("Challenging plan..."); if (context.backend) { const result = await this.executeViaBackend( context, `Stress-test the plan for phase ${context.phase}. Specification: ${context.specification}` ); return { ...result, duration_ms: Date.now() - start }; } return { success: false, output: "Plan challenge requires an intelligence backend. Configure one with: ci init --backend", artifacts_created: [], decisions: 0, escalations: 0, duration_ms: Date.now() - start, error: "No intelligence backend available", }; } }