Skip to content

evidence: browser pointer markers from verified CDP capture geometry #229

Open

Description

@ElbertePlinio

Problem

Evidence reports mark desktop pointer actions since #199. Browser captures have no markers. The browser evidence recorder (packages/browser/src/devtools-evidence.ts) is a passive JSON-RPC proxy in front of chrome-devtools-mcp. It sees tool arguments and responses, but not the capture rectangle, viewport, scroll offset, device pixel ratio or page identity. Without those facts, a point cannot be placed on a screenshot.

Where it was found

Planning for #200. Moved out of #200 by maintainer decision, because it needs new infrastructure.

Findings from the #200 design brainstorm

  • chrome-devtools-mcp 1.5.0: take_screenshot accepts format, quality, uid, fullPage and filePath. Downscale limits are launch options. click takes uid and dblClick; drag takes from_uid and to_uid. click_at and the screencast tools need experimental flags that Pickforge does not pass.
  • A second CDP connection can read layout metrics, scroll and DPR without model-visible calls. It cannot reliably tell which page the upstream server selected, or see its exact capture request.
  • Candidate design: a loopback CDP transport observer between the child and Chromium. It observes target routing, Page.captureScreenshot requests and Input.dispatchMouseEvent points, plus bounded private geometry reads. It stores no raw CDP messages.
  • Upstream risk: at DPR 2 with a downscale limit, a scrolled element capture used the wrong crop origin and returned a blank image. Metadata must describe the actual request and returned pixels.
  • The MCP evidence wrapper sets xvfb-root directly (packages/mcp-server/src/evidence.ts). A neutral hook such as { space, identity: () => Promise<string | undefined> }, compared by string equality, avoids browser branches there.

Acceptance criteria

  • Each browser capture records its actual source rectangle in CSS pixels, output size, DPR, scroll and viewport state, and an opaque page identity.
  • Fractional CSS coordinates are kept until render.
  • UID actions get a marker only when the dispatched point is observed and correlated. Otherwise they stay unmarked.
  • MCP tool lists, arguments and responses stay byte-identical. Captured PNGs never change.

Checklist

  • CDP transport observer with transparency tests (full MCP stream compared with recording on and off)
  • Capture geometry and page identity per screenshot
  • Evidence-only paired captures behind human configuration, default off
  • Viewer projection for browser captures
  • Tests: DPR 1 and 2, zoom, scroll, full page, element crop, downscale, navigation, tabs, frames
  • Release note

Refs #199, #200.

Activity

  1. added
    enhancement
    on Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions