import { c as getProjectRoot } from './paths-2M_UxD_H.js';
import { join } from 'node:path';
import { mkdir, appendFile } from 'node:fs/promises';
import 'node:fs';
import 'node:os';
import 'node:events';
import 'node:diagnostics_channel';
import 'fs';
import 'events';
import 'util';
import 'path';
import 'assert';
import 'worker_threads';
import 'module';
import 'node:url';
import 'url';
import 'buffer';
import 'node:module';
import 'node:child_process';
import 'node:crypto';
import 'node:process';
import 'node:async_hooks';

//#region ../core/dist/tasks/depends-waiver-audit.js
/**
* Depends-waiver audit trail.
*
* Records waiver entries to `.cleo/audit/depends-waiver.jsonl` when a caller
* completes a task whose own work is done but whose `depends` edges point at
* tasks that are not yet in a terminal state, by supplying
* `--waive-depends "<reason>"` to bypass the `E_CLEO_DEPENDENCY` gate.
*
* Pattern mirrors `cancelled-child-waiver-audit.ts` (T10538) and
* `premature-close-audit.ts` (T1632) — one JSONL file per audit concern,
* created on demand, appended atomically.
*
* @task T11954 — DHQ-071: complete hard-blocks on stale/over-specified depends
* @epic T11679
*/
/**
* Append a depends-waiver entry to the audit file.
*
* Creates `.cleo/audit/` if it does not exist and atomically appends a
* single-line JSON record to `.cleo/audit/depends-waiver.jsonl`.
*
* @param entry - The audit entry to append.
* @param projectRoot - Absolute path to the project root (defaults to `getProjectRoot()`).
*/
async function appendDependsWaiverAudit(entry, projectRoot) {
	const auditDir = join(projectRoot ?? getProjectRoot(), ".cleo", "audit");
	await mkdir(auditDir, { recursive: true });
	await appendFile(join(auditDir, "depends-waiver.jsonl"), `${JSON.stringify(entry)}\n`, { encoding: "utf8" });
}

export { appendDependsWaiverAudit };
//# sourceMappingURL=depends-waiver-audit-zJ6KDrCS.js.map
