#!/usr/bin/env node /** * CI: feature-roadmap.md must contain 100 numbered rows under capability word 7 heading (word-7 checklist). */ 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)), '..') function read(rel) { return fs.readFileSync(path.join(root, rel), 'utf8') } function main() { const md = read('docs/reference/feature-roadmap.md') const heading = '## Capability word 7 checklist (100-item mega kernel)' const idx = md.indexOf(heading) if (idx < 0) { console.error('feature-roadmap.md missing', heading) process.exit(1) } const rest = md.slice(idx + heading.length) const nextH2 = rest.search(/\n## /) const block = nextH2 < 0 ? rest : rest.slice(0, nextH2) let count = 0 for (const line of block.split('\n')) { if (/^\| *[0-9]+ *\|/.test(line)) count++ } if (count < 100) { console.error( 'verify-kernel-capabilities-word-7: expected >=100 table rows in capability word 7 block, got', count ) process.exit(1) } console.log('verify-kernel-capabilities-word-7: OK', count, 'rows') } main()