-
-
Notifications
You must be signed in to change notification settings - Fork 90
feat(review): wire up existing pixel-diff into a 'Diff' column (self-host) #3674
Copy link
Copy link
Closed
Labels
maintainer-onlyOwner-only work — yields no Gittensor points.Owner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)On the Wave-2 agent-layer roadmap board (project 9)visualUI/web visual work — owner-led, NOT for Gittensor contributors (extensions excepted)UI/web visual work — owner-led, NOT for Gittensor contributors (extensions excepted)
Description
Metadata
Metadata
Assignees
Labels
maintainer-onlyOwner-only work — yields no Gittensor points.Owner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)On the Wave-2 agent-layer roadmap board (project 9)visualUI/web visual work — owner-led, NOT for Gittensor contributors (extensions excepted)UI/web visual work — owner-led, NOT for Gittensor contributors (extensions excepted)
Context
Phase 2 of the visual-evidence upgrade (epic #3607, following #3667's full-page screenshot fix). A complete, tested pixel-diff implementation already exists at
src/visual-agent/visual-diff.ts(compareRouteScreenshots/compareVisualCaptureSets— pixelmatch + pngjs, changed-pixel %, diff-PNG output, full coverage intest/unit/visual-diff.test.ts) but has zero production callers. It was ported during the reviewbot→gittensory convergence and never wired up.Constraint (already verified, not a new investigation)
test/unit/worker-entry-boundary.test.tsstatically assertsvisual-agent/pixelmatch/pngjsare unreachable from the Worker bundle entry (src/index.ts) — this is deliberate (NodeBuffer-dependent code, not guaranteed in the Workers runtime), not an oversight. The test only walks the import graph fromsrc/index.ts, so any code path reachable only fromsrc/server.ts(self-host) is unaffected by the boundary.Deliverables
compareRouteScreenshots/compareVisualCaptureSetsfrom a self-host-only code path (reachable only fromsrc/server.ts, confirmed never reachable fromsrc/index.ts) — reuse the existing module as-is, do not reimplement.unified-comment-bridge.ts'sbuildBeforeAfterCollapsible(currently a hardcoded 4-column table: Route | Viewport | Before | After) with a 5th "Diff" column, showing the diff-PNG whenchangedPixelPercentclears the module's noise threshold (default 0.05%), a dash otherwise. Match the existing column's cell-escaping/link pattern (attr()helper,<a href><img></a>).DecompressionStream("deflate")feeding raw pixels intopixelmatchdirectly, since pixelmatch itself has no Node dependency).worker-entry-boundary.test.tsstill passes after wiring (proves the boundary wasn't violated).Expected outcome
The "Visual preview" comment gains a Diff column making a visual change self-evident (a highlighted diff image) rather than requiring a reviewer to eyeball two full-page images side by side — for self-hosted repos (which covers the maintainer's own gittensory + metagraphed reviews today).
Part of #3607.