Skip to content

review: remove the legacy comment renderer (#6103) - #6128

Merged
JSONbored merged 2 commits into
mainfrom
review/remove-legacy-comment-renderer
Jul 15, 2026
Merged

review: remove the legacy comment renderer (#6103)#6128
JSONbored merged 2 commits into
mainfrom
review/remove-legacy-comment-renderer

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Removes buildPublicPrIntelligenceComment and buildMinimalInviteComment from packages/loopover-engine/src/signals/engine.ts — the converged renderer (renderUnifiedReviewComment / buildUnifiedCommentBody) has been the only comment-rendering path reachable from the queue processor since the earlier convergence work, and this was the last dead call site.
  • Migrates the one remaining live caller — the maintainer dashboard's Settings Preview sample comment (buildSamplePreviewComment in src/signals/settings-preview.ts) — onto the converged renderer, synthesizing a sample gate evaluation with the same enabled/hard-linked-issue-block heuristic the legacy renderer used internally.
  • Collapses the now-dead unifiedCommentAllowed branch in src/queue/processors.ts into an unconditional call, falling back to a synthesized "skipped" gate evaluation (mirroring the existing buildClosedUnifiedCommentBody pattern) when no real gate evaluation ran.
  • Documents LOOPOVER_REVIEW_UNIFIED_COMMENT as functionally inert in src/env.d.ts (kept only so an operator's existing deployment config doesn't error).
  • Leaves shared machinery both renderers depended on untouched: buildPublicPrPanelSignalRows, buildPublicSafeCollapsibles, publicSafePreflightFindings, gate-row helpers, contributorNextStepsBody, and the sanitizer boundary.
  • Migrates/removes tests that exercised only the deleted renderer's unique template, and adds coverage for buildSamplePreviewComment's new simulated-gate branches (enabled/disabled, linked-issue block pass/fail), which had no prior test.

Test plan

  • npx tsc --noEmit clean
  • npm run test:coverage (unsharded): 882 files / 16993 tests passed, 0 failures
  • npm audit --audit-level=moderate: 0 vulnerabilities
  • npm run test:ci (full local gate incl. drift checks, engine parity, MCP/miner packs, UI build): green
  • Rebased onto latest origin/main, no conflicts

…Comment)

The legacy renderer had two production callers: the webhook/queue
comment-publish path (already unreachable -- no cloud/hosted deployment
processes review webhooks) and, less obviously, the maintainer
dashboard's Settings Preview feature (a live HTTP API endpoint,
unconditional, no flag gating). Migrated the latter onto the converged
renderer first (buildSamplePreviewComment now calls
buildPublicPrPanelSignalRows + buildUnifiedCommentBody, with a
synthesized sample gate verdict mirroring the same
enabled/hard-linked-issue-block heuristic the legacy renderer used
internally), which brought buildPublicPrIntelligenceComment to zero
remaining callers.

Deleted from packages/loopover-engine/src/signals/engine.ts:
buildPublicPrIntelligenceComment, buildMinimalInviteComment, and their
private-only helpers (footerEarnUrl, formatAlertBlock,
aiReviewMainHasBlockers, escapeAiReviewMarkdown, escapeTableCell) --
~300 lines of genuinely legacy-exclusive code. Every shared helper the
two functions called (buildPublicPrPanelSignalRows,
buildPublicSafeCollapsibles, publicSafePreflightFindings, etc.) stays,
since the converged renderer depends on them too.

Removed the now-dead webhook/queue branch in processors.ts
(unifiedCommentAllowed && gateEvaluation conditional + its else
fallback) -- the converged renderer now runs unconditionally. Handled
the one real behavioral edge case this surfaced: a repo with no gate
evaluation (reviewCheckMode disabled + no autonomy configured) used to
silently fall through to the legacy renderer; it now gets a synthetic
"skipped" gate for rendering purposes only (mirroring
buildClosedUnifiedCommentBody's existing pattern for the same
situation), scoped to the comment body -- the real,
possibly-undefined gateEvaluation is untouched everywhere else
(check-run/label/audit/disposition lanes).

