Skip to content

review: wire per-blocker AI fix-context, CodeRabbit-style - #6086

Merged
JSONbored merged 1 commit into
review/comment-decision-driver-chipsfrom
review/comment-blocker-fix-context
Jul 15, 2026
Merged

review: wire per-blocker AI fix-context, CodeRabbit-style#6086
JSONbored merged 1 commit into
review/comment-decision-driver-chipsfrom
review/comment-blocker-fix-context

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Closes #6068. Highest-value item in #6065.

Stacked on #6083 (which is itself stacked on #6077) — same file, sequential edits; this PR's diff is scoped to just the fix-context wiring.

Summary

Today's "Copy for AI agents" block is one combined prompt for the whole PR, built from the same free-text blockers: string[] shown in "Why this is blocked" — no file/line/rule metadata. Separately, buildFixHandoffBlock (src/review/fix-handoff-render.ts) already produces exactly the structured shape this needs ({ path, line, severity, instruction, suggestedChange?, body }) per AI inline finding — but it only ever rendered into its own disconnected, all-severities-combined "Fix handoff" collapsible, gated behind review.fixHandoff (default off).

This PR connects them:

  • UnifiedReviewInput gets a new optional blockerFixContext?: ReadonlyArray<{ path, line?, body }>. Rendered as its own 🔧 Copy AI fix context collapsible per entry, labeled with the finding's path:line, placed right after the blockers list — independent of the plain-text blockers (can render even with zero string blockers).
  • The bridge (buildUnifiedCommentBody) now splits args.fixHandoffBlocks by severity: blocker-severity findings feed the new per-blocker collapsibles; nit-severity findings keep going into the existing combined "Fix handoff" collapsible, unchanged.
  • Same gating as before (review.fixHandoff, operator kill-switch LOOPOVER_REVIEW_FIX_HANDOFF) — this PR does not flip any default, it only improves what renders when the feature is already on.
  • The whole-PR "Copy for AI agents" aggregate prompt is untouched and stays available as the "fix everything in one pass" option.

Test plan

  • npx vitest run test/unit/unified-comment.test.ts test/unit/unified-comment-bridge.test.ts test/unit/signals-coverage.test.ts test/unit/fix-handoff-collapsible.test.ts test/unit/review-fix-handoff.test.ts — 253/253 pass (9 new tests: renderer-level per-entry rendering/labeling/escaping/independence, bridge-level severity split incl. mixed/all-blocker/all-nit/absent/no-line-sentinel)
  • npx tsc --noEmit clean
  • npm run docs:drift-check, npm run manifest:drift-check, npm run command-reference:check — pass
  • Coverage-checked the exact diff hunks — no uncovered statements/branches within changed lines

@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (review/comment-decision-driver-chips@80484f0). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@                           Coverage Diff                           @@
##             review/comment-decision-driver-chips    #6086   +/-   ##
=======================================================================
  Coverage                                        ?   95.23%           
=======================================================================
  Files                                           ?      595           
  Lines                                           ?    47028           
  Branches                                        ?    15021           
=======================================================================
  Hits                                            ?    44786           
  Misses                                          ?     1493           
  Partials                                        ?      749           
Flag Coverage Δ
shard-1 43.95% <75.00%> (?)
shard-2 36.57% <37.50%> (?)
shard-3 31.95% <87.50%> (?)
shard-4 33.80% <100.00%> (?)
shard-5 31.46% <37.50%> (?)
shard-6 44.67% <37.50%> (?)

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

Files with missing lines Coverage Δ
src/review/unified-comment-bridge.ts 99.58% <100.00%> (ø)
src/review/unified-comment.ts 99.61% <100.00%> (ø)

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 15, 2026
@loopover-orb

loopover-orb Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 LoopOver review result - fixes required

Review updated: 2026-07-15 09:09:23 UTC

4 files · 1 AI reviewer · no blockers · readiness 80/100 · CI failing · unstable

🛑 Suggested Action - Manual Review

Review summary
This PR wires the already-existing per-finding `buildFixHandoffBlock` structured output into the unified comment as a new per-blocker "Copy AI fix context" collapsible, and updates the bridge to split `fixHandoffBlocks` by severity so blocker-severity findings feed the new per-blocker section while nit-severity findings keep populating the existing combined "Fix handoff" collapsible unchanged. The line-0/undefined-line sentinel is handled correctly (falls back to path-only label in both `unified-comment.ts:770` and the tests), and the severity split in `unified-comment-bridge.ts:754` and `:829` is symmetric and well-tested for both arms (all-blocker, all-nit, mixed, and absent). New tests in both unit-comment test files exercise labeling, isolation between the two sections, and default byte-identical behavior when the field is absent.

Nits — 5 non-blocking
  • src/review/unified-comment-bridge.ts:754/829 filters `args.fixHandoffBlocks` twice (once per severity) — a single pass with a reduce/partition would avoid the double iteration, though the array is small so this is purely stylistic.
  • The JSDoc on `blockerFixContext` in src/review/unified-comment.ts:161-174 is quite dense (14 lines) — consider trimming to the load-bearing invariants (byte-identical when absent, not correlated 1:1 with `blockers`) rather than restating the full design rationale inline.
  • Consider extracting the severity filter into a small local helper (e.g. `partitionBySeverity`) in unified-comment-bridge.ts if a third consumer of `fixHandoffBlocks` severity splitting appears later.
  • The `location` computation in unified-comment.ts:770 duplicates the `hasLine` logic already present in `buildFixHandoffBlock` (fix-handoff-render.ts) — since `FixHandoffBlock.line` is already normalized to the 0 sentinel there, this is safe, but a comment noting that reliance would help a future reader avoid redoing the check differently.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.

CI checks failing

  • validate
  • codecov/patch — 87.50% of diff hit (target 99.00%)
  • validate-tests (1)
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #6068
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: 43 registered-repo PR(s), 35 merged, 360 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 43 PR(s), 360 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor
Review context
Contributor next steps
  • Start here: Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • Then work through the remaining 3 steps in the Signals table above.
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.
🧪 Chat with LoopOver

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

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover 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/loopover-commands

🧪 Experimental — new and may change.

🟩 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 added the manual-review Gittensor contributor context label Jul 15, 2026
The structured fix-context data (path/line/instruction/suggested diff)
already existed via buildFixHandoffBlock, but only ever rendered into
its own disconnected, all-severities-combined "Fix handoff" collapsible
-- never attached to the blockers a reader is actually looking at.

Split fixHandoffBlocks by severity: blocker-severity findings now
render as their own "Copy AI fix context" collapsible directly under
each blocker (still gated by the existing review.fixHandoff toggle);
nit-severity findings keep going into the combined "Fix handoff"
collapsible as before. The whole-PR "Copy for AI agents" prompt is
unchanged and stays available as the aggregate option.

Closes #6068
@JSONbored
JSONbored force-pushed the review/comment-blocker-fix-context branch from 4de0443 to 6b99f6b Compare July 15, 2026 09:13
@JSONbored
JSONbored merged commit dca092b into review/comment-decision-driver-chips Jul 15, 2026
13 checks passed
@JSONbored
JSONbored deleted the review/comment-blocker-fix-context branch July 15, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review: wire per-blocker AI fix-context (CodeRabbit-style), not just one whole-PR prompt

1 participant