BI Validation
Driven by ValidationHook.on_end for gen_dashboard runs. The hook passes a
SessionTarget containing every DashboardTarget / ChartTarget /
DatasetTarget the run delivered. Iterate them and run the checks below.
Target shape
You receive SessionTarget.targets — loop over each entry and dispatch on
type:
dashboard → inspect chart list via get_dashboard / list_charts
chart → inspect config via get_chart; if supported, run get_chart_data
dataset → verify fields via get_dataset
Layer A (the builtin hook) has already confirmed each resource exists
and is reachable — skip existence checks and focus on config correctness
and data presence.
Publish success criteria
A dashboard publish is complete when:
get_dashboard returns the dashboard
- the expected chart ids / names are present in
get_dashboard or list_charts
- every chart can be inspected with
get_chart
- supported
get_chart_data calls return data or a valid empty result without backend errors
- known values match expected results or tolerances
When these criteria pass, return PASS and stop. Treat additional styling or
structural changes as a separate request unless a concrete failing check is
present.
Core workflow
For every target in the session:
- Dashboard targets: call
get_dashboard(dashboard_id) to retrieve the
chart list. For each chart on the dashboard call get_chart and inspect
config (step 2). When get_chart_data is supported, validate data (step 3).
- Chart targets (standalone or from step 1): verify
chart_type,
metrics, x_axis, dimensions, dataset_id against the intended design.
- Data presence: when
get_chart_data is supported, call it on every chart
to confirm the chart returns data without backend errors. Compare numeric
values against expected tolerances when expectations are available.
- Dataset targets: call
get_dataset(dataset_id) to verify schema / SQL /
column definitions.
- Remediation planning:
- only propose or perform a follow-up change for a specific failed
configuration or data check
- prefer the smallest supported update for fields the platform can modify
(
title, chart_type, metrics, x_axis, description, platform SQL)
- for unsupported wiring changes, report the exact mismatch and required
follow-up action for the main agent / user
- if the publish success criteria already pass, return PASS instead of
planning follow-up changes
- Return a compact pass / fail report covering every target.
IMPORTANT: Every chart on the dashboard must pass configuration inspection with get_chart. Data validation with get_chart_data is mandatory when that tool is supported on the active platform. If get_chart_data is unavailable, mark the data check as unsupported / N/A and validate configuration plus reference SQL or known expectations instead.
Platform notes
- Superset: confirm dashboard reachability, chart count, chart type, metric expressions, group-by dimensions, and runtime query success. Use
get_chart and get_chart_data for every chart. Compare exact numeric values where expectations are known.
- Grafana: confirm dashboard reachability, panel count, panel type, datasource wiring, and panel SQL against the materialized tables. Use
get_chart with dashboard_id for every panel. get_chart_data is not available in Grafana yet, so configuration validation is mandatory and the data check should be reported as unsupported / N/A unless a separate reference query is available.
Configuration inspection checklist (per chart)
When calling get_chart for each chart, verify these fields:
| Field |
Check |
chart_type |
Matches intended visualization (bar, pie, big_number, line, table, etc.) |
metrics |
Correct aggregation expressions (COUNT, SUM, AVG, etc.) |
x_axis |
Correct column for the horizontal axis (bar/line charts) |
dimensions |
Correct grouping columns (pie charts, grouped bar charts) |
dataset_id |
Points to the correct dataset |
If title, chart_type, metrics, x_axis, description, or platform-specific SQL is wrong, fix it with update_chart when the tool supports that change. If dimensions, dataset_id, or unsupported wiring is wrong, report the mismatch and the required follow-up action.
Publish verification checklist
After a BI publish, run this checklist:
- Call
get_dashboard to confirm the dashboard is reachable and to retrieve
the full chart list.
- For every chart on the dashboard:
- call
get_chart to inspect configuration (chart_type, metrics,
x_axis, dimensions, dataset_id)
- verify each configuration field matches the intended design
- if
get_chart_data is supported on the active platform, call it to
confirm the chart returns data without backend errors
- verify key numeric values match expected results or tolerances when
those expectations are available
- if
get_chart_data is not supported, record the data check as
unsupported / N/A and rely on configuration inspection plus reference SQL
or known expectations
- If any chart fails validation:
- use
update_chart only for fields the tool actually supports
- recreate the chart or panel when the issue is
dimensions, dataset_id,
or another unsupported wiring change
- Report both absolute and relative differences when possible.
- Block rollout when any chart fails configuration or supported data
validation.
Do not skip any charts. get_chart_data is required for every chart only
on platforms that actually expose it.
Output expectations
For each chart, report:
| Column |
Description |
| Chart ID |
The chart identifier |
| Chart Name |
Human-readable title |
| Config Check |
PASS if get_chart fields match design, FAIL + reason otherwise |
| Data Check |
PASS if get_chart_data succeeds and expected values match when available; N/A when the platform does not support get_chart_data; FAIL + reason otherwise |
Final summary: total charts, passed, failed, overall PASS/FAIL decision.
1---2name: bi-validation3description: BI validator driven by ValidationHook — inspects every dashboard, chart, and dataset delivered in the run, verifies config quality (chart type, metrics, dimensions, dataset wiring) and data presence via get_chart_data when supported4---56# BI Validation78Driven by `ValidationHook.on_end` for `gen_dashboard` runs. The hook passes a9`SessionTarget` containing every `DashboardTarget` / `ChartTarget` /10`DatasetTarget` the run delivered. Iterate them and run the checks below.1112## Target shape1314You receive `SessionTarget.targets` — loop over each entry and dispatch on15`type`:1617- `dashboard` → inspect chart list via `get_dashboard` / `list_charts`18- `chart` → inspect config via `get_chart`; if supported, run `get_chart_data`19- `dataset` → verify fields via `get_dataset`2021Layer A (the builtin hook) has already confirmed each resource **exists**22and is reachable — skip existence checks and focus on config correctness23and data presence.2425## Publish success criteria2627A dashboard publish is complete when:2829- `get_dashboard` returns the dashboard30- the expected chart ids / names are present in `get_dashboard` or `list_charts`31- every chart can be inspected with `get_chart`32- supported `get_chart_data` calls return data or a valid empty result without backend errors33- known values match expected results or tolerances3435When these criteria pass, return PASS and stop. Treat additional styling or36structural changes as a separate request unless a concrete failing check is37present.3839## Core workflow4041For every target in the session:42431. **Dashboard targets**: call `get_dashboard(dashboard_id)` to retrieve the44 chart list. For each chart on the dashboard call `get_chart` and inspect45 config (step 2). When `get_chart_data` is supported, validate data (step 3).462. **Chart targets (standalone or from step 1)**: verify `chart_type`,47 `metrics`, `x_axis`, `dimensions`, `dataset_id` against the intended design.483. **Data presence**: when `get_chart_data` is supported, call it on every chart49 to confirm the chart returns data without backend errors. Compare numeric50 values against expected tolerances when expectations are available.514. **Dataset targets**: call `get_dataset(dataset_id)` to verify schema / SQL /52 column definitions.535. Remediation planning:54 - only propose or perform a follow-up change for a specific failed55 configuration or data check56 - prefer the smallest supported update for fields the platform can modify57 (`title`, `chart_type`, `metrics`, `x_axis`, `description`, platform SQL)58 - for unsupported wiring changes, report the exact mismatch and required59 follow-up action for the main agent / user60 - if the publish success criteria already pass, return PASS instead of61 planning follow-up changes626. Return a compact pass / fail report covering **every** target.6364**IMPORTANT**: Every chart on the dashboard must pass configuration inspection with `get_chart`. Data validation with `get_chart_data` is mandatory when that tool is supported on the active platform. If `get_chart_data` is unavailable, mark the data check as unsupported / N/A and validate configuration plus reference SQL or known expectations instead.6566## Platform notes6768- Superset: confirm dashboard reachability, chart count, chart type, metric expressions, group-by dimensions, and runtime query success. Use `get_chart` and `get_chart_data` for every chart. Compare exact numeric values where expectations are known.69- Grafana: confirm dashboard reachability, panel count, panel type, datasource wiring, and panel SQL against the materialized tables. Use `get_chart` with `dashboard_id` for every panel. `get_chart_data` is not available in Grafana yet, so configuration validation is mandatory and the data check should be reported as unsupported / N/A unless a separate reference query is available.7071## Configuration inspection checklist (per chart)7273When calling `get_chart` for each chart, verify these fields:7475| Field | Check |76|-------|-------|77| `chart_type` | Matches intended visualization (bar, pie, big_number, line, table, etc.) |78| `metrics` | Correct aggregation expressions (COUNT, SUM, AVG, etc.) |79| `x_axis` | Correct column for the horizontal axis (bar/line charts) |80| `dimensions` | Correct grouping columns (pie charts, grouped bar charts) |81| `dataset_id` | Points to the correct dataset |8283If `title`, `chart_type`, `metrics`, `x_axis`, `description`, or platform-specific SQL is wrong, fix it with `update_chart` when the tool supports that change. If `dimensions`, `dataset_id`, or unsupported wiring is wrong, report the mismatch and the required follow-up action.8485## Publish verification checklist8687After a BI publish, run this checklist:88891. Call `get_dashboard` to confirm the dashboard is reachable and to retrieve90 the full chart list.912. For **every** chart on the dashboard:92 - call `get_chart` to inspect configuration (`chart_type`, `metrics`,93 `x_axis`, `dimensions`, `dataset_id`)94 - verify each configuration field matches the intended design95 - if `get_chart_data` is supported on the active platform, call it to96 confirm the chart returns data without backend errors97 - verify key numeric values match expected results or tolerances when98 those expectations are available99 - if `get_chart_data` is not supported, record the data check as100 unsupported / N/A and rely on configuration inspection plus reference SQL101 or known expectations1023. If any chart fails validation:103 - use `update_chart` only for fields the tool actually supports104 - recreate the chart or panel when the issue is `dimensions`, `dataset_id`,105 or another unsupported wiring change1064. Report both absolute and relative differences when possible.1075. Block rollout when any chart fails configuration or supported data108 validation.109110Do **not** skip any charts. `get_chart_data` is required for every chart only111on platforms that actually expose it.112113## Output expectations114115For each chart, report:116117| Column | Description |118|--------|-------------|119| Chart ID | The chart identifier |120| Chart Name | Human-readable title |121| Config Check | PASS if `get_chart` fields match design, FAIL + reason otherwise |122| Data Check | PASS if `get_chart_data` succeeds and expected values match when available; `N/A` when the platform does not support `get_chart_data`; FAIL + reason otherwise |123124Final summary: total charts, passed, failed, overall PASS/FAIL decision.