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
+10 -10
View File
@@ -108,16 +108,14 @@ public:
void bumpBankGeneration() { ++bankGeneration_; }
// Serializes book/view/tail to ext state, clears the retired legacy
// `bank_index` key. No-ops with no active/saved project.
// `bank_index` key. No-ops with no active/saved project. Returns true iff
// a persist happened, so a caller can skip an undo block when nothing was written.
//
// Returns true iff the `banks` key READ BACK as exactly what this call wrote
// the only per-key observation available under a shared extname
// (wire::extStateWriteLanded owns why SetProjExtState's own return cannot
// answer it). A false therefore covers four things without distinguishing
// them: no active project, an unsaved project, a rejected write, and a
// read-back that could not complete. The sibling keys (view/tail/ledger/
// version/generation) are written but NOT verified, so no caller may read
// this as "everything persisted" — only as "the bank state is in the project".
// "Happened" is the writes being ISSUED, and a false means exactly two things
// no active project, or an unsaved one — with NOTHING written under either. SIX
// callers turn a false straight into a discarded undo point, so this must never
// grow a third, OBSERVATIONAL failure mode: a false negative would silently
// remove the Ctrl-Z for a bank mutation that landed.
bool saveToActiveProject();
// Report-only prune dry-run: feeds the pure core with (present, referenced,
@@ -151,7 +149,9 @@ public:
// Write the ingest assignment request (`assign_request` key): "the active
// sampler instance should now play THIS sample." `wire` is pre-encoded
// (assignment_request.h); a sibling one-shot write, not part of
// saveToActiveProject's blob. Returns true iff written.
// saveToActiveProject's blob. Same two-condition return as that call: false
// means no active/saved project and nothing was written, true means the write
// was ISSUED — never that the project took it.
bool writeAssignmentRequest(const std::string& wire);
// Detects a project load or Save-As and reacts. Driven by REAPER's