Repository navigation
feat(device-pass): export standalone HTML reports - #36
Merged
Merged
Conversation
Embed CSS, script, and each unique screenshot once so the report opens offline from any folder. Add a restrictive CSP with a script hash, strict artifact confinement, image type checks, size caps, video disclosure, and findings. Keep the linked report behind --linked.
Open artifacts through pinned directory descriptors with O_NOFOLLOW at every component, so a directory swapped for a symlink cannot redirect a read, and reject empty paths such as ".". Validate PNG, JPEG, and WebP structure before embedding or linking instead of trusting signatures. Keep journey steps collapsed in both modes, label the standalone topbar as a self-contained file, and decode each embedded image once into a blob URL shared by thumbnails and the viewer. Run the renderer tests from the rendered checks.
Reject crafted JPEG, WebP, and PNG files that pass a header check but cannot decode: validate JPEG frame and scan headers and require entropy data, check WebP VP8, VP8L, and VP8X bitstream headers, and require PNG IDAT data to inflate to the size IHDR implies. Name trailing data in the error, cap screenshot size in linked mode too, and report filesystem errors without a traceback.
19 tasks done
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.
The device-pass renderer now writes one self-contained HTML file by default, for pickforge/pickforge#186. CSS, script and every screenshot are embedded, so the file opens offline from any folder.
--linkedkeeps the old output that links files beside the manifest.Each unique image is embedded once, keyed by SHA-256, in a non-executing JSON block that the report script loads into the gallery and viewer as one blob URL per image. Original bytes are kept with no re-encoding. The standalone file carries a CSP that allows only
blob:images and the inline script by hash. Paths must be relative, stay inside the evidence folder, contain no symlinks, and point to PNG, JPEG or WebP files checked for complete structure (PNG chunks, CRCs and a full zlib stream sized to IHDR; JPEG and WebP frame headers). This is a structural check, not a full decode. Artifacts are opened by walking pinned directory descriptors with no symlinks at any level. Over 32 MiB per image or 256 MiB in total, rendering fails with a clear error instead of shrinking or dropping evidence. Video is never embedded and is disclosed as not included. Optionalfindingslists render at the top level and per scenario. The command prints the output size and the embedded image totals.gallery.mdcovers sharing: download and open the file, or ZIP it if a channel blocks HTML.--linkedrenders of a three-scenario fixturescripts/test-device-pass-report.py,~/.pickforge/kickoff/186/device-pass-qa/standalone-full-1440.png,standalone-full-390.pngscripts/test-device-pass-report.pyviewer-1440.png,viewer-zoom-390.pngstandalone-1440.png../, absolute,., symlink inside and outside, directory swapped for a symlink during open, signature-only, truncated and corrupt PNG/JPEG/WebP, PNG with oversized header, missing file, unreadable folder, CSP hash, no URLs or relative linksscripts/test-device-pass-report.py(19 tests, run byscripts/check/rendered-checks.sh)scripts/test-device-pass-report.pystandalone-full-1440.pngreferences/gallery.mdscripts/check-agent-config-sync.sh, PickCheckpickcheck --base origin/main~/.pickforge/kickoff/186/dotfiles-check.logRound 2 and 3 QA reran the export with PNG, JPEG, lossy, lossless and VP8X WebP in offline Chromium at 1440 and 390 (
~/.pickforge/kickoff/186/device-pass-qa/round2/,round3/). Not verified: Firefox and Safari, and a browser run with a wrong CSP hash.