feat(review): emit fix-handoff blocks into the unified review comment (#1962)#4053
Conversation
…ment (JSONbored#1962) The fix-handoff renderer (JSONbored#2175), its config/gate resolver (JSONbored#2176), the review.fixHandoff manifest toggle, and the follow-up-issue local-write action (JSONbored#2177/JSONbored#2185) all landed, but buildFixHandoffBlocks had no caller — the blocks were never emitted. Wire the final piece: append a "Fix handoff" collapsible to the unified review comment, one machine-readable block per inline finding a contributor's own local coding agent can consume (content only, no server-side write — every block carries the LOCAL_WRITE_BOUNDARY). Mirrors the impact-map / finding-category collapsible slices exactly: a pure buildFixHandoffCollapsible in the bridge (null on empty) plus an optional fixHandoffBlocks arg, fed at the publish site from THIS pass's inline findings (same source as findingCategories) only when shouldEmitFixHandoff ANDs the operator GITTENSORY_REVIEW_FIX_HANDOFF flag, the per-repo review.fixHandoff manifest opt-in, and the convergence allowlist. Default-OFF ⇒ the processor passes nothing ⇒ the rendered comment is byte-identical. Closes JSONbored#1962.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-07 16:13:44 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 4 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4053 +/- ##
=======================================
Coverage 93.59% 93.59%
=======================================
Files 379 379
Lines 35575 35582 +7
Branches 13044 13049 +5
=======================================
+ Hits 33295 33302 +7
Misses 1618 1618
Partials 662 662
🚀 New features to boost your workflow:
|
Adds buildFixHandoffAggregateBlock, the aggregate sibling of the existing per-finding buildFixHandoffBlock/buildFixHandoffBlocks (#2175): it combines every InlineFinding into ONE fix-handoff block for a single local-agent run over the whole PR, instead of one run per finding. Mirrors CodeRabbit's split between a per-finding "Prompt for AI Agents" collapsible and its separate aggregate "Fix all issues" prompt. Render slice only, same as buildFixHandoffBlock was before its own wiring PR (#4053) -- not wired into the unified comment here. Reuses the exact public-safe/boundary-safe contract already established by the per-finding renderer (InlineFinding fields are sanitized upstream by composeInlineFindings; same LOCAL_WRITE_BOUNDARY text). Closes #5102 Co-authored-by: nghetienhiep <13849419+nghetienhiep@users.noreply.github.com>
Summary
Wires the final, missing piece of the fix-handoff feature: emission. The renderer (
buildFixHandoffBlock(s), #2175), its config/gate resolver (shouldEmitFixHandoff, #2176), thereview.fixHandoffmanifest toggle, and the follow-up-issue local-write action (#2177/#2185) all landed in prior slices — butbuildFixHandoffBlockshad no caller, so the blocks were never actually shown. This appends a "Fix handoff" collapsible to the unified review comment: one machine-readable "apply this fix" block per inline finding that a contributor's own local coding agent can consume (content only — every block carries theLOCAL_WRITE_BOUNDARY, no server-side write to contributor code).Closes #1962
Design
Mirrors the merged impact-map / finding-category collapsible slices exactly, so it's a familiar additive shape:
src/review/unified-comment-bridge.ts: a purebuildFixHandoffCollapsible(blocks)(returnsnullon empty, so it chains unconditionally) + an optionalfixHandoffBlocks?bridge arg, appended inbuildUnifiedCommentBodyright after the Impact map section (another structural, no-AI collapsible) and ahead of the visual preview.src/queue/processors.ts: resolvesfixHandoffEnabledForReviewonce per pass viashouldEmitFixHandoff, which ANDs the operatorGITTENSORY_REVIEW_FIX_HANDOFFkill-switch, the per-reporeview.fixHandoffmanifest opt-in, and the convergence allowlist. The blocks are built at the publish site from this pass's inline findings — the exact sameaiReview.inlineFindingssourcefindingCategoriesuses, so a cache hit never re-emits them.review.fixHandofftoggle already parses inpackages/gittensory-engine), no DB migration, no generated-file changes.Tests
test/unit/fix-handoff-collapsible.test.ts(new):buildFixHandoffCollapsiblerenders one block per finding under a single collapsible (blocker + suggestion, and a path-only nit), carries the no-server-side-write boundary, returnsnullon empty, isn't raw HTML; andbuildUnifiedCommentBodyappends the section when blocks are present, omits it when absent/empty (flag-OFF parity), and coexists with the Impact map + Visual preview sections.test/unit/queue.test.ts: an end-to-end review withGITTENSORY_REVIEW_FIX_HANDOFF+review.fixHandoffon emits the "Fix handoff" collapsible with the per-finding block (location anchor, instruction, suggested change) into the published unified comment.Validation
git diff --check— clean.npm run typecheck— clean.npm run test:coverage(full, unsharded) — no logic failures;codecov/patchpredicted 100% of the changedsrc/**lines and branches (bridge builder + both chain sides + the processor resolve/emit branch). Only the known Windowsspawn claude/codex/docker ENOENTenv suites fail locally (green on Linux CI).If any required check was skipped, explain why:
test:workers/build:mcp/ui:*/actionlint/npm auditwere not run locally — this is an additive backend review-rendering slice touching no worker entrypoint, MCP package, UI, workflow, or dependency; CI covers them.Safety
InlineFinding.body/suggestion, already sanitized upstream bycomposeInlineFindings; the collapsible adds only fixed label/marker strings.review.fixHandofftoggle is already documented in the example config).UI Evidence
N/A — backend review-comment rendering; no dashboard/frontend/extension surface. (The rendered section is exercised by the unit + integration tests above.)
Notes