Liz on the Web: Digital Strategy from Start to Scale

Liz on the Web: Digital Strategy from Start to Scale

B*tchwork my AI Did for Me - Part 57: My AI Replays Proof Commits in a Worktree When a Git Push Race Hits

Oct 16, 2026
∙ Paid

ATHENA logs a receipt for every post it publishes. When two processes reached the same branch at the same time and one got knocked off, I told my AI to fix the recovery path without a full re-clone.

ATHENA had just published a post.

After every publish, the system writes a proof commit. Think of it like a timestamp in a ledger. Git records the file, the content, and when it happened. That log is how I know what shipped and what did not.

Except this time, another automation had pushed to the same branch a half-second earlier. It got there first. ATHENA's proof commit got rejected.

Git does not share. Two things try to update the same branch at the same time, and one of them loses. That is a push race.

The old recovery path re-cloned the whole repo before retrying. Clone means download a full copy of everything. On a normal day, that works. Under load, it can take long enough to time out. If it times out, the retry fails too. The post shipped. The ledger has a blank line. Nobody knows.

That kind of silent failure shows up weeks later when I am trying to audit what actually ran.

I was not going to sit and watch git retries. So I handed the problem to my AI.

I told it: do not re-clone. Fetch just the latest state of the branch. Replay the patch in a temporary local worktree. Verify the file actually landed on the remote before counting it as done. Clean up the temp folder either way.

The fix shipped September 25. The code is in automation/genius-bitchwork/git-handoff.mjs. The tests are in automation/genius-bitchwork/git-handoff.test.mjs.

A push race is two things trying to write to the same place at the same time. The fix does not prevent the race. It makes sure the proof still lands after losing one.

What this article covers

I am going to show you the full failure mode and the fix. You will see:

  • What a push race is and why it knocked the proof commit off the branch

  • Why re-cloning was the slow, risky old path

  • What I asked my AI to build instead

  • How the worktree replay works in plain language

  • The four things ATHENA checks before it calls the proof delivered

Who this is for

This is for you if:

  • You run automations that write to git and have seen a push fail for no obvious reason.

  • You have a system logging receipts, records, or timestamps and you are not sure they always land.

  • You want to understand how a git worktree works without being a developer.

  • You are building ATHENA-style automation and want to see how one real edge case got patched.

  • You keep finding silent failures in your logs and want a pattern for fixing them properly.

If that is you, keep reading.

Why you can trust this story

This was not a test run. The push race happened in a live ATHENA run on a real branch.

The fix is real code. automation/genius-bitchwork/git-handoff.mjs is the recovery module. automation/genius-bitchwork/git-handoff.test.mjs covers the replay path. Both are in ATHENA-git, committed September 25, 2026.

I am not selling a tool. There is no paid tool here. I am giving you the prompts I actually used, in plain language.

Behind this paywall

Paid readers get:

  • The exact prompt I used to hand this problem to my AI.

  • A plain-language walkthrough of every step in the worktree replay flow.

  • The four checks ATHENA runs before it counts a replayed commit as delivered.

  • The two decisions my AI could not make and why I had to call them.

  • What to check manually if you are building something similar.

  • A copy-this recap for your own push-race recovery pattern.

  • Sources and receipts from the ATHENA-git repo.

Subscribe and the rest opens right now.

The full walkthrough is below the paywall.


Click the button, subscribe, and the locked section below opens right away. You get this article now.


User's avatar

Continue reading this post for free, courtesy of Liz Elliott 🕸️.

Or purchase a paid subscription.
© 2026 Liz Elliott · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture