Repository navigation
Add renderdiff merge - #87
Merged
Merged
Conversation
Combine a full run's out dir with a partial run's (e.g. a few routes rerun under a new mask) into a new out dir: the partial's shots replace or add to the full run's, each tagged with `from`. Fixes #76 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ore wiping Compare realpaths so a symlink or case alias of an input can't be wiped, and refuse an --out inside an input. Check every referenced file exists before wiping --out, so a missing source can't cost the previous output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tmashara
force-pushed
the
claude/issue-76-merge
branch
from
October 29, 2026 18:42
d463cdf to
03d80b8
Compare
Merged
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 / why
renderdiff merge <full-out> <partial-out> --out <dir>combines a full run with a partial one, e.g. a handful of routes rerun under a new mask, which--rerun-failedcan't do (it refuses a changed config). No browser. The result is a new out dir: the full run's results, eachname@widththe partial run also has replaced in place by the partial's shot (files included), and the partial's other shots appended. The key is the samename@widthkey--rerun-faileduses. Summary, findings,report.htmlandevidence.htmlare recomputed; exit 0, or 2 with✗ …(never 1 or 3: merging measures nothing).metais the full run's, withwidths,masks,hideSelectorsandblockUrlPatternsunioned (so "What was neutralized" never under-reports what the partial run hid or blocked) andrightReplayedFromrecomputed over the merged results. Stale accepts: the full run's minus the replaced shots, plus the partial's. Each shot keeps theacceptedflag its own run gave it;renderdiff.accepted.jsonisn't reread (no config context), documented.Refusals (exit 2) and what they protect
meta.left/meta.right: the shots would compare different sites.--outat or inside an input: never write into an input. Compared by realpath, so a trailing slash, a relative path, a symlink or a case alias can't slip past (an--outthat's a parent of an input is already refused bywipeable).--outholding foreign files: samewipeable()check and message as a run.--outis wiped, so the previous output isn't lost for nothing.slugs()suffixes-2by route order, so a partial run with fewer routes can give a route the bare stem a full-run shot uses). Checked while building the copy map, before--outis touched.--rerun-failedon a merged out dir (previous()guard): otherwise it would match the full run's config hash, reuse shots taken under the partial run's config and rewritemeta.masksto the old one, so evidence would under-report what was neutralized.The
fromfieldBaseResult.from?: string: thegeneratedAtof the run the shot came from; absent for the run inmeta. A shot that already hadfrom(the partial was itself a merge) keeps it.evidence.html: Not verified
A merged run says Not verified, with a "N shot(s) merged from a later run" note. Same rule as a
--rerun-failedrun that reused shots: shots taken at different times may not reflect the same build. For a verdict, chainrenderdiff report <dir> --verdict ….Cut
meta.merged[]: per-entryfromis the record; add a list if someone needs the partial run's config/version.--verdict/--titleon merge (chainreport), in-place merge, re-applyingrenderdiff.accepted.json, a "merged" line in report.html.How tested
Unit tier,
describe("renderdiff merge")intests/unit/report.test.ts: two out dirs built withwriteResultsand distinct file bytes per run, driven through the CLI./@1440 carriesfromand the partial's file bytes, untouched shots have nofrom,/b(an error with unsettledframes) appended with its frames copied, the replaced shot's extra crop not copied,summary.differing0,meta.masksunioned,generatedAtstays the full run's,report.htmlwritten, evidence banner Not verified; re-merging into the same--outsucceeds.--out= input, a symlink to an input with a trailing slash, a dir inside an input,--outwith a foreign file (left intact), a missing source file (the existing--outkeeps its results.json).--outnot created.All three fail on
main(the CLI treatsmergeas an origin) and pass with the change.npm run typecheck,lint,format:check,npm test(314 pass),npm run test:visual(337 pass). Partial failure: past the checks,--outonly ever held renderdiff output and stays wipeable, so rerunning the merge recovers. Theprevious()guard isn't unit-testable (the CLI preflights both URLs beforerun()).Docs: README § Output,
docs/output.md(## merge,fromin the results.json sample, the Not verified list),skills/renderdiff/reference.md(## merge, an Iterating bullet, the exit-2 row).Fixes #76
🤖 Generated with Claude Code