-
fix(tracks): repair the stale-Pulsar-buffer clobber, and detect the next one in seconds · a5c61c0b
PLN: "wap has atm bass on d4, yet d4 effects on 57 and 89!! Why dont i see your changes in tidal ??" ... then, on the diagnosis: "how can we trust each other with pulsar" and "cause reloads dont do it, and i could close tabs before your edits then, but its annoying ahahah". == WHAT HAPPENED == Pulsar saves the BUFFER, not the file. Its process had been running since Sun Jul 26 17:19, so every track opened before this afternoon held three-day-old text. PLN commented two lines out in wap.tidal and hit ctrl+S — and Pulsar wrote that entire stale buffer back, silently reverting EVERY control the column migration had moved: ^31 -> ^52 ^32 -> ^53 ^33 -> ^34 ^17 -> ^18 and it deleted the FIXME(#54) comment No warning, no conflict marker, no error. He noticed an hour later because a knob was in the wrong place. do_it_right.tidal was hit the same way. Two details that make this nastier than it sounds, both now written down: * "Window: Reload" does NOT fix it — that restores buffers from Pulsar's session cache, not from disk. The only reliable action is to CLOSE THE TAB and reopen. * The clobber is INDISTINGUISHABLE from a hand edit at a glance. It arrives inside a legitimate diff, mixed with real intent. Repaired by re-running migrate-columns (idempotent — it recomputes the permutation from current content), plus one hand fix for wap's d9 ^18 -> ^17 which the migrator does not cover since d9-d12 are not column orbits. PLN's actual intent — commenting out three crushbus/octer lines in wap d4 — is preserved: those were live pre- migration and he disabled them on purpose. Verified by diffing against the pre-migration commit rather than assuming. == WHY DETECTION AND NOT PREVENTION == Prevention is unavailable. Pulsar's ~/.pulsar/storage/application.json is 75 bytes of project roots — there is no way for a tool to ask which files are open, so I cannot refuse to edit an open file. And "close every tab before Claude edits" is a chore, not a system; PLN is right to reject it. So the trust mechanism is two things that need no discipline from either of us: 1. COMMIT IMMEDIATELY. Already the practice, and it is exactly why this was recoverable in two commands instead of lost — the clobber showed up as a diff against a known-good commit. 2. DETECT IN SECONDS, NOT AN HOUR. tools/check-drift.sh. == THE DESIGN LESSON INSIDE check-drift == The first version counted changed ^NN lines and called any bulk change a clobber. It then flagged my own REPAIR of the clobber as drift. That is crying wolf, and a gate that cries wolf gets ignored — the same principle already written into `gig-log preflight` about never failing on intentional performance state. The fix was to define the thing properly. Drift is not "control numbers changed", it is "control numbers moved AWAY FROM THE GRID". So the grid is measured FIRST (surface-columns --knobs, floor of 5 = the deliberate gSel overflows), and the working-tree diff is then judged in that light: bulk CC change + broken grid = DRIFT; bulk CC change + intact grid = a repair, reported and not failed. Verified both directions, which is the only way this is worth anything: positive — current repaired tree: exit 0, wap correctly read as "toward the grid" negative — restored the pre-migration wap over the top to simulate the clobber: 13 knobs out of column and 16 ^NN lines changed, both flagged, exit 1 Then restored, grid back to 5. Wired into gig-up.sh's readiness gate alongside preflight and check-mix, so the question gets asked whether or not anyone remembers to ask it.PLN (Algolia) authoreda5c61c0b
×