Skip to content

feat(review): render + comment-assembly for generated E2E test blocks #4193

Description

@JSONbored

Part of #4189. Depends on #4191, #4192.

Context

src/review/fix-handoff-render.ts and its integration into src/review/unified-comment-bridge.ts are the exact blueprint, verified directly:

  • The render layer is explicit that it must never re-derive safety — it trusts that gated emission already happened upstream (fix-handoff-render.ts:9-13), and produces a public-safe markdown block carrying its own HTML marker (FIX_HANDOFF_MARKER, fix-handoff-render.ts:34).
  • The bridge integration is a three-part splice, verified at the exact lines:
    • fixHandoffBlocks?: FixHandoffBlock[] | undefined on the args interface (unified-comment-bridge.ts:377)
    • buildFixHandoffCollapsible(blocks) (unified-comment-bridge.ts:657)
    • the actual splice into the collapsible chain (unified-comment-bridge.ts:794-803) — every subsequent withX link must re-base off the new variable (withFixHandoff) or that section silently disappears from the final comment.

Requirements

  • New file src/review/e2e-test-gen-render.ts with a pure buildE2eTestGenBlock(s) function turning feat(review): LLM core to turn a PR diff into Playwright E2E test source #4191's generated test source into a public-safe markdown code block (fenced ```typescript, Playwright source only — never raw model chatter) with its own HTML marker, mirroring FIX_HANDOFF_MARKER's shape.
  • Explicitly do not re-derive or re-check safety/public-safety inside this file — trust that feat(review): resolver gate for e2eTests — src/review/e2e-test-gen.ts #4192's gate and feat(review): LLM core to turn a PR diff into Playwright E2E test source #4191's parser already produced safe, validated content before this layer ever sees it, exactly matching fix-handoff-render.ts's own documented discipline.
  • Add e2eTestGenBlocks?: E2eTestGenBlock[] | undefined to UnifiedCommentBridgeArgs next to fixHandoffBlocks (unified-comment-bridge.ts:377).
  • Add buildE2eTestGenCollapsible(blocks) mirroring buildFixHandoffCollapsible (unified-comment-bridge.ts:657).
  • Splice into the collapsible chain immediately after the fix-handoff splice (unified-comment-bridge.ts:794-803), re-basing every subsequent withX link (e.g. withVisualFindings) off the new variable — get this wrong and the section silently vanishes with no error, so a rendering test that asserts the block actually appears in the final comment body is mandatory, not optional.
  • Unit + snapshot tests: block renders correctly when present, is fully absent (not an empty collapsible) when there's nothing to show, and every downstream section in the comment still renders after the splice.

Deliverables

  • src/review/e2e-test-gen-render.ts.
  • unified-comment-bridge.ts updated at all three touch points (args interface, collapsible builder, chain splice).
  • Tests proving the splice doesn't silently drop any existing section.

Expected outcome

A generated E2E test, once produced by #4191 and gated by #4192, renders as a collapsible, public-safe markdown block inside the same unified PR comment every other converged feature already posts into — no new comment, no new posting path.

Resources / examples

  • src/review/fix-handoff-render.ts (full file)
  • src/review/unified-comment-bridge.ts:372-377, 657-660, 789-807

Effort

M — mostly mechanical mirroring, but the splice-ordering test is easy to get subtly wrong.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.orbGittensory Orb related - maintainer self-hosting analytics.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions