Skip to content

feat(evi): attested one-call before/after capture tool - #534

Merged
HugoRCD merged 2 commits into
mainfrom
feat/evi-capture-tool
Aug 9, 2026
Merged

feat(evi): attested one-call before/after capture tool#534
HugoRCD merged 2 commits into
mainfrom
feat/evi-capture-tool

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Stacked on #533. Collapses the multi-step capture flow into one authored tool and makes the visual evidence unfakeable.

capture__before_after

One call per comparison: opens both URLs in the sandbox Chromium (via runAgentBrowser), waits the 5s settle, screenshots cropped to the selector, validates the bytes (magic numbers + trailers, shared with blob__upload_image), uploads both frames to the Blob store, and returns the finished markdown — table, caption, and an attestation receipt naming the compared URLs, viewport, frame, and timestamp.

Trust properties:

  • A working Blob URL can only be minted by the runtime (token never in the sandbox, bytes validated), so its presence in a PR proves the pipeline ran.
  • The receipt says exactly what was compared; the tool call and its result are in the session stream, auditable after the fact.
  • Origins are gated by the same allowlist as the browser extension, now shared from agent/lib/capture.ts (single source). Gated to maintainer/schedule sessions, re-resolved per turn.

Skill

before-after shrinks to: start the dev server early, review sensitive surfaces first (public-the-instant-it-runs caveat), find the selector, one tool call, paste the returned markdown verbatim — the receipt is never stripped.

Eval

contributing/visual-evidence pins that visual proof flows through the tool.

Latency: replaces ~8 sequential model round-trips with one tool call.

No changeset: confined to apps/evi. Verified: tsc, 44 unit tests, eve build. End-to-end capture validates on the preview deployment.

Summary by CodeRabbit

  • New Features

    • Added authorized before-and-after webpage captures with selectable viewport sizes and optional element targeting.
    • Added URL validation, screenshot hosting, capture metadata, attestation receipts, and ready-to-use Markdown output.
    • Added shared domain restrictions between browser navigation and capture tools.
    • Added guidance for reviewing sensitive content and using sanitized demonstration data.
  • Bug Fixes

    • Standardized capture timing and validation to improve reliable visual comparisons.
  • Tests

    • Added coverage for URL validation, Markdown rendering, metadata, and attestation formatting.
    • Added evaluation coverage for visual evidence workflows.

@vercel

vercel Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
evi Ready Ready Preview Aug 9, 2026 4:20pm
4 Skipped Deployments
Project Deployment Actions Updated (UTC)
evlog-docs Skipped Skipped Aug 9, 2026 4:20pm
evlog-render-lab Skipped Skipped Aug 9, 2026 4:20pm
evlog-telemetry Skipped Skipped Aug 9, 2026 4:20pm
just-use-evlog Skipped Skipped Aug 9, 2026 4:20pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview – evlog-render-lab August 9, 2026 15:29 Inactive
@vercel
vercel Bot temporarily deployed to Preview – just-use-evlog August 9, 2026 15:29 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-telemetry August 9, 2026 15:29 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-docs August 9, 2026 15:29 Inactive
@changeset-bot

changeset-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b7a68b5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@HugoRCD, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 380629c6-7f1a-412a-956f-d59a0f97216a

📥 Commits

Reviewing files that changed from the base of the PR and between bf63d1c and b7a68b5.

📒 Files selected for processing (6)
  • apps/evi/agent/lib/capture.test.ts
  • apps/evi/agent/lib/capture.ts
  • apps/evi/agent/sandbox.ts
  • apps/evi/agent/skills/before-after/SKILL.md
  • apps/evi/agent/tools/capture.ts
  • apps/evi/evals/contributing/visual-evidence.eval.ts
📝 Walkthrough

Walkthrough

The PR adds an authorized capture__before_after tool. It validates approved URLs, captures browser frames, uploads images, and returns attested Markdown. Shared domain rules, skill instructions, browser configuration, tests, and evaluation coverage are updated.

Changes

Before-after capture workflow

Layer / File(s) Summary
Capture contracts and output formatting
apps/evi/agent/lib/capture.ts, apps/evi/agent/lib/capture.test.ts, apps/evi/agent/extensions/browser.ts
Adds shared capture settings, approved-domain URL validation, attestation receipts, Markdown output, and related tests. The browser extension uses the shared domain configuration.
Authorized capture tool
apps/evi/agent/tools/capture.ts
Adds the authorized capture__before_after tool for browser capture, image validation, Blob uploads, and structured results.
Workflow adoption and evaluation
apps/evi/agent/skills/before-after/SKILL.md, apps/evi/evals/contributing/visual-evidence.eval.ts
Updates the skill to use the tool and adds sensitive-surface guidance. The evaluation checks for attested visual evidence with hosted screenshots.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Session
  participant capture__before_after
  participant Browser
  participant BlobStorage
  Session->>capture__before_after: authorize and register tool
  capture__before_after->>Browser: navigate and capture before and after frames
  Browser-->>capture__before_after: image frames
  capture__before_after->>BlobStorage: upload validated public images
  BlobStorage-->>capture__before_after: hosted image URLs
  capture__before_after-->>Session: Markdown and attestation receipt
