Repository navigation
feat(evidence): per-action pointer glyphs and run exports - #235
Merged
Merged
Conversation
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.
3 tasks done
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.
3 tasks done
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Evidence reports now draw a glyph per desktop pointer action, and a new
artifacts exportcommand 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
packages/core/test/evidence-glyphs.test.ts(80),evidence-markers.test.ts(44); gallery scenario 2evidence-glyphs.test.ts; exported frames 0018 and 0019desktop_movehas no capture glyph and appears in the pointer track onlymoveevent in the trackevidence-glyphs.test.ts;export/pointer-track.jsonDISPLAYandXAUTHORITYnever used; live record has focus 0,0 900x600packages/mcp-server/test/desktop-pointer-evidence.test.ts,packages/desktop-linux/test/windows.test.ts;actions.jsonldocs/pointer-track.md,packages/core/test/pointer-track.test.ts; live track with 11 events and no keyboard dataexportsrefused; symlinked, hard-linked, corrupt and oversize screenshots skipped with reasons; unknown run and empty project errors; anorigin/mainrun exports with older glyph rulespackages/core/test/evidence-export.test.ts,packages/cli/test/artifacts-export.test.ts;export-edges.log--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-mshandled; stderr tail redactedevidence-export.test.ts,export/slideshow.mp4packages/core/test/png-raster.test.ts(51),evidence-glyphs.test.ts; report and export screenshotsexportsstill countpackages/core/test/evidence-export-cap.test.tsorigin/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 unchangedmcp-responses-main.json,mcp-responses-branch.json;evidence-markers.test.tsshots/browser-checks.json, gallery scenarios 2 and 3bun run typecheck,bun run lint,bun run test:coverageat 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 CIcoverage-f4682af.logdocs/releases/UNRELEASED.mdentrydocs/releases/UNRELEASED.md,README.mdPickCheck 0.4.0
--base origin/main --fail-on new,worsened,unmatchedpasses 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:
gitleaksfailed 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.