Files
reverse-engineering-anything/scripts/lib/verifier-file-snapshots.mjs
T
morluto d01ee7b19a fix(verifiers): own setup terminal and snapshot lifetimes
Join identity-verified PTY family cleanup and native exit before workspace removal, retaining failed cleanup capabilities for retry. Replace duplicate kill-and-reject loops with shared process ownership and deadlines.

Capture configuration before setup using owned file handles and compare raw bytes. Preserve interactive cancellation, terminal restoration, redirected output, and selected inputs; remove the test-only forwarding export. Verified 122 focused cases, 9 README cases, build, static checks, docs, discovery, and duplication at 3.58%.
2026-10-24 17:54:18 +08:00

23 lines
731 B
JavaScript

let implementation;
/** Load the source file owner only when a verifier needs snapshot facts. */
const loadImplementation = () => {
implementation ??= import("tsx/esm/api").then(({ tsImport }) =>
tsImport(
new URL("./verifier-file-snapshot-owner.mts", import.meta.url).href,
import.meta.url,
),
);
return implementation;
};
export async function captureVerifierFileSnapshot(commands, paths) {
const module = await loadImplementation();
return module.captureVerifierFileSnapshot(commands, paths);
}
export async function assertVerifierFilesUnchanged(commands, snapshot, label) {
const module = await loadImplementation();
return module.assertVerifierFilesUnchanged(commands, snapshot, label);
}