feat(mcp): surface ingested test-coverage on context and impact#196
Open
theagenticguy wants to merge 1 commit into
Open
feat(mcp): surface ingested test-coverage on context and impact#196theagenticguy wants to merge 1 commit into
theagenticguy wants to merge 1 commit into
Conversation
The coverage overlay phase already annotates File and callable nodes with a
coveragePercent ratio (consumed today only by verdict's complex_and_untested
signal). This reads that data out on the two high-frequency exploration tools.
context: add an optional `coverage` block { percent, covered, source } to a
resolved target. Reads the per-symbol ratio carried on the node (callables get
one from the coverage phase); a symbol with no own ratio inherits its enclosing
File node's ratio (source="file"). The block is OMITTED entirely when no report
was ingested — absent coverage is UNKNOWN, never rendered as 0%.
impact: add an optional `untestedBlastRadius` summary over the depth-1
dependents, splitting them into untested (known coverage below the 0.5
threshold), tested, and unknownCoverage (no coverage ingested). Dependents with
no ingested coverage land in unknownCoverage, never in untested, so a repo that
never ran coverage is not misreported as fully untested. The field is omitted
when there are no direct dependents.
Both thresholds match verdict's complex_and_untested escalation (0.5) so the
three surfaces agree on what "untested" means. ToolResult shape (structuredContent
+ text) is preserved; the new fields are additive and optional. Tool descriptions
document the new fields and the absent-vs-zero contract.
Tests: context asserts coverage present (per-symbol + file-inherited), thin
coverage flagged not-covered, and field omitted (no false 0%) when absent.
impact asserts the tested/untested/unknown split, that absent coverage is
unknown not untested, and that the field is omitted with zero dependents.
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.
What
Reads out already-ingested test-coverage on the two high-frequency exploration MCP tools,
contextandimpact. Pure read-out — the coverage overlay phase is already default-auto,coveragePercentis already round-tripped onto File and callable nodes, andverdictalready consumes it. No ingestion re-plumbing.contextcoveragefield on the resolved target:{ percent (0–1), covered, source }.Filenode's ratio (source: "file").impactuntestedBlastRadiusover the depth-1 dependents:{ threshold, directCount, testedCount, untestedCount, unknownCount, untested[], unknownCoverage[] }.unknownCoverage, neveruntested— a repo that never ran coverage isn't misreported.next_stepshint when any direct dependent is thinly tested.Both share
COVERAGE_THIN_THRESHOLD = 0.5, matchingverdict'scomplex_and_untested, so the three tools agree on "untested".How verified
@opencodehub/mcp.pnpm -F @opencodehub/mcp test— 200 pass / 0 fail / 25 skipped;pnpm -F @opencodehub/cli test— 286 / 0 / 16 skipped.ToolResultshape preserved (additive optional fields); run-smoke shape test unaffected.Tests added (7)
context: present per-symbol, thin flagged, file-inherited, omitted-when-absent (no false 0%).impact: tested/untested/unknown split, absent→unknown not untested, omitted with zero dependents.🤖 Surfaced by an automated roadmap-survey workflow; implemented + verified in an isolated worktree.