Skip to content

feat(evidence): per-action pointer glyphs and run exports - #235

Merged
ElbertePlinio merged 20 commits into
mainfrom
feat/200-cursor-polish
Oct 3, 2026
Merged

ElbertePlinio merged 20 commits into
mainfrom
feat/200-cursor-polish

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 3, 2026 •

Copy link
Copy Markdown
Member

Evidence reports now draw a glyph per desktop pointer action, and a new artifacts export command writes annotated copies of a run's screenshots, a pointer track for demo videos, and an optional ffmpeg slideshow. Captured PNGs, the journal, the reports and every MCP tool response stay unchanged, so none of this costs the agent tokens.

One module (packages/core/src/evidence-glyphs.ts) turns a record and a linked capture into glyph parts. The HTML viewer draws those parts as SVG, and the export rasterizes the same parts into PNG copies. Before captures show intent, after captures add a dot where pointer input landed, and attempted input is dashed. Typing gets a ringed caret tag inside the focused window's top-left corner and never claims a text position. Scroll records now carry signed wheel steps. Type records carry the focused window rectangle, queried only for evidence and only while a run is active. The query never gates or changes typing, and no text, keys or lengths are added.

Exports go to a new exports/<exportId>/ inside the run. Writes go through pinned directory handles, and files are created exclusively. ffmpeg reads each frame through a verified, no-follow open descriptor, so a swapped frame makes the export incomplete instead of leaking outside content. The manifest is written last, so an export without one is visibly incomplete. exports/ is excluded from the evidence byte cap, so derived files can never truncate later actions or outcomes.

Closes #200

Traceability

Requirement Verified by Scenario and edge cases Result Evidence
Glyph per kind: click, double click, drag, scroll with direction, type as a caret at the verified focused window Automated tests, device pass Each kind in before and after phases and attempted and completed states; diagonal and zero-step scrolls; focus off-capture, partly visible and full screen; size mismatch, out-of-bounds points, contested captures, unknown tools Pass packages/core/test/evidence-glyphs.test.ts (80), evidence-markers.test.ts (44); gallery scenario 2
Before shows intent, after shows result, attempted input distinguishable Automated tests, device pass Live click and type refused by a held human lease render dashed; completed input adds a dot where it landed Pass evidence-glyphs.test.ts; exported frames 0018 and 0019
desktop_move has no capture glyph and appears in the pointer track only Automated tests, device pass Live move stays unmarked in the report and appears as a move event in the track Pass evidence-glyphs.test.ts; export/pointer-track.json
Type glyph marks the focused window; no text, keys or lengths added Automated tests, device pass Focus is queried just before dispatch, only with an evidence run; a failed, missing or malformed query still types and records no focus; host DISPLAY and XAUTHORITY never used; live record has focus 0,0 900x600 Pass packages/mcp-server/test/desktop-pointer-evidence.test.ts, packages/desktop-linux/test/windows.test.ts; actions.jsonl
Versioned pointer-track schema, documented, pointer events only, approximate timing labelled Automated tests, device pass Type and key records with typed metadata excluded; older records, invalid times and unverified points excluded; ties ordered like the report Pass docs/pointer-track.md, packages/core/test/pointer-track.test.ts; live track with 11 events and no keyboard data
Export writes annotated copies, pointer track and a hashed manifest next to the run; originals never change Automated tests, device pass All 23 run files byte-identical after export; repeat export makes a new directory; symlinked exports refused; symlinked, hard-linked, corrupt and oversize screenshots skipped with reasons; unknown run and empty project errors; an origin/main run exports with older glyph rules Pass packages/core/test/evidence-export.test.ts, packages/cli/test/artifacts-export.test.ts; export-edges.log
Opt-in ffmpeg slideshow with timing in the manifest; ffmpeg needed only then Automated tests, device pass Live --video --frame-ms 1500: h264 1280x800, 28.5 s, decoded frame timestamps exactly 1.5 s apart; exact timing at 1500, 137 and 41 ms on ffmpeg 9.0.1 and on 4.4.2 in an Ubuntu 22.04 container; frames of different sizes padded to the largest; frame symlink and content swaps, a descendant holding stdout, missing ffmpeg and bad --frame-ms handled; stderr tail redacted Pass evidence-export.test.ts, export/slideshow.mp4
One glyph geometry source for HTML and raster Automated tests, device pass Raster matches the viewer's part order, dashed halos, caps and joins, caret serifs and dash phase; every PNG layout the validator accepts is decoded, including 1-bit grayscale from ImageMagick; attempted and completed typing differ in both renderers even when the focus box is clipped Pass packages/core/test/png-raster.test.ts (51), evidence-glyphs.test.ts; report and export screenshots
Exports do not count toward the evidence byte cap Automated tests Exports larger than the remaining cap still allow the next action; a non-export file of the same size still counts; nested and file-named exports still count Pass packages/core/test/evidence-export-cap.test.ts
MCP tool lists, arguments and responses unchanged; older records render as before; CSP and redaction intact Automated tests, device pass 20 live MCP responses compared with origin/main: 0 shape, content-type, ok or inputState differences; 19 capture PNGs hashed: 0 changed; exact response key sets; unmarked and older records byte-identical; CSP and script hashes unchanged Pass mcp-responses-main.json, mcp-responses-branch.json; evidence-markers.test.ts
Report geometry and switch Device pass Glyph anchors within 0.054 image px in fit, actual size, 390x844 and the share report; switch by mouse, keyboard and touch; no console errors (rerun at f059ea4) Pass shots/browser-checks.json, gallery scenarios 2 and 3
Typecheck, lint and coverage green Manual check bun run typecheck, bun run lint, bun run test:coverage at f4682af with origin/main merged: 2882 passed, 6 environment skips; coverage 87.87 / 82.82 / 88.29 / 88.84. Export tests also pass with ffmpeg hidden from PATH, as on CI Pass coverage-f4682af.log
docs/releases/UNRELEASED.md entry Manual check Glyph and export notes added; README evidence section updated Pass docs/releases/UNRELEASED.md, README.md

