#!/usr/bin/env node /** * CI: posix-dashboard.md is in sync with posix-compliance-matrix.json. */ 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 matrixPath = path.join(root, 'docs/reference/posix-compliance-matrix.json') const dashPath = path.join(root, 'docs/reference/posix-dashboard.md') function main() { const matrix = JSON.parse(fs.readFileSync(matrixPath, 'utf8')) const dash = fs.readFileSync(dashPath, 'utf8') if (!dash.includes(String(matrix.profileId || ''))) { console.error('verify-posix-dashboard: dashboard missing profileId', matrix.profileId) process.exit(1) } const sch = matrix.synthetic_proc?.syscalls_json_schema if (sch != null && !dash.includes(String(sch))) { console.error( 'verify-posix-dashboard: dashboard missing syscalls_json_schema', sch ) process.exit(1) } if (!dash.includes('gen-posix-dashboard.mjs')) { console.error('verify-posix-dashboard: dashboard missing generator pointer') process.exit(1) } console.log('verify-posix-dashboard: OK') } main()