import { spawnSync } from 'node:child_process'

for (const script of [
  'generate-design-tokens.mjs',
  'generate-screen-recipe-contracts.mjs',
  'generate-api-contracts.mjs',
  'generate-integration-contracts.mjs',
  'generate-provider-contracts.mjs',
  'generate-external-data-contracts.mjs',
  'generate-configuration-contracts.mjs',
  'generate-authorization-contracts.mjs',
  'generate-telemetry-contracts.mjs',
  'generate-experiment-contracts.mjs',
  'generate-test-contracts.mjs',
  'generate-field-contracts.mjs',
  'generate-screen-manifest.mjs',
  'generate-component-manifest.mjs',
  'generate-navigation-manifest.mjs',
  'generate-app-screen-registry.mjs',
  'generate-catalog-manifest.mjs',
  'generate-figma-contract.mjs',
  'validate-screen-governance.mjs',
  'validate-field-governance.mjs',
  'validate-api-governance.mjs',
  'validate-integration-governance.mjs',
  'validate-provider-governance.mjs',
  'validate-external-data-governance.mjs',
  'validate-configuration-governance.mjs',
  'validate-migration-safety.mjs',
  'validate-deployment-governance.mjs',
  'validate-authorization-governance.mjs',
  'validate-telemetry-governance.mjs',
  'validate-experiment-governance.mjs',
  'validate-test-governance.mjs',
  'validate-scaffolder.mjs',
  'validate-typescript-syntax.mjs',
  'validate-architecture.mjs',
  'validate-operations.mjs',
  'validate-process-coverage.mjs',
  'validate-production-readiness.mjs',
  'validate-application-shell.mjs',
  'validate-template-completeness.mjs',
  'validate-interaction-contracts.mjs',
  'validate-grid-productivity.mjs',
  'validate-golden-fe-parity-v41.mjs',
  'validate-fe-runtime-v42.mjs',
  'validate-theme-navigation-v43.mjs',
  'validate-fe-state-navigation-v44.mjs',
  'validate-fe-preference-navigation-v45.mjs',
  'validate-fe-resume-navigation-v46.mjs',
  'validate-fe-problem-recovery-v47.mjs',
  'validate-fe-template-completion-v48.mjs',
  'validate-fe-workbench-wms-v49.mjs',
  'validate-fe-operational-truth-v50.mjs',
  'validate-fe-presentation-v51.mjs',
  'validate-fe-anatomy-v52.mjs',
  'validate-fe-golden-interaction-v53.mjs',
  'validate-fe-work-surface-v54.mjs',
  'validate-fe-recovery-workbench-v55.mjs',
  'validate-fe-interaction-closure-v56.mjs',
  'validate-fe-authoritative-outcome-v57.mjs',
  'validate-fe-workflow-queue-runtime-v58.mjs',
  'validate-fe-grid-status-v59.mjs',
  'validate-status-canonical-v60.mjs',
  'validate-golden-fast-master-detail.mjs',
  'validate-record-lifecycle.mjs',
  'validate-template-navigation-v29.mjs',
  'validate-template-navigation-v30.mjs',
  'validate-template-navigation-v31.mjs',
  'validate-template-navigation-v32.mjs',
  'validate-template-navigation-v33.mjs',
  'validate-template-navigation-v34.mjs',
  'validate-template-navigation-v35.mjs',
  'validate-template-navigation-v36.mjs',
  'validate-component-catalog.mjs',
  'validate-design-code-parity.mjs',
  'validate-release-governance.mjs',
]) {
  const result = spawnSync(process.execPath, [`scripts/${script}`], { stdio: 'inherit' })
  if (result.status !== 0) process.exit(result.status ?? 1)
}
