Skip to content

feat(mcp): add gittensory_get_repo_onboarding_pack tool - #4243

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jsdevninja:feat/mcp-repo-onboarding-pack-tool
Jul 8, 2026
Merged

feat(mcp): add gittensory_get_repo_onboarding_pack tool#4243
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jsdevninja:feat/mcp-repo-onboarding-pack-tool

Conversation

@jsdevninja

Copy link
Copy Markdown
Contributor

Summary

  • Register gittensory_get_repo_onboarding_pack on the hosted MCP server with ownerRepoShape input and a zod output schema for the onboarding-pack preview shape.
  • Handler calls buildRepoOnboardingPackPreviewForRepo behind requireRepoAccess, returning repo_not_accepted when the repository is not registered.
  • Add unit tests for authorized maintainer session, unauthorized cross-repo session, and unregistered-repo branches; extend output-schema and tools/list coverage.

Closes #2223

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.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck (passed before rebase onto latest main; upstream added aws4fetch for selfhost S3 — CI installs full deps)
  • npm run test:coverage locally on focused MCP onboarding-pack tests; branch arms in getRepoOnboardingPack covered (success, repo_not_accepted, forbidden session)
  • 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:

  • Full local npm run validate / test:ci not run end-to-end here (large suite + local env variance); focused MCP tests, build:mcp, and npm audit were run. CI validate is the authoritative gate.

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

N/A — MCP server change only; no visible UI.

Notes

  • Mirrors existing repo-scoped read tools (gittensory_get_maintainer_lane, gittensory_get_label_audit) for access control and structured output.

Expose the repo onboarding-pack preview via hosted MCP so the stdio
prompt has a real data source, with repo-access guard and tests for
authorized, unauthorized, and unregistered-repo branches.

Closes JSONbored#2223

Co-authored-by: Cursor <cursoragent@cursor.com>
@jsdevninja
jsdevninja requested a review from JSONbored as a code owner July 8, 2026 18: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 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.78%. Comparing base (a4e50c6) to head (8794755).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4243   +/-   ##
=======================================
  Coverage   93.78%   93.78%           
=======================================
  Files         394      394           
  Lines       36619    36628    +9     
  Branches    13402    13403    +1     
=======================================
+ Hits        34342    34351    +9     
  Misses       1622     1622           
  Partials      655      655           
Files with missing lines Coverage Δ
src/mcp/server.ts 95.17% <100.00%> (+0.05%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

loopover-orb Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-08 18:24:59 UTC

4 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This PR registers a new read-only MCP tool, gittensory_get_repo_onboarding_pack, following the exact established pattern of neighboring tools (getMaintainerLane, getBurdenForecast): requireRepoAccess gate, service call, and a summary+data ToolPayload. It closes #2223, adds focused unit tests covering the authorized, cross-repo-forbidden, and unregistered-repo branches, plus extends the output-schema and tools/list coverage tests, and CI is green. The diff is narrow, consistent with existing conventions, and I see no reachable-path defect in the visible code.

Nits — 5 non-blocking
  • src/mcp/server.ts: `preview: z.unknown().optional()` in repoOnboardingPackOutputSchema gives up structural validation on the preview payload — consider a shaped zod schema (even a loose one with `previewOnly`/`publicSafe` booleans) so a future shape change to buildRepoOnboardingPackPreviewForRepo doesn't silently pass an unvalidated blob through the MCP contract.
  • test/unit/mcp-repo-onboarding-pack.test.ts: the `policySource: "policy_compiler"` and `preview: { previewOnly: true, publicSafe: true }` assertions assume specifics of buildRepoOnboardingPackPreviewForRepo's return shape that aren't in this diff — worth double-checking those literal values are stable/documented in services/repo-onboarding-pack.ts rather than incidental to current implementation.
  • src/mcp/server.ts:getRepoOnboardingPack — the redundant-looking `response as unknown as Record<string, unknown>` cast pattern matches sibling handlers, so it's consistent, but consider whether the service could just return `Record<string, unknown>` directly to drop the double cast repo-wide (broader than this PR, not a blocker here).
  • Confirm services/repo-onboarding-pack.ts's buildRepoOnboardingPackPreviewForRepo is itself covered by dedicated unit tests (not just through this MCP wrapper), since the MCP tests here only assert its output shape rather than its internal preview-generation logic.
  • Consider tightening repoOnboardingPackOutputSchema's `preview` field with a minimal zod object shape (previewOnly: z.boolean(), publicSafe: z.boolean()) to catch schema drift at the type level instead of relying solely on test assertions.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2223
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low 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: 230 registered-repo PR(s), 142 merged, 39 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jsdevninja; Gittensor profile; 230 PR(s), 39 issue(s).
Gate result ✅ Passing No configured blocker found.
Linked issue satisfaction

Addressed
The diff registers gittensory_get_repo_onboarding_pack in src/mcp/server.ts with ownerRepoShape input and a zod output schema, the handler calls buildRepoOnboardingPackPreviewForRepo behind requireRepoAccess, and new tests cover the authorized, unauthorized, and unregistered-repo branches exactly as the issue's deliverables specify.

Review context
  • Author: jsdevninja
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Swift, C, CSS, MDX, Python, Vue
  • Official Gittensor activity: 230 PR(s), 39 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
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 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.

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

@loopover-orb
loopover-orb Bot merged commit 0796aa7 into JSONbored:main Jul 8, 2026
8 checks passed
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_get_repo_onboarding_pack MCP tool

1 participant