/** * Topology — map a repo-relative file path to its product area. * * This is the DRY keystone of the topology layer: the ONLY area-matching * implementation in the monorepo. Consumers (CLI scan, Cloud managed-editor * preview, cross-repo reconciliation) import it; none reimplements glob/area * logic. Pure and browser-safe — no Node, no parser deps. * * See `apps/cloud/docs/topology/01-architecture.md §1`. */ type AreaCriticality = "low" | "medium" | "high" | "revenue" | "regulated"; interface Area { id: string; name: string; criticality: AreaCriticality; owners: string[]; /** Globs matched against repo-relative file paths in v0. */ files: string[]; /** Stored for later route-topology adapters; NOT matched in v0. */ routes?: string[]; /** Tie-break: higher wins. Defaults to declaration order. */ priority?: number; } interface Topology { /** Bump signals "re-tag" to consumers that cache. */ version: number; /** Whether area file globs are matched relative to app.path or repo root. Defaults to "app". */ base?: "app" | "repo"; /** Array (not a keyed record) so precedence is deterministic. */ areas: Area[]; } interface AreaMatch { areaId: string; areaName: string; criticality: AreaCriticality; owners: string[]; /** The winning pattern — surfaced in reports for transparency. */ matchedGlob: string; } /** * Resolve the product area for a repo-relative path. First match by * `(priority desc, declaration order)`. Returns `null` when nothing matches — * the caller buckets that as the explicit "Unassigned" area (never dropped; * dropping unmatched evidence would make coverage lie). */ declare function resolveArea(repoRelPath: string, topology: Topology): AreaMatch | null; export { type Area, type AreaCriticality, type AreaMatch, type Topology, resolveArea };