feat(selfhost): persist visual-review screenshots via an fs-backed REVIEW_AUDIT store - #1490
Merged
Conversation
…VIEW_AUDIT store Visual review uses env.REVIEW_AUDIT (R2) to cache + serve captured PNGs from /gittensory/shot?key=…; self-host had no such binding, so screenshots couldn't persist (they degraded to on-demand re-render and never survived a restart). Add a minimal R2Bucket-compatible filesystem blob store (the get/put surface capture.ts + the shot route use), bound when REVIEW_AUDIT_DIR is set — modular + off by default (unset ⇒ on-demand, byte-identical to before). Keys are boundary-checked so none can escape the base dir. Node-only; wired in the codecov-ignored server bootstrap.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (93.33%) is below the target coverage (97.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1490 +/- ##
==========================================
- Coverage 95.44% 95.44% -0.01%
==========================================
Files 194 195 +1
Lines 21096 21111 +15
Branches 7630 7632 +2
==========================================
+ Hits 20136 20150 +14
Misses 383 383
- Partials 577 578 +1
🚀 New features to boost your workflow:
|
This was referenced Jul 1, 2026
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.
Summary
Visual review uses
env.REVIEW_AUDIT(R2) to cache + serve captured PNGs from/gittensory/shot?key=…. Self-host had no such binding, so screenshots couldn't persist — they degraded to on-demand re-render and never survived a restart.This adds a minimal R2Bucket-compatible filesystem blob store (blob-store.ts) implementing exactly the
get/putsurfacecapture.ts+ the/shotroute use, bound whenREVIEW_AUDIT_DIRis set.REVIEW_AUDIT_DIR⇒ no binding ⇒ on-demand behavior, byte-identical to before. Pair withBROWSER_WS_ENDPOINTto enable visual review end-to-end on self-host.gittensory/shots/<hash>.png) are resolved + boundary-checked so none can escape the base dir.Validation
npm run typecheck;npm run test:coverage— full suite green; blob store 100% covered (round-trip; miss → null; string body; traversal → put throws / get safe-miss). Docs §8 +.env.exampleupdated.Roadmap item #10 (visual review parity).