Skip to content

feat(mcp): register loopover_get_agent_audit_feed as a local stdio tool - #7967

Closed
real-venus wants to merge 1 commit into
JSONbored:mainfrom
real-venus:feat/get-agent-audit-feed-stdio-tool-7757
Closed

feat(mcp): register loopover_get_agent_audit_feed as a local stdio tool#7967
real-venus wants to merge 1 commit into
JSONbored:mainfrom
real-venus:feat/get-agent-audit-feed-stdio-tool-7757

Conversation

@real-venus

Copy link
Copy Markdown
Contributor

Summary

Closes #7757loopover_get_agent_audit_feed has a remote MCP tool (src/mcp/server.ts) and a maintain audit-feed CLI command, but no local stdio MCP tool registration. #6733 added the REST route + CLI but never the matching stdio tool, so a self-host operator using the local MCP server (not the CLI or remote MCP) couldn't call it.

What changed (packages/loopover-mcp/bin/loopover-mcp.ts)

  • A registerStdioTool("loopover_get_agent_audit_feed", …) block, placed next to loopover_get_maintainer_noise, mirroring the sibling proxy pattern exactly — a thin GET of the same {repoBase}/agent/audit-feed route the maintain audit-feed CLI already calls, forwarding the optional since/limit query filters verbatim (the route validates them and applies defaults).
  • Input schema auditFeedShape mirrors the remote auditFeedShape (owner/repo/since/limit). Description centralized via stdioToolDescription(...) + a STDIO_TOOL_DESCRIPTORS entry (category: "agent", matching the remote tool). No hardcoded inline description.

