Skip to content

Finish the unified PR comment (close out PR #1007) #1011

Description

@JSONbored

Part of #983.

Context

The unified PR comment is natively re-ported into gittensory (src/review/unified-comment.ts + src/review/unified-comment-bridge.ts, zero reviewbot imports) and wired into the OPEN-PR path only, behind env.UNIFIED_REVIEW_COMMENT (default "false"). The CLOSED/skipped-PR path is still unconditional legacy: maybePublishPrPublicSurface (processors.ts:1339) posts buildClosedPrPanelUpdate(repoFullName, pullNumber) (processors.ts:1284) — a hardcoded > [!NOTE] Gittensory Gate skipped table — with NO flag check, so with the flag ON an open PR's unified comment is overwritten by the legacy panel on close (same marker gittensory-pr-panel:v1). There is also NO processGitHubWebhook → maybePublishPrPublicSurface → comment integration test. This closes out PR #1007.

Deliverables

  • Route the closed/skipped-PR panel (buildClosedPrPanelUpdate, processors.ts:1284, posted at :1339 with createIfMissing:false) through the unified renderer behind isUnifiedReviewCommentEnabled; the bridge gateConclusionToVerdict already maps skipped → comment, so add a closed-state branch in unified-comment-bridge.ts.
  • Single-source PR_PANEL_COMMENT_MARKER — it is duplicated as a literal in unified-comment-bridge.ts:34 vs the canonical comments.ts:4; import the one from comments.ts and confirm the legacy marker aliases (gittensory-pr-intelligence, gittensory-agent-command, comments.ts:7-8) still upsert in place (comments.ts:68 markerAliases).
  • Add the FIRST processGitHubWebhook → maybePublishPrPublicSurface → comment integration test (none exists; use TestD1Database, test/helpers/d1.ts) asserting: flag-OFF = legacy body, flag-ON = unified body, exactly ONE marker present, identical Gittensory Gate conclusion both ways.
  • Verify the AI consensusDefect is not shown twice (once as a gate-blocker row, once as a Code-review blocker) when the flag is ON — runAiReviewForAdvisory mutates advisory.findings with ai_consensus_defect BEFORE the gate, and the unified comment surfaces it again as a reviewer blocker.
  • Confirm both comment branches are public-safe: neither the unified nor the legacy branch calls sanitizePublicComment at processors.ts:1647 today (relies on per-input construction safety — AI notes via toPublicSafe, gate blockers via sanitizeForCheckRun, panel rows via sanitizePanelText). Prove construction-safety for every field fed into buildUnifiedCommentBody, OR add a sanitize pass.
  • Flip UNIFIED_REVIEW_COMMENT to SHADOW on one repo.

Acceptance criteria

  • Open and closed PRs render through the SAME unified renderer when the flag is ON; the legacy buildClosedPrPanelUpdate no longer surfaces under the flag.
  • Exactly one gittensory-pr-panel:v1 marker per PR; the comment upserts in place (no duplicate posts).
  • The new integration test passes for both flag states and asserts an identical Gittensory Gate conclusion.
  • No private framing (reward/score/wallet/rubric/path/threshold) can leak into either comment branch.

Notes

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions