import type { QualityGateResult } from "./quality-gate.interface";

/**
 * Claim by an agent that a task is complete
 */
export interface CompletionClaim {
  /** ID of the task being claimed as complete */
  taskId: string;

  /** ID of the agent making the claim */
  agentId: string;

  /** Workspace context */
  workspaceId: string;

  /** Timestamp of claim */
  claimedAt: Date;

  /** Agent's message about completion */
  message: string;

  /** List of files changed during task execution */
  filesChanged: string[];
}

/**
 * Result of validating a completion claim
 */
export interface CompletionValidation {
  /** Original claim being validated */
  claim: CompletionClaim;

  /** Results from all quality gates */
  gateResults: QualityGateResult[];

  /** Whether all gates passed */
  allGatesPassed: boolean;

  /** List of required gates that failed */
  requiredGatesFailed: string[];

  /** Final verdict on the completion */
  verdict: "accepted" | "rejected" | "needs-continuation";

  /** Feedback message for the agent */
  feedback?: string;

  /** Specific actions to take to fix failures */
  suggestedActions?: string[];
}
