feat(dla): M7 — KPI workbook, coverage, prior-bundle import, term mapping - #11
Merged
Merged
Conversation
- Schema: KpiPayload + TermMappingRulePayload + FormulaKind/PatternKind enums (reader dispatch registered for kpi + term_mapping_rule) - KPI workbook: validate_source_tables (refs must exist; raises with the missing list), kpi artifact builder/writer (provenance sme-authored) - dla kpi add CLI (--name/--definition/--formula/--grain/--owner/ --source-tables/--dimensions); exit 4 when a source table is missing - Tests: KPI validation (missing-table list) + valid-write Part of M7 (KPI/coverage/prior-bundle/term-mapping). 140 apps/dla tests pass; ruff + mypy clean. Local-only (M7 PR opens when the milestone is complete).
- coverage.compute_coverage: confirmed/total per reviewable artifact type (confirmed = client-provided-reconciled / ai-drafted-edited / sme-authored) - dla coverage CLI (--format table/json) - Test: 5-of-10 confirmed descriptions -> 50% coverage 141 apps/dla tests pass; ruff + mypy clean. (/coverage web page + KPI web UI batched into the M7 UI increment.)
- import_prior_bundle inherits a prior engagement's reviewable artifacts (descriptions, glossary, KPIs) into the new bundle with imported_from set and original provenance preserved; the atomic writer protects newer SME work (a prior artifact that would clobber it is skipped) - dla import --prior-bundle <path> wired (now one of client-docs/dbt/prior) - Tests: inherit with imported_from + preserved provenance; newer SME work not clobbered 143 apps/dla tests pass; ruff + mypy clean.
- reconciliation.term_mapping: SME rules (exact/glob/regex on NAMES only, T166) map a column/table name to a glossary term; resolve_term returns the highest-precedence match and is authoritative — consulted before any fuzzy match (FR-021). save_rule / delete_rule / load_rules. - Re-import preservation: a late re-import never clobbers an artifact an SME already reconciled (client-provided-reconciled is preserve-worthy in the writer) — demonstrated by test_late_arriving_docs. - Tests: rule precedence (glob + exact, higher precedence wins; no fuzzy when a rule matches) + late-arriving re-import preservation. 146 apps/dla tests pass; ruff + mypy clean. (Web pages for KPI/coverage/ term-mappings + demos batched into the M7 UI/finalize increment.)
- /kpi list + create/update form (validates source tables; missing table ->
400 inline, no half-written KPI) + /kpi/{id} detail
- /coverage dashboard page (confirmed/total bar per artifact type)
- /term-mappings: list + create + delete (HTMX); rules consulted before fuzzy
- nav links + coverage-bar CSS; routers registered
- TestClient tests: kpi create + missing-table 400, coverage page, term-rule
create
150 apps/dla tests pass; ruff + mypy clean.
The license gate rejected hypothesis 6.155.2 (MPL-2.0), a dev/test dependency from the workspace dev group. MPL-2.0 is file-level copyleft and the package is never shipped — same rationale as the existing tqdm/certifi/pathspec exceptions. Unblocks ci/checks.
…e gate greenlet (transitive via sqlalchemy) reports the compound license string 'MIT AND PSF-2.0'; both halves are permissive and already individually allow-listed. Same per-package exception pattern as tiktoken/tqdm.
…ction The pinned ref google/osv-scanner-action@<sha> resolves the repo-root action.yml, which has no 'runs:' section (it is a metadata stub), so every run failed with 'Top level runs: section is required'. The actual composite action lives at osv-scanner-action/action.yml (runs: using docker, same scan-args inputs). Repoint to google/osv-scanner-action/osv-scanner-action@<sha>; SHA unchanged (same pinned commit).
…rlette 1.x) With the osv-scanner-action pin corrected the lockfile scan runs for the first time and surfaces real findings: - pydantic-settings 2.14.1 -> 2.14.2 (GHSA-4xgf-cpjx-pc3j, Medium): in-range patch bump, genuine fix. - 4 starlette findings (GHSA-82w8/wqp7/x746/jp82): fixed only in starlette 1.x (TestClient -> httpx2 major migration), the same deferral already documented for GHSA-86qp. Added to osv-scanner.toml under the same rationale, owner (Anmol), and 2026-09-12 review-by; lift on the starlette 1.x move.
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.
Summary
M7 makes the engagement measurable and reusable: a KPI workbook, a review-
coverage tracker, prior-bundle import, and SME term-mapping rules + late-
arriving-doc preservation. Built on the
apps/dlaworkspace layout.What's included
dla kpi addand a/kpiweb form define KPIs (name,definition, formula, grain, dimensions, source tables, owner). Source tables
are validated to exist; a missing table is rejected (CLI exit 4 / web 400
inline) with the offending table listed — no half-written KPI on disk. KPIs
are
sme-authored.dla coverage(table/json) and a/coveragepagereport confirmed/total per reviewable artifact type (FR-022).
dla import --prior-bundle <dir>inherits a priorengagement's descriptions / glossary / KPIs with
imported_fromset andoriginal provenance preserved; the writer protects newer SME work.
map a column/table to a glossary term and are consulted before any fuzzy
match (FR-021); higher precedence wins. CLI-free storage +
/term-mappingscreate/delete UI.
reconciled (
client-provided-reconciledis preserve-worthy).Testing
prior-bundle inherit + preserve, term-mapping precedence, late-arriving
re-import preservation. New TestClient tests for the KPI/coverage/term-rule
web routes.
Notes
(+ FormulaKind/PatternKind), reader-registered.