You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Milestone: M1
High-rebase-collision risk: codex churns processors.ts (maybePublishPrPublicSurface), comments.ts, and signals/engine.ts across other gittensory worktrees. Keep convergence edits minimal + flag-gated and rebase onto main before in-flight codex PRs touching those files settle.
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, behindenv.UNIFIED_REVIEW_COMMENT(default"false"). The CLOSED/skipped-PR path is still unconditional legacy:maybePublishPrPublicSurface(processors.ts:1339) postsbuildClosedPrPanelUpdate(repoFullName, pullNumber)(processors.ts:1284) — a hardcoded> [!NOTE] Gittensory Gate skippedtable — with NO flag check, so with the flag ON an open PR's unified comment is overwritten by the legacy panel on close (same markergittensory-pr-panel:v1). There is also NOprocessGitHubWebhook → maybePublishPrPublicSurface → commentintegration test. This closes out PR #1007.Deliverables
buildClosedPrPanelUpdate, processors.ts:1284, posted at :1339 withcreateIfMissing:false) through the unified renderer behindisUnifiedReviewCommentEnabled; the bridgegateConclusionToVerdictalready mapsskipped → comment, so add a closed-state branch inunified-comment-bridge.ts.PR_PANEL_COMMENT_MARKER— it is duplicated as a literal inunified-comment-bridge.ts:34vs the canonicalcomments.ts:4; import the one fromcomments.tsand confirm the legacy marker aliases (gittensory-pr-intelligence,gittensory-agent-command, comments.ts:7-8) still upsert in place (comments.ts:68markerAliases).processGitHubWebhook → maybePublishPrPublicSurface → commentintegration test (none exists; useTestD1Database, test/helpers/d1.ts) asserting: flag-OFF = legacy body, flag-ON = unified body, exactly ONE marker present, identical Gittensory Gate conclusion both ways.consensusDefectis not shown twice (once as a gate-blocker row, once as a Code-review blocker) when the flag is ON —runAiReviewForAdvisorymutatesadvisory.findingswithai_consensus_defectBEFORE the gate, and the unified comment surfaces it again as a reviewer blocker.sanitizePublicCommentat processors.ts:1647 today (relies on per-input construction safety — AI notes viatoPublicSafe, gate blockers viasanitizeForCheckRun, panel rows viasanitizePanelText). Prove construction-safety for every field fed intobuildUnifiedCommentBody, OR add a sanitize pass.UNIFIED_REVIEW_COMMENTto SHADOW on one repo.Acceptance criteria
buildClosedPrPanelUpdateno longer surfaces under the flag.gittensory-pr-panel:v1marker per PR; the comment upserts in place (no duplicate posts).Notes
processors.ts(maybePublishPrPublicSurface),comments.ts, andsignals/engine.tsacross other gittensory worktrees. Keep convergence edits minimal + flag-gated and rebase onto main before in-flight codex PRs touching those files settle.