Skip to content

feat(gooddata-eval): check that gen-ai sends the Document wire names - #1862

Open
romrak wants to merge 2 commits into
masterfrom
rr/LX-3248-document-names
Open

romrak wants to merge 2 commits into
masterfrom
rr/LX-3248-document-names

Conversation

@romrak

@romrak romrak commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

gd-eval's Publisher copilot evaluator now uses the Document names and fails a run when gen-ai still sends a Report name. Do not merge before gen-ai ships the Document wire names (LX-3244): against today's gen-ai every document eval fails, by design.

Jira: LX-3248, epic GDP-3485. Wire names as proposed on LX-3244.

Two commits, review them one by one:

  1. refactor — rename only. Evaluator, test kind and score names go from report to document; the old Python names keep working.
  2. feat — the wire names flip, plus the new document_wire_names check.

What this implements

Where Before After
Test kind agentic_report_skill agentic_document_skill
Module core/agentic/report_skill.py core/agentic/document_skill.py
Scores report_drafted, report_ref_matches, … document_drafted, document_ref_matches, …, plus document_wire_names
Answer part read type: "report", report, report_ref, saved_report_id, base_report_id type: "document", document, document_ref, saved_document_id, base_document_id
Tool / skill draft_report, report_builder draft_document, document_builder
User context view.report passed through view.document; view.report rejected before the first request

What a run against today's gen-ai reports (from the unit test that pins it):

Document skill assertion failed. … gen-ai still sends the Report names, so it predates the Document rename.
Failures: gen-ai sends the Report names: skill 'report_builder', tool 'draft_report', part type 'report',
part key 'report', part key 'report_ref', part key 'base_report_id', part key 'saved_report_id',
document type 'report'; the agent never produced a successful draft_document call.

Decisions

  1. The evaluator accepts only the Document names; there is no fallback to the Report ones.
    A fallback would pass a half-switched chain, and the point is to prove every link was renamed.
  • src/gooddata_eval/core/agentic/document_skill.py — legacy_wire_names, _LEGACY_* constants
  • The conversation stops at an old draft_report instead of replying up to max_iterations times.
  1. document_wire_names is a strict check published on every run, and its failure leads the list.
    Without it an old gen-ai reads as "never produced a draft_document call", which hides why. It scans every turn: part type and keys, the embedded document's type, the old tools, and report_builder in either the set_skills arguments or its result.
  • It adds one always-present check, so a failing run's quality_score moves (4/6 → 5/7 when it passes). Scores before and after this PR are not comparable anyway, because the names changed.
  1. The old Python names keep working; the old test kind does not.
    gdc-nas imports gooddata_eval.core.agentic.report_skill directly, so its names stay. The agentic_report_skill kind is gone: its one dataset needs migrating for the Document wire names anyway, and the Tavern shim calls the function, not the kind.
  • core/agentic/report_skill.py re-exports the old names with a DeprecationWarning.
  • core/agentic/__init__.py keeps the old aliases.
  • An item still on agentic_report_skill is skipped as an unsupported test_kind and listed at the end of the run.
  1. Langfuse score names change from report_* to document_*.
    Score history splits at this release: old runs keep report_*, new runs get document_*.

What comes next

  • gdc-nas, when bumping the gooddata-eval pin: tests/tavern-e2e/ci/combo_report.py _REPORT_*_FIELDS → document_*, the report_skill_agentic.py import path and the Langfuse dataset kind.
  • The Langfuse dataset items: test_kind agentic_report_skill → agentic_document_skill, and view.report → view.document in their user context.

Test plan

  • tox py310–py314 for gooddata-eval: all green (1622 passed, 1 skipped on each).
  • ruff format --check and ruff check repo-wide: clean. ty check: no new diagnostics in src; the test file keeps its existing test-double diagnostics.
  • Each commit passes on its own (1612 and 1622 tests).
  • Live run against staging: not possible until LX-3244 ships.

risk: high — a published package that stops passing against current gen-ai.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added evaluation support for agentic document skills, including checks for document content, structure, references, save state, and narrative quality.
    • Added document-skill support to the evaluation runner and public exports.
  • Compatibility
    • Preserved existing report-skill imports and names as deprecated compatibility aliases.
  • Behavior Changes
    • Document content is recognized in chat responses. Report-skill test kinds are no longer accepted; legacy report wire names fail document-skill checks.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: e810e38c-a383-404f-bef2-21b2342218a6


📥 Commits

Reviewing files that changed from the base of the PR and between b41dd40 and 92fe97e.



