import { RemediationPlan, Finding, RemediationBlock, RemediationItemState, CoverageLedger } from "../state/types.js"; import type { AuditFindingsReport } from "audit-tools/shared"; /** * Whether a parsed JSON value claims the audit-findings contract — the ROUTING * predicate for structured vs markdown/freeform input. * * INV-remediate-state-07: contract_version presence and expected value are * enforced here — an absent or mismatched contract_version never routes * structured. Deliberately NOT the full strict validator: a report that claims * the contract but is internally invalid must enter the structured path and be * refused there with its real issues, not silently fall through to the * markdown parser. */ export declare function isAuditFindingsReport(value: unknown): value is AuditFindingsReport; export { ESTIMATED_PROMPT_OVERHEAD_TOKENS as ESTIMATED_BLOCK_BASE_TOKENS, ESTIMATED_ITEM_OVERHEAD_TOKENS as ESTIMATED_FINDING_OVERHEAD_TOKENS, } from "audit-tools/shared"; export declare function estimateGroupTokens(findingIds: string[], findings: Finding[], fileByteCounts: Map, root?: string): number; /** * Account for every finding the plan received: each is marked `planned` (kept and * mapped to a block), `folded_into` (merged into a survivor by cross-lens dedup), * `dropped_no_evidence` (excluded for carrying no evidence), `dropped_by_checkpoint`, * or `dropped_phantom_paths` (every cited path was phantom, post-repair). The * dispositions are mutually exclusive and cover the whole source set, so nothing * is lost silently. Kept extracted findings additionally carry their grounding * annotations (stripped phantom paths, evidence-grounded flag). */ export declare function buildCoverageLedger(params: { planId: string; sourceFindings: Finding[]; droppedNoEvidence: string[]; droppedByCheckpoint: string[]; /** Findings dropped by the grounding pass, with the phantom paths they cited. */ droppedPhantomPaths?: Map; /** Phantom paths stripped from findings that survived grounding. */ phantomPathsRemoved?: Map; /** * Findings the user disapproved at the review-approval gate, with the recorded * reason. These are IN `sourceFindings` (an approved/declined finding is a * filter-pass survivor — folded/dropped findings never reach the gate), so they * produce an in-source `declined_by_review` disposition exactly like * `droppedByCheckpoint`, and they ARE part of the source reconciliation. */ declinedByReview?: Array<{ finding_id: string; reason: string; }>; mergeMap: Map; items: Record; }): CoverageLedger; /** * Reconcile blocks whose findings touch a shared file. * * A3 decomposition seam: two blocks that share a canonical physical file but come * from INDEPENDENT findings (distinct finding ids, no dependency edge ordering * them) are NO LONGER unioned into one serial block. They are kept SEPARATE and * each is flagged `cofile_parallel_safe=true` — a mechanical decision that the * findings are independent, NOT a proof of edit-region disjointness; correctness * is enforced later at merge by git (a real overlap surfaces as a conflict). Only * a genuine ordering dependency (an existing dependency edge between the two * blocks) keeps them serialized — and ordered blocks were never unioned anyway, * they simply run in dependency order. A single finding whose fix spans multiple * regions of one file is one block already and is never split. * * File identity uses `canonicalizeFilePath` (the one M1-BOUNDARY scheme) so * `src/A.ts`, `./src/A.ts`, `src\A.ts` and case variants collide on one key. * Pure; preserves the auditor's structure otherwise. */ export declare function mergeBlocksSharingFiles(blocks: RemediationBlock[], findings: Finding[], root?: string): RemediationBlock[]; /** * Applies the backend-independent post-dedup steps that every plan must go through * before being handed off to the implement phase: * * 1. mergeBlocksSharingFiles — preserves content-coherent membership while * annotating independent co-file work * 2. addAdvisoryTokenEstimates — reports deterministic local size metadata * 3. snapshotAffectedFileHashes — records trusted baseline hashes * * Sole caller is handlePendingExtractedPlan (LLM-extracted plans join site); * kept as its own function so the post-dedup logic has one home. */ export declare function applyPlanPipeline(plan: RemediationPlan, options: { root: string; artifactsDir?: string; }): Promise; //# sourceMappingURL=plan.d.ts.map