/**
 * Validates the business-rules catalog:
 *
 *  - File frontmatter must conform to docs/business-rules/_schema.json.
 *  - No duplicate rule identifiers across the catalog.
 *  - Implementa paths in the rule body should resolve to actual files
 *    (warnings, not errors — code may have been refactored).
 *  - Per-rule metadata table parses (Tipo, Estado, Severidad present and valid).
 *
 * All of the above is shared logic in `../_catalog-runtime/validate`; this
 * script shrinks to BR config (schema path + globs) and converts the returned
 * exit code into `process.exit`.
 *
 * Invoked via `pnpm br:validate`. Exit codes:
 *   0 — clean
 *   1 — structural errors
 *   2 — only warnings
 */
import { runCatalogValidation, runCatalogMain } from '../_catalog-runtime';

async function main(): Promise<void> {
  const exitCode = await runCatalogValidation({
    schema: 'docs/business-rules/_schema.json',
    globs: ['cliter/*/business-rules/*.md'],
    extraChecks: [],
  });
  process.exit(exitCode);
}

runCatalogMain(main, 'validate-catalog');
