Skip to content

feat(workbench): add local branch/commit review, GitHub PR review, and symbol navigation - #6974

Merged
M4n5ter merged 4 commits into
rust-previewfrom
feat/code-review-navigation
Nov 17, 2026
Merged

M4n5ter merged 4 commits into
rust-previewfrom
feat/code-review-navigation

Conversation

@M4n5ter

@M4n5ter M4n5ter commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Summary

Add a complete built-in Code Review, GitHub PR Review, and Symbol Navigation experience across Maka's workbench diff views, source file viewer, and live conversation composer — combining pure-Rust local Git revision comparison, native HTTPS GitHub PR review with minimal CLI dependency, inline prompt annotations, and opportunistic local LSP symbol navigation.

  • 4-Mode Review Hub (Uncommitted · Branch · Commits · PR) & Review Progress:
    • Add pure-Rust gix revision & comparison primitives (gitRevisions, gitCompare, gitCompareDiff) supporting working-tree changes, three-dot branch merge-base comparisons (base...HEAD via commit-graph LCA), single-commit parent diffs, and arbitrary commit ranges, alongside syntax-highlighted NSH <DiffView> (Unified / Split, expandable full-file context, word-level highlights, hunk stepping) and multi-file Review all.
    • Add per-file Viewed (✓ / V) progress bound to file diff content digests (auto-invalidating when file hunks change), ‹ N / M › ([ / ]) cross-file stepping, ← / → (Mod+[ / Mod+]) resource history, and flicker-free per-session ChangesViewCache.
  • Native HTTPS GitHub PR Review Integration (Minimal CLI Dependency):
    • Add githubContext, githubPullRequests, githubPullRequest, githubPullRequestFileDiff, githubSubmitReview, githubReplyComment, saveGitHubToken, and deleteGitHubToken on the agent contract, implemented directly over reqwest + maka_network::Policy against GitHub REST API (supporting github.com and GitHub Enterprise hosts).
    • Resolve credentials via UI token override (passed out-of-band via CallResources "secret" so secrets never enter the SQLite journal) → GH_TOKEN / GITHUB_TOKEN → pure-Rust ~/.config/gh/hosts.yml → pure-Rust ~/.netrc → cached gh auth token --hostname only as last-resort fallback.
    • Enforce user-only mutation guards (scope.identity.agent().is_none()), verify expected_head_sha against live PR head.sha before publishing reviews, fast-path PR file diffs via local gix objects when base_sha & head_sha are present locally, and render inline GitHubThreadCard threads (with live Reply and 1-click Ask Agent handoff), pending PR review comments (mapped only onto valid GitHub patch hunk lines), and a Submit review (Comment / Approve / Request changes) popover.
  • Inline Local Review Annotations & Live Prompt Delivery:
    • Add gutter + / toolbar inline review notes on both diffs and source files, backed by a per-session ReviewStore and ReviewBatchBar that formats file + line range + code excerpts into Markdown and either inserts into the Composer draft (Add to prompt) or dispatches immediately (Send review / Send now, steering active runs and rolling back drafts only after host acceptance).
  • Symbol Navigation with Opportunistic Local LSP + Lexical Fallback:
    • Add codeDefinition, codeReferences, and codeHover on the agent contract. LspPool auto-detects installed local Language Servers (rust-analyzer, typescript-language-server, vtsls, basedpyright-langserver, pyright-langserver, pylsp, gopls, clangd, sourcekit-lsp, zls, lua-language-server) with workspace-containment URI filtering, didOpen/didChange disk synchronization, bounded latency/idle TTL, and negative-cache cooldowns, falling back seamlessly to a capability-scoped declaration/reference index when no server is installed or responsive.
    • Upgrade CurrentFile (<= 2 MiB text files) to <Editor readOnly> with Cmd+Hover link underlines, Cmd+Click / F12 Go to Definition, Shift+F12 Find References (SymbolLocationsDrawer), hover signature/doc cards, Mod+F find bar, and #L20 / #L20-L35 / path:line:col link range reveal.

Verification

