feat(review): render the deterministic impact map in the unified review comment (#1971) - #4056
Conversation
…ew comment (JSONbored#1971) The impact-map feature (JSONbored#2182-JSONbored#2186) computes a deterministic RAG-derived impact map and splices it into the AI-review prompt, and buildImpactMapCollapsible (unified-comment-bridge) already knows how to render it — but no production caller ever passed the entries to buildUnifiedCommentBody, so the map was invisible to the maintainer/contributor reading the PR comment. Thread the entries this pass already computed out of runAiReviewForAdvisory (next to inlineFindings) and render them as the "Impact map" collapsible at the publish site — reusing the SAME array, no second RAG query. Present only on a fresh review (a cache hit / frozen reuse carries none); empty or feature-off ⇒ buildImpactMapCollapsible returns null ⇒ the comment is byte-identical. Closes JSONbored#1971
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-07 18:04:12 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 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 #4056 +/- ##
=======================================
Coverage 93.59% 93.59%
=======================================
Files 379 379
Lines 35582 35584 +2
Branches 13049 13050 +1
=======================================
+ Hits 33302 33304 +2
Misses 1618 1618
Partials 662 662
🚀 New features to boost your workflow:
|
Summary
Renders the deterministic impact map in the unified review comment. The impact-map feature (#2182-#2186) already computes a RAG-derived "which other modules plausibly need a second look" map and splices it into the AI-review prompt, and
buildImpactMapCollapsible(src/review/unified-comment-bridge.ts) already knows how to render it — but no production caller ever passed the entries tobuildUnifiedCommentBody, so the map was invisible to the human reading the PR comment; only the model saw it.This threads the entries this pass already computed out of
runAiReviewForAdvisory(right next toinlineFindings) and renders them as the "Impact map" collapsible at the publish site — reusing the same array, so there is no second RAG query.Closes #1971
Design
runAiReviewForAdvisory: the block-scopedimpactMapcomputed for the prompt is hoisted to a function-scopedimpactMapEntriesand added to the review result (a new optionalimpactMap?: ImpactMapEntry[]field, mirroringinlineFindings).maybePublishPrPublicSurface): passesimpactMap: aiReview?.impactMap ?? []tobuildUnifiedCommentBody, right afterfindingCategories.ImpactMapEntryIS the bridge'sImpactMapSummaryInputshape (documented as such), so it's a zero-transform pass-through.shouldComputeImpactMapANDs the operatorGITTENSORY_REVIEW_IMPACT_MAPflag with the per-reporeview.impact_mapmanifest opt-in. A cache hit / frozen reuse / skipped review carries none (undefined ⇒ []), andbuildImpactMapCollapsiblereturnsnullfor an empty list — so no section renders and the comment is unchanged. No new flag, no config surface, no migration.Tests
test/unit/impact-map-processor-wiring.test.ts: extended the flag-on case to assert the review result now carries the threadedimpactMapentries (correctchangedModule+affectedModules), so the publish site has real data to render.buildUnifiedCommentBody→ "Impact map" collapsible) is already covered bytest/unit/impact-map-collapsible.test.ts(section present with entries, absent/empty without); the new publish-site pass-through's branches (present vs cache-hit/skipped) are exercised by the existing full-review + cache-hit queue tests.Validation
git diff --check— clean.npm run typecheck— clean.npm run test:coverage(full, unsharded) — no logic failures;codecov/patch= 100% of the changedsrc/**lines and branches. 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 change touching no worker entrypoint, MCP package, UI, workflow, or dependency; CI covers them.Safety
GITTENSORY_REVIEW_IMPACT_MAP+review.impact_mapare already documented).UI Evidence
N/A — backend review-comment rendering; no dashboard/frontend/extension surface.
Notes
computeImpactMap's RAG-retrieval output, labelled "from the codebase index, not an AI guess" by the existing renderer. No extraenv.AI.runcall — the entries are the ones the prompt already used.