Skip to content

feat: add suggestion_box_pre_triage MCP tool - #156

Merged
igmagollo merged 2 commits into
mainfrom
worktree-agent-a75f5757
Mar 11, 2026
Merged

feat: add suggestion_box_pre_triage MCP tool#156
igmagollo merged 2 commits into
mainfrom
worktree-agent-a75f5757

Conversation

@igmagollo

Copy link
Copy Markdown
Owner

Adds the suggestion_box_pre_triage tool. Closes #99.

Before a review session you'd normally stare at a flat list of open items and manually figure out which ones are about the same thing. This does that work for you.

It clusters open feedback by trigram similarity, checks GitHub for existing issues per cluster (so you know before publishing), rolls up combined votes and impact estimates across each cluster, and moves everything into a pending_review status so it's off the open queue and ready for the TUI review flow.

What changed:

  • FeedbackStatus now includes pending_review (sits between open and published/dismissed)
  • FeedbackStore gets markPendingReview() and preTriage() — the latter does the clustering and GitHub checks
  • listFeedback schema updated to accept pending_review as a status filter
  • TriageGroup, PreTriageInput, PreTriageResult exported from the SDK
  • tests/pre-triage.test.ts covers the new methods end to end

The clustering threshold is 0.25 Jaccard — loose enough to catch paraphrases, tight enough to not mash unrelated things together. GitHub dedup reuses the existing extractKeywords + keywordSimilarity logic from github.ts.

igmagollo added a commit that referenced this pull request Mar 11, 2026
- Hoist execFileSync import to top of mcp.ts (was re-imported on every
  loop iteration inside suggestion_box_pre_triage)
- Filter suggestion-box-created issues from GitHub dedup candidates in
  pre-triage using isSuggestionBoxIssueTitle, matching the behaviour in
  github.ts so own published issues are never flagged as pre-existing
- Allow pending_review items to be dismissed or published; dismiss() in
  store.ts and the CLI now accept status IN ('open', 'pending_review'),
  and suggestion_box_publish_to_github accepts both statuses so items
  marked by pre-triage are not stranded in a dead-end state
Comment thread src/mcp.ts
import { getCategories } from "./categories.js";
import { checkGhAuth, createGithubIssue } from "./github.js";
import { execFileSync } from "child_process";
import { checkGhAuth, createGithubIssue, extractKeywords, keywordSimilarity, isSuggestionBoxIssueTitle } from "./github.js";

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

isSuggestionBoxIssueTitle isn't exported from github.ts (it doesn't even exist there as a named function — the bracket-prefix check is inlined inside searchExistingIssues). This import will fail at compile time and at runtime.

Either export it from github.ts or inline the check here.

…g feedback

Groups open feedback into similarity clusters using trigram Jaccard distance,
checks GitHub for existing issues per cluster, computes combined votes and
impact estimates, and moves items to a new `pending_review` status queue.

- Add `pending_review` to `FeedbackStatus` type
- Add `markPendingReview` and `preTriage` methods to `FeedbackStore`
- Add `preTriageSchema` to schemas and expose `TriageGroup`, `PreTriageInput`,
  `PreTriageResult` types from the SDK
- Update `listFeedback` schema to accept `pending_review` as a status filter
- Add `tests/pre-triage.test.ts` with full coverage

Closes #99
- Hoist execFileSync import to top of mcp.ts (was re-imported on every
  loop iteration inside suggestion_box_pre_triage)
- Filter suggestion-box-created issues from GitHub dedup candidates in
  pre-triage using isSuggestionBoxIssueTitle, matching the behaviour in
  github.ts so own published issues are never flagged as pre-existing
- Allow pending_review items to be dismissed or published; dismiss() in
  store.ts and the CLI now accept status IN ('open', 'pending_review'),
  and suggestion_box_publish_to_github accepts both statuses so items
  marked by pre-triage are not stranded in a dead-end state
@igmagollo
igmagollo force-pushed the worktree-agent-a75f5757 branch from ba4421a to a3f4fb0 Compare March 11, 2026 16:05
@igmagollo
igmagollo merged commit 6cb1ec3 into main Mar 11, 2026
1 check failed
@igmagollo
igmagollo deleted the worktree-agent-a75f5757 branch March 11, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add a pre-triage MCP tool that spins an agent to group entries, deduplicate a...

1 participant