/**
 * Focused, fast validation. Four modes selected by argument shape:
 *
 *   pnpm br:check <bc>/<aggregate>     # rules touching this aggregate
 *   pnpm br:check BR-<BC>-<AGG>-<NNN>  # one specific rule
 *   pnpm br:check --branch <name>      # rules potentially impacted by branch diff
 *   pnpm br:check --pr <number>        # rules impacted by a GitHub PR (uses gh)
 *   pnpm br:check                       # rules touched by current working tree
 *
 * The check engine (git plumbing, arg parsing, index loading, dispatch) lives
 * in `../_catalog-runtime/check-core`; this script shrinks to BR config.
 */
import { runCheck, runCatalogMain } from '../_catalog-runtime';

function main(): void {
  runCheck({
    indexPath: 'cliter/business-rules-index.json',
    generateCmd: 'br:generate',
    ruleIdRegex: /^BR-[A-Z0-9-]+$/,
    messages: {
      mergeHint:
        '› Considera revisar estas reglas antes de mergear o documentar las nuevas/derogadas en el `proposal.md` del cambio (si pasaste por OpenSpec).',
    },
  });
}

runCatalogMain(main, 'check');
