Take the read-back back out of the persist; a write verdict belongs only where evidence crosses the plugin boundary

Its false gated six undo points, so an unverified byte-equality assumption could have silently removed Ctrl-Z for a bank mutation that landed.
This commit is contained in:
2026-08-02 13:42:51 -04:00
parent 25390d5253
commit 1c8709e82d
12 changed files with 181 additions and 127 deletions
+4 -17
View File
@@ -183,23 +183,10 @@ bool ReaSamplerSession::saveToActiveProject() {
MarkProjectDirty(static_cast<ReaProject*>(proj));
// Prove the ONE key a caller's answer hinges on. Each SetProjExtState above returns the
// size of the whole extname's state, which the six writes here keep non-zero between
// them, so no single one of those returns can speak for `banks`
// (wire::extStateWriteLanded owns the reasoning). The sibling keys stay unobserved and
// no caller claims otherwise; `banks` is the one whose absence would make a landed
// capture vanish on reload.
const wire::GrowingExtStateRead back = wire::readProjExtStateGrowing(
[&](char* buf, int cap) {
return GetProjExtState(static_cast<ReaProject*>(proj), projExtNamespace(),
kProjExtBanksKey, buf, cap);
});
if (back.status == wire::GrowingExtStateRead::Status::Overflow)
return false; // could not check -> do not claim; never folded in as an absence
return wire::extStateWriteLanded(
banksJson, back.status == wire::GrowingExtStateRead::Status::Complete
? std::optional<std::string>(back.value)
: std::nullopt);
// The writes were ISSUED into a saved active project — all this call can observe, and
// deliberately all it claims. Do not "prove" them with a read-back; session.h states
// what a false has to keep meaning to its callers, and why.
return true;
}
bool ReaSamplerSession::writeAssignmentRequest(const std::string& wire) {