Skip to content

feat: add bounded region screenshot series - #212

Merged
yashranaway merged 1 commit into
mainfrom
feat/211-region-screenshot-series
Sep 22, 2026
Merged

yashranaway merged 1 commit into
mainfrom
feat/211-region-screenshot-series

Conversation

@SarthakWade

Copy link
Copy Markdown
Collaborator

Summary

  • add screenshot --by-region @rN as a bounded, cross-engine screenshot series
  • bind captures to the current document and exact region geometry, with per-slice viewport and clipping revalidation
  • reserve artifacts atomically, restore scroll position, report explicit truncation, and omit page labels and coordinates from region metadata
  • update capabilities, generated TypeScript and Python SDK contracts, the Rust validator, command docs, roadmap, and agent skill

Security and failure behavior

  • accepts only current-page opaque region references, never selectors or arbitrary JavaScript
  • rejects stale, hidden, clipped, moving, oversized, malformed, or non-ASCII references
  • caps region width at 4096 CSS pixels, keeps shared image bounds, and limits output to 80 artifacts
  • removes every reserved artifact on capture, validation, write, or scroll-restoration failure
  • revalidates the viewport after capture to reject scroll races

Verification

  • pnpm test: 73/73 protocol tests plus MCP and secure prompt tests passed
  • pnpm test:runtime: passed
  • pnpm test:npm: 41/41 passed
  • Python: Ruff, format, strict mypy, and 42/42 pytest passed
  • Rust: cargo test --locked and strict Clippy passed in Docker
  • pnpm build: macOS app and website passed
  • pnpm test:e2e:linux: passed with real Chromium and all three region artifacts validated
  • targeted production WKWebView E2E: passed with all three region artifacts validated
  • full local macOS E2E reaches an existing System Events accessibility failure at start-page-address-hud before screenshot coverage; the PR carries macos-e2e for the clean runner

Closes #211

@SarthakWade SarthakWade added the macos-e2e Run the macOS WKWebView E2E suite label Sep 22, 2026

@yashranaway yashranaway left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thermo-nuclear + deslop pass.

Clean bounded surface screenshot --by-region @rN, opaque region refs only. Reuses artifact reservation + viewport revalidation + scroll restore, no fork. Protocol-first, SDKs + schema + fixtures in sync. No file >1k due to PR, validation centralized.

Nits (non-blocking):

  • HostCore.swift mixes reservation/restore + capture — extract RegionCaptureCoordinator if more region ops land
  • AgentRuntime viewport math duplicated — watch drift

Verification strong (protocol/MCP/python/rust + e2e). Ready to merge after other reviewer.

@yashranaway
yashranaway merged commit 1ce7c96 into main Sep 22, 2026
52 of 53 checks passed
@yashranaway
yashranaway deleted the feat/211-region-screenshot-series branch September 22, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

macos-e2e Run the macOS WKWebView E2E suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

G6: add bounded region-scoped screenshot series

2 participants