📒 Files selected for processing (2)
  • packages/gooddata-eval/src/gooddata_eval/cli/agentic_runner.py
  • packages/gooddata-eval/tests/test_agentic_runner.py


Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.




📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request adds document-skill evaluation for document drafts, including validation, scoring, optional narrative judging, multi-run evaluation, and trace scoring. It retains report-skill names as deprecated compatibility aliases and dispatches document-skill inputs through the CLI.

Changes

Document Skill Evaluation

Layer / File(s) Summary
Document validation and scoring
packages/gooddata-eval/src/gooddata_eval/core/agentic/document_skill.py, packages/gooddata-eval/tests/test_agentic_document_skill.py
Adds fixture validation and document response checks for structure, references, saved state, periods, visualizations, narrative slots, and legacy wire names.
Conversation and narrative judging
packages/gooddata-eval/src/gooddata_eval/core/agentic/document_skill.py, packages/gooddata-eval/tests/test_agentic_document_skill.py
Adds document conversation handling, clarification diagnostics, optional narrative judging, and per-run results.
Multi-run evaluation and trace scoring
packages/gooddata-eval/src/gooddata_eval/core/agentic/document_skill.py, packages/gooddata-eval/tests/test_agentic_document_skill.py
Adds K-run evaluation, scored-run trace submission, gate handling, and result or error reporting.
Public exports and dispatch compatibility
packages/gooddata-eval/src/gooddata-eval/core/agentic/...
Exports document-skill APIs and retains report-named aliases. Routes document-skill CLI inputs to the evaluator and recognizes document as a known multipart type. Related tests cover dispatch, aliases, multipart handling, and trace-linker evaluator coverage.

Priority: ⬇️ Low

Estimated code review effort: 4 (Complex) | ~60 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Runner as run_agentic_document_skill
  participant Chat as ChatClient
  participant Judge as LLMJudge
  Runner->>Chat: Send conversation request
  Chat-->>Runner: Return tool events and document part
  Runner->>Runner: Evaluate document response
  Runner->>Judge: Judge rendered document text when narrative is expected
  Judge-->>Runner: Return narrative verdict
Loading


Merge Risk: ⚪ Minimal · up to 92fe9

Legacy report-kind items are skipped as intended, and no merge-blocking issue remains after normal checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 123 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: validating that GenAI uses Document wire names instead of legacy Report names.

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks each page at dawn
And tests the charts before moving on
It asks the judge to read the prose
Then scores the drafts from nose to toes
Report names stay, as aliases do
The document path is ready too

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.13978% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.32%. Comparing base (a1ae1c2) to head (92fe97e).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
...l/src/gooddata_eval/core/agentic/document_skill.py 99.09% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1862      +/-   ##
==========================================
+ Coverage   84.19%   84.32%   +0.12%     
==========================================
  Files         333      335       +2     
  Lines       23261    23439     +178     
==========================================
+ Hits        19585    19764     +179     
+ Misses       3676     3675       -1     

☔ 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.

@romrak
romrak marked this pull request as ready for review October 10, 2026 08:44
Roman Rakus and others added 2 commits October 10, 2026 10:47
Publisher calls its output a document, so the evaluator, its test
kind and its check names now say document: agentic_document_skill,
document_skill.py, Document* classes and document_* scores.

The agentic_report_skill test kind is gone: its one dataset has to be
migrated for the Document wire names anyway, and the Tavern shim calls
the evaluator function, not the kind. The Python names stay for
existing callers: report_skill.py re-exports the old names with a
DeprecationWarning, and core.agentic keeps the old aliases.

The wire names gen-ai sends are unchanged here; the evaluator still
reads the report part.

jira: LX-3248
risk: low
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The evaluator now reads the names gen-ai sends after the Publisher
rename: the document answer part with document_ref and the
saved_document_id and base_document_id keys, the draft_document tool
and the document_builder skill.

A new strict check, document_wire_names, fails a run when any Report
name is still on the wire: the report part type or keys, the
draft_report or list_report_layouts tool, or the report_builder
skill. It reads every turn, and its failure leads the list and names
each old name, so a half-switched chain shows which part still sends
the old one. A user context with view.report is rejected before the
first request, because gen-ai reads view.document.

This evaluator fails against a gen-ai without the Document names, so
release it only once gen-ai sends them.

jira: LX-3248
risk: high
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@romrak
romrak force-pushed the rr/LX-3248-document-names branch from b41dd40 to 92fe97e Compare October 10, 2026 08:50
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.

2 participants