Skip to content

feat(mcp): surface ingested test-coverage on context and impact#196

Open
theagenticguy wants to merge 1 commit into
mainfrom
roadmap/coverage-on-context-impact
Open

feat(mcp): surface ingested test-coverage on context and impact#196
theagenticguy wants to merge 1 commit into
mainfrom
roadmap/coverage-on-context-impact

Conversation

@theagenticguy
Copy link
Copy Markdown
Owner

What

Reads out already-ingested test-coverage on the two high-frequency exploration MCP tools, context and impact. Pure read-out — the coverage overlay phase is already default-auto, coveragePercent is already round-tripped onto File and callable nodes, and verdict already consumes it. No ingestion re-plumbing.

context

  • New optional coverage field on the resolved target: { percent (0–1), covered, source }.
  • Per-symbol ratio off the resolved node; a symbol with no own ratio inherits its enclosing File node's ratio (source: "file").
  • Omitted entirely when no coverage was ingested. Absent coverage is UNKNOWN, never rendered as 0%.

impact

  • New optional untestedBlastRadius over the depth-1 dependents: { threshold, directCount, testedCount, untestedCount, unknownCount, untested[], unknownCoverage[] }.
  • Dependents with no ingested coverage land in unknownCoverage, never untested — a repo that never ran coverage isn't misreported.
  • Emits a next_steps hint when any direct dependent is thinly tested.

Both share COVERAGE_THIN_THRESHOLD = 0.5, matching verdict's complex_and_untested, so the three tools agree on "untested".

How verified

  • Full build incl. the cli tsup bundle that re-bundles @opencodehub/mcp.
  • pnpm -F @opencodehub/mcp test — 200 pass / 0 fail / 25 skipped; pnpm -F @opencodehub/cli test — 286 / 0 / 16 skipped.
  • Biome clean; banned-strings PASS.
  • ToolResult shape 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.

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.
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