PickCheck 0.4.0 --base origin/main --fail-on new,worsened,unmatched passes with no violations at f4682af (452 functions).

Device pass evidence: ~/Artifacts/pickforge/2026-10-03/device-pass-200/manifest.html, a standalone gallery at f059ea4 kept outside the repo. The only later commit changes one test file. It used 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.

Review

Independent xhigh reviews by Astra and Fable. Fixed over four repair rounds, the fourth approved by the maintainer: frames passed to ffmpeg as verified no-follow descriptors (blocking), every PNG layout decoded, exact frame timing, ffmpeg 4.4 compatibility, process-group timeout, typing without a false landing dot and with attempted state on the tag, wheel steps from the sanitized pair, decode failures copied instead of aborting, partial video removed, portable concat file, stderr redaction of whole blocks before truncation, and smaller nits. Final rechecks: Fable has no findings at f059ea4 for its areas, and Astra has no findings at f4682af.

CI: gitleaks failed earlier on fixtures from PR #225's branch; #241 (for #236) scoped the scan to each PR's history, and it passes since origin/main was merged in. A containment test flaked once under local load and is tracked in #238. The device pass also covers an ffmpeg failure whose output contains a multi-line JSON secret; the CLI error shows it as [REDACTED].

Moved out of #200 by maintainer decision: browser markers #229, Android markers #230, an Android swipe tool #231, the root cursor capture policy #232, and the browser recording overlay #233. Live-view cursor notes are on #207.

Declare the glyph parts that the viewer and the raster export draw, and
the scroll and focus target fields that desktop producers will record.
Move bounded PNG validation and safe screenshot reads out of the report
renderer so the raster export can use them, and declare the run-level
glyph lookup that both will share.
Desktop scroll records signed wheel steps, and desktop type records the
focused window rectangle, queried only for evidence and never gating
input. Typing also gets the owned-display check, so a verified record
carries the xvfb-root space. Tool responses are unchanged.
Click, double click, drag, scroll with direction and type each get a
glyph. Before captures show intent, after captures show the result, and
attempted input is dashed. Glyph geometry lives in one module that the
raster export will also draw.
The report renderer reads the glyph style at module load. Importing it
from the glyph module broke when the raster code loaded first, so the
constants now live in a module that imports nothing.
Typing has no verified landing point, so the type glyph no longer adds
the result dot. The caret now sits in a ring just inside the top-left
corner of the visible window, clear of the capture edges in gallery
previews. Attempted typing dashes that ring, so it stays distinct when
the focus box falls outside the capture.
The type glyph keeps its tag clear of the capture edges in a gallery
preview, so it depends on the stage height and padding. Both now come
from shared constants, and a test fails if any stage rule shrinks the
preview below that height. Rendered report bytes are unchanged.
@ElbertePlinio
ElbertePlinio merged commit 4bb734d into main Oct 3, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the feat/200-cursor-polish branch October 3, 2026 21:35
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: agent cursor polish (glyphs, exports, browser overlay)

1 participant