import { z } from "zod"; /** One normalized result imported from an external analyzer such as eslint or tsc. */ export declare const ExternalAnalyzerResultItemSchema: z.ZodObject<{ id: z.ZodString; category: z.ZodString; severity: z.ZodString; path: z.ZodString; line_start: z.ZodOptional; line_end: z.ZodOptional; summary: z.ZodString; rule: z.ZodOptional; /** Preserves the analyzer-native payload when consumers need original detail. */ raw: z.ZodOptional; /** Content-anchored lead identity for the close-verify draw (item C). */ provenance: z.ZodOptional; path: z.ZodString; snippet_hash: z.ZodString; }, "strict", z.ZodTypeAny, { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; }, { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; }>>; }, "strict", z.ZodTypeAny, { path: string; id: string; category: string; severity: string; summary: string; rule?: string | undefined; line_start?: number | undefined; line_end?: number | undefined; provenance?: { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; } | undefined; raw?: unknown; }, { path: string; id: string; category: string; severity: string; summary: string; rule?: string | undefined; line_start?: number | undefined; line_end?: number | undefined; provenance?: { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; } | undefined; raw?: unknown; }>; export type ExternalAnalyzerResultItem = z.infer; /** * A normalized language-neutral graph edge contributed by an EXTERNAL analyzer * (ast-grep / broader-semgrep dataflow / CodeQL dataflow). `from`/`to` are repo * paths (resolved against the path lookup at extraction); `kind`/`confidence`/ * `reason` are optional provenance, mirroring the in-tree {@link GraphEdge} * shape so external dataflow enriches the same edge set the language analyzers * feed — no per-ecosystem fork. Carried on the adapter contract so a malformed * native payload degrades to an empty edge list rather than throwing. */ export declare const ExternalAnalyzerGraphEdgeSchema: z.ZodObject<{ from: z.ZodString; to: z.ZodString; kind: z.ZodOptional; confidence: z.ZodOptional; reason: z.ZodOptional; }, "strict", z.ZodTypeAny, { from: string; to: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }, { from: string; to: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }>; export type ExternalAnalyzerGraphEdge = z.infer; /** A normalized analyzer hint that a bounded set of files belongs to a root. */ export declare const ExternalAnalyzerOwnershipRootSchema: z.ZodObject<{ root: z.ZodString; paths: z.ZodArray; kind: z.ZodOptional; confidence: z.ZodOptional; reason: z.ZodOptional; }, "strict", z.ZodTypeAny, { paths: string[]; root: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }, { paths: string[]; root: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }>; /** * The analyzer status vocabulary, single-sourced (artifact:analyzer-status-vocabulary). * The zod enum below is BUILT from this tuple, so there is exactly one place a member * is added — and {@link EXTERNAL_ANALYZER_STATUS_CLASSIFICATION} below is an exhaustive * `Record` over it, so widening the tuple without classifying the new member is a * COMPILE error rather than a silent fall-through to "the run was fine". */ export declare const EXTERNAL_ANALYZER_TOOL_STATUSES: readonly ["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed", "checksum_mismatch"]; export type ExternalAnalyzerToolStatusValue = (typeof EXTERNAL_ANALYZER_TOOL_STATUSES)[number]; /** * What each status says about COVERAGE — the question every consumer of a status * record is really asking. `clean` is the ONLY value that may be read as "this tool * ran and found nothing"; `degraded` means the tool ran but its output cannot be * trusted as coverage; `not_run` means no coverage was produced at all. * * Exhaustive by construction: adding a member to * {@link EXTERNAL_ANALYZER_TOOL_STATUSES} without adding its row here fails * `npm run check`, so a new status can never default into `clean`. */ /** * What a status says about coverage. Named as a type so the vocabulary has ONE * home and every consumer of the classification speaks it by name. */ export type ExternalAnalyzerCoverage = "clean" | "findings" | "degraded" | "not_run"; /** * True when a coverage class means NO trustworthy coverage was produced — the * single member-level answer. Both consumers ask it here rather than each * re-typing `=== "degraded" || === "not_run"`, so widening the coverage * vocabulary is one edit guarded by a compile error, never a silent divergence * between two copies of the same comparison. */ export declare function isNonCleanAnalyzerCoverage(coverage: ExternalAnalyzerCoverage): boolean; export declare const EXTERNAL_ANALYZER_STATUS_CLASSIFICATION: Record; /** * True when a RECORD means "this tool did not produce trustworthy coverage". * * The status member alone cannot answer this, because degradation is not always * terminal: a run can exit non-zero, fail to parse, or drop rows and STILL surface * some items, which lands it on `findings` — an affirmative member describing a * partially-crashed run. Asking the member in isolation reports such a run as * trustworthy, which is the same success-shaped-empty mistake one level up. * * So the question is asked of the whole record: degraded when the member says so, OR * when the record carries a marker that findings were LOST — * - a non-zero exit, or a NULL exit (killed by a signal, never exited on its own); * - `dropped_rows` (parser rows plus normalizer items the run failed to report). * * `source_read_failures` is deliberately NOT in that set. Provenance is optional * everywhere on this contract: an item whose anchor could not be resolved is still a * fully reported lead, so an unresolved anchor is a weaker join key, not lost * coverage. It stays on the record because it is worth surfacing; it just does not * make the run untrustworthy. * * {@link EXTERNAL_ANALYZER_STATUS_CLASSIFICATION} remains the status-MEMBER map and * the compile gate; this is the consumer-facing answer. */ export declare function isDegradedExternalAnalyzerStatus(record: Pick): boolean; export declare const ExternalAnalyzerToolStatusSchema: z.ZodObject<{ tool: z.ZodString; command: z.ZodOptional; resolved: z.ZodBoolean; status: z.ZodEnum<["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed", "checksum_mismatch"]>; exit_code: z.ZodOptional>; error: z.ZodOptional; output_snippet: z.ZodOptional; /** * The tool's own stderr, bounded. Present whenever stderr carried text — it is * the only post-run evidence of WHY a non-zero exit or a stderr-only run failed. */ stderr_snippet: z.ZodOptional; /** * Everything this run failed to report, as ONE count: rows the parser understood * the shape of but could not use (malformed CSV/JSON rows), PLUS items the * normalizer discarded for a missing path or summary. The engine merges the two * because they are the same question to a consumer — how much did this run lose? * A non-zero count means the run under-reports; it is never a clean scan. */ dropped_rows: z.ZodOptional; /** * Items that named a path + line but whose source could not be read, so their * content-anchored provenance was dropped. Distinguishes a broken read seam from * a tool that legitimately reports no line numbers. */ source_read_failures: z.ZodOptional; duration_ms: z.ZodOptional; }, "strict", z.ZodTypeAny, { status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch"; resolved: boolean; tool: string; error?: string | undefined; command?: string | undefined; duration_ms?: number | undefined; exit_code?: number | null | undefined; output_snippet?: string | undefined; stderr_snippet?: string | undefined; dropped_rows?: number | undefined; source_read_failures?: number | undefined; }, { status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch"; resolved: boolean; tool: string; error?: string | undefined; command?: string | undefined; duration_ms?: number | undefined; exit_code?: number | null | undefined; output_snippet?: string | undefined; stderr_snippet?: string | undefined; dropped_rows?: number | undefined; source_read_failures?: number | undefined; }>; export type ExternalAnalyzerToolStatus = z.infer; /** * The generic pre-normalization item shape every analyzer parser emits. `from`/`to` * are the optional dataflow-edge endpoints `normalizeGenericExternalEdges` reads. */ export interface ExternalAnalyzerParsedItem { id?: string; category?: string; severity?: string; path?: string; line_start?: number; line_end?: number; summary?: string; rule?: string; raw?: unknown; from?: unknown; to?: unknown; } /** * A parse that can SAY it degraded. A bare `[]` cannot distinguish "the tool found * nothing" from "the payload was unparseable" or "half the rows were malformed", and * that ambiguity is what makes a broken analyzer read as a clean scan downstream. */ export interface ExternalAnalyzerParseReport { items: ExternalAnalyzerParsedItem[]; /** The payload could not be parsed at all (bad JSON/CSV, or the wrong top-level shape). */ parse_failed?: boolean; /** Rows recognised but unusable — counted, never silently dropped. */ dropped_rows?: number; /** Human-readable cause, carried onto the status record. */ note?: string; } /** * What `ExternalAnalyzerCandidate.parse` returns. A plain array is the "nothing to * report beyond the items" form; the report form is how a parser reports degradation. * Read both through {@link readParseOutcome} so no consumer has to branch. */ export type ExternalAnalyzerParseOutcome = ExternalAnalyzerParsedItem[] | ExternalAnalyzerParseReport; /** Normalize either parse-outcome form into the report form. */ export declare function readParseOutcome(outcome: ExternalAnalyzerParseOutcome | undefined | null): Required> & Omit; /** Imported analyzer output captured at a single generation time. */ export declare const ExternalAnalyzerResultsSchema: z.ZodObject<{ tool: z.ZodString; generated_at: z.ZodOptional; ownership_roots: z.ZodOptional; kind: z.ZodOptional; confidence: z.ZodOptional; reason: z.ZodOptional; }, "strict", z.ZodTypeAny, { paths: string[]; root: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }, { paths: string[]; root: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }>, "many">>; /** * Language-neutral graph edges contributed by an external dataflow analyzer. * Optional so legacy/finding-only imports still parse under `.strict()`. */ graph_edges: z.ZodOptional; confidence: z.ZodOptional; reason: z.ZodOptional; }, "strict", z.ZodTypeAny, { from: string; to: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }, { from: string; to: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }>, "many">>; tool_statuses: z.ZodOptional; resolved: z.ZodBoolean; status: z.ZodEnum<["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed", "checksum_mismatch"]>; exit_code: z.ZodOptional>; error: z.ZodOptional; output_snippet: z.ZodOptional; /** * The tool's own stderr, bounded. Present whenever stderr carried text — it is * the only post-run evidence of WHY a non-zero exit or a stderr-only run failed. */ stderr_snippet: z.ZodOptional; /** * Everything this run failed to report, as ONE count: rows the parser understood * the shape of but could not use (malformed CSV/JSON rows), PLUS items the * normalizer discarded for a missing path or summary. The engine merges the two * because they are the same question to a consumer — how much did this run lose? * A non-zero count means the run under-reports; it is never a clean scan. */ dropped_rows: z.ZodOptional; /** * Items that named a path + line but whose source could not be read, so their * content-anchored provenance was dropped. Distinguishes a broken read seam from * a tool that legitimately reports no line numbers. */ source_read_failures: z.ZodOptional; duration_ms: z.ZodOptional; }, "strict", z.ZodTypeAny, { status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch"; resolved: boolean; tool: string; error?: string | undefined; command?: string | undefined; duration_ms?: number | undefined; exit_code?: number | null | undefined; output_snippet?: string | undefined; stderr_snippet?: string | undefined; dropped_rows?: number | undefined; source_read_failures?: number | undefined; }, { status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch"; resolved: boolean; tool: string; error?: string | undefined; command?: string | undefined; duration_ms?: number | undefined; exit_code?: number | null | undefined; output_snippet?: string | undefined; stderr_snippet?: string | undefined; dropped_rows?: number | undefined; source_read_failures?: number | undefined; }>, "many">>; results: z.ZodArray; line_end: z.ZodOptional; summary: z.ZodString; rule: z.ZodOptional; /** Preserves the analyzer-native payload when consumers need original detail. */ raw: z.ZodOptional; /** Content-anchored lead identity for the close-verify draw (item C). */ provenance: z.ZodOptional; path: z.ZodString; snippet_hash: z.ZodString; }, "strict", z.ZodTypeAny, { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; }, { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; }>>; }, "strict", z.ZodTypeAny, { path: string; id: string; category: string; severity: string; summary: string; rule?: string | undefined; line_start?: number | undefined; line_end?: number | undefined; provenance?: { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; } | undefined; raw?: unknown; }, { path: string; id: string; category: string; severity: string; summary: string; rule?: string | undefined; line_start?: number | undefined; line_end?: number | undefined; provenance?: { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; } | undefined; raw?: unknown; }>, "many">; }, "strict", z.ZodTypeAny, { tool: string; results: { path: string; id: string; category: string; severity: string; summary: string; rule?: string | undefined; line_start?: number | undefined; line_end?: number | undefined; provenance?: { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; } | undefined; raw?: unknown; }[]; generated_at?: string | undefined; ownership_roots?: { paths: string[]; root: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }[] | undefined; graph_edges?: { from: string; to: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }[] | undefined; tool_statuses?: { status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch"; resolved: boolean; tool: string; error?: string | undefined; command?: string | undefined; duration_ms?: number | undefined; exit_code?: number | null | undefined; output_snippet?: string | undefined; stderr_snippet?: string | undefined; dropped_rows?: number | undefined; source_read_failures?: number | undefined; }[] | undefined; }, { tool: string; results: { path: string; id: string; category: string; severity: string; summary: string; rule?: string | undefined; line_start?: number | undefined; line_end?: number | undefined; provenance?: { path: string; analyzer_id: string; snippet_hash: string; rule?: string | undefined; } | undefined; raw?: unknown; }[]; generated_at?: string | undefined; ownership_roots?: { paths: string[]; root: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }[] | undefined; graph_edges?: { from: string; to: string; reason?: string | undefined; confidence?: number | undefined; kind?: string | undefined; }[] | undefined; tool_statuses?: { status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch"; resolved: boolean; tool: string; error?: string | undefined; command?: string | undefined; duration_ms?: number | undefined; exit_code?: number | null | undefined; output_snippet?: string | undefined; stderr_snippet?: string | undefined; dropped_rows?: number | undefined; source_read_failures?: number | undefined; }[] | undefined; }>; export type ExternalAnalyzerResults = z.infer; /** * Marker artifact written by the external-analyzer acquisition executor * (`external_analyzer_acquisition.json`). It records THAT acquisition ran for the * current {repo_manifest, file_disposition} and WITH WHAT outcome per candidate — * the obligation `external_analyzers_current` is satisfied when this marker is * present + fresh. The normalized findings themselves live in * `external_analyzer_results.json` (the per-tool array); this marker is the * provenance/run record + the staleness anchor, so a manifest/disposition change * re-stales it and re-runs acquisition. `enabled: false` is the hermetic no-op * (acquisition was not explicitly enabled for this advance) — no subprocess or * network ran; `tool_statuses` is empty. */ export declare const ExternalAnalyzerAcquisitionMarkerSchema: z.ZodObject<{ generated_at: z.ZodOptional; enabled: z.ZodBoolean; tool_statuses: z.ZodArray; resolved: z.ZodBoolean; status: z.ZodEnum<["skipped", "success", "findings", "not_resolved", "spawn_error", "parse_error", "failed", "checksum_mismatch"]>; exit_code: z.ZodOptional>; error: z.ZodOptional; output_snippet: z.ZodOptional; /** * The tool's own stderr, bounded. Present whenever stderr carried text — it is * the only post-run evidence of WHY a non-zero exit or a stderr-only run failed. */ stderr_snippet: z.ZodOptional; /** * Everything this run failed to report, as ONE count: rows the parser understood * the shape of but could not use (malformed CSV/JSON rows), PLUS items the * normalizer discarded for a missing path or summary. The engine merges the two * because they are the same question to a consumer — how much did this run lose? * A non-zero count means the run under-reports; it is never a clean scan. */ dropped_rows: z.ZodOptional; /** * Items that named a path + line but whose source could not be read, so their * content-anchored provenance was dropped. Distinguishes a broken read seam from * a tool that legitimately reports no line numbers. */ source_read_failures: z.ZodOptional; duration_ms: z.ZodOptional; }, "strict", z.ZodTypeAny, { status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch"; resolved: boolean; tool: string; error?: string | undefined; command?: string | undefined; duration_ms?: number | undefined; exit_code?: number | null | undefined; output_snippet?: string | undefined; stderr_snippet?: string | undefined; dropped_rows?: number | undefined; source_read_failures?: number | undefined; }, { status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch"; resolved: boolean; tool: string; error?: string | undefined; command?: string | undefined; duration_ms?: number | undefined; exit_code?: number | null | undefined; output_snippet?: string | undefined; stderr_snippet?: string | undefined; dropped_rows?: number | undefined; source_read_failures?: number | undefined; }>, "many">; }, "strict", z.ZodTypeAny, { enabled: boolean; tool_statuses: { status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch"; resolved: boolean; tool: string; error?: string | undefined; command?: string | undefined; duration_ms?: number | undefined; exit_code?: number | null | undefined; output_snippet?: string | undefined; stderr_snippet?: string | undefined; dropped_rows?: number | undefined; source_read_failures?: number | undefined; }[]; generated_at?: string | undefined; }, { enabled: boolean; tool_statuses: { status: "failed" | "findings" | "skipped" | "spawn_error" | "success" | "not_resolved" | "parse_error" | "checksum_mismatch"; resolved: boolean; tool: string; error?: string | undefined; command?: string | undefined; duration_ms?: number | undefined; exit_code?: number | null | undefined; output_snippet?: string | undefined; stderr_snippet?: string | undefined; dropped_rows?: number | undefined; source_read_failures?: number | undefined; }[]; generated_at?: string | undefined; }>; export type ExternalAnalyzerAcquisitionMarker = z.infer; /** * Merge one tool's results into the per-tool array artifact: the entry with the * same `tool` is REPLACED (a fresh run supersedes the prior one); otherwise the * entry is appended. Multiple producers (import / syntax-resolution / the * acquisition engine) each contribute their own tool entry without clobbering * the others. Returns a new array sorted by `tool` for deterministic output. */ export declare function upsertExternalToolResults(existing: ExternalAnalyzerResults[] | undefined, incoming: ExternalAnalyzerResults): ExternalAnalyzerResults[]; //# sourceMappingURL=types.d.ts.map