Files
KArtSell.Aegis/scripts/validate-kbx-screen-recipes.mjs
kjh2064 31b36ba226 V13-FE-005: consolidate approved UI governance and contract hardening
Consolidates KBX UI Boundary Governance framework with component manifest,
screen recipe registry, AI component gate, and exception lifecycle validation.

Evidence (evidence/V13-FE-005/*.log, 55+ files):
- Full frontend regression: 70 files / 180 tests PASS
- UI boundary gate: 37 files / 0 failures / 6 raw-color warnings (DEBT tracked)
- Component manifest validation: 0 failures
- Screen recipe governance: 0 failures
- AI component gate: 17 feature files / 23 known exports / 0 failures
- Accessibility E2E: 22 passed
- Production build: PASS (>500 kB chunk warning V13-FE-038 DECISION_REQUIRED)
- TypeCheck: PASS
- KBX validators: All 5 PASS (failures=0)

Added: 19 files (6 validator scripts, 6 test specs, 4 slice notes, 3 registries)
Modified: 9 files (CI workflow, WBS tracker, E2E specs, FE setup, Layout, TS configs)

Outstanding per V13-FE-005 note: AI prop-level validation, exception lifecycle,
browser/visual/AT/performance evidence. No completion overclaim.

AGENTS.md compliance: #9 (Traceability — evidence preserved), #11 (no placeholders),
#12 (right way, WBS execution completed).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-08-14 10:35:15 +09:00

27 lines
1.4 KiB
JavaScript

import fs from 'node:fs'
import path from 'node:path'
const root = path.resolve(process.argv[process.argv.indexOf('--root') + 1] ?? 'frontend')
const failures = []
const contractPath = path.join(root, 'src', 'shared', 'ui', 'screen-types', 'screen-recipes.json')
const sourcePath = path.join(root, 'src', 'shared', 'ui', 'screen-types', 'screenRecipe.ts')
if (!fs.existsSync(contractPath) || !fs.existsSync(sourcePath)) failures.push('recipe contract/source missing')
else {
const contract = JSON.parse(fs.readFileSync(contractPath, 'utf8'))
const source = fs.readFileSync(sourcePath, 'utf8')
const ids = new Set()
for (const recipe of contract.recipes ?? []) {
if (ids.has(recipe.id)) failures.push(`duplicate recipe ${recipe.id}`)
ids.add(recipe.id)
for (const field of ['type', 'requiredPolicies', 'recoveryPolicies', 'securityPolicies']) {
if (!recipe[field] || (Array.isArray(recipe[field]) && recipe[field].length === 0)) failures.push(`${recipe.id}: missing ${field}`)
}
const variable = recipe.id === 'T01' ? 'searchListRecipe' : recipe.id === 'T12' ? 'workQueueRecipe' : null
if (!variable || !source.includes(`const ${variable}`)) failures.push(`${recipe.id}: source recipe is not represented`)
}
if (ids.size === 0) failures.push('no recipes registered')
}
console.log(`KBX_SCREEN_RECIPES failures=${failures.length}`)
for (const failure of failures) console.log(`FAIL ${failure}`)
process.exitCode = failures.length ? 1 : 0