Skip to content

feat: reviewer suggestions on the CLI and MCP (preview) - #689

Merged
aryamthecodebreaker merged 2 commits into
mainfrom
claude/reviewer-suggestions-0cbedb
Nov 22, 2026
Merged

aryamthecodebreaker merged 2 commits into
mainfrom
claude/reviewer-suggestions-0cbedb

Conversation

@aryamthecodebreaker

@aryamthecodebreaker aryamthecodebreaker commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Work package 03-reviewer-suggestions-surfaces.md, without step 5 (GitHub Action parity comes later in a separate PR).

What changed

  • CLI fixmap reviewers (--report plan.json | --diff <spec> | --working-tree) [--no-history-authors] [--repo] [--format markdown|json] [--output] [--no-cache]. Help line starts with Preview: . Output is grouped by changed path; each reviewer shows confidence and every reason with its source (.github/CODEOWNERS:3, annotation id, policy rule, commit count). --report routes the plan's changed files, or its ranked context files when it has none.
  • MCP fixmap_reviewers, same inputs (report, diff, workingTree, noHistoryAuthors, repo, format, noCache). Annotated readOnlyHint: true, openWorldHint: false. Description starts with Preview (may change before v0.10.0): .
  • Core (packages/core/src/ownership.ts):
    • routeReviewers(repo, { includeHistoryAuthors: false }) drops commit-author suggestions and says so in a diagnostic. The CLI also skips reading history in that mode.
    • Evidence records changedPath, so output can be grouped per path. This is an additive field.
    • Shallow history gives a warning; truncated history gives an info note.
    • New exports withoutMentions, reviewRoutingWithoutMentions and renderReviewRoutingMarkdown, ready for Action parity.
  • No @ mentions: handles lose their @ in both Markdown and JSON (@org/team → org/team). E-mail addresses stay, since GitHub doesn't notify on them. Markdown names are code spans too. Nothing requests reviews.
  • .mailmap: history is already read with git log --format=%aN, and Git applies .mailmap to %aN. So no new parser was needed. A real-repository test now proves two aliases merge into one author before counting. The scan cache key includes HEAD, status and the dirty diff, so a committed or edited .mailmap invalidates the cache. Without a .mailmap, behavior is unchanged.
  • Feature catalog entry Reviewer suggestions (preview: true), the MCP catalog line, README and CLI README docs (including --no-history-authors), and the preview-set tests in cli-runner.test.ts and mcp.test.ts.

Names are never treated as identity, employment or availability evidence. That is stated in the output, help, MCP description and docs, and availabilityInferred: false is unchanged.

Ledger evidence: "Ownership and review routing"

Requirement Evidence
CODEOWNERS precedence + last rule wins core/test/ownership.test.ts "uses only the highest-precedence CODEOWNERS file and last matching rule"; cli/test/reviewers-command.test.ts "routes CODEOWNERS by last matching rule…" (line 3 wins over * and /src/**)
Annotation owners core/test/ownership.test.ts "combines CODEOWNERS, active annotations, policy…" plus the expired-annotation test
Policy reviewers same combined test (requiredReviews → platform-team)
.mailmap canonicalization reviewers-command.test.ts "canonicalizes commit authors through .mailmap before counting" (real git repo, two aliases → one author with 2 commits)
--no-history-authors reviewers-command.test.ts "drops commit authors with --no-history-authors"; Core test "drops commit authors on request…"; MCP test uses noHistoryAuthors: true
No CODEOWNERS file reviewers-command.test.ts "works without a CODEOWNERS file, from commit history alone"
Shallow history reviewers-command.test.ts "warns that a shallow clone…" (real git clone --depth 1); Core shallow-diagnostic test
No @ mentions CLI Markdown + JSON assertions, the Core withoutMentions test, and an MCP output assertion
Malformed input / traversal ../outside.js in a report is rejected, as are a Markdown report passed to --report, bad flag combinations, URL --repo, unknown MCP arguments, and an unresolvable diff spec
Read-only MCP mcp.test.ts "suggests reviewers read-only…"

Verification

Per the release session's instruction, the full npm run ci was not run locally; GitHub CI runs the full gate. What I ran on Windows:

  • npm run typecheck: pass
  • npm run lint: pass
  • Core tests: 875 passed, 1 skipped. CLI tests: 342 passed. Action: 53 passed. Web: 15 passed.
  • After rebasing on feat(action): preview change scope and capability maps #687: npm run build:action regenerated packages/action/dist/index.mjs. The Action's change-scope code now embeds routeReviewers, so the bundle picks up the Core changes (includeHistoryAuthors, history diagnostics, changedPath). The rebuilt bundle is committed and npm run check:action-bundle passes. Re-run after the rebase: Core 875 passed (1 skipped), CLI 342, Action 66, web 15, plus typecheck and lint.

Not touched: ledger, CHANGELOG.md, versions, apps/web/app/changelog/page.tsx, Action sources (only the generated dist/index.mjs was rebuilt), package-lock.json.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
fixmap Ready Ready Preview Nov 22, 2026 2:47pm UTC

aryamthecodebreaker and others added 2 commits November 22, 2026 20:10
Add `fixmap reviewers (--report plan.json | --diff <spec> | --working-tree)`
and the read-only MCP tool `fixmap_reviewers`. Both print suggested
reviewers per changed path with the reason and source line, from the
highest-precedence CODEOWNERS file (last matching rule wins), active
annotation owners, architecture-policy reviewers, and bounded commit
authors.

- `--no-history-authors` / `noHistoryAuthors` drops commit-author
  suggestions and skips reading history.
- Commit authors are read with git's `%aN`, which applies `.mailmap`;
  a real-repository test now proves aliases are merged before counting.
- Output strips `@` from handles so nothing notifies anyone; e-mail
  addresses stay. Core exports `renderReviewRoutingMarkdown`,
  `reviewRoutingWithoutMentions` and `withoutMentions` for Action parity.
- Evidence now records `changedPath`; shallow and truncated history are
  diagnosed.
- Feature catalog entry `Reviewer suggestions` with `preview: true`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aryamthecodebreaker
aryamthecodebreaker force-pushed the claude/reviewer-suggestions-0cbedb branch from 4d8c97d to a31eff8 Compare November 22, 2026 14:47
@aryamthecodebreaker
aryamthecodebreaker merged commit 91499ab into main Nov 22, 2026
8 checks passed

This branch was successfully deployed

1 active deployment
Preview — a31eff8e Deployed Nov 22, 2026 by vercel[bot]
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.

1 participant