Repository navigation
feat(data-mcp): open a mixed answer's digest with the server's coverage line - #29
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_plantokens of segmentcoverage, which no other token takes (DevelopmentFinanceObservatory/apis#67).render_digestinservices/data-mcp/src/data_mcp/digest.pyleads 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 checkat 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.