/** * Per spec §4.2 验收审计 + §7 阶段二 — MutReportJson v1.0. * * Hard constraints: * H8 (audit trail hashable): sha256 + inputSig (chain to TACT.sig) * H6 (CLI裁决, not LLM): passed boolean is computed by CLI, not LLM */ import { z } from 'zod'; export type MutVersion = '1.0'; export type MutTool = 'stryker' | 'mutmut' | 'go-mutesting'; export type WeakPattern = 'toBeDefined' | 'toBeTruthy' | 'toEqual-self' | 'expect-anything' | 'toBe-self'; export interface SurvivedMutant { readonly line: number; readonly mutation: string; readonly survivedBecause: string; } export interface FileMutationReport { readonly file: string; readonly killRate: number; readonly survived: ReadonlyArray; } export interface MutationReport { readonly tool: MutTool; readonly mutantsTotal: number; readonly mutantsKilled: number; readonly mutantsSurvived: number; readonly mutantsTimeout: number; readonly killRate: number; readonly byFile: ReadonlyArray; } export interface WeakExample { readonly file: string; readonly line: number; readonly code: string; } export interface WeakPatternCount { readonly pattern: WeakPattern; readonly count: number; readonly examples: ReadonlyArray; } export interface AssertionsReport { readonly totalAssertions: number; readonly weakAssertions: number; readonly weakRate: number; readonly weakPatterns: ReadonlyArray; } export interface ThresholdsConfig { readonly mutationKillRateMin: number; readonly weakAssertionRateMax: number; readonly passed: boolean; } export type FollowupSeverity = 'soft' | 'hard'; export type FollowupIssue = 'low_kill_rate' | 'high_weak_assertions'; export interface Followup { readonly file: string; readonly issue: FollowupIssue; readonly severity: FollowupSeverity; readonly suggestion: string; } export interface MutReportJson { readonly version: MutVersion; readonly sha256: string; readonly generatedAt: string; readonly inputSig: string; readonly mutation: MutationReport; readonly assertions: AssertionsReport; readonly thresholds: ThresholdsConfig; readonly followups: ReadonlyArray; } export declare const WeakPatternSchema: z.ZodEnum<["toBeDefined", "toBeTruthy", "toEqual-self", "expect-anything", "toBe-self"]>; export declare const MutReportSchema: z.ZodObject<{ version: z.ZodLiteral<"1.0">; sha256: z.ZodString; generatedAt: z.ZodString; inputSig: z.ZodString; mutation: z.ZodObject<{ tool: z.ZodEnum<["stryker", "mutmut", "go-mutesting"]>; mutantsTotal: z.ZodNumber; mutantsKilled: z.ZodNumber; mutantsSurvived: z.ZodNumber; mutantsTimeout: z.ZodNumber; killRate: z.ZodNumber; byFile: z.ZodArray, "many">; }, "strip", z.ZodTypeAny, { file: string; killRate: number; survived: { line: number; mutation: string; survivedBecause: string; }[]; }, { file: string; killRate: number; survived: { line: number; mutation: string; survivedBecause: string; }[]; }>, "many">; }, "strip", z.ZodTypeAny, { tool: "stryker" | "mutmut" | "go-mutesting"; killRate: number; mutantsTotal: number; mutantsKilled: number; mutantsSurvived: number; mutantsTimeout: number; byFile: { file: string; killRate: number; survived: { line: number; mutation: string; survivedBecause: string; }[]; }[]; }, { tool: "stryker" | "mutmut" | "go-mutesting"; killRate: number; mutantsTotal: number; mutantsKilled: number; mutantsSurvived: number; mutantsTimeout: number; byFile: { file: string; killRate: number; survived: { line: number; mutation: string; survivedBecause: string; }[]; }[]; }>; assertions: z.ZodObject<{ totalAssertions: z.ZodNumber; weakAssertions: z.ZodNumber; weakRate: z.ZodNumber; weakPatterns: z.ZodArray; count: z.ZodNumber; examples: z.ZodArray, "many">; }, "strip", z.ZodTypeAny, { count: number; examples: { code: string; file: string; line: number; }[]; pattern: "toBeDefined" | "toBeTruthy" | "toEqual-self" | "expect-anything" | "toBe-self"; }, { count: number; examples: { code: string; file: string; line: number; }[]; pattern: "toBeDefined" | "toBeTruthy" | "toEqual-self" | "expect-anything" | "toBe-self"; }>, "many">; }, "strip", z.ZodTypeAny, { weakRate: number; totalAssertions: number; weakAssertions: number; weakPatterns: { count: number; examples: { code: string; file: string; line: number; }[]; pattern: "toBeDefined" | "toBeTruthy" | "toEqual-self" | "expect-anything" | "toBe-self"; }[]; }, { weakRate: number; totalAssertions: number; weakAssertions: number; weakPatterns: { count: number; examples: { code: string; file: string; line: number; }[]; pattern: "toBeDefined" | "toBeTruthy" | "toEqual-self" | "expect-anything" | "toBe-self"; }[]; }>; thresholds: z.ZodObject<{ mutationKillRateMin: z.ZodNumber; weakAssertionRateMax: z.ZodNumber; passed: z.ZodBoolean; }, "strip", z.ZodTypeAny, { passed: boolean; mutationKillRateMin: number; weakAssertionRateMax: number; }, { passed: boolean; mutationKillRateMin: number; weakAssertionRateMax: number; }>; followups: z.ZodArray; severity: z.ZodEnum<["soft", "hard"]>; suggestion: z.ZodString; }, "strip", z.ZodTypeAny, { file: string; severity: "soft" | "hard"; issue: "low_kill_rate" | "high_weak_assertions"; suggestion: string; }, { file: string; severity: "soft" | "hard"; issue: "low_kill_rate" | "high_weak_assertions"; suggestion: string; }>, "many">; }, "strip", z.ZodTypeAny, { version: "1.0"; sha256: string; generatedAt: string; inputSig: string; mutation: { tool: "stryker" | "mutmut" | "go-mutesting"; killRate: number; mutantsTotal: number; mutantsKilled: number; mutantsSurvived: number; mutantsTimeout: number; byFile: { file: string; killRate: number; survived: { line: number; mutation: string; survivedBecause: string; }[]; }[]; }; assertions: { weakRate: number; totalAssertions: number; weakAssertions: number; weakPatterns: { count: number; examples: { code: string; file: string; line: number; }[]; pattern: "toBeDefined" | "toBeTruthy" | "toEqual-self" | "expect-anything" | "toBe-self"; }[]; }; thresholds: { passed: boolean; mutationKillRateMin: number; weakAssertionRateMax: number; }; followups: { file: string; severity: "soft" | "hard"; issue: "low_kill_rate" | "high_weak_assertions"; suggestion: string; }[]; }, { version: "1.0"; sha256: string; generatedAt: string; inputSig: string; mutation: { tool: "stryker" | "mutmut" | "go-mutesting"; killRate: number; mutantsTotal: number; mutantsKilled: number; mutantsSurvived: number; mutantsTimeout: number; byFile: { file: string; killRate: number; survived: { line: number; mutation: string; survivedBecause: string; }[]; }[]; }; assertions: { weakRate: number; totalAssertions: number; weakAssertions: number; weakPatterns: { count: number; examples: { code: string; file: string; line: number; }[]; pattern: "toBeDefined" | "toBeTruthy" | "toEqual-self" | "expect-anything" | "toBe-self"; }[]; }; thresholds: { passed: boolean; mutationKillRateMin: number; weakAssertionRateMax: number; }; followups: { file: string; severity: "soft" | "hard"; issue: "low_kill_rate" | "high_weak_assertions"; suggestion: string; }[]; }>;