feat: update verify page for HTML and PDF uploads (#37) - #43
Merged
Conversation
Replace JSON-only verification with support for report.html (extracts embedded JSON from <script id="coderepute-report"> tag) and report.pdf (reads repo from URL ?repo= param or XMP metadata packet). Drops .json upload path with a clear error. Adds prefillFromURL() for QR code scan landing. 18 test suites, 64 tests, all pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Jul 4, 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
report.htmlandreport.pdfsupport;.jsondrops with a clear error messageverifyHTML: hashes full bytes, extractsverification.repositoryfrom embedded<script type="application/json" id="coderepute-report">tag, runs existing attestation/Rekor pipelineverifyPDF: hashes full bytes, resolves repo from URL?repo=hint → XMP packet regex (<?xpacketmarkers,<meta name="coderepute:repo">) →{status:"needs-repo"}UI prompt; no PDF library addedverifyFile: top-level dispatcher by file name/MIME typeprefillFromURL(): reads?repo=and?subject=on page load so QR code scans land on a ready-to-use pageindex.html: updatedaccept=".html,.pdf", drop-zone copy, needs-repo prompt section, removed paste/JSON textareaTest plan
npm testindocs/verify/passes — 64 tests across 18 suites (18 new tests added)verifyHTMLfixture: minimal HTML with embedded JSON intestdata/report.htmlverifyPDFfixture: minimal PDF with XMP packet intestdata/report.pdf.jsonfile dispatch rejects with message referencingreport.html or report.pdfprefillFromURLis a no-op in Node (nodocument)🤖 Generated with Claude Code