Skip to content

feat(mcp): add gittensory_check_test_evidence tool (#2235) - #3767

Closed
kiannidev wants to merge 1 commit into
JSONbored:mainfrom
kiannidev:feat/mcp-check-test-evidence-2235
Closed

feat(mcp): add gittensory_check_test_evidence tool (#2235)#3767
kiannidev wants to merge 1 commit into
JSONbored:mainfrom
kiannidev:feat/mcp-check-test-evidence-2235

Conversation

@kiannidev

Copy link
Copy Markdown
Contributor

Summary

  • Adds buildCheckTestEvidenceReport in src/mcp/check-test-evidence.ts, composing classifyTestCoverage and isCodeFile into a metadata-only coverage-gap band plus actionable guidance strings.
  • Registers gittensory_check_test_evidence on the hosted /mcp Worker with zod input/output schemas (changedPaths, optional testPaths; classification + guidance out). Description states metadata-only, no GitHub writes.
  • Tests cover code-only, code+tests, docs-only, adequate/weak/strong threshold branches, output-schema discovery, and MCP tool invocation.

Closes #2235

Conflict avoidance

Touches only src/mcp/check-test-evidence.ts, src/mcp/server.ts, and new/extended unit tests — no overlap with open PRs (#3765 ci.yml, #3764 deps, #3763 path-matchers, #3760/#3755/#3721/#3698 processors, #3724 local-branch, #3712 visual).

Test plan

  • npx vitest run test/unit/mcp-check-test-evidence.test.ts test/unit/mcp-output-schemas.test.ts
  • npm run typecheck

Made with Cursor

Expose the deterministic changed-path test-evidence classifier as a metadata-only MCP tool with coverage-gap guidance.

Co-authored-by: Cursor <cursoragent@cursor.com>
@kiannidev
kiannidev requested a review from JSONbored as a code owner July 6, 2026 08:14
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
10041 1 10040 7
View the full list of 1 ❄️ flaky test(s)
test/unit/check-miner-package.test.ts > check-miner-package script > passes on the real miner workspace package

Flake rate in main: 100.00% (Passed 0 times, Failed 2 times)

Stack Traces | 1.42s run time
AssertionError: expected 1 to be +0 // Object.is equality

- Expected
+ Received

- 0
+ 1

 ❯ test/unit/check-miner-package.test.ts:20:27

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@loopover-orb loopover-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 6, 2026
@loopover-orb

loopover-orb Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-06 08:23:01 UTC

4 files · 1 AI reviewer · no blockers · readiness 82/100 · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
Adds a small, self-contained MCP tool that classifies test-evidence coverage from changed/test file paths, composing existing `classifyTestCoverage`/`isTestPath`/`isCodeFile` helpers into a metadata-only report with guidance strings. The wiring in server.ts (shape, output schema, registerTool, private handler, rate-limit enforcement, output-schema discovery list) mirrors the pattern used by sibling tools like `checkIssueSlop`, and the new report builder is pure/deterministic with reasonable docs-only and threshold-band test coverage. The design choice to compute `testFileCount` from the combined changedPaths+testPaths set while `codeFileCount` only counts changedPaths is intentional and internally consistent given the tests provided.

Nits — 5 non-blocking
  • src/mcp/check-test-evidence.ts: `generatedAt: new Date().toISOString()` makes the report non-deterministic despite the doc comment claiming 'Pure — paths only'; consider dropping the field or accepting it as an explicit exception to purity.
  • src/mcp/check-test-evidence.ts: docs-only changesets (codeFileCount === 0) are hard-coded to classification 'absent', which is a slightly odd label for 'not applicable' — consider a dedicated status or at least documenting why 'absent' doubles as both meanings.
  • test/unit/mcp-check-test-evidence.test.ts: no test exercises the `testPaths` field being combined with a mostly-docs changedPaths set (i.e., docsOnly still true even when testPaths are supplied), which is an easy edge case to miss given docsOnly is derived only from codeFileCount.
  • src/mcp/server.ts: unlike `predictGate`, `checkTestEvidence` has no `requireContributorAccess`/login gating — consistent with `checkIssueSlop` here, but worth a one-line comment confirming this is intentional for path-metadata-only tools.
  • Add a test where `testPaths` contains entries also present in `changedPaths` to confirm `uniquePaths` dedup across the two arrays behaves as expected for `testFileCount`.

CI checks failing

  • validate
  • validate-code
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2235
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 1505 registered-repo PR(s), 790 merged, 47 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kiannidev; Gittensor profile; 1505 PR(s), 47 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: kiannidev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: TypeScript, MDX, C++, HTML, Rust
  • Official Gittensor activity: 1505 PR(s), 47 issue(s).
  • Related work: Titles/paths share 8 meaningful terms. (issue #2057, issue #2308)
  • Related work: Titles/paths share 8 meaningful terms. (issue #2222, issue #2234)
  • Related work: Titles/paths share 7 meaningful terms. (issue #2222, issue #2238)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb

loopover-orb Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (Linked issue #2235 is assigned to the maintainer (@JSONbored) — that work is reserved for the maintainer, so this PR cannot be auto-accepted.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): add gittensory_check_test_evidence tool (deterministic coverage-gap self-check)

1 participant