Skip to content

feat(data-mcp): open a mixed answer's digest with the server's coverage line - #29

Merged
jm-rivera merged 4 commits into
devfrom
feat/mixed-answer-opener
Oct 23, 2026
Merged

jm-rivera merged 4 commits into
devfrom
feat/mixed-answer-opener

Conversation

@jm-rivera

Copy link
Copy Markdown
Contributor

data-mcp's digest opens a mixed answer with the Search API's own coverage line. Search sends "Answered 2 of 3 parts." as sentence_plan tokens of segment coverage, which no other token takes (DevelopmentFinanceObservatory/apis#67). render_digest in services/data-mcp/src/data_mcp/digest.py leads with that text (_answered_line) in place of its own "Mixed outcome: the parts below differ in status." line, and adds no leading line to an envelope without coverage tokens.

Merge this after that apis branch deploys to dev. Until then no envelope carries coverage tokens, so a mixed digest opens with its first part's block and no leading line.

Testing: just check at e1cfbff passed lint, the type check and 11,177 tests, with 22 skipped and 5 xfailed. At 2bd5905, which reads the coverage segment, the data-mcp suite passed 1,568 tests with 20 skipped, and ruff and ty pass on the touched files.

…ge line

Search now opens a mixed resolution that has a definite part with an unowned heading token, "Answered N of M parts.", in the envelope's sentence_plan. The digest leads with that token's text in place of its own "Mixed outcome" line, and adds no leading line when the server sends none.
Search opens a mixed resolution with "Answered N of M parts." only when a part is definite. Without one, the first unowned heading token belongs to another sentence, such as the "No match for " frame two refused parts share, and the digest led with that fragment. `_mixed_opener` now returns nothing unless a part is definite. The tests assert that an envelope with no opener leads with the first part's block.
Search sends "Answered N of M parts." as `sentence_plan` tokens of segment `coverage`, which no other token takes (DevelopmentFinanceObservatory/apis `feat/search-answer-statements`). `_answered_line` joins those tokens' text, so the digest needs no rule of its own about which unowned heading token opens a mixed answer, and an envelope from a Search build that sends no coverage tokens gets no leading line.
@jm-rivera
jm-rivera marked this pull request as ready for review October 23, 2026 10:28
@jm-rivera
jm-rivera merged commit e2a104c into dev Oct 23, 2026
6 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