Skip to content

Nutrient DWS: grade the API's own Markdown by default, caption chart tables with printed text only - #4

Merged
etienne-alby merged 2 commits into
mainfrom
etienne/fork-default-own-markdown
Oct 27, 2026
Merged

etienne-alby merged 2 commits into
mainfrom
etienne/fork-default-own-markdown

Conversation

@etienne-alby

Copy link
Copy Markdown

The Nutrient DWS provider now grades the Markdown the API returns (body_source: "hosted") by default, and a chart table's <caption> comes only from text printed on the page.

Why

Since #2 the request asks for inline formatting, so the hosted Markdown carries the styles the formatting rules score. In understand mode it now scores within 0.02 points of the rebuild (75.53 against 75.55 on CI build 438), and it is what a DWS user gets back.

The caption fallback used the chart's generated summary sentence when the page had no printed caption. That sentence isn't on the page. On the chart pages where it changed a score, a rule passed only because the summary repeated a label.

Changes

Testing

  • uv run ruff check src tests and uv run ruff format --check src tests pass.
  • uv run pytest -q: 5,074 passed.
  • Two new tests check that a chart table takes its printed caption and never the summary.

Re-grade

Stored CI responses (build 438, understand, 2,078 files) re-normalized with these commits and graded again:

Group Rebuild (old default) Hosted (new default)
Charts 54.97 54.93
Overall 75.55 75.53

The default body_source is now "hosted": the graded body is the API's
own output.markdown, as for most providers here, instead of Markdown
rebuilt from the returned elements. The rebuild stays available with
body_source "graph" or NUTRIENT_DWS_BODY_SOURCE=graph, and its tests
now select it explicitly.
When a chart had no printed caption, the provider wrote the chart's
summary field into the table's <caption>. The summary is text DWS
generates, not text on the page. Its only effect on scoring was that
label words in it let chart rules pass for values the table holds in
the wrong row or column. Chart tables now take their caption from the
captionIds elements or keep the caption already in htmlTable.
@etienne-alby
etienne-alby merged commit 80fa68b into main Oct 27, 2026
4 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