/**
 * Types for business-rules tooling.
 *
 * The catalog lives at `cliter/<bc>/business-rules/<aggregate>.md`. Each file has a
 * file-level frontmatter (validated against `docs/business-rules/_schema.json`) and a
 * body containing one section per rule. Rule-level metadata is parsed from the body.
 *
 * The generic structural types (`ParsedRule`, `CatalogIndex`, `IndexedRule`,
 * `RuleState`, `RuleSeverity`) are shared with the harness-rules catalog and live
 * in `../_catalog-runtime/types`; they are re-exported here so the rest of the BR
 * scripts keep importing them from `./types` unchanged. Only `FileFrontmatter` is
 * BR-specific (BR requires `aggregates`) and stays local.
 */
export type {
  RuleState,
  RuleSeverity,
  ParsedRule,
  CatalogIndex,
  IndexedRule,
} from '../_catalog-runtime/types';
import type { BaseFrontmatter } from '../_catalog-runtime/types';

/**
 * BR-specific frontmatter: extends the shared `BaseFrontmatter`
 * (bounded_contexts, last_updated, keywords, paths) and adds the BR-required
 * `aggregates`. The four base fields are no longer duplicated here (fix #17).
 */
export interface FileFrontmatter extends BaseFrontmatter {
  aggregates: string[];
}

export interface ParsedFile {
  filePath: string;
  relativePath: string;
  frontmatter: FileFrontmatter;
  rules: import('../_catalog-runtime/types').ParsedRule[];
}