Testing / coverage

  • test/unit/mcp-cli-agent-audit-feed.test.ts drives the tool in-process (the loopover_plan_repo_issues has no REST route, CLI command, or local stdio MCP tool #7764 isProcessEntrypoint guard + InMemoryTransport, mirroring mcp-cli-repo-focus-manifest.test.ts) so the registration + handler get real Codecov-measured coverage — a subprocess spawn can't be v8-instrumented. Covers both the with-filters path (since+limit forwarded, verified against the harness's echoed query) and the no-filters path (empty query string — the query.size > 0 false branch).
  • Tool-count invariant in test/unit/mcp-tool-rename-aliases.test.ts bumped to 95.

No REST/OpenAPI/CLI-surface change (the route and maintain audit-feed CLI already exist) — ui:openapi:check, command-reference:check, docs/manifest drift all clean; build:mcp clean.

loopover_get_agent_audit_feed has a remote MCP tool (src/mcp/server.ts) and a
`maintain audit-feed` CLI command, but no local stdio MCP tool registration.
JSONbored#6733 added the REST route + CLI but never the matching stdio tool, so a self-host
operator using the local MCP server couldn't call it.

Adds the registerStdioTool block following the existing sibling pattern -- a thin
GET proxy of the same {repoBase}/agent/audit-feed route the CLI hits, forwarding
the optional since/limit query filters verbatim (the route validates + defaults).
Input mirrors the remote auditFeedShape (owner/repo/since/limit); description via
stdioToolDescription; category "agent".

test/unit/mcp-cli-agent-audit-feed.test.ts drives it in-process (JSONbored#7764 entrypoint
guard) so the registration + handler get real Codecov coverage, covering both the
with-filters (since+limit) and no-filters (empty query) branches. Count 94 -> 95.

Closes JSONbored#7757
@real-venus
real-venus requested a review from JSONbored as a code owner July 22, 2026 00:24
@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:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 22, 2026
@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Warning

⏸️ LoopOver review result - manual review recommended

Review updated: 2026-07-22 00:41:00 UTC

3 files · 1 AI reviewer · no blockers · CI green · dirty

⏸️ Suggested Action - Manual Review

Review summary
This PR registers a thin stdio proxy for loopover_get_agent_audit_feed, mirroring the existing loopover_get_maintainer_noise pattern exactly (same ownerRepo-style shape, apiGet, query-forwarding, and STDIO_TOOL_DESCRIPTORS entry). The tool-count bump to 95 is verified in-process via mcp-tool-rename-aliases.test.ts, and the new test exercises both the with-filters and no-filters (query.size===0) branches against a fixture server. The `: any` param annotation and the hardcoded `200` limit bound match the file's existing conventions elsewhere, so this is low-risk, well-targeted, narrow operator-facing work tied to #7757.

Nits — 6 non-blocking
  • packages/loopover-mcp/bin/loopover-mcp.ts:376 — the `200` max-limit magic number could be named as a constant (e.g. `AGENT_AUDIT_FEED_LIMIT_MAX`) for consistency with other bounded shapes in this file, though the existing `openPrShape`/similar shapes in this file also inline their bounds so this is consistent with local convention.
  • The external brief flags a possible leaked secret at test/unit/mcp-cli-agent-audit-feed.test.ts:31, but that line is `process.env.LOOPOVER_API_TOKEN = "in-process-token";`, a clearly fake fixture token matching the same pattern used in mcp-cli-maintain-tools.test.ts (`LOOPOVER_TOKEN: "session-token"`) — not a real credential.
  • The handler param is typed `async ({ owner, repo, since, limit }: any)`, matching the file's existing `any`-typed handler pattern throughout, so it's a pre-existing convention rather than a regression, but worth eventually tightening with the zod-inferred type.
  • packages/loopover-mcp/bin/loopover-mcp.ts:376 — consider a named constant for the `200` limit bound if this value is referenced elsewhere (e.g. shared with the remote MCP tool's auditFeedShape) to avoid drift.
  • Confirm the linked issue Register loopover_get_agent_audit_feed as a local stdio MCP tool #7757 is fully closed by this PR since the brief notes 'partial' coverage — worth a quick check that no other surface (e.g., docs) still needs the stdio tool listed.
  • Possible secret-shaped assignment in the diff (generic_secret_assignment) — Verify the value is not a real credential.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7757
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: 112 registered-repo PR(s), 50 merged, 19 issue(s).
Contributor context ✅ Confirmed Gittensor contributor real-venus; Gittensor profile; 112 PR(s), 19 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Linked issue satisfaction

Addressed
The diff adds a registerStdioTool block for loopover_get_agent_audit_feed following the exact sibling pattern (stdioToolDescription + STDIO_TOOL_DESCRIPTORS entry, same inputSchema convention), reuses the same /agent/audit-feed REST route via apiGet without duplicating HTTP logic, and includes a dedicated in-process test plus the tool-count invariant bump.

Review context
  • Author: real-venus
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, JavaScript, Python, Rust, CSS, MDX, Svelte, Swift
  • Official Gittensor activity: 112 PR(s), 19 issue(s).
  • Related work: Titles/paths share 7 meaningful terms. (PR #7969)
  • Related work: Titles/paths share 8 meaningful terms. (PR #7968)
  • Related work: Titles/paths share 8 meaningful terms. (PR #7966)
  • Additional title-only matches omitted; title-only overlap does not block.
Contributor next steps
  • Start here: Review top overlaps.
  • Then work through the remaining 2 steps in the Signals table above.
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.
🧪 Chat with LoopOver

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

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

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@real-venus

Copy link
Copy Markdown
Contributor Author

@JSONbored
waiting to merge

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.78%. Comparing base (8c2950c) to head (316f416).

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #7967       +/-   ##
===========================================
- Coverage   91.87%   81.78%   -10.09%     
===========================================
  Files         735       91      -644     
  Lines       75477    23720    -51757     
  Branches    22960     4554    -18406     
===========================================
- Hits        69344    19400    -49944     
+ Misses       5041     4124      -917     
+ Partials     1092      196      -896     
Flag Coverage Δ
shard-1 0.00% <0.00%> (-58.35%) ⬇️
shard-2 11.77% <100.00%> (-40.37%) ⬇️
shard-3 0.00% <0.00%> (-50.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/loopover-mcp/bin/loopover-mcp.ts 11.77% <100.00%> (-4.61%) ⬇️

... and 644 files with indirect coverage changes

@andriypolanski

Copy link
Copy Markdown
Contributor

PR #7966 was approved earlier than your PR, #7967.

@loopover-orb

loopover-orb Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Register loopover_get_agent_audit_feed as a local stdio MCP tool

2 participants