Skip to main content

Function: validateIntent()

validateIntent(input, catalog): IntentResult

Defined in: intent/validateIntent.ts:32

Validates a raw value against intentSchema and grounds every reference against catalog — the PRD-005 plan D4 algorithm, corrected by the grilling session's D9/D10 mechanism fixes: dataset resolution is a metricIds/geographyIds intersection over catalog.datasets (not Catalog.joins), and IntentFilter.field grounds against Catalog.filters[] (not raw dataset columns), scoped to the resolved dataset/geography.

Every check runs and its issues are collected — the pass never short-circuits on the first failure, mirroring validateCatalog's "report everything found in one pass" contract. Dataset resolution and filter grounding (validateIntentChecks.ts) run only once the metric and geography they depend on have themselves resolved, since there is nothing meaningful to intersect or scope against otherwise.

Parameters

ParameterType
inputunknown
catalog{ collections?: object[]; datasets: object[]; domain?: string; filters: object[]; geographies: object[]; joins: object[]; mapTypes: object[]; metrics: object[]; permissions?: Record<string, unknown>; series?: object[]; version: string; }
catalog.collections?object[]
catalog.datasetsobject[]
catalog.domain?string
catalog.filtersobject[]
catalog.geographiesobject[]
catalog.joinsobject[]
catalog.mapTypesobject[]
catalog.metricsobject[]
catalog.permissions?Record<string, unknown>
catalog.series?object[]
catalog.versionstring

Returns

IntentResult