Skip to content

feat(mcp): add skipped PR audit tool - #5865

Closed
pekar9781 wants to merge 4 commits into
JSONbored:mainfrom
pekar9781:feat/mcp-skipped-pr-audit
Closed

feat(mcp): add skipped PR audit tool#5865
pekar9781 wants to merge 4 commits into
JSONbored:mainfrom
pekar9781:feat/mcp-skipped-pr-audit

Conversation

@pekar9781

Copy link
Copy Markdown
Contributor

Summary

  • add the loopover_get_skipped_pr_audit MCP tool for maintainers
  • reuse the existing skipped-PR audit route logic via a shared src/services/skipped-pr-audit.ts helper
  • expose the tool in the maintainer-triage recommended toolset and cover it with focused tests

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Closes #5825

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Ran focused validation in this environment instead of the full release checklist:
    • ./node_modules/.bin/vitest run --reporter=verbose test/unit/mcp-skipped-pr-audit.test.ts
    • ./node_modules/.bin/vitest run --reporter=verbose test/unit/mcp-output-schemas.test.ts -t "loopover_get_skipped_pr_audit|exposes an outputSchema for every covered tool in tools/list|exposes an outputSchema on EVERY registered tool"
    • direct CLI verification: node packages/loopover-mcp/bin/loopover-mcp.js init-client --print codex --agent-profile maintainer-triage --json
  • ./node_modules/.bin/tsc --noEmit --pretty false did not finish within a reasonable local window here.
  • The narrowed test/unit/mcp-cli-basics.test.ts harness still returned empty stdout in this sandbox even though the direct CLI invocation above produced the expected JSON including loopover_get_skipped_pr_audit.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

  • Not applicable; no visible UI changes.

Notes

  • The MCP tool mirrors /v1/app/skipped-pr-audit behavior, including repo scoping, limit clamping, reason/since filters, and remediation text.
  • Added the tool to the maintainer-triage recommended tools list in packages/loopover-mcp/bin/loopover-mcp.js.
  • Added focused unit coverage for default/scoped access, each filter, limit clamping, empty results, and forbidden non-maintainer access.

@pekar9781
pekar9781 marked this pull request as ready for review July 14, 2026 21:22
@pekar9781
pekar9781 requested a review from JSONbored as a code owner July 14, 2026 21:22
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 14, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

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

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Caution

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

🛑 LoopOver review result - reject/close recommended

Review updated: 2026-07-14 21:30:20 UTC

10 files · 1 AI reviewer · 1 blocker · readiness 57/100 · CI green · unstable

🛑 Suggested Action - Reject/Close

Review summary
This PR extracts the skipped-PR audit logic from src/api/routes.ts into a shared src/services/skipped-pr-audit.ts module and reuses it to add a new maintainer-only loopover_get_skipped_pr_audit MCP tool, with the route updated to call the same shared functions (return shape changed from Response-or-array to a discriminated {ok} result, and the route call site was updated accordingly). The refactor is a faithful extraction — no logic drift visible between the old inline route code and the new shared functions — and the new tool is gated behind maintainer/owner/operator roles with focused tests for filtering, limit clamping, empty results, and non-maintainer rejection. The diff also slips in an unrelated CI hardening change (continue-on-error: true on three Codecov upload steps) that isn't mentioned in the PR description despite the PR's own checklist claiming focus.

Nits — 6 non-blocking
  • src/mcp/server.ts adds a new local clampInteger helper that duplicates the existing clampInteger already used in src/api/routes.ts for the same limit-clamping logic — consider exporting one shared implementation instead of maintaining two copies.
  • The .github/workflows/ci.yml continue-on-error additions (and their matching codecov-policy.test.ts assertions) are unrelated to the stated MCP-tool feature and aren't called out in the PR description, which is a mild violation of the PR's own 'focused, no unrelated deploy changes' checklist item.
  • In src/mcp/server.ts:getSkippedPrAudit, the forbidden check `this.identity.kind === "static" && this.identity.actor === "mcp"` special-cases only the literal actor "mcp"; worth confirming buildStaticControlPanelRoleSummary can't return a maintainer-equivalent role for some other static actor that shouldn't have audit access.
  • Factor clampInteger into a shared util (e.g. src/utils) imported by both routes.ts and server.ts to avoid drift if the bounds ever change in one place but not the other.
  • Split the CI continue-on-error change into its own PR or explicitly call it out in this PR's description so reviewers aren't surprised by deploy-pipeline changes bundled with an MCP feature.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.

Why this is blocked

  • Linked issue overlaps another open PR — Review the related PRs before spending reviewer time on duplicate work.
📋 Copy for AI agents — paste into your coding agent
Fix the following blocker(s) from this PR review:

1. Linked issue overlaps another open PR — Review the related PRs before spending reviewer time on duplicate work.
Flagged checks (non-blocking)
  • Contributor trust — Contributor flagged for review
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ Linked #5825
Related work ⚠️ 1 scoped overlap 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 ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 884 registered-repo PR(s), 624 merged, 83 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jony376; Gittensor profile; 884 PR(s), 83 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence. LLM value judgment: moderate — The PR cleanly de-duplicates existing, already-tested audit logic into a shared module and exposes it as a new read-only maintainer MCP tool with matching test coverage, closing a linked issue, though the unrelated CI tweak slightly dilutes the otherwise well-targeted scope.
Linked issue satisfaction

Addressed
The PR adds loopover_get_skipped_pr_audit to src/mcp/server.ts with the required input/output schemas, extracts skippedPrAuditRepoScope/listPrVisibilitySkipAuditEvents into a shared service reused by both the route and the new tool (no HTTP round-trip or reimplemented scoping logic), adds it to the maintainer-triage recommendedTools list, and includes tests covering default/no-filter, each individ

Review context
  • Author: jony376
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 884 PR(s), 83 issue(s).
  • Related work: Titles/paths share 3 meaningful terms. (issue #4241, PR #5879)
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Triage stale or unlinked PRs.
  • Refresh registry data or choose a registered active repo.
  • 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.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (Linked issue overlaps another open PR; duplicate of another open PR). 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 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. 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): expose the skipped-PR audit trail as a read-only maintainer MCP tool (loopover_get_skipped_pr_audit)

1 participant