pS-usage: captures held by live ReaSampler 9000 instances are un-prunable — instances publish usage_<guid> ext-state records (ComponentState v11), prune unions live holds into referenced

This commit is contained in:
2026-07-28 12:56:36 -04:00
parent f988ded543
commit 5886ae1456
19 changed files with 1282 additions and 10 deletions
+11 -2
View File
@@ -96,6 +96,7 @@
#include "app_version.h"
#include "capture_paths.h"
#include "prune_reconcile.h"
#include "usage_scan.h" // liveInstanceHeldPaths (pS-usage: instance holds join `referenced`)
#include "vst/bank_sync.h" // parseBankGeneration / formatBankGeneration (SHARED with the instrument reader)
#define REAPERAPI_MINIMAL
@@ -359,9 +360,17 @@ PruneScan scanPruneOrphans(const BankBook& book, const OwnedFileManifest& owned)
// The decision lives in the pure core — read-only inputs from the book and manifest.
// referencedPaths() unions across the whole book (pool included); owned().paths() is
// the manifest set. This shell only enumerates, resolves, and stats.
// the manifest set. pS-usage: the referenced set additionally unions every LIVE
// ReaSampler 9000 instance's held captures (usage_scan reads the per-instance
// usage_* records + the live FX enumeration; sample_usage decides liveness) — a
// capture any live instance holds can NEVER be an orphan, even when its bank entry
// was deleted while the instance kept its ref. liveInstanceHeldPaths is READ-ONLY,
// preserving this scan's no-write contract. This shell only enumerates, resolves,
// and stats.
scan.bankDirAbs = bankDir;
scan.orphans = pruneOrphans(present, book.referencedPaths(), owned.paths());
scan.orphans = pruneOrphans(
present, mergeReferenced(book.referencedPaths(), liveInstanceHeldPaths(proj)),
owned.paths());
return scan;
}