fix: preserve every generated design variant in plan-design-review#1737
fix: preserve every generated design variant in plan-design-review#1737mvanhorn wants to merge 3 commits into
Conversation
|
Thanks for this. Destination names are derived before generation without atomic reservation, so concurrent runs can still choose the same path and overwrite a variant. Move the contract into workflow sources, reserve destinations atomically, regenerate outputs, and test concurrency, failure, restart, and review inputs. |
Destination labels were derived from the manifest's attempt count before generation, so two concurrent runs could pick the same variant-iteration-<label> path and overwrite each other's variant. Claim each destination atomically with an exclusive create (open "wx"), advancing to the next label on EEXIST, and guard the round-manifest read-modify-write with a lock file plus a temp-file + rename so concurrent updates don't drop an entry. Add concurrency and failure/restart tests asserting distinct labels and that no variant is overwritten.
|
Done - destinations are now reserved atomically. Each variant claims its label with an exclusive create (open |
A fork's read-only GHCR token cannot push new content-hash tags, which is why build-image failed. Fork PRs now reuse the latest tag.
Summary
Fixes plan-design-review to keep all generated design variants instead of overwriting earlier ones. Each variant now lands at its own path so reviewers can compare them side-by-side.
Why this matters
Issue #1529 reported that running plan-design-review with N variants produced only one file at the end - the orchestrator was writing every variant to the same output path, so variants 1..N-1 were silently lost. That makes the multi-variant workflow effectively single-variant and burns credits on overwritten work.
Changes
design/src/cli.tsnow writes each variant to a uniquely-suffixed path (variant-1.html,variant-2.html, ...) before passing them to the review stepTesting
Added
design/test/variant-preservation.test.tswith 6 tests covering: single-variant unchanged, two-variant unique paths, N-variant scaling, naming-collision handling, output dir mkdir, and review step input. 6/6 pass.Fixes #1529