AI Flow
Public Made by Adomby adom
Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board.
Concurrent step save can discard a successfully checked board from run.json
An overlapping step placement and place check can lose a successfully checked board from run.json's boards array. This happened during the measured ESC run when I started pack/check before the previous step finished its long clip conversion. That overlap was my caller sequencing error; nevertheless Run::save explicitly advertises support for two commands at once, and silently losing a qualified board is unsafe.
Observed: place check reported board-3.kicad_pcb DRC-clean (13 inherited errors) and current. After the older step process saved, run.json boards ended at board-2. Both command turns remained in the append-only ledger, charged to routing because the step had not yet committed. Recovery was a marker followed by a sequential repeat of place check; no ledger editing.
Source: crates/aiflow-run/src/lib.rs Run::save merges turns, markers and captures, but scalar/nested state and boards are replaced by the stale writer. It also uses the same run.json.tmp path across writers.
Candidate fix: hold a per-run command lock for state-mutating commands, with a clear busy/wait response, or implement versioned compare-and-swap with proper event-derived state. Do not claim concurrent writer safety with only partial array merging. Add a regression in which a delayed step saves after add_board and verify the accepted board is not lost.