import type { AuditResult, CoverageMatrix, Finding, UnitManifest } from "../types.js"; import type { AuditScopeManifest } from "../types/auditScope.js"; import type { IntentCheckpoint, SubmissionLedgerEvent } from "audit-tools/shared"; import type { DesignAssessment } from "../types/designAssessment.js"; import type { StructureDecomposition } from "../types/structureDecomposition.js"; import type { CharterRegister } from "../types/charterRegister.js"; import type { SystemicChallengeRegister } from "../types/systemicChallenge.js"; import type { ExternalAnalyzerResults } from "audit-tools/shared"; import type { AuditFindingsReport, ContentCoherenceTrace, CriticalFlowManifest, Finding as SharedFinding, FindingTheme, GraphBundle, SynthesisNarrative, WorkBlockSeam } from "audit-tools/shared"; import { type AgentReflection } from "audit-tools/shared"; import type { RuntimeValidationReport, RuntimeValidationTaskManifest } from "../types/runtimeValidation.js"; import { type WorkBlock } from "./workBlocks.js"; /** * Contract version stamped onto the canonical `audit-findings.json`. * Single-sourced from `audit-tools/shared` so the auditor's output and the * remediator's validator can never drift (guarded by the * `seam-artifact-ipc-envelope` test). */ export declare const AUDIT_FINDINGS_CONTRACT_VERSION: "audit-tools/audit-findings/v1alpha1"; /** * Anything renderable as the deterministic audit report. Both `AuditReportModel` * (no narrative) and the canonical `AuditFindingsReport` (optionally carrying * themes/executive_summary/top_risks) satisfy this shape, so the same renderer * produces the base report and the narrative-enriched report. */ export interface RenderableAuditReport { summary: AuditReportSummary; findings: SharedFinding[]; work_blocks: WorkBlock[]; work_block_seams: WorkBlockSeam[]; /** Tool-REFUTED findings excluded from the admitted set (B4); rendered separately. */ quarantined_findings?: SharedFinding[]; themes?: FindingTheme[]; executive_summary?: string; top_risks?: string[]; } export interface AuditReportSummary { finding_count: number; work_block_count: number; severity_breakdown: Record; lens_breakdown?: Record; audited_file_count: number; excluded_file_count: number; runtime_validation_status_breakdown: Record; /** * Per-status counts (grounded/ungrounded) of the S7 grounding pass. Optional * so the shared `AuditFindingsSummary` (which also makes it optional) stays * assignable to this render shape; absent when no finding carried a verdict. */ grounding_status_breakdown?: Record; } export interface AuditReportModel { summary: AuditReportSummary; findings: Finding[]; coherence_trace: ContentCoherenceTrace; work_blocks: WorkBlock[]; work_block_seams: WorkBlockSeam[]; /** Tool-REFUTED findings (S7 tier-2 disproof) excluded from the admitted set. */ quarantined_findings?: Finding[]; } export declare function buildAuditReportModel(params: { results: AuditResult[]; unitManifest?: UnitManifest; graphBundle?: GraphBundle; criticalFlows?: CriticalFlowManifest; coverageMatrix?: CoverageMatrix; runtimeValidationReport?: RuntimeValidationReport; runtimeValidationTaskManifest?: RuntimeValidationTaskManifest; externalAnalyzerResults?: ExternalAnalyzerResults[]; designAssessment?: DesignAssessment; structureDecomposition?: StructureDecomposition; charterRegister?: CharterRegister; systemicChallenge?: SystemicChallengeRegister; /** Intake manifest byte sizes used to estimate remediation source context. */ sizeIndex?: Readonly>; }): AuditReportModel; /** * Wrap the deterministic report model in the canonical `audit-findings.json` * contract — the machine hand-off consumed by the remediator. Narrative fields * are absent here; they are layered on later by {@link applyNarrative}. */ export declare function buildAuditFindingsReport(model: AuditReportModel): AuditFindingsReport; /** * Merge an LLM synthesis narrative into the canonical findings report: tag each * covered finding with its (first-claiming) `theme_id`, and attach the * executive summary / top risks. Deterministic and idempotent — the same * narrative yields the same report. * * Uniform id-join contract: a `finding_ids` entry that names no finding in the * report REFUSES the whole narrative (throws, naming the unknown ids) — never a * silent drop, which would present a theme as covering findings it does not. */ export declare function applyNarrative(report: AuditFindingsReport, narrative: SynthesisNarrative): AuditFindingsReport; export interface RenderAuditReportOptions { /** Scope manifest for the run; when delta, the report header reports it honestly. */ scope?: AuditScopeManifest; /** * Opt-in agent meta-audit reflections to surface in a "Process Feedback" * section. Omitted/empty renders nothing. Populated from the parsed * `agent-feedback.jsonl` (`bundle.agent_reflections`) by the synthesis * executors. */ reflections?: AgentReflection[]; /** * The accepted intent checkpoint; its `excluded_scope` is surfaced in an * "Excluded / Out-of-Scope" section so omissions are explicit in the report. */ intent_checkpoint?: IntentCheckpoint; /** * The submission ledger's events, in arrival order. Rendered as per-kind * totals in the process section so a run that drifted and was repaired stays * distinguishable, in the DELIVERABLE, from one that was clean on the first * try — the fact the ledger exists to preserve, previously readable only by * opening the ledger itself. */ submission_ledger?: readonly SubmissionLedgerEvent[]; } export declare function renderAuditReportMarkdown(report: RenderableAuditReport, options?: RenderAuditReportOptions): string; /** * Re-derive the summary fields that can be computed from the existing findings * and work_blocks, bump the contract_version to the current constant, and leave * upstream-derived fields that cannot be reconstructed (audited/excluded counts, * runtime validation breakdown) untouched. * * Safe to call on already-promoted `audit-findings.json` files without access to * the pruned `.audit-tools/audit` working-bundle intermediates. */ export declare function normalizeExistingFindingsReport(report: AuditFindingsReport): AuditFindingsReport; //# sourceMappingURL=synthesis.d.ts.map