// Wires the static plugin validator (tests/validate-plugin.sh) into the canonical // node --test suite so its checks — including RX-P1 Check 6 (install-mode path & // delegation safety) — are enforced on every suite run, not just manual invocation. import { test } from 'node:test'; import assert from 'node:assert/strict'; import { execFileSync } from 'node:child_process'; import { fileURLToPath } from 'node:url'; import { dirname, join } from 'node:path'; const here = dirname(fileURLToPath(import.meta.url)); const pluginRoot = join(here, '..', '..'); // tests/kb-update -> plugin root const script = join(pluginRoot, 'tests', 'validate-plugin.sh'); test('validate-plugin.sh passes (frontmatter, encoding, KB refs, plugin.json, install-mode Check 6)', () => { let out; try { out = execFileSync('bash', [script], { encoding: 'utf8', cwd: pluginRoot }); } catch (err) { assert.fail( `validate-plugin.sh exited ${err.status}:\n${err.stdout || ''}${err.stderr || ''}`, ); } assert.match(out, /VALIDATION PASSED/); assert.doesNotMatch(out, /VALIDATION FAILED/); });