[dev] [Marfuen] mariano/sale-45-screenshot-automation-feature-improvements#2657
[dev] [Marfuen] mariano/sale-45-screenshot-automation-feature-improvements#2657github-actions[bot] wants to merge 28 commits into
Conversation
Design doc covering three fixes: baked-in audit overlay (timestamp, source URL, auditor requirement), stable redirect endpoint to replace stale presigned URLs on "Open full size", and evaluation-error repair. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
11-task TDD plan: overlay module + integration, org-scoped redirect service method + controller endpoint, RunItem href swap, eval-error hardening, and final verification. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ar strip Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…c failures Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… errors Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…isNoPage predicate, SVG dim safety) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…icons ChevronDown, ExternalLink (as Launch), and ImageIcon now come from @trycompai/design-system/icons (Carbon icons). @trycompai/ui/badge kept since no DS equivalent exists. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The service was instantiating its own S3Client without credentials, falling back to the default AWS credential chain which fails locally and in most deployments. Reuse the shared s3Client / BUCKET_NAME from @/app/s3 (same pattern as the rest of the API). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Left brand pillar with hex logo mark + "Comp AI" wordmark + "AUDIT TRAIL" tag, vertical divider, info column on the right, and a thin brand-green accent stripe at the bottom. Keeps the 88px total height so existing tests remain valid. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Service now accepts a `download` flag that signs the S3 URL with a ContentDisposition: attachment header so the browser downloads the image instead of rendering it inline. Controller exposes the flag via ?download=true on the existing redirect endpoint. RunItem.tsx gets a new Download link next to "Open full size". Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Users can now set an optional natural-language "Evaluation Criteria" on each BrowserAutomation. When set, runs use stagehand.extract() to inspect the final page and produce a pass/fail verdict with a short reason. When unset, runs just capture a screenshot with no verdict. - schema: add BrowserAutomation.evaluationCriteria (nullable) - service: executeAutomation runs the eval step when criteria present; drops the misleading "Navigation completed..." fallback reason when no criteria is configured - dto: accept evaluationCriteria on create/update - ui: add the field to the config dialog; hide the eval result block in RunItem unless a real pass/fail verdict was produced - tests: cover the null-evaluationStatus UI path Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…mismatch
next build reported: "Type 'string | undefined' is not assignable to
type 'string'" because .optional().default('') makes the zod input
type differ from the output type, which confuses zodResolver's Resolver
generic. Drop the .default() — defaultValues in useForm already supplies
the empty string.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…nts' of https://github.com/trycompai/comp into mariano/sale-45-screenshot-automation-feature-improvements
…uction The node:*-slim base images ship with zero fonts installed, so librsvg falls back to .notdef glyphs and the overlay rendered as □ □ □ boxes in production. Install fontconfig + fonts-dejavu-core in both Dockerfiles and use "DejaVu Sans" explicitly in the SVG. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
There was a problem hiding this comment.
cubic analysis
1 issue found across 20 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/plans/2026-04-22-sale-45-screenshot-automation-improvements.md">
<violation number="1" location="docs/plans/2026-04-22-sale-45-screenshot-automation-improvements.md:1024">
P2: The generic fallback error message is self-referential: it says "see run error details for specifics" but the `error` field _is_ the run error details — the raw error has been discarded (only logged server-side). The user would read this message and find no further specifics anywhere.
Consider either including a sanitised summary of the original error, or removing the misleading "see run error details" clause.</violation>
</file>
Linked issue analysis
Linked issue: SALE-45: Screenshot automation: feature improvements
| Status | Acceptance criteria | Notes |
|---|---|---|
| ✅ | Bake audit metadata into screenshot image: include timestamp | renderOverlay supports capturedAt and tests assert timestamp rendering |
| ✅ | Bake audit metadata into screenshot image: include source URL | renderOverlay accepts sourceUrl and tests include sourceUrl prop |
| ✅ | Bake audit metadata into screenshot image: include auditor requirement text (instruction) | renderOverlay accepts instruction and tests assert instruction truncated/visible |
| ✅ | Install fonts at runtime so sharp/librsvg can render text | Dockerfiles add fontconfig and fonts-dejavu-core packages |
| Integrate overlay rendering into automation capture/upload flow (bake into stored screenshot) | renderOverlay imported into service, but usage in execute flow not fully shown | |
| ✅ | Replace stale presigned-URL 'Open full size' with stable redirect endpoint | New controller endpoint /runs/:runId/screenshot and OpenAPI path added |
| ✅ | Redirect endpoint mints a fresh presigned S3 URL (302 redirect) | Service/controller add getSignedUrl usage and controller annotated for 302 |
| Support ?download=true to force attachment download on redirect | Controller docs & OpenAPI include download param but implementation snippet truncated | |
| ✅ | Front-end 'Open full size' link points at stable redirect endpoint (not expired signed URL) | RunItem builds /v1/browserbase/runs/:id/screenshot and tests assert it |
| ✅ | Front-end download link uses stable endpoint with ?download=true | RunItem defines downloadHref = `${fullSizeHref}?download=true` |
| ✅ | Database schema stores evaluation criteria (evaluationCriteria column and migration) | Prisma schema updated and SQL migration added |
| ✅ | API DTOs accept evaluationCriteria on create/update | Create/Update DTOs include optional evaluationCriteria fields |
| ✅ | UI form allows entering evaluation criteria (create/edit dialog) | BrowserAutomationConfigDialog schema and initialValues include evaluationCriteria |
| ✅ | Add tests for overlay rendering, redirect, run-item links, and error formatting | Multiple spec/test files added for overlay, service, controller, run item, formatter |
| Diagnose and repair 'evaluation error' UI state (classify and surface run errors appropriately) | run-error-formatter added and imported, but full fix in eval path not fully shown | |
| ✅ | OpenAPI docs updated to include new screenshot redirect endpoint | openapi.json includes /v1/browserbase/runs/{runId}/screenshot path |
| ✅ | Controller/service return 404 when run or screenshot not found | Controller annotated with 404 response and NotFoundException used in tests |
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.
| ? 'Browser session ended before we could capture evidence. Please retry.' | ||
| : isTimeout | ||
| ? 'Automation timed out before completing. Please retry — if this keeps happening, simplify the instruction or check the target site.' | ||
| : 'Automation failed to complete. Please retry — see run error details for specifics.'; |
There was a problem hiding this comment.
P2: The generic fallback error message is self-referential: it says "see run error details for specifics" but the error field is the run error details — the raw error has been discarded (only logged server-side). The user would read this message and find no further specifics anywhere.
Consider either including a sanitised summary of the original error, or removing the misleading "see run error details" clause.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At docs/plans/2026-04-22-sale-45-screenshot-automation-improvements.md, line 1024:
<comment>The generic fallback error message is self-referential: it says "see run error details for specifics" but the `error` field _is_ the run error details — the raw error has been discarded (only logged server-side). The user would read this message and find no further specifics anywhere.
Consider either including a sanitised summary of the original error, or removing the misleading "see run error details" clause.</comment>
<file context>
@@ -0,0 +1,1093 @@
+ ? 'Browser session ended before we could capture evidence. Please retry.'
+ : isTimeout
+ ? 'Automation timed out before completing. Please retry — if this keeps happening, simplify the instruction or check the target site.'
+ : 'Automation failed to complete. Please retry — see run error details for specifics.';
+
+ return {
</file context>
This is an automated pull request to merge mariano/sale-45-screenshot-automation-feature-improvements into dev.
It was created by the [Auto Pull Request] action.
Summary by cubic
Adds an audit overlay to automation screenshots and replaces stale full‑size links with a signed redirect to meet SALE‑45 auditor requirements. Also adds per‑automation evaluation criteria with pass/fail verdicts and clearer run errors, fixing “Access denied” and “evaluation error” cases.
New Features
sharpwith Comp AI branding./v1/browserbase/runs/{runId}/screenshotissues a fresh 302 to a signed S3 URL; supports?download=true. UI now links to this endpoint.evaluationCriteriaon automations; runs produce pass/fail with a short reason when set. DTOs and OpenAPI updated.Migration
BrowserAutomation.evaluationCriteria.fontconfigandfonts-dejavu-coreso overlay text renders in production.Written for commit ff83c69. Summary will update on new commits.