Skip to content

feat(evidence): show the agent pointer as a view-time overlay - #218

Merged
ElbertePlinio merged 10 commits into
mainfrom
feat/199-cursor-overlay
Oct 3, 2026
Merged

ElbertePlinio merged 10 commits into
mainfrom
feat/199-cursor-overlay

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Evidence reports now show where the agent clicked, double-clicked, scrolled or dragged on desktop captures. The viewer draws the marker at view time from the recorded action. Captured PNGs and MCP tool responses do not change, so the feature costs the agent no tokens.

A marker appears only on a capture that the action explicitly links to, with its phase and pixel size. It also needs a point in the xvfb-root coordinate space and an attempted or completed input. Pickforge records xvfb-root only when the session's own Xvfb verifies before and after the action. That check never gates or redirects input, so input behavior is unchanged. Older or incomplete records render exactly as before.

Closes #199

Traceability

Requirement Verified by Scenario and edge cases Result Evidence
Producers record drag start and end, explicit capture links with phase and size, and input state; never infer the next screenshot Automated tests, device pass Click, double click, drag, scroll with a point and move, in all capture modes; input, before-capture and after-capture failures; capped runs; a published capture with failed metadata; a later desktop_screenshot Pass packages/mcp-server/test/desktop-pointer-evidence.test.ts; actions.jsonl in the gallery folder
CLI click and drag append action records Automated tests, device pass Input is dispatched before the evidence run is claimed; evidence on or off; argument errors write nothing; an append or run-start failure never changes the result or hides an input error Pass packages/cli/test/desktop-pointer-evidence.test.ts; device pass journal
SanitizedActionTarget gains xvfb-root; malformed or missing values are dropped, never guessed Automated tests Partial, negative, fractional and non-number pairs, unknown spaces, duplicate or unsafe capture links; browser x/y rounding unchanged Pass packages/core/test/evidence-sanitize.test.ts
New fields stay out of MCP tool responses Automated tests, device pass Exact response key sets in tests; 14 live MCP responses compared with origin/main: 0 shape or content-type differences; 10 capture PNGs hashed before and after: 0 changed Pass packages/mcp-server/test/desktop-pointer-evidence.test.ts; mcp-responses-*.json
Viewer draws a hollow ring and a drag line on linked captures, against the displayed image rectangle Automated tests, device pass Only when the link size equals a fully valid PNG on disk, both drag endpoints exist, and one record owns the capture. Thumbnails, letterboxed fit mode and actual size, at 1440x900 and 390x844, in report.html and report-share.html; every ring within 0.05 image px of its point (0.08 px at the 1279,799 corner); no upscaling Pass packages/core/test/evidence-markers.test.ts; screenshots 01, 04, 05, 08 to 12
Static SVG and CSS, offline CSP unchanged, overlay switch, older records unmarked Automated tests, device pass CSP and script hashes unchanged; switch by mouse, keyboard (Tab, Space, visible focus) and touch; 17 malformed or older record shapes render byte-identical to unmarked records Pass evidence-markers.test.ts; screenshots 02, 03
Attempted and completed input are distinguished Automated tests, device pass Click refused by a held human lease shows a dashed ring and an "attempted" label Pass screenshot 07
Isolation regression test against the owned Xvfb process and socket identity Automated tests, device pass Mismatched lock, socket, argv and session display; dead and recycled servers; inherited DISPLAY, WAYLAND_DISPLAY and XAUTHORITY; click and drag pass the session display to xdotool; live run with host endpoints poisoned still verified the owned Xvfb Pass packages/desktop-linux/test/pointer-target.test.ts (42 cases)
Typecheck, tests and coverage green Manual check bun run typecheck, bun run lint, bun run test:coverage at 42ce3d2: 2349 passed, 6 environment skips; coverage 86.55 / 81.44 / 87.00 / 87.55 (statements, branches, functions, lines) Pass Local run
Feature flag only if merged before its enabling release Manual check The feature is complete at merge and ships enabled in the next release, so no flag is needed Not applicable
docs/releases/UNRELEASED.md entry Manual check User-facing note added Pass docs/releases/UNRELEASED.md

PickCheck 0.4.0 --base origin/main --fail-on new,worsened,unmatched passes with no violations at 42ce3d2.

Independent xhigh reviews by Astra and Fable found no blocking issues. Their should-fix findings are fixed in this PR and rechecked by the reviewer who raised them: PNG size and validity checks, both drag endpoints, contested captures, input dispatch before the evidence claim, and display assertions in tests. Follow-ups found during this work: #219 (pointer input ownership), #220 and #224 (existing test flakes under parallel load).

Device pass evidence: ~/Artifacts/pickforge/2026-10-03/device-pass-199/manifest.html (standalone gallery at 42ce3d2, kept outside the repo). It ran headless Chromium 152 over CDP, with phone widths in Chromium emulation only. Safari, Firefox and physical phones were not tested. xterm is not installed on the test host, so the live journey used a zenity text window.

Pointer input still does not verify Xvfb ownership itself; typing does. That gap predates this change and is tracked in #219.

Declare the capture link, input state, drag start and xvfb-root coordinate
space fields, plus an evidence-only owned display check stub. Refs #199.
Share the typing ownership checks with verifyOwnedDisplayTarget, an
evidence-only check that never gates input. The isolation regression test
covers mismatched ownership, dead and recycled servers, and inherited host
endpoints. Refs #199.
Sanitize drag starts, the xvfb-root coordinate space and capture links.
Overlay a ring and a drag line on explicitly linked captures, with dashed
markers for attempted input and a CSS-only switch. Refs #199.
MCP pointer tools record drag starts, input state, capture links and the
verified coordinate space without changing tool responses. CLI click and
drag append best-effort action records. Refs #199.
Extract the best-effort run start, the post-input record step and the
sanitizer predicates. Behavior is unchanged. Refs #199.
Read each admitted PNG header, require both drag endpoints, and leave a
capture unmarked when more than one record claims it. Refs #199.
Only the config read and the bounded ownership check run before input.
Tests now assert the display each ownership check verifies. Refs #199.
Reuse the share report's full PNG validation for both reports, so a file
with a valid header but broken image data stays unmarked. Refs #199.
@ElbertePlinio
ElbertePlinio merged commit cf233c8 into main Oct 3, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the feat/199-cursor-overlay branch October 3, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

evidence: show the agent cursor as a view-time overlay

1 participant