feat(report): emit self-contained HTML validation report + report.json#74
Merged
Conversation
Implements steps 3-7 of docs/validation-report.md (step 1-2 shipped in #73). Every run now writes out/<slug>/report.json (machine-readable RunReport) and validation-report.html (self-contained, screenshots base64-embedded) summarizing all validation layers + the reviewer. - src/report/model.ts — RunReport / RunMeta / RepairAttempt / AssetMap - src/report/render.ts — renderReport(report, assets): pure, no I/O; gate strip, platform×layer matrix, Layer 1 findings, Layer 2 stderr, Layer 3 screenshots + rubric rationales (incl. Stage 2 filmstrip), reviewer diff, rename-plan appendix, reproduce footer. HTML-escaped throughout. - src/report/theme.ts — inline brand CSS (matches social-preview) - src/report/collect.ts — buildRunReport (pure assembly), resolveAssets (embed as data: URI, or copy to report-assets/), writeReport (report.json + HTML) - src/version.ts — shared readPackageVersion (dedups mcp.ts copy) - dispatch: records timing, assembles + writes the report, returns DispatchResult = JudgeResult & { report, reportPaths }. Writing defaults off in stub mode so the test suite never touches ./out. - index: --no-report / --report-format / --report-embed / --report-open flags; prints a file:// path. mcp: returns report + html/json paths in structuredContent. Tests: pure renderer assertions (findings, stderr, diff, rename plan, HTML escaping, empty-platforms summary fallback), writeReport round-trip (self-contained — asserts no tmp/ paths and no external URLs leak), embed=false externalization, and buildRunReport assembly. 46/46 pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dadachi
added a commit
that referenced
this pull request
May 22, 2026
…rt (#75) Finishes the validation-report story (follows #74). - index: the CLI now exits non-zero when overallPass is false, so CI steps and shell `&&` chains catch a failed run. New --exit-zero flag opts out (e.g. when you only want the report). parseArgs is exported and unit-tested. - README: new "Validation report" section documenting validation-report.html + report.json, the out/<slug>/ layout, the CI exit-code behavior, and the --no-report / --report-format / --report-embed / --report-open / --exit-zero flags. Tests: parseArgs flag parsing (incl. --exit-zero, invalid format ignored, defaults). 49/49 pass. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dadachi
added a commit
that referenced
this pull request
May 22, 2026
…kflow (#76) Adds section 10 to docs/validation-report.md covering how to render and visually verify validation-report.html: - Path A — Playwright MCP (interactive, inside Claude Code): local-scope `claude mcp add playwright`, restart to load tools, then browser_navigate (file:// URL) + browser_take_screenshot. Note it's a maintainer convenience, not part of the pipeline (device shots use mobile-mcp). - Path B — Playwright CLI (headless, no MCP, CI-friendly): `npx -y playwright@latest screenshot --full-page file://… report.png`, no project dependency added. Also marks section 9 as shipped (#73/#74/#75). Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
What
Implements steps 3–7 of
docs/validation-report.md(steps 1–2 shipped in #73). Every run now emits, intoout/<slug>/:report.json— the machine-readableRunReport(for CI gating, MCP, future web product)validation-report.html— a single self-contained file (screenshots base64-embedded, CSS inlined, no JS framework, no network) summarizing all validation layers + the reviewerReport contents
Overall verdict badge → gate strip → platform×layer matrix → Layer 1 leftover-token findings → Layer 2 command/duration/
stderr→ Layer 3 home-screen screenshots + rubric rationales (incl. Stage 2 filmstrip) → reviewer contract diff → domain/rename-plan appendix → reproduce command.Design
render.tsis pure —renderReport(report, assets) → string, no I/O, no clock. Deterministic and golden-file testable. All interpolated text is HTML-escaped.collect.tsowns I/O —buildRunReport(pure assembly),resolveAssets(base64-embed or copy toreport-assets/),writeReport.dispatchreturnsDispatchResult = JudgeResult & { report, reportPaths }— a superset, so existingresult.overallPass/result.summaryconsumers (CLI, MCP, tests) are unaffected. Report writing defaults off in stub mode, so the test suite never writes into./out.--no-report,--report-format=html|json|both,--report-embed=true|false,--report-open; prints afile://path.report+reportHtmlPath/reportJsonPathinstructuredContent.src/version.tsdedups thereadPackageVersionhelper that was duplicated inmcp.ts.Tests
writeReportround-trip: asserts the HTML is self-contained — embeds adata:URI and leaks notmp/paths and no external URLs.embed=falseexternalization toreport-assets/, andbuildRunReportassembly.npm run cigreen — build + typecheck + 46/46 tests pass.A rendered sample (mixed pass/fail run) was eyeballed end-to-end with real generated screenshots.
🤖 Generated with Claude Code