// engine/heal/proposal-writer.ts — SPEC-745
// Writes .heal-proposal.<ts>.json files for tier-2 out-of-range violations.
import { writeFile, mkdir } from 'node:fs/promises';
import { dirname } from 'node:path';
/**
 * Write a heal proposal file next to the original.
 * Returns the proposal file path.
 */
export async function writeHealProposal(originalPath, proposal, timestampMs) {
    const ts = timestampMs ?? Date.now();
    const proposalPath = `${originalPath}.heal-proposal.${ts}.json`;
    await mkdir(dirname(proposalPath), { recursive: true });
    await writeFile(proposalPath, JSON.stringify(proposal, null, 2), 'utf-8');
    return proposalPath;
}
//# sourceMappingURL=proposal-writer.js.map