Skip to content

feat(mcp): add follow-up issue local-write action spec (#2177) - #3832

Closed
kiannidev wants to merge 1 commit into
JSONbored:mainfrom
kiannidev:feat/2177-follow-up-issue-spec
Closed

feat(mcp): add follow-up issue local-write action spec (#2177)#3832
kiannidev wants to merge 1 commit into
JSONbored:mainfrom
kiannidev:feat/2177-follow-up-issue-spec

Conversation

@kiannidev

Copy link
Copy Markdown
Contributor

Summary

Implements #2177 by adding buildFollowUpIssueSpec in src/mcp/local-write-tools.ts. The helper composes a public-safe follow-up issue title/body from a deferred review finding, strips HTML comment markers, bounds title/body length, and delegates to the existing buildFileIssueSpec / gh issue create shape with optional point-bearing labels. No new hosted MCP write path is introduced.

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 an issue, or this is small enough that the summary explains why an issue is not needed.

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:

  • Full npm run test:ci was run in parts locally; cf-typegen:check reports stale worker-configuration.d.ts in this environment without any wrangler.jsonc changes (upstream main CI is green).

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 — backend-only MCP local-write helper; no visible UI change.

Notes

  • Conflict check: open PRs touch commands.ts, processors.ts, and focus-manifest.ts; this PR only changes local-write-tools.ts and its unit tests.
  • Tests cover typo-style title assembly, marker stripping, POSIX sq escaping, label/no-label branches, existing Follow-up: prefix handling, and over-long title/body bounding.

Made with Cursor

Compose a boundary-safe gh issue-create spec from deferred review findings
so contributors can file follow-up work locally without a new MCP write path.

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

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.41%. Comparing base (fd8b3da) to head (1ef5e24).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3832   +/-   ##
=======================================
  Coverage   93.41%   93.41%           
=======================================
  Files         325      325           
  Lines       32844    32873   +29     
  Branches    12030    12039    +9     
=======================================
+ Hits        30680    30709   +29     
  Misses       1530     1530           
  Partials      634      634           
Files with missing lines Coverage Δ
src/mcp/local-write-tools.ts 100.00% <100.00%> (ø)
🚀 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 6, 2026
@loopover-orb

loopover-orb Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Caution

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

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-06 13:50:06 UTC

2 files · 1 AI reviewer · 3 blockers · readiness 100/100 · CI green · clean

🛑 Suggested Action - Reject/Close

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
  • AI reviewers agree on a likely critical defect: src/mcp/local-write-tools.ts buildFollowUpIssueSpec (~line 96-100) stores the raw, un-sanitized input.finding.title/detail/action in the returned inputs.finding object even though composeFollowUpIssueTitle/composeFollowUpIssueBody strip HTML comment markers for the command/description — since LocalWriteActionSpec.inputs is documented as letting the harness 'construct its own invocation instead of running command raw' (src/mcp/local-write-tools.ts:13), any consumer using inputs.finding instead of command/inputs.title/inputs.body will emit the un-stripped content (potentially private text hidden in HTML comments) into a public GitHub issue, defeating the feature's core 'public-safe' claim. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
Adds buildFollowUpIssueSpec, which composes a public-safe follow-up issue title/body from a deferred review finding (stripping HTML comments, bounding lengths) and delegates to buildFileIssueSpec's gh issue create command; this part is correct and well-tested. However, the returned spec's inputs.finding object stores the RAW, un-stripped finding.title/detail/action (including any HTML comment content) alongside the sanitized inputs.title/inputs.body inherited from fileSpec, which undermines the function's stated 'public-safe' guarantee since inputs is documented as an alternative path for a harness to construct its own write.

Blockers

  • src/mcp/local-write-tools.ts buildFollowUpIssueSpec (~line 96-100) stores the raw, un-sanitized input.finding.title/detail/action in the returned inputs.finding object even though composeFollowUpIssueTitle/composeFollowUpIssueBody strip HTML comment markers for the command/description — since LocalWriteActionSpec.inputs is documented as letting the harness 'construct its own invocation instead of running command raw' (src/mcp/local-write-tools.ts:13), any consumer using inputs.finding instead of command/inputs.title/inputs.body will emit the un-stripped content (potentially private text hidden in HTML comments) into a public GitHub issue, defeating the feature's core 'public-safe' claim.
Nits — 5 non-blocking
  • composeFollowUpIssueBody bounds each line individually (detail/action) and then bounds the entire joined string again via boundFollowUpBody with the same FOLLOW_UP_ISSUE_BODY_MAX — for very long detail text this double truncation can silently drop the trailing disclaimer line ('Filed locally from a deferred review finding…'), losing the local-write-boundary attribution on large findings.
  • The literal 500 used for the 'Suggested next step' bound (src/mcp/local-write-tools.ts:87) is a magic number; consider a named constant like FOLLOW_UP_ISSUE_ACTION_MAX for consistency with FOLLOW_UP_ISSUE_TITLE_MAX/FOLLOW_UP_ISSUE_BODY_MAX.
  • stripFollowUpMarkers is invoked twice for the same string in the title path (once directly in composeFollowUpIssueTitle, again inside boundFollowUpLine) — harmless but redundant; consider stripping once up front.
  • Sanitize input.finding before embedding it in inputs.finding (e.g. reuse stripFollowUpMarkers on title/detail/action) so the structured inputs stay consistent with the sanitized command/description.
  • Name the 500 bound as a constant alongside FOLLOW_UP_ISSUE_TITLE_MAX/FOLLOW_UP_ISSUE_BODY_MAX for discoverability.

Why this is blocked

  • src/mcp/local-write-tools.ts buildFollowUpIssueSpec (~line 96-100) stores the raw, un-sanitized input.finding.title/detail/action in the returned inputs.finding object even though composeFollowUpIssueTitle/composeFollowUpIssueBody strip HTML comment markers for the command/description — since LocalWriteActionSpec.inputs is documented as letting the harness 'construct its own invocation instead of running command raw' (src/mcp/local-write-tools.ts:13), any consumer using inputs.finding instead of command/inputs.title/inputs.body will emit the un-stripped content (potentially private text hidden in HTML comments) into a public GitHub issue, defeating the feature's core 'public-safe' claim.
  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
  • Maintainer requires a linked issue — Link the relevant issue (for example Closes #123) before opening the PR.
Signal Result Evidence
Code review ❌ 3 blockers 1 reviewer
Linked issue ✅ No-issue rationale PR body explains why no issue is linked.
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 (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 1512 registered-repo PR(s), 796 merged, 47 issue(s).
Contributor context ✅ Confirmed Gittensor contributor kiannidev; Gittensor profile; 1512 PR(s), 47 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: kiannidev
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: TypeScript, MDX, C++, HTML, Rust
  • Official Gittensor activity: 1512 PR(s), 47 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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 (No linked issue detected; Maintainer requires a linked issue; AI reviewers agree on a likely critical defect: src/mcp/local-write-tools.ts buildFollowUpIssueSpec (~line 96-100) stores the raw, un-sanitized input.finding.title/detail/action in the returned inputs.finding object even though composeFollowUpIssueTitle/composeFollowUpIssueBody strip HTML comment markers for the command/description — since LocalWriteActionSpec.inputs is documented as letting the harness 'construct its own invocation instead of running command raw' (src/mcp/local-write-tools.ts:13), any consumer using inputs.finding instead of command/inputs.title/inputs.body will emit the un-stripped content (potentially private text hidden in HTML comments) into a public GitHub issue, defeating the feature's core 'public-safe' claim.). 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: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.

1 participant