Loading

Possibly related PRs

  • HugoRCD/evlog#528: Extends the related browser-restricted before-after workflow with shared validation and automated evidence generation.
  • HugoRCD/evlog#533: Also modifies the before-after workflow with browser captures, settling, selectors, and approved origins.

Suggested labels: feature

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the new one-call attested before/after capture tool and follows the repository's conventional commit format.
Description check ✅ Passed The description explains the implementation, trust properties, skill changes, evaluation, scope, and verification results, while referencing the stacked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/evi-capture-tool

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@HugoRCD
HugoRCD force-pushed the feat/evi-capture-tool branch from e1637b6 to 92dfb03 Compare August 9, 2026 15:36
@vercel
vercel Bot temporarily deployed to Preview – just-use-evlog August 9, 2026 15:36 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-render-lab August 9, 2026 15:36 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-telemetry August 9, 2026 15:36 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-docs August 9, 2026 15:36 Inactive
@HugoRCD
HugoRCD force-pushed the feat/evi-capture-tool branch from 92dfb03 to 4c326a9 Compare August 9, 2026 15:42
@vercel
vercel Bot temporarily deployed to Preview – just-use-evlog August 9, 2026 15:43 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-render-lab August 9, 2026 15:43 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-telemetry August 9, 2026 15:43 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-docs August 9, 2026 15:43 Inactive
Base automatically changed from feat/evi-faster-captures to main August 9, 2026 15:58
@HugoRCD
HugoRCD force-pushed the feat/evi-capture-tool branch from 4c326a9 to bf63d1c Compare August 9, 2026 16:02
@vercel
vercel Bot temporarily deployed to Preview – evlog-render-lab August 9, 2026 16:02 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-docs August 9, 2026 16:02 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-telemetry August 9, 2026 16:02 Inactive
@vercel
vercel Bot temporarily deployed to Preview – just-use-evlog August 9, 2026 16:02 Inactive
@pkg-pr-new

pkg-pr-new Bot commented Aug 9, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@evlog/cli@534
npm i https://pkg.pr.new/evlog@534
npm i https://pkg.pr.new/@evlog/nuxthub@534
npm i https://pkg.pr.new/@evlog/telemetry@534

commit: b7a68b5

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/evi/agent/lib/capture.ts`:
- Around line 55-74: Update captureMarkdown and captureAttestation to sanitize
all Markdown/HTML-bound values: normalize beforeImageUrl and afterImageUrl
before embedding them as image links, convert caption to one-line plain text and
escape Markdown-sensitive content, and escape attestation fields including
selector before placing them inside <sub>. Reuse existing normalization or
escaping utilities if available, and ensure raw input URLs and line breaks
cannot create additional sections or HTML.

In `@apps/evi/agent/tools/capture.ts`:
- Around line 59-77: Update the capture flow in execute and its upload path via
hostFrame to enforce the public-image boundary: require trusted approval before
uploading captures of sensitive route classes, or reject those routes unless the
source is a sanitized demo environment. Preserve the existing authorization
check, and ensure no successful sensitive capture can reach the access: 'public'
upload without this validation.

In `@apps/evi/evals/contributing/visual-evidence.eval.ts`:
- Around line 9-11: Update the closedQA criterion in the visual-evidence
evaluation to require the attestation receipt in addition to the
capture__before_after tool or before-after skill flow and hosted before/after
screenshots. Keep the existing visual evidence requirements while rejecting
answers that omit the receipt.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 71ce68d5-2fbe-4985-882d-32e424aebcdf

📥 Commits

Reviewing files that changed from the base of the PR and between 942d4eb and bf63d1c.

📒 Files selected for processing (6)
  • apps/evi/agent/extensions/browser.ts
  • apps/evi/agent/lib/capture.test.ts
  • apps/evi/agent/lib/capture.ts
  • apps/evi/agent/skills/before-after/SKILL.md
  • apps/evi/agent/tools/capture.ts
  • apps/evi/evals/contributing/visual-evidence.eval.ts

Comment thread apps/evi/agent/lib/capture.ts
Comment thread apps/evi/agent/tools/capture.ts
Comment thread apps/evi/evals/contributing/visual-evidence.eval.ts Outdated
@vercel
vercel Bot temporarily deployed to Preview – evlog-docs August 9, 2026 16:16 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-render-lab August 9, 2026 16:16 Inactive
@vercel
vercel Bot temporarily deployed to Preview – evlog-telemetry August 9, 2026 16:16 Inactive
@vercel
vercel Bot temporarily deployed to Preview – just-use-evlog August 9, 2026 16:16 Inactive
@HugoRCD
HugoRCD merged commit 9bb702c into main Aug 9, 2026
18 checks passed
@HugoRCD
HugoRCD deleted the feat/evi-capture-tool branch August 9, 2026 16:32
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.

1 participant