feat(review): let a bot-captured before/after satisfy the screenshot-table gate - #4128
Conversation
…table gate evaluateScreenshotTableGate now accepts a botCaptureSatisfied input: when the visual-capture pipeline (review.visual.enabled) already rendered a real before/after pair for the PR's current head, the gate is satisfied without a hand-authored body table. The capture result is persisted to a new pull_requests.visual_capture_satisfied_sha column (keyed to head SHA, mirrors approved_head_sha) by maybePublishPrPublicSurface and re-read by the maintenance pass in the same webhook, so no capture is re-run and no return value needs threading through every caller. Also resolves the dead ScreenshotTableGateAction surface: request_changes and comment were fully typed/validated but processors.ts only ever branched on "close", so setting either silently did nothing. Both are removed; "close" is now the only valid action, and a legacy config value normalizes to it with a warning like any other invalid input.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 8988f58 | Commit Preview URL Branch Preview URL |
Jul 08 2026, 04:53 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4128 +/- ##
=======================================
Coverage 93.66% 93.66%
=======================================
Files 384 384
Lines 35936 35949 +13
Branches 13188 13196 +8
=======================================
+ Hits 33660 33673 +13
Misses 1618 1618
Partials 658 658
🚀 New features to boost your workflow:
|
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-08 05:20:48 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 6 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
evaluateScreenshotTableGate(bothsrc/review/screenshot-table-gate.tsand itspackages/gittensory-enginemirror) now accepts an optionalbotCaptureSatisfiedinput. When true it short-circuits to "no violation" ahead of the body-table / outside-table / committed-image anti-gaming checks, so a successful automated before/after capture is treated as evidence equivalent to a hand-authored table.src/queue/processors.ts'smaybePublishPrPublicSurfacecomputeshasSuccessfulBotCapture(new pure helper insrc/review/visual/capture.ts) over the capture pipeline's routes and, on success, persists the head SHA to a newpull_requests.visual_capture_satisfied_shacolumn viamarkPullRequestVisualCaptureSatisfied(mirrorsapproved_head_sha/last_published_surface_sha).runAgentMaintenancePlanAndExecutere-reads that same PR row (already re-fetched fresh in the same webhook, aftermaybePublishPrPublicSurfaceruns) and threadsbotCaptureSatisfied = visualCaptureSatisfiedSha === headShainto the evaluator. No return-value threading through the publish/maintenance call chain was needed.request_changes/commentconfig surface named in the issue:ScreenshotTableGateActionis narrowed to"close"only (the sole valueprocessors.tsever branched on). A legacy.gittensory.yml/DB value of either removed action normalizes to the default"close"with a warning, exactly like any other invalid value — chosen over wiring them to a real effect (which would require a first-ever use of the unusedactionClass: "review"planner surface) to keep this PR narrow and scoped to the gate-wiring issue.screenshotTableGatedoc blocks in.gittensory.yml.exampleandconfig/examples/gittensory.full.yml, and regeneratedapps/gittensory-ui/public/openapi.jsonfor the narrowedactionenum.Verified against the current code before implementing (per the epic's due-diligence note):
evaluateScreenshotTableGatetruly had no bot-capture input, andprocessors.ts's screenshot-table close path (~line 2787) only ever read.action === "close", so this is a real capability addition, not a no-op.Closes #4110
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateRan the full local gate via
npm run test:ci(aggregates actionlint, db:migrations:check, db:schema-drift:check, selfhost:env-reference:check, selfhost:validate-observability, cf-typegen:check, typecheck, test:coverage, test:engine-parity, test:workers, build:mcp, test:mcp-pack, build:miner, test:miner-pack, rees:test, ui:openapi:check, ui:openapi:settings-parity, ui:version-audit, docs:drift-check, manifest:drift-check, command-reference:check, ui:lint, ui:typecheck, ui:test, ui:build) — all green, plusnpm audit --audit-level=moderatereporting 0 vulnerabilities. Also rannpx vitest run test/unit/worker-entry-boundary.test.tssince this touchessrc/review/**/src/queue/**(green — no forbiddenpixelmatch/pngjs/visual-diff/gifencreference introduced).Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.No visible UI change — this PR is backend-only (queue processor, DB schema/repositories, review engine, config docs); the only
apps/gittensory-ui/**diff is the regeneratedpublic/openapi.json.UI Evidence
Not applicable — no visible UI change.
Notes
src/queue/**andsrc/db/**(guarded/crucial paths per.gittensory.yml's hard-guardrail globs), so I expect this PR to be held for manual owner review even with a fully green gate — that is the documented, correct behavior for this path, not a failure signal.