Skip to content

feat(device-pass): export standalone HTML reports - #36

Merged
ElbertePlinio merged 5 commits into
mainfrom
feat/device-pass-standalone
Oct 1, 2026
Merged

ElbertePlinio merged 5 commits into
mainfrom
feat/device-pass-standalone

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

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. --linked keeps 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. Optional findings lists render at the top level and per scenario. The command prints the output size and the embedded image totals. gallery.md covers sharing: download and open the file, or ZIP it if a channel blocks HTML.

Requirement Verified by Scenario Result Evidence
Standalone export by default, linked mode kept Automated test, device pass Default and --linked renders of a three-scenario fixture Pass scripts/test-device-pass-report.py, ~/.pickforge/kickoff/186/device-pass-qa/
Opens offline with only the HTML Device pass HTML copied alone to a fresh /tmp folder and opened in headless Chromium at 1440 and 390 Pass standalone-full-1440.png, standalone-full-390.png
Each unique image embedded once, bytes match originals Automated test Same file referenced twice, identical bytes in two files, decoded payload compared Pass scripts/test-device-pass-report.py
Filters, search, keyboard viewer, actual size kept Device pass Mobile filter, search "webp", ArrowRight in viewer, Actual size Pass viewer-1440.png, viewer-zoom-390.png
Revision, environment, steps, outcomes, findings, limitations in the HTML Automated test, device pass Pass, fail and blocked scenarios with findings and limitations Pass standalone-1440.png
Escaping, path confinement, CSP, no network Automated test Script-tag and onerror captions, ../, 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 links Pass scripts/test-device-pass-report.py (19 tests, run by scripts/check/rendered-checks.sh)
Evidence untouched Automated test Bytes and mtimes compared after rendering Pass scripts/test-device-pass-report.py
Size reported, limits explicit, video disclosed Automated test, device pass Lowered caps in tests, video entry in fixture Pass standalone-full-1440.png
Sharing instructions Manual check references/gallery.md Pass this diff
Source checks scripts/check-agent-config-sync.sh, PickCheck Full source suite in a clean clone, pickcheck --base origin/main Pass ~/.pickforge/kickoff/186/dotfiles-check.log
Independent review Astra xhigh, Fable xhigh Findings fixed over three repair rounds and rechecked by the reviewer who raised them Pass review rounds on 48f36c3, 15c47a1, 21a1d0b

Round 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.

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.
@ElbertePlinio
ElbertePlinio merged commit c197d96 into main Oct 1, 2026
@ElbertePlinio
ElbertePlinio deleted the feat/device-pass-standalone branch October 1, 2026 20:52
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