#!/usr/bin/env node /** * Release checklist: workspace tests + kernel/seeder parity. * Optional: set CHECK_DOC_LINKS=1 to grep handbook for broken relative links (heuristic). */ import { spawnSync } from 'node:child_process' import { readFileSync, readdirSync, statSync } from 'node:fs' import path from 'node:path' import { fileURLToPath } from 'node:url' const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..') function run(cmd, args, opts = {}) { const r = spawnSync(cmd, args, { cwd: root, stdio: 'inherit', ...opts }) if (r.status !== 0) process.exit(r.status ?? 1) } console.log('[release-checklist] npm test') run('npm', ['test']) console.log('[release-checklist] npm run test:bare') run('npm', ['run', 'test:bare']) console.log('[release-checklist] verify-kernel-seeder-parity') run('node', ['scripts/verify-kernel-seeder-parity.mjs']) console.log('[release-checklist] verify-init-bundle-recipe (focused init bundle gate)') run('node', ['scripts/verify-init-bundle-recipe.mjs']) console.log('[release-checklist] gen-require-initjs-sha256 fixture') run('node', ['scripts/gen-require-initjs-sha256.mjs']) console.log('[release-checklist] verify-ctx-api-feature-bits') run('node', ['scripts/verify-ctx-api-feature-bits.mjs']) console.log('[release-checklist] verify-compat-matrix') run('node', ['scripts/verify-compat-matrix.mjs']) console.log( '[release-checklist] audit:placeholder-baseline (writes docs/audit/placeholder-baseline-scan.json; diff vs docs/audit/PLACEHOLDER_BASELINE.md)' ) run('npm', ['run', 'audit:placeholder-baseline']) console.log('[release-checklist] report-holepunch-lockfile-drift') run('node', ['scripts/report-holepunch-lockfile-drift.mjs']) console.log('[release-checklist] report-holepunch-runtime-compat') run('node', ['scripts/report-holepunch-runtime-compat.mjs']) console.log('[release-checklist] gen-holepunch-catalog-tiers') run('node', ['scripts/gen-holepunch-catalog-tiers.mjs']) console.log( '[release-checklist] verify-holepunch-clone-drift (BARE_OS_HOLEPUNCH_DRIFT_CHECK=0 to skip; empty repos[] is no-op)' ) run('node', ['scripts/verify-holepunch-clone-drift.mjs']) if ( process.env.BARE_OS_HOLEPUNCH_DRIFT_TIER1_RELEASE === '1' || process.env.BARE_OS_HOLEPUNCH_DRIFT_TIER1_RELEASE === 'true' ) { console.log( '[release-checklist] verify-holepunch-clone-drift tier1 (BARE_OS_HOLEPUNCH_DRIFT_TIER1_RELEASE=1)' ) run('node', [ 'scripts/verify-holepunch-clone-drift.mjs' ], { env: { ...process.env, BARE_OS_HOLEPUNCH_DRIFT_TIER1: '1' } }) } console.log('[release-checklist] verify-personal-drive-path-policy') run('node', ['scripts/verify-personal-drive-path-policy.mjs']) console.log( '[release-checklist] corestore snapshot workflow reminder: exercise host snapshot lane and verify /proc snapshot hints parity (BARE_OS_CORESTORE_SNAPSHOT_JSON / BARE_OS_CORESTORE_SNAPSHOT_WORKFLOW_JSON)' ) console.log( '[release-checklist] optional mirror-drive experiment helper: node scripts/mirror-drive-experiment.mjs --source-key <64hex> --mirror-key <64hex> --aux ' ) console.log('[release-checklist] verify-ctx-client-helper-sync') run('node', ['scripts/verify-ctx-client-helper-sync.mjs']) console.log('[release-checklist] verify-pear-module-manifest-data (pear tier parity + shape)') run('node', ['scripts/verify-pear-module-manifest-data.mjs']) console.log('[release-checklist] verify-pear-ctx-host-imports (static host imports vs pearEntries)') run('node', ['scripts/verify-pear-ctx-host-imports.mjs']) console.log( '[release-checklist] Optional: BARE_OS_HOLEPUNCH_FRESHNESS_STRICT=1 with fresh `holepunchto_repos` clones — see docs/audit/holepunch-freshness-gate.json' ) console.log( '[release-checklist] If you edited kernel/lib/init/init-main.js or kernel/lib/boot/, run: npm run bundle:kernel && rsync -a --delete kernel/ packages/bare-os-seeder/kernel/ then re-run this script.' ) if (process.env.CHECK_DOC_LINKS === '1') { console.log('[release-checklist] doc link heuristic (CHECK_DOC_LINKS=1)') const handbook = path.join(root, 'handbook') const ref = path.join(root, 'docs', 'reference') /** @param {string} dir */ function walkMd(dir) { const out = [] for (const name of readdirSync(dir)) { const p = path.join(dir, name) const st = statSync(p) if (st.isDirectory()) out.push(...walkMd(p)) else if (name.endsWith('.md')) out.push(p) } return out } let bad = 0 const linkRe = /\]\(([^)#\s]+\.(md|json))(?:#[^)]*)?\)/g for (const file of [...walkMd(handbook), ...walkMd(ref)]) { const text = readFileSync(file, 'utf8') let m while ((m = linkRe.exec(text))) { const target = m[1] if (target.startsWith('http')) continue const resolved = path.normalize(path.join(path.dirname(file), target)) try { statSync(resolved) } catch { console.warn(`[release-checklist] missing link target: ${path.relative(root, file)} -> ${target}`) bad++ } } } if (bad) process.exit(1) } console.log('[release-checklist] done') console.log( '[release-checklist] Optional: BARE_OS_HOLEPUNCH_DRIFT_CHECK=1 node scripts/verify-holepunch-clone-drift.mjs after populating docs/audit/holepunch-drift-repos.json and git fetch in each clone.' ) console.log( '[release-checklist] Boot policy: confirm extensionSignerPins / kernelExtensionHashPins in boot.policy.example.json match your governance before tagging.' ) console.log( '[release-checklist] Word 6 release notes template: bits6 + BARE_OS_KERNEL_FEATURES_STOCK_WORD_REPLICATION_OPERATOR_SURFACE, ctx API + feature-bits doc from compatibility-matrix, seed RPCs + boot.policy v6, OTel otlSchemaVersion 3, auditSchemaVersion 3, NDJSON lifecycle 5 — see docs/reference/feature-roadmap.md Capability word 6 table' ) console.log( '[release-checklist] Word 7 release notes template: bits7 + BARE_OS_KERNEL_FEATURES_STOCK_WORD_PEAR_CORESTORE_HRPC, protocol 0.3.x, ctx 1.16.x, boot.policy v7 (Pear runtime + protocol semver gates, denyCtxMethodPrefixes, extension depth), seed RPCs + /proc index schema 3 — see feature-roadmap.md Capability word 7 table' ) console.log( '[release-checklist] Word 8 release notes template: bits8 + BARE_OS_KERNEL_FEATURES_STOCK_WORD_BARE_RUNTIME_PROTO_MUX, protocol 0.4.x, ctx 1.17.x, boot.policy v8 (Bare runtime semver, denySeedRpcMethods, protomux channel name cap), seed RPCs + /proc index schema 4, NDJSON lifecycle 7 / OTel 5 / audit 5 — see feature-roadmap.md Capability word 8 table' ) console.log( '[release-checklist] Word 11 release notes template: bits11 + BARE_OS_KERNEL_FEATURES_STOCK_WORD_HYPERCORE_PACK_HRPC_LIFECYCLE, protocol 0.8.x, ctx 1.21.x, boot.policy v11 (requireKernelCapabilitiesHypercorePackHrpcLifecycle, extensionSignerPinsV4, pack/addon mins, maxHrpcAllowlistDepth, offlineLkgRequireHypercorePackHrpcLifecycle), twenty word-11 seed RPCs + /proc index schema 7, NDJSON lifecycle 10 / OTel 8 / audit 8, optional BARE_OS_HIDE_PROC_HYPERCORE_PACK_HRPC_LIFECYCLE to hide word-11 proc JSON — see feature-roadmap.md Capability word 11 table' )