/**
 * engine/living-spec/auto-updater.ts — SPEC-170: Auto-update specs from code changes
 *
 * Pure functions that analyse a git-style code diff, map changed functions to
 * acceptance criteria, and propose (or apply) spec updates.
 *
 * Design:
 * - mapDiffToAcs: heuristic matching between diff functions and AC text
 * - generateSpecUpdate: applies proposals onto existing spec content
 * - autoUpdateSpecFromCode: orchestrates the full pipeline
 */
import type { AcceptanceCriterion, AcMapping, AutoUpdateConfig, AutoUpdateResult, DiffFunction, SpecUpdateProposal } from '../../types/index.js';
/**
 * Extract function-level changes from a unified diff string.
 * Detects `+function`, `-function`, `+async function`, `+export function`, etc.
 */
export declare function parseDiffFunctions(diff: string): DiffFunction[];
/**
 * Extract acceptance criteria lines from spec markdown content.
 * Looks for ALL checklist items (`- [ ] ...` or `- [x] ...`) in the document,
 * regardless of section. Returns them with sequential numeric counters.
 *
 * Note: differs from the shared `extractAcceptanceCriteria` (ac-extractor.ts) which
 * requires an explicit "Acceptance Criteria" section header and is used for diffing.
 */
export declare function extractAcsFromSpec(specContent: string): AcceptanceCriterion[];
/**
 * Map diff functions to acceptance criteria using keyword heuristics.
 *
 * For each changed function:
 * - If it matches one or more ACs → emit 'mark-covered' or 'update-progress'
 * - If removed and matches an AC → emit 'flag-obsolete'
 * - If no AC matches at all → emit 'suggest-new-ac'
 */
export declare function mapDiffToAcs(functions: DiffFunction[], acs: AcceptanceCriterion[], config?: AutoUpdateConfig): AcMapping[];
/**
 * Build SpecUpdateProposals from AcMappings.
 */
export declare function buildProposals(mappings: AcMapping[], specId: string): SpecUpdateProposal[];
/**
 * Apply proposals onto existing spec content and return the updated string.
 *
 * Strategy: append a changelog section at the end of the spec with all patches.
 * Marking individual ACs in-place would require complex line manipulation, so
 * instead we append a structured "Auto-sync changelog" section.
 */
export declare function generateSpecUpdate(proposals: SpecUpdateProposal[], specContent: string): string;
/**
 * Analyse a code diff and produce auto-update proposals for a spec.
 *
 * @param specId - The spec to update.
 * @param codeDiff - Unified diff string. If empty, returns empty result.
 * @param specContent - Current markdown content of the spec.
 * @param autoApply - When true, apply proposals and return the updated content.
 * @param config - Optional configuration overrides.
 */
export declare function autoUpdateSpecFromCode(specId: string, codeDiff: string, specContent: string, autoApply?: boolean, config?: AutoUpdateConfig): AutoUpdateResult;
//# sourceMappingURL=auto-updater.d.ts.map