Skip to content

feat(gooddata-eval): add agentic_summary and agentic_describe_object - #1980

Draft
myduong243 wants to merge 1 commit into
masterfrom
myd/QA-30179
Draft

myduong243 wants to merge 1 commit into
masterfrom
myd/QA-30179

Conversation

@myduong243

@myduong243 myduong243 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • New agentic kind agentic_summary: the chat summary of a widget or a dashboard, sent the way the UI's "Summarize" items send it.
    • An item stores the UI's userContext without result ids, plus one execution per widget (agentic_summary_input.executions: AFM + result spec, filters included). Result ids expire, so each run re-executes the stored executions (a 429/5xx is retried) and puts the fresh ids back.
    • Data baseline: an execution may store baseline (has data, row count, sum of values). When the fresh result differs, the item ends as an ERROR (data_baseline_changed) before any chat: the run would say nothing about the agent. An execution that fails, or whose result cannot be read, ends the item as an ERROR widget_execution_failed, not as a data change. Both causes are on SETUP_ERRORS in core/outcome.py, the one place that says what makes an ERROR.
    • Follow-up questions run in the same conversation, each with its own expected output; a follow-up's judge also reads the conversation before it.
    • Code checks gate the verdict:
      • shape by scope (chart: 4 headings, KPI: no headings and few sentences, dashboard: 3 headings, dashboard without data: one paragraph, or the user's own format);
      • no reference tags or raw ids on the summary turn; no figures when every widget in scope returned no data; no tool calls on a follow-up marked no_tool_calls;
      • figures_grounded (core/evaluators/chat_summary_figures.py): every figure of every turn must match a value of the tables the agent read in the conversation (cells, totals, shares, differences, ratios, sums of rows, ...) within the precision it was written with. A figure next to a row's name (or a day, "October 7") must be a value of that row; a summary turn that read no table may state no figure, whatever tools it ran (a workspace search reads no table). Labels, dates and bounds ("above $900 K") are not figures. The reason lists each failing figure, its sentence and the nearest values.
      • Long columns and wide rows get only a fixed few derived values per value (neighbours, ends, extremes), plus pairs of the rows a sentence names, computed on the fly: a 500×20 table takes ~3 s, once per conversation (cached on the table).
      • Limit, also in the module docstring: on long tables (some hundred values in a column) the 0.5 % slack is wider than the gaps between cells, so a wrong figure without a row's name next to it fits some cell. With one figure of a real answer changed by 8–15 %, about 7 in 10 changes are caught on tables of up to 10 rows and about 3 in 10 on tables of more than 50 rows.
    • An unknown key in an expected_output (item or follow-up) or in its format is rejected before any execution, so a misspelt key cannot switch a check off.
    • Judge criteria are graded one by one with summary-specific steps.
    • Run labels and results as the other kinds (label_runs, raise_agentic_failure, agentic_success, agentic_detail): a run the judge could not grade is an ERROR (unscored in Langfuse), an item where no run got a verdict raises JudgeResponseError, and best_run_latency_s / tool_calls are set.
  • New agentic kind agentic_describe_object: "describe / explain " with no context. The answer must rest on a workspace lookup (search_objects / get_object_with_children) unless the item expects the agent to ask back.
  • Both kinds only read, so they are in PARALLEL_SAFE_TEST_KINDS; agentic_summary is multi-turn, agentic_describe_object single-turn. An agentic_summary item with a question of its own or with follow_ups (free text) runs serially, like agentic_search with setup_turns.
  • Why a second summary kind: agentic_dashboard_summary builds the context itself from a dashboard id and grades a rubric. agentic_summary sends the context the UI sent (any widget, tab and filter state), re-executes the stored executions, asks follow-ups and checks the figures. agentic_dashboard_summary and dashboard_summary are not changed.
  • Test Plan

    • Unit tests:
      • test_agentic_chat_summary.py (22): stored context + fresh result ids, missing executions, UI default question, execute errors, conversation stops on a failed turn, Langfuse item mapping, data baseline → ERROR and no conversation is opened, an item with follow-ups or a question of its own runs serially, the item's gate (pass, an invented figure fails, no verdict → JudgeResponseError with harness_error). Also: a failed execution → widget_execution_failed and no conversation; a misspelt format or follow-up key fails before any execution.
      • test_chat_summary_evaluator.py (26): every shape rule, ids, figures on no data, figures without any data tool, follow-up grading with the earlier turns, scope facts. Also: known and unknown expectation keys. The no-data check and figures_grounded read figures the same way; sentences are counted with the shared _text_utils.count_sentences.
      • test_chat_summary_figures.py (28): real answers pass; one changed figure fails and is named; labels, dates, ranges, Czech scale words, rounded and derived values; a value named with the wrong row or day fails (xtab and rows format, a 60-row series). Also: "with a total of" keeps a figure tied to its row; a one-digit amount ($1 M) is at most 10% wide.
      • test_agentic_describe_object.py (4): the lookup rule; the item passes, fails, or errors with the judge.
      • test_agentic_runner.py, test_trace_linker.py: the two kinds in the dispatch and trace-link registries.
    • Local runs with this branch (eval-lab --sdk-src) on a staging workspace, every item K=8 at reasoning effort medium and low: describe items 27–28 of 28 at 8/8 per effort. Every figure the check flagged was read by hand: the flagged ones are wrong in the answer (miscomputed sums/shares, values named with a neighbouring row); items that hit them often are tracked under LX-3357 / LX-3358.
    • Figure check re-run offline on 1,744 stored answers of those runs after the last two figure fixes: 2 verdicts changed, both now fail for a real reason (a day's value written under another day). The shared sentence counter changed no shape verdict on 309 stored answers with a sentence limit; the shared figure reader flagged none of 163 stored no-data answers.
    • Mutation check: 23 one-line breaks of the new code (a check switched off, the baseline never raised, follow-up items sent in parallel, the loader dropping agentic_summary_input) each fail a unit test.
    • The Langfuse datasets chat_summary (45 items), chat_summary_known_bugs (18) and describe_objects (28) load with load_langfuse_dataset from this branch; gdc-nas wiring: gooddata/gdc-nas#30783 (draft until this is released).
    • Type check and the tox matrix run in CI only.

    Risk Assessment

    low — two new kinds in the eval package; existing kinds unchanged. Revert: full.

    jira: QA-30179
    risk: low

    🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.08264% with 132 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.63%. Comparing base (7047d9e) to head (cb36845).

Files with missing lines Patch % Lines
...val/src/gooddata_eval/core/agentic/chat_summary.py 78.89% 84 Missing ⚠️
...ddata_eval/core/evaluators/chat_summary_figures.py 96.54% 21 Missing ⚠️
.../src/gooddata_eval/core/agentic/describe_object.py 83.87% 20 Missing ⚠️
.../src/gooddata_eval/core/evaluators/chat_summary.py 96.15% 5 Missing ⚠️
...c/gooddata_eval/core/evaluators/describe_object.py 92.59% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1980      +/-   ##
==========================================
+ Coverage   88.57%   88.63%   +0.06%     
==========================================
  Files         365      370       +5     
  Lines       31571    32902    +1331     
==========================================
+ Hits        27964    29163    +1199     
- Misses       3607     3739     +132     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@myduong243
myduong243 force-pushed the myd/QA-30179 branch 9 times, most recently from 18e2879 to e72a12f Compare November 27, 2026 16:37
agentic_summary evaluates the chat summary of a widget or a dashboard
the way the UI asks for it. An item stores the UI's userContext without
result ids and one execution (AFM + result spec, filters included) per
widget; every run re-executes them, because result ids expire, and puts
the fresh ids back. Follow-up questions run in the same conversation.

- Data baseline: an execution may store has_data, row_count and the sum
  of its values; when the fresh result differs, the item is an error
  (data_baseline_changed) and no chat runs.
- Code checks: shape by scope (chart, KPI, dashboard, no data, or the
  user's own format), no ids on the summary turn, no figures on no
  data, no tool calls on a follow-up that should answer from the
  conversation, and figures_grounded: every figure must match a value
  of the data the agent read (cells, totals, shares, differences, ...)
  within the precision it was written with, and a figure next to a
  row's name must be a value of that row.
- Judge criteria are graded one by one with summary-specific steps; a
  follow-up's judge also reads the conversation before it.

agentic_describe_object asks to describe or explain an analytics
object with no context; the answer must rest on a workspace lookup
unless the item expects the agent to ask back.

Both kinds only read, so they run in parallel.

jira: QA-30179
risk: low
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