All files / src/action/fix-evaluation types.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64                2x                                                                                                              
import { z } from 'zod';
import { FixStatusSchema } from '../../types/index.js';
import type { FixStatus, UsageStats } from '../../types/index.js';
import type { ExistingComment } from '../../output/dedup.js';
 
export { FixStatusSchema };
export type { FixStatus };
 
export const FixJudgeVerdictSchema = z.object({
  status: FixStatusSchema,
  reasoning: z.string(),
});
export type FixJudgeVerdict = z.infer<typeof FixJudgeVerdictSchema>;
 
export interface FixJudgeResult {
  verdict: FixJudgeVerdict;
  usage: UsageStats;
  usedFallback: boolean;
}
 
/** Per-comment evaluation detail for structured reporting. */
export interface FixEvaluation {
  findingId?: string;
  skill?: string;
  path: string;
  line: number;
  title: string;
  verdict: FixStatus | 're_detected' | 'eval_error';
  reasoning?: string;
  durationMs: number;
  usage: UsageStats;
  usedFallback: boolean;
}
 
export interface EvaluateFixAttemptsResult {
  /** Comments where fix was successful and should be resolved */
  toResolve: ExistingComment[];
  /** Comments where fix failed and need a reply */
  toReply: { comment: ExistingComment; replyBody: string; commitSha: string }[];
  /** Comments not evaluated (no patches, or over limit) */
  skipped: number;
  /** Comments sent to LLM for evaluation */
  evaluated: number;
  /** Evaluations that failed and used fallback (API errors, invalid responses) */
  failedEvaluations: number;
  /** Unique finding threads evaluated in this run */
  uniqueFindingsEvaluated: number;
  /** Unique finding threads with evidence of code-change action */
  uniqueFindingsCodeChanged: number;
  /** Unique finding threads judged resolved */
  uniqueFindingsResolved: number;
  /** Accumulated usage stats from all fix evaluations */
  usage: UsageStats;
  /** Per-comment evaluation details for logging/reporting */
  evaluations: FixEvaluation[];
}
 
export interface EvaluateFixAttemptsContext {
  owner: string;
  repo: string;
  baseSha: string;
  headSha: string;
}