import { execFileSync } from 'node:child_process'
import { join } from 'node:path'
import { describe, expect, it } from 'vitest'

describe('KBX screen recipe governance', () => {
  it('validates the normalized recipe contract against the real TypeScript recipe source', () => {
    const validator = join(process.cwd(), '..', 'scripts', 'validate-kbx-screen-recipes.mjs')
    const output = execFileSync(process.execPath, [validator, '--root', '.'], { cwd: process.cwd(), encoding: 'utf8' })
    expect(output).toContain('failures=0')
  })
})
