Skip to content

feat(review): add aggregate fix-handoff block renderer - #5788

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nghetienhiep:fix/issue-5102
Jul 14, 2026
Merged

feat(review): add aggregate fix-handoff block renderer#5788
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nghetienhiep:fix/issue-5102

Conversation

@nghetienhiep

Copy link
Copy Markdown
Contributor

Summary

Real example output

For a held PR with 2 blocking findings (InlineFinding[] — same fixture shape the existing buildFixHandoffBlock tests use):

<!-- loopover:fix-handoff-aggregate -->
**Fix handoff — 2 findings across this PR**
1. **Blocker at `src/auth.ts:42`** — Null check missing before dereferencing `session.user`.

if (!session.user) return null;

2. **Nit at `src/routes/profile.ts:18`** — Prefer the shared `formatDisplayName` helper over inlining the join here.

_This is a suggestion for your own local coding agent to apply — gittensory does not write to your repository._

Recommendation (not implemented here — the maintainer's call per #5102)

Wire this alongside the existing per-finding blocks, gated by the SAME LOOPOVER_REVIEW_FIX_HANDOFF + review.fixHandoff toggle (no new config surface needed) — a repo that already opted into fix-handoff gets both forms, matching CodeRabbit's own choice to ship both rather than pick one. The per-finding blocks stay useful for reviewing one thing at a time inline; the aggregate block is what a contributor would paste for a single "fix everything this PR flagged" agent run. Happy to do the wiring PR once you confirm the shape above is right.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused (one render function + its tests) and does not mix unrelated changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves — Closes #5102.

Validation

  • git diff --check
  • npm run typecheck — clean
  • npm run test:coverage — full unsharded run green; the new function's lines and branches (empty list, single vs. plural wording, line vs. no-line, suggestion present/absent, both markers) are covered by test/unit/fix-handoff-render.test.ts
  • Full vitest run unit suite green (fix-handoff-render, fix-handoff-collapsible, queue-4 — the suites that already exercise this feature family)

If any required check was skipped, explain why:

  • npm run test:workers, build:mcp, test:mcp-pack, ui:openapi:check, ui:lint, ui:typecheck, ui:build — not exercised; this change is confined to src/review/fix-handoff-render.ts + its test file, touches no Worker binding, MCP surface, OpenAPI schema, or apps/loopover-ui/** code, and is not wired into any live code path yet.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, PATs, private keys, raw trust scores, private rankings, or private maintainer evidence exposed — the new function renders only fields InlineFinding already carries, which are made public-safe upstream by composeInlineFindings before they ever reach this renderer (same contract as the existing per-finding block).
  • Public GitHub text stays sanitized, low-noise, and implies no compensation guarantees or optimization tactics — reuses the exact LOCAL_WRITE_BOUNDARY "gittensory does not write to your repository" text every other local-execution artifact carries.
  • Auth/cookie/CORS/GitHub App/Cloudflare/session — N/A, none changed.
  • API/OpenAPI/MCP — N/A, none changed.
  • UI changes — N/A. This is a backend markdown-block renderer, not wired into apps/loopover-ui.
  • Public docs/changelogs — N/A. Not wired into any emission path yet, so the existing LOOPOVER_REVIEW_FIX_HANDOFF docs text (which already describes the flag generically) doesn't need updating for a prototype that isn't live.

Notes

Closes #5102

Adds buildFixHandoffAggregateBlock, the aggregate sibling of the
existing per-finding buildFixHandoffBlock/buildFixHandoffBlocks
(JSONbored#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 (JSONbored#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 JSONbored#5102
@nghetienhiep
nghetienhiep requested a review from JSONbored as a code owner July 14, 2026 15:50
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5788   +/-   ##
=======================================
  Coverage   95.06%   95.07%           
=======================================
  Files         580      580           
  Lines       46156    46169   +13     
  Branches    14804    14810    +6     
=======================================
+ Hits        43880    43893   +13     
  Misses       1516     1516           
  Partials      760      760           
Flag Coverage Δ
shard-1 43.41% <100.00%> (-0.53%) ⬇️
shard-2 35.88% <7.69%> (+0.13%) ⬆️
shard-3 32.22% <7.69%> (-0.06%) ⬇️
shard-4 31.20% <7.69%> (-1.75%) ⬇️
shard-5 32.51% <7.69%> (+0.76%) ⬆️
shard-6 44.97% <7.69%> (+0.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/review/fix-handoff-render.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 14, 2026
@loopover-orb

loopover-orb Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-14 15:56:25 UTC

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

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a clean, well-scoped render-only slice adding buildFixHandoffAggregateBlock, the aggregate sibling to the existing per-finding buildFixHandoffBlock, mirroring the established pattern (#4053) of landing render logic before its own wiring PR. The function is pure, null-safe on empty input, and reuses the same public-safe/boundary-safe contract as the existing per-finding renderer. Test coverage is thorough, exercising both arms of the line/no-line branch, singular/plural wording, suggestion-present/absent/whitespace-only, and the distinct HTML marker — all changed lines appear covered.

Nits — 5 non-blocking
  • The external brief's 'magic numbers' flags (issue references like Research + prototype AI-agent-ready copy-paste fix suggestions (CodeRabbit-inspired) #5102, feat(review): emit fix-handoff blocks into the unified review comment (#1962) #4053) are just doc-comment issue citations, not real magic numbers — not actionable.
  • fix-handoff-render.ts: fixHandoffAggregateItem duplicates markdownPathCodeText/hasLine/location/label logic from buildFixHandoffBlock almost verbatim; consider extracting a shared helper to avoid drift between the two renderers.
  • The suggestion-block indentation in fixHandoffAggregateItem uses a fixed 3-space prefix (`\n `) that assumes single-digit list numbering; findings 10+ would misalign under GitHub's markdown list rules, worth a comment or guard if PRs can realistically exceed 9 findings.
  • Consider factoring the shared location/label composition between buildFixHandoffBlock and fixHandoffAggregateItem into one helper to keep the two renderers in sync.
  • Since this PR is explicitly render-only and unwired, confirm the wiring PR will also cover the open question of per-finding vs aggregate vs both placement, as the doc comment states.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #5102
Related work ⚠️ 2 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 14 registered-repo PR(s), 8 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor nghetienhiep; Gittensor profile; 14 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence. LLM value judgment: moderate — This adds a real, tested, self-contained rendering capability (the aggregate fix-handoff block) that directly extends an already-shipped pattern and closes the research half of a linked issue, though it delivers no user-visible behavior until a follow-up wiring PR lands.
Linked issue satisfaction

Partially addressed
The PR delivers a concrete aggregate fix-handoff renderer plus tests, and its description ties back to real research (specific PRs inspected, noting CodeRabbit's own aggregate feature isn't renderable as embeddable markdown), covering the 'design gittensory's own version' and part of the 'where data already exists' deliverables. However, the issue explicitly asks for a short research writeup (with

Review context
  • Author: nghetienhiep
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 14 PR(s), 0 issue(s).
  • Related work: Titles/paths share 3 meaningful terms. (issue #4801, issue #5102)
  • Related work: Titles/paths share 3 meaningful terms. (issue #4803, issue #5102)
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Check active issues and PRs before submitting.
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.
[BETA] Chat with Gittensory

Ask Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands

🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit e261e63 into JSONbored:main Jul 14, 2026
15 checks passed
This was referenced Jul 14, 2026
This was referenced Jul 15, 2026
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.

Research + prototype AI-agent-ready copy-paste fix suggestions (CodeRabbit-inspired)

1 participant