import type { Statistic, TestLabel, TestStatus } from "@allurereport/core-api"; import { type EnrichmentActionCategory } from "./guidance.js"; import type { AgentHumanReportStatus } from "./model.js"; export type AgentFindingSeverity = "info" | "warning" | "high"; export type AgentFindingCategory = "bootstrap" | "scope" | "metadata" | "evidence" | "smells"; export type AgentScopeMatch = "match" | "unexpected" | "forbidden" | "unknown"; export type AgentAcceptanceStatus = "accept" | "iterate" | "reject"; export type AgentAcceptanceImpact = "advisory" | "iterate" | "reject"; export type AgentExpectationResultStatus = "matched" | "failed" | "partial" | "degraded" | "unsupported" | "unavailable" | "not_requested"; export type AgentExpectationResultImpact = "accept" | "reject" | "iterate" | "advisory"; export type AgentEnrichmentActionCategory = EnrichmentActionCategory; export type AgentExpectationSelector = { environments?: string[]; full_names?: string[]; full_name_prefixes?: string[]; label_values?: Record; test_count?: number; }; export type AgentEvidenceExpectations = { required?: boolean; min_steps?: number; min_attachments?: number; step_name_contains?: string[]; attachments?: Array<{ name?: string; content_type?: string; }>; }; export type AgentExpectations = { goal?: string; task_id?: string; expected?: AgentExpectationSelector; forbidden?: AgentExpectationSelector; evidence?: AgentEvidenceExpectations; notes?: string[]; }; export type AgentHarnessScopeInput = { environments?: string[]; fullNames?: string[]; fullNamePrefixes?: string[]; labelValues?: Record; }; export type AgentHarnessRequest = { goal?: string; taskId?: string; target?: AgentHarnessScopeInput; expected?: AgentHarnessScopeInput; forbidden?: AgentHarnessScopeInput; notes?: string | string[]; repoContext?: { framework?: string; workspace?: string; }; }; export type AgentRunManifest = { schema_version: string; report_uuid: string; generated_at: string; phase?: "running" | "done"; command: string | null; actual_exit_code: number | null; original_exit_code: number | null; exit_code: { original: number; actual: number | null; } | null; summary: { stats: Statistic; modeled_stats?: { total: number; failed: number; broken: number; skipped: number; unknown: number; passed: number; }; unmodeled_from_stats?: { total: number; failed: number; broken: number; skipped: number; unknown: number; passed: number; }; compact?: { visible_results: number; logical_tests: number; unmodeled_visible_results: number; runner_failures_outside_logical_tests: number; completeness: "complete" | "partial"; findings?: number; }; duration_ms: { total: number; average: number; max: number; }; environments: Array<{ environmentId: string; total: number; failed: number; broken: number; skipped: number; unknown: number; passed: number; }>; }; paths: { index_md: string; agents_md: string; tests_manifest: string; findings_manifest: string; test_events_manifest?: string; expected_manifest: string | null; human_report_manifest?: string | null; process_logs: { stdout: string | null; stderr: string | null; }; }; human_report?: AgentHumanReportStatus | null; modeling?: { completeness: "complete" | "partial"; reasons: string[]; modeledStats: { total: number; failed: number; broken: number; skipped: number; unknown: number; passed: number; }; unmodeledFromStats: { total: number; failed: number; broken: number; skipped: number; unknown: number; passed: number; }; runnerFailures: { total: number; globalErrors: number; stderrActionable: number; samples: Array<{ source: "stderr" | "global_error"; kind: "import" | "suite-load" | "setup" | "global-error"; message: string; count: number; }>; }; stderr: { actionableCount: number; actionableSamples: string[]; noisyWarningCount: number; noisyWarningSamples: string[]; }; compact: { visible_results: number; logical_tests: number; unmodeled_visible_results: number; runner_failures_outside_logical_tests: number; completeness: "complete" | "partial"; }; }; expectations_present: boolean; expectations: AgentExpectations | null; expectation_result: { schema_version: "allure-agent-expectation-result/v1"; status: AgentExpectationResultStatus; impact: AgentExpectationResultImpact; source: { kind: "inline" | "file" | "none"; path: string | null; }; recognized_control_count: number; unsupported_controls: string[]; degraded_controls: string[]; summary: { expected_tests: number; observed_tests: number; missing_expected: number; forbidden_observed: number; unexpected_observed: number; evidence_mismatches: number; }; finding_ids: string[]; }; check_summary: { total: number; countsBySeverity: Record; countsByCategory: Record; }; agent_context: { agent_name: string | null; loop_id: string | null; task_id: string | null; conversation_id: string | null; }; }; export type AgentTestManifestLine = { environment_id: string; retry_hash: string | null; test_result_id: string; full_name: string; package: string | null; labels: TestLabel[]; status: TestStatus; duration_ms: number; retries: number; flaky: boolean; scope_match: AgentScopeMatch; scope_reasons?: string[]; finding_counts: { total: number; high: number; warning: number; info: number; }; markdown_path: string; assets_dir: string; }; export type AgentFindingManifestLine = { schema_version?: "allure-agent-finding/v2"; check_id?: string; instance_id?: string; finding_id: string; subject: string | { type: "run" | "test" | "environment" | "attachment" | "global"; id?: string; path?: string; full_name?: string; environment?: string; }; subject_ref?: string; subject_type?: "run" | "test"; severity: AgentFindingSeverity; impact?: AgentAcceptanceImpact; category: AgentFindingCategory; check_name: string; title?: string; message: string; explanation: string; evidence_paths: string[]; remediation_hint: string; expected_reference?: string; confidence?: number; expected?: Record; observed?: Record; evidence?: { paths?: string[]; }; action?: string; legacy?: { finding_id: string; subject: string; subject_type?: "run" | "test"; check_name: string; explanation?: string; evidence_paths?: string[]; remediation_hint: string; expected_reference?: string; }; }; export type AgentOutputBundle = { outputDir: string; run: AgentRunManifest; tests: AgentTestManifestLine[]; findings: AgentFindingManifestLine[]; expected?: AgentExpectations; humanReport?: AgentHumanReportStatus; }; export type AgentEnrichmentAction = { checkName: string; category: AgentEnrichmentActionCategory; title: string; guidance: string; }; export type AgentEnrichmentPlanItem = AgentEnrichmentAction & { subject: string; subjectType: "run" | "test"; severity: AgentFindingSeverity; message: string; explanation: string; remediationHint: string; evidencePaths: string[]; expectedReference?: string; confidence?: number; acceptanceImpact: AgentAcceptanceImpact; fullName?: string; markdownPath?: string; scopeMatch?: AgentScopeMatch; }; export type AgentEnrichmentReview = { status: AgentAcceptanceStatus; outputDir: string; expectationsPresent: boolean; expected?: AgentExpectations; summary: { totalTests: number; totalFindings: number; planItems: number; rejectingItems: number; iterationItems: number; advisoryItems: number; countsByActionCategory: Record; }; notes: string[]; plan: AgentEnrichmentPlanItem[]; rejecting: AgentEnrichmentPlanItem[]; iterate: AgentEnrichmentPlanItem[]; advisory: AgentEnrichmentPlanItem[]; rerun: { requiresExpectations: boolean; useExistingExpectations: boolean; targetedTests: string[]; }; }; export type AgentReviewOptions = { antiDummyConfidenceThreshold?: number; requireExpectationsForAcceptance?: boolean; }; export declare const DEFAULT_ANTI_DUMMY_CONFIDENCE = 0.75; export declare const AGENT_ENRICHMENT_ACTIONS: Record; export declare const SCOPE_REJECTING_CHECKS: readonly ["expected-test-missing", "expected-count-mismatch", "expected-prefix-missing", "expected-label-missing", "expected-environment-missing", "no-tests-observed", "unexpected-environment", "forbidden-label-observed", "unexpected-test"]; export declare const ITERATION_REQUIRED_CHECKS: readonly ["expectations-invalid", "expectations-empty", "expectations-unsupported-control", "runner-failures-outside-logical-results", "metadata-mismatch", "history-id-collision", "expected-step-containing-missing", "insufficient-expected-steps", "insufficient-expected-attachments", "missing-expected-attachment"]; export declare const ANTI_DUMMY_CHECKS: readonly string[]; export declare const buildAgentExpectations: (input: AgentHarnessRequest) => AgentExpectations; export declare const mapFindingToEnrichmentAction: (finding: AgentFindingManifestLine | string) => AgentEnrichmentAction; export declare const loadAgentOutput: (outputDir: string) => Promise; export declare const planAgentEnrichmentReview: (output: AgentOutputBundle, options?: AgentReviewOptions) => AgentEnrichmentReview; export declare const reviewAgentOutput: (outputDir: string, options?: AgentReviewOptions) => Promise;