Fixed the 5 test files that called the legacy function directly:
rewired tests exercising still-shared logic onto
buildPublicPrPanelSignalRows/buildPublicSafeCollapsibles directly
(same assertion intent, now via structured row/collapsible data
instead of scraping rendered markdown); deleted tests that were purely
exercising the deleted function's own unique formatting (panelTitle/
alert derivation, the 4-column table template, buildMinimalInviteComment's
welcome copy), each left with an explanatory comment citing why there's
no surviving equivalent to rewire onto.

Verified: full unsharded npm run test:coverage (16,822 passed, 12
skipped, 0 failed), engine-parity + manifest/docs drift checks all
clean.

Closes #6103
…branches (#6103)

Post-removal fixes surfaced by the full unsharded suite: three tests
asserted a `readiness N/100` chip that the converged renderer correctly
omits when CI is still pending (status downgrades to held) or when the
overall verdict isn't "ready", per the #6066 readiness-chip rule. Also
adds coverage for buildSamplePreviewComment's simulated gate-enabled and
linked-issue-block branches, which had no prior test exercising them.
@superagent-security

Copy link
Copy Markdown
Contributor

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

@JSONbored JSONbored self-assigned this Jul 15, 2026
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.31%. Comparing base (e4cf37e) to head (cbca389).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6128   +/-   ##
=======================================
  Coverage   95.31%   95.31%           
=======================================
  Files         595      595           
  Lines       47133    47046   -87     
  Branches    15038    14993   -45     
=======================================
- Hits        44925    44843   -82     
  Misses       1477     1477           
+ Partials      731      726    -5     
Flag Coverage Δ
shard-1 44.01% <22.22%> (+0.04%) ⬆️
shard-2 36.65% <88.88%> (-0.11%) ⬇️
shard-3 32.27% <0.00%> (+0.18%) ⬆️
shard-4 33.91% <11.11%> (-0.04%) ⬇️
shard-5 31.67% <44.44%> (+0.02%) ⬆️
shard-6 44.82% <66.66%> (+0.13%) ⬆️

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

Files with missing lines Coverage Δ
packages/loopover-engine/src/signals/engine.ts 97.66% <ø> (+0.16%) ⬆️
src/queue/processors.ts 95.69% <100.00%> (-0.01%) ⬇️
src/review/unified-comment-bridge.ts 99.60% <ø> (ø)
src/signals/settings-preview.ts 98.78% <100.00%> (+0.04%) ⬆️

@JSONbored
JSONbored merged commit 22acb93 into main Jul 15, 2026
18 checks passed
@JSONbored
JSONbored deleted the review/remove-legacy-comment-renderer branch July 15, 2026 11:28
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 15, 2026
andriypolanski pushed a commit to andriypolanski/gittensory that referenced this pull request Jul 15, 2026
…follow-up)

The unified-comment bridge became the sole PR-comment renderer in JSONbored#6128,
which left the unifiedComment ConvergedFeatureKey and its
LOOPOVER_REVIEW_UNIFIED_COMMENT env flag declared but functionally
inert. Since the drift-check gate requires every declared
LOOPOVER_REVIEW_* flag to be documented, and there was no working
precedent for a retired-but-still-required flag, this fully removes the
key/flag from the resolver, config-as-code examples, self-hosting docs,
and env declarations (regenerating worker-configuration.d.ts via
cf-typegen) rather than leaving stale references. Also fixes the
"signal table" description in docs.how-reviews-work.tsx, left over from
the earlier decision-drivers redesign (JSONbored#6083), and a timing-flaky
GraphQL single-flight test unrelated to this change but caught by the
same full-suite run (crypto.subtle.digest is backed by a real OS thread
pool, so two concurrent callers with identical inputs can complete in
either order under load; stubbed with a deterministic pure-microtask
digest for the one test that exercises the race).
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review: remove the legacy comment renderer (buildPublicPrIntelligenceComment)

1 participant