Repository navigation
brief --include coverage returns coverage (the MCP shape), not the REST name stances - #33
Merged
Merged
Conversation
…#27) The REST payload carries the per-outlet framing as stances ({outlet, stance, note}). --include coverage kept that array under its REST name, so a caller following the README found no coverage key. With --include, the CLI and io.sh now return it as coverage, [{outlet, framing, note}], the shape the MCP get_brief tool uses, and drop stances. Without --include the REST payload is unchanged. README says which name appears when. Test: test/brief-coverage.test.mjs; the #7 test now expects coverage.
Contributor
Author
|
Review by Grok Bot (Indian Opinion QA agent) Tested at head Fixes: #27. What I checked
Review
Automated checks (this head vs current main)
I'm Grok Bot, the automated QA agent for Indian Opinion. This is a comment-only review. I don't approve, request changes or merge. Local stack: PHP 8.4.28, Composer 2.11.3, MariaDB 11.8.9, Node 24.22.1, WordPress 7.1.5. |
makriman
marked this pull request as ready for review
December 5, 2026 20:12
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.
Problem
The README and the
--includecheck both saybrief --includetakescoverage, but the output never has acoveragekey. A caller following the README sees the brief text go and no coverage come back.What is actually happening
The data is not lost. The REST payload calls the per-outlet framing
stances(outlet,stance,note), andcmdBriefusedcoverageonly as the switch that keptstances. So--include coveragereturned the coverage data under the REST namestances. The issue's own key list showsstancesin the output. The MCPget_brieftool returns the same data ascoverage,[{outlet, framing, note}], so the CLI and MCP disagreed on the name for the same request. The issue got the naming mismatch right. "Always returns nothing" overstates it: the data came back, under a name nothing documented.Change
This is the smallest honest fix on the CLI side: map the name and leave the API alone.
--include coverage, the CLI andio.shreturncoveragebuilt fromstancesexactly as the MCP server builds it (IndianOpinion/mcp,src/tools.js:{outlet, framing: stance, note: note || null}).--include,stancesis dropped, so the output holds only the parts that were named, under their documented names.--include, nothing changes: the REST payload comes through as it is,stancesincluded.--text) lists the coverage in both cases, as before.CHANGELOG.mdhas an Unreleased entry.Tests
test/brief-coverage.test.mjs(CLI, andio.shwith jq):--include coveragegivescoverageequal to the MCP mapping of the stub's stances, with nostances,brief,analysisorsources. Combined includes keep exactly what was named.--include briefhas neither name. Without--includethe payload equals the REST body. Before the fix the first test fails.test/fixes.test.mjs#7: this test asserted the old behaviour (brief,coveragereturnsstances). It now expectscoverageand nostances.Commands run on this branch:
npm test(Node 22.23.4, jq 1.7,../mcpinstalled): 34 tests, 34 pass, 0 skipped.npm pack --dry-run: the same 6 files.For the reviewer
--include coverageand readstances. The documented name was alwayscoverage, and the package is pre-1.0 and not yet on npm, so I think the fix is right. It is still a behaviour change, so it is called out in the CHANGELOG.coveragein the REST API itself. That is a server change, outside this repository, and the CLI mapping does not block it.Fixes #27