Ran locally and passed:

  • cargo nextest run -p maka-fs-tools (42/42 tests covering GitDiff before/after, workspace_diff, branch merge-base compare & commit diffs, remote repo URL parsing, lexical symbol definition/references/hover, mock stdio LSP definition/hover & stale-buffer didChange sync, unmaterialized private_root, and outside-workspace URI filtering)
  • cargo nextest run -p maka-agent-api
  • cargo nextest run -p maka-agent-native --lib -E 'test(github::tests)' (covering pure-Rust gh/hosts.yml & .netrc parsing, GitHub REST endpoints, expected_head_sha mismatch protection, and agent-identity mutation rejection)
  • cargo nextest run --manifest-path products/maka/client/Cargo.toml
  • cargo nextest run -p maka-workbench --lib (including #L20, #L20-L35, #L20C5, and path:line:col link parsing)
  • node scripts/ci.mjs run contracts (generate.mjs check, SDK acceptance tsc, bundle tsc, and workbench ui_types)
  • node scripts/ci.mjs check tooling-tests (290/290 tests including conversation-resources.test.mjs covering openChanges, openDiff across working/branch/commit/PR sources, back/forward history, buildPatchLineMap, Viewed digest invalidation, and ReviewStore batch formatting)
  • node scripts/ci.mjs run product
  • node scripts/ci.mjs check licenses and node scripts/ci.mjs check notices
  • cargo fmt --check and biome format check

Not run locally:

  • Cross-platform Windows / Linux desktop runner suites (linux-desktop, Windows native tests).

Desktop verification screenshots (isolated maka desktop instance):

GitHub PR Review Hub with auto-detected #6974 and Viewed progress

PR single-file diff with file stepper, inline PR comment, and Viewed toggle

Submit GitHub PR review popover with Approve, Comment, and Request changes

Local branch merge-base (rust-preview...HEAD) review mode

Single-file diff inline review note and batch bar

Live clangd LSP symbol navigation and references

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Maka (Antigravity / Gemini) authored the backend Git/GitHub/symbol/LSP implementation, workbench UI components, tests, and live desktop verification.

Checklist

  • Tests cover the change and fail without it
  • Format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@M4n5ter M4n5ter changed the title feat(workbench): add code review diff annotations and symbol navigation feat(workbench): add local branch/commit review, GitHub PR review, and symbol navigation Nov 17, 2026
Add built-in code review and symbol navigation across workbench diffs, source files, and session prompts, backed by opportunistic local Language Servers with automatic lexical-index fallback.

Generated-by: Maka (Antigravity / Gemini)
Fix external review prompt delivery without clobbering Composer drafts or dropping notes when blocked, enforce Directory capability containment and process-group Drop cleanup in LspPool, restore CurrentFile snapshot reactivity, and tighten URI scheme and file:// anchor handling.

Generated-by: Maka (Antigravity / Gemini)
@M4n5ter
M4n5ter force-pushed the feat/code-review-navigation branch from 812db4c to d2d3b90 Compare November 17, 2026 13:19
@M4n5ter
M4n5ter merged commit 4d4a450 into rust-preview Nov 17, 2026
12 of 14 checks passed
@M4n5ter
M4n5ter deleted the feat/code-review-navigation branch November 17, 2026 13:26
liugddx added a commit that referenced this pull request Nov 18, 2026
4d4a450 (#6974) merged the per-source ignore matchers into one
GitignoreBuilder and added them as .rgignore, .ignore, .gitignore. The
ignore crate lets the last matching rule win, so the priority was reversed:
.gitignore overrode .rgignore, and `!keep.cache` in .rgignore no longer
rescued a file excluded by `*.cache` in .gitignore. Add the sources weakest
first: .git/info/exclude, .gitignore, .ignore, .rgignore.

The regression went unnoticed because files/tests.rs had been unreferenced
since #6713. Re-attach it; the test that covers this now passes and fails
without the fix. Also restore the test-only template()/flat() helpers that
#6713 removed together with baseline/tests.rs, and re-attach that module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Generated-by: Claude Code
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