#!/usr/bin/env node /** * CI: naming-alias-matrix.md must list canonical ↔ legacy ctx hooks and policy keys. */ import fs from 'node:fs' import path from 'node:path' import process from 'node:process' import { fileURLToPath } from 'node:url' const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') const required = [ 'bareOsRegisterBootStepHook', 'bareOsRegisterBootPhaseHook', 'bareOsInvokeBootStepHooks', 'bareOsInvokeBootPhaseHooks', 'bareOsEmitBareBootStepHint', 'bareOsEmitBareBootPhaseHint', 'skipBootStages', 'skipPhases', 'denyBootStages', 'denyBootPhases', 'bootStagesRequireProcIndexMinSchema', 'bootPhasesRequireProcIndexMinSchema', 'kernel_program.json', 'giant_phase_program.json' ] function main() { const md = fs.readFileSync( path.join(root, 'docs/reference/naming-alias-matrix.md'), 'utf8' ) for (const s of required) { if (!md.includes(s)) { console.error('verify-naming-alias-matrix: missing required substring:', s) process.exit(1) } } console.log('verify-naming-alias-matrix: OK') } main()