feat(dla): KPI dimension validation + dimension hierarchy artifact - #15
Merged
Conversation
…rarchy artifact KPIs now resolve each dimension to a discovered column (stored in the new dimension_refs field; missing/ambiguous dimensions are rejected, with a --skip-dimension-validation escape for conceptual dimensions). New sme-authored 'hierarchy' artifact type + 'dla hierarchy add' records drill-down paths (coarsest to finest), every level validated against the schema. 'dla bundle validate' gains kpi_missing_dimension_column and hierarchy_missing_column error checks so downstream consumers are never offered phantom dimensions. Contract doc reconciled with the on-disk layout (descriptions are flat files; hierarchies/ + coverage/ documented; generated JSON Schema declared normative) and regenerated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes the L1-side half of the L2 kickoff gap analysis finding G1 ("metrics x grouping sets / drill-down hierarchies have no upstream data source"):
dla kpi add --dimensionsresolves every dimension to a discovered column and stores the resolved ids in a newdimension_refsfield (column:artifact ids). Accepted forms: bare name (matched within the KPI's source tables, must be unique),schema.table.column, or a fullcolumn:ref. Missing/ambiguous dimensions are rejected (exit 4) with every problem listed;--skip-dimension-validationrecords conceptual dimensions as labels only.hierarchyartifact type (SME-authored) +dla hierarchy add: ordered drill-down levels (coarsest to finest), each level's column validated to exist. Lives atbundle/hierarchies/, tracked by review coverage.dla bundle validategains two error checks:kpi_missing_dimension_columnandhierarchy_missing_column— a downstream consumer must never be offered a phantom dimension.docs/bundle-contract.mdlayout now matches the bundle on disk (descriptions are flat files;hierarchies/andcoverage/documented), and the generated JSON Schema is declared normative over the prose doc. Schema regenerated (parity test green).Why
The L2 Knowledge Representation Assembler compiles "metric x dimension" menus and drill-down paths for downstream agents (the anti-hallucination mechanism for the plan-and-execute dashboard pattern). The bundle previously carried dimensions as free, unvalidated strings and had no hierarchy concept at all — so L2's flagship output had no trustworthy data source.
Acceptance evidence
make cigreen: 196 app tests passed (10 new unit tests + updated integration test), lib/scripts suites at 100% coverage gates, ruff clean.bundle-schema.jsonregenerated; contract parity test passes.dimension_refsdefaults to empty).