Skip to content

feat(dla): KPI dimension validation + dimension hierarchy artifact - #15

Merged
udaybhan05 merged 1 commit into
mainfrom
feat/l1-kpi-dimensions-hierarchy
Jul 9, 2026
Merged

feat(dla): KPI dimension validation + dimension hierarchy artifact#15
udaybhan05 merged 1 commit into
mainfrom
feat/l1-kpi-dimensions-hierarchy

Conversation

@udaybhan05

Copy link
Copy Markdown
Collaborator

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"):

  1. KPI dimensions are now validated. dla kpi add --dimensions resolves every dimension to a discovered column and stores the resolved ids in a new dimension_refs field (column: artifact ids). Accepted forms: bare name (matched within the KPI's source tables, must be unique), schema.table.column, or a full column: ref. Missing/ambiguous dimensions are rejected (exit 4) with every problem listed; --skip-dimension-validation records conceptual dimensions as labels only.
  2. New hierarchy artifact type (SME-authored) + dla hierarchy add: ordered drill-down levels (coarsest to finest), each level's column validated to exist. Lives at bundle/hierarchies/, tracked by review coverage.
  3. dla bundle validate gains two error checks: kpi_missing_dimension_column and hierarchy_missing_column — a downstream consumer must never be offered a phantom dimension.
  4. Contract reconciliation (gap analysis G5): docs/bundle-contract.md layout now matches the bundle on disk (descriptions are flat files; hierarchies/ and coverage/ 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 ci green: 196 app tests passed (10 new unit tests + updated integration test), lib/scripts suites at 100% coverage gates, ruff clean.
  • bundle-schema.json regenerated; contract parity test passes.
  • Backward compatible: existing KPI artifacts remain valid (dimension_refs defaults to empty).

…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.
@udaybhan05
udaybhan05 merged commit f64af6f into main Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant