Skip to content

Visual/screenshot capture convergence (one before/after preview path) #1021

Description

@JSONbored

Part of #983.

Context

Two visual-capture paths exist and must reconcile into ONE before/after preview path. reviewbot has core/browser-render.ts (headless HTML render via the Browser binding, degraded-fetch fallback) + agents/gittensory/{capture,shot}.ts (the taopedia-style realtime before/after screenshot pipeline: route resolution, mobile viewport, authed-route preview-session via ?preview=1/VITE_PREVIEW, the preview-session param). gittensory has src/visual-agent/visual-diff.ts (pixelmatch/pngjs, Node-only, NOT wired to any Browser binding) — so capture is a real gap while the diff is native. The Browser binding is added in #1017. Authed /app/* routes previously showed sign-in walls; the existing synthetic preview session + an honest auth-wall placeholder are the fix.

Deliverables

  • Reconcile reviewbot's browser-render/capture/shot with gittensory's visual-agent/visual-diff into ONE before/after preview path (capture from reviewbot, diff from gittensory).
  • Wire the Browser binding (coordinated with Infra bindings + adapters (LOCK DO, Vectorize, R2, Browser, private-config home, queue) #1017) for the capture step; fail-safe to no-preview / degraded-fetch when absent.
  • Preserve authed-route previews: enable the synthetic preview session on preview builds (VITE_PREVIEW + ?preview=1), authedRoutePattern/previewSessionParam, and the honest auth-wall placeholder when a route still walls.
  • Render before/after into the unified comment's capture table (parity with the existing preview surface).
  • Add tests: capture resolves routes + mobile viewport; diff produces a before/after; missing Browser binding degrades to no-preview.

Acceptance criteria

  • A single before/after preview path produces capture (Browser) + diff (pixelmatch) for visual PRs.
  • Authed /app/* routes preview via the synthetic session, not a sign-in wall; walled routes show the honest placeholder.
  • Missing/failed Browser binding degrades gracefully to no-preview, never errors the review.

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