#!/usr/bin/env bun /** * history-anatomy-cache — CLI glue (task 1005 R4, ADR-130 lib rule) for the history-anatomy * report cache (feature I8, HA-S1 0659 / ADR-079): eight verbs, byte-identical argv/stdout/exit. * Logic lives in packages/app/src/services/history-anatomy.ts, reached through the generated * standalone bundle `plugins/sp/lib/history-anatomy.generated.mjs`; twin runs under bare `node` * (`bun run build:scripts`). */ import { spawnSync } from 'node:child_process'; import { mkdirSync, readFileSync, writeFileSync } from 'node:fs'; import * as core from '../lib/history-anatomy.generated.mjs'; export * from '../lib/history-anatomy.generated.mjs'; const VALID_COMMANDS = 'digest, check, paths, assert-clean, probe, stamp, refresh, publish'; const PROBE_USAGE = '