/** * Vertical relationship-pattern projector + warn-only edge check. * * The schema markdown files (`schema-*.md`) declare their canonical edges in a * fenced code block under a `## Relationship Patterns` heading, e.g. * * ## Relationship Patterns * * ``` * (:Job)-[:HAS_VALUATION]->(:Valuation) * (:Quote)-[:HAS_LINE]->(:QuoteLine) * ``` * * `schema-loader.ts` parses the markdown TABLES (required-properties, naming * rules, forbidden properties) but not this block. This module projects the * block into machine-readable `(source, edgeType, target)` triples and offers a * warn-only check: is an edge being written off the canonical set for a * schema-governed source label? * * The check is warn-only: an off-allowlist edge is *logged*, never blocked. The * canonical ontology is the schema markdown — the one shipped vertical schema * every account follows — so the check surfaces drift from it without blocking * writes. There is no per-account ontology overlay. */ export interface RelationshipPattern { readonly source: string; readonly edgeType: string; readonly target: string; /** Schema file the pattern was declared in (e.g. "schema-construction.md"). */ readonly sourceFile: string; } /** * Extract the `(source, edgeType, target)` triples declared in the * `## Relationship Patterns` fenced block of one schema markdown file. Arrows * appearing in prose outside that block are ignored. Returns `[]` when the file * has no such section. */ export declare function parseRelationshipPatterns(markdown: string, sourceFile: string): RelationshipPattern[]; /** * The patterns in scope for a write: base patterns plus the resolved vertical's * patterns. A `null` vertical (non-vertical brand) yields base-only. Other * verticals' patterns are excluded so a construction write is never judged * against estate-agent edges. * * `resolvedVertical` is the file basename without `.md` (e.g. * `"schema-construction"`), matching `VerticalContext.resolvedVertical`. */ export declare function selectPatternsForVertical(all: readonly RelationshipPattern[], resolvedVertical: string | null): RelationshipPattern[]; export interface EdgeCheck { /** True when at least one of the node's labels is a source in the patterns. */ governed: boolean; /** True when `(someSourceLabel, edgeType)` matches a pattern. */ allowed: boolean; } /** * Warn-only check for one outgoing edge. `sourceLabels` are the writing node's * labels; `edgeType` is the relationship type. The check is at * `(sourceLabel, edgeType)` granularity — sufficient to catch an invented edge * type from a governed label (the observed `JOB_FOR` / `VALUATION_FOR` drift, * both outgoing from `:Job`) without a target-label lookup. * * Warn when `governed && !allowed`. An ungoverned source label (no pattern * declares it as a source — e.g. base/document labels) is never warned on. */ export declare function checkEdgeAgainstPatterns(sourceLabels: readonly string[], edgeType: string, patterns: readonly RelationshipPattern[]): EdgeCheck; //# sourceMappingURL=relationship-patterns.d.ts.map