mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-11 21:57:14 +03:00
The sync workflow built once from the checked-out main and aborted when a human commit landed during the ~30s build window (about 10% of runs per the evidence in issue #388), leaving generated provider output stale until the next unrelated push re-triggered it. The commit step now loops up to five times: on a lost race it resets hard to the fresh origin/main (source included), re-installs and rebuilds, and pushes again with linear backoff. Every attempt therefore builds from the main it will land on, which is the invariant the old abort guard protected; the merge-base check stays inside the loop as the pre-push verification. When the rebuilt output shows no drift (the racing commit was another sync, or the new source produces identical output) the step exits cleanly instead of committing an empty sync. Validated by yaml-lint, bash -n, and a local three-repo simulation (bare origin + worker + racer) confirming the lost race rebuilds against the racer's source and lands matching output on attempt two. Retry design proposed by @mktdgtbrz in #388; implemented from the description with the no-drift early exit added. Prepared with AI assistance (Claude Code), directed by @pbakaus. Co-Authored-By: Claude Code <noreply@anthropic.com>