Repository navigation
feat(shots): before/after PR evidence kit - #72
Merged
Merged
Conversation
changeroa
force-pushed
the
feat/audit-p4-before-after
branch
2 times, most recently
from
October 19, 2026 12:10
c78d5ff to
b2383d2
Compare
…e/--after) Capture 390/1440 x light/dark (x focus/hover) for two revisions, diff each pair in Chromium, and write PNGs, an image-diff-compatible report.json, and pr-body.md. Add the Before/After PR Evidence doc with a PR body template, README/CLI help, search-eval questions, and a self-test run in the compiler workflow.
changeroa
force-pushed
the
feat/audit-p4-before-after
branch
from
October 19, 2026 12:30
b2383d2 to
af97cb4
Compare
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
Adds P4, the before/after PR evidence kit.
stylegallery shots --before <ref|url> --after <ref|url>captures 390 and 1440 widths x light/dark (x focus/hover when--selectoris given) for both sides with Playwright Chromium, computes a pixel diff ratio, a bounding box of changed pixels, and visual-qa grid hotspots per pair, and writesbefore/,after/,diff/PNGs,report.json, andpr-body.md(a before|after table per viewport, a violation-id slot, verification results, and the evidence boundary sentence). A side is a Git ref (exported withgit archiveand served locally),.for the working tree, or an http(s)/file URL. PNG decoding and diffing run inside Chromium, so no new dependency is added. Plainstylegallery shotswithout--before/--afterstill routes to the site compiler unchanged.Also adds the governed how-to
quality/evidence/before-after-pr-evidence.md, a copyable PR body template inside that doc, README and CLI help usage, andscripts/test-shots-compare.mjs(bun run test:shots), which proves identical pages diff to 0 and an injected 200x120 block yields a nonzero ratio with the exact bbox40,300 200x120, across Git refs, the working tree, URLs, and argument errors. CI runs it in the compiler workflow after installing Chromium.Governance Classification
.github/pull_request_template.md.scripts/validate-okf.mjsrequires OKF frontmatter on every Markdown file outside.git/.omo/node_modules, and GitHub would insert that frontmatter into every new PR body. Exempting.githubwould be a validator scope change for the Validation owner, so it is left as a follow-up.quality/evidence/before-after-pr-evidence.mdis an Evidence Reference besidevisual-qa.md, routed fromquality/evidence/index.mdand admitted to material v2 asshared/stablelike its neighbors (quality/**family in GOVERNANCE.md). No domain guidance, Layout pattern, token, or profile value changes.scripts/shots-compare.mjsand theshotsdispatch inscripts/stylegallery-cli.mjs; the compiler adapter is untouched.consumer-reference/agent-native/v2/material-registry.json,consumer-reference/agent-native/v2/search-embeddings.json(197 documents), the admission policyversion_id, the admitted-count pins 196 -> 197 (on top of Add audit ledger schema andstylegallery audit status(P5) #71, feat(expression): AI-slop UI anti-pattern catalog (P3) #70, and Add HIG universal principles extraction (P1) #73) (schema and material tests), and the a2a/ag-ui lifecycle inventory hashes and counts viagenerateProtocolExtensionInventory(no disposition, owner, deadline, or caller-status change).log.mdentry; release is separate.Consumer Reference
consumer_reference: consumer-reference/agent-native/registry.json
Before/After
UI is unchanged, so this shows CLI output on
origin/main(1836913, before #70, #71, #73) vs this branch.stylegallery shots --before origin/main --after ., before:{ "ok": false, "operation": "shots", "failures": [ { "code": "argument_invalid", "message": "Unknown or repeated argument: --before" } ] }After (branch),
stylegallery shots --before origin/main --after . --page showcase/index.html --selector "main a":ok: true, 12 pairs (390/1440 x light/dark x default/focus/hover), 0 changed, max ratio 0 (Chromium 149.0.7827.55). The ratio is 0 because this PR changes no page. It writesreport.jsonandpr-body.md.stylegallery help, diff fromorigin/mainto this branch:Violation IDs
None. This adds tooling and fixes no audit violation.
Verification
All run locally on the tree rebased onto 9830abf (#71, #70, #73):
.github/workflows/validate.yml(validate job, 102 commands, including generated-artifact drift, OKF, links, IA, vocabulary, governance, domains, consumer-reference, agent-native, material v2, lifecycle dispositions, and pattern checks): all exit 0.bun run validate: exit 0.bun run test: exit 0.bun run eval:search(embeddings--check+ hybrid gate) andnode scripts/search-eval.mjs --gate --mode lexical: pass.node --test scripts/test-stylegallery-search.mjs,node --test scripts/test-stylegallery-setup.mjs,bun run test:compiler: pass.bun run test:audit(from Add audit ledger schema andstylegallery audit status(P5) #71): pass.bun run test:shots: 4/4 pass (identical pages ratio 0 with bbox null; injected block ratio > 0 with bbox40,300 200x120anddiffPixels24000 in all 12 pairs; Git ref + working tree; argument errors).Screenshot diffs show rendered change, not usability.