feat(mcp): expose repo label-policy audit via gittensory_get_label_audit#1461
feat(mcp): expose repo label-policy audit via gittensory_get_label_audit#1461oktofeesh1 wants to merge 2 commits into
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1461 +/- ##
=======================================
Coverage 95.37% 95.37%
=======================================
Files 199 200 +1
Lines 21546 21556 +10
Branches 7791 7792 +1
=======================================
+ Hits 20550 20560 +10
Misses 416 416
Partials 580 580
🚀 New features to boost your workflow:
|
The deterministic label audit (`buildLabelAudit`, src/signals/engine.ts) reports whether a repo's configured (.gittensory.yml / dashboard) label set matches the live GitHub labels and is trustworthy for label-multiplier scoring — surfacing missing configured labels, suspicious status/source-style labels, and the overall trusted-label-pipeline readiness. It already powers the repo-intelligence response but had no MCP surface, so agents/CLI couldn't pull it (it is also absent from gittensory_get_repo_context, which exposes a different subset). Add `gittensory_get_label_audit` (maintainer-authenticated via the existing requireRepoAccess, advisory only), mirroring the merged maintainer-noise (JSONbored#1414) and outcome-calibration (JSONbored#1174) serving: a thin load-or-compute service (src/services/label-audit.ts) that loads the repo's labels + cached signals and runs the existing builder, plus the MCP tool registration + output schema + method. Output flows through the existing redactSensitiveForMcp wrapper. No new REST route, no migration, no auth-policy change — purely additive to the MCP surface. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
4a72571 to
75cf7ef
Compare
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review — blocked
🛑 Blocked Review summary Nits (5)
CI checks failing
Nits — 2 non-blocking
Review context
Contributor next steps
Signal definitions
Review detailsGenerated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative. Adds `gittensory_get_label_audit`, a thin MCP tool that wires the existing `buildLabelAudit` builder to the MCP surface, mirroring the `maintainer-noise` and `outcome-calibration` precedent exactly. Tool registration, output schema, service layer, and test coverage all follow the established pattern correctly. The `requireRepoAccess` guard is correctly placed before `loadLabelAudit` in `getLabelAudit`, so the current MCP call path is protected. Nits (5)
🟩 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.
|
Summary
The deterministic label audit (
buildLabelAudit,src/signals/engine.ts) reports whether a repo's configured (.gittensory.yml/ dashboard) label set matches the live GitHub labels and is trustworthy for label-multiplier scoring — surfacing missing configured labels, suspicious status/source-style labels, and the overall trusted-label-pipeline readiness. It already powers the repo-intelligence response but had no MCP surface, so agents/CLI couldn't pull it (it is also absent fromgittensory_get_repo_context, which exposes a different subset).This adds
gittensory_get_label_audit(maintainer-authenticated via the existingrequireRepoAccess, advisory only), mirroring the mergedgittensory_get_maintainer_noise(#1414) andgittensory_get_outcome_calibration(#1174): a thin load-or-compute service (src/services/label-audit.ts) that loads the repo's labels + cached signals and runs the existing builder, plus the MCP tool registration + output schema + method. Output flows through the existingredactSensitiveForMcpwrapper.No linked issue: small, self-evident additive MCP surface over a live builder — same shape and scope as the merged maintainer-noise / outcome-calibration tools. No new REST route, no migration, no auth-policy change.
Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coverage—codecov/patch: every changed line and branch insrc/services/label-audit.tsand the newsrc/mcp/server.tslines is covered (verified via lcov, incl. both sides of the pipeline-readiness summary ternary).npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderate(0 vulnerabilities)test/unit/label-audit.test.ts, incl. both readiness summary branches + sanitizer boundary), the MCP call-test intest/unit/mcp-output-schemas.test.ts, and the tool-list assertion intest/integration/api.test.ts.Safety
redactSensitiveForMcp; a test asserts nowallet/hotkey/payout/rewardterms leak.requireRepoAccessmaintainer guard (no new auth surface).Notes
Third tool in the maintainer-side MCP series after the merged
gittensory_get_maintainer_noise(#1414) and the in-reviewgittensory_get_maintainer_lane(#1456); identical blessed pattern (service + tool + output schema + tests). MCP-tool-only — does not touch the deliberately-consolidated/v1/contributors/:login/*surface.🤖 Generated with Claude Code