Cut core/wire and shell/persist comment bloat ~46% (comments only, zero code change)

This commit is contained in:
2026-07-29 20:49:28 -04:00
parent 1f24c4b095
commit 8dac5b4a54
19 changed files with 638 additions and 1286 deletions
+24 -43
View File
@@ -1,59 +1,40 @@
#pragma once
// ext_state_io — the ext-state ↔ JSON serialization half of the persist seam
// (Q-W5 split of the former persist god-TU; session.h holds the ReaSamplerSession
// lifecycle, prune_fs.cpp the prune scan + the single file-deletion authority).
// ext_state_io — the ext-state <-> JSON serialization half of the persist seam.
// This header owns the persist-side key spellings and the channel-derived
// namespace accessor; the TU (ext_state_io.cpp) implements the session's
// save/load/assignment-request bridge plus the GUID minting and bank-folder
// relocation helpers the poll executes.
// namespace accessor; ext_state_io.cpp implements the session's save/load/
// assignment-request bridge plus GUID minting and bank-folder relocation.
//
// The ext-state namespace + the WIRE-SHARED key names are the contract between this
// extension (writer) and the VST3 instrument (reader), so they live in ext_keys.h
// (pure, REAPER-free) and are included here — not duplicated. The namespace is
// CHANNEL-DERIVED (Phase V, V4): ext_keys.h's kProjExtNamespace / this projExtNamespace()
// both delegate to app_version's extStateNamespace() — "reasampler" on stable (byte-
// identical to the pre-V4 build) or "reasampler_beta" on the isolated beta build. Both
// artifacts read the ONE app_version symbol, so the instrument reads exactly the namespace
// the extension writes, per channel. Beta reads/writes ONLY its own namespace — a project
// saved by stable shows empty/default state in beta and vice versa; that isolation is the
// accepted V4 safety property (no cross-namespace read, migration, or fallback), not a bug.
// The per-key semantics persist relies on (spellings owned by ext_keys.h):
// * kProjExtBanksKey : the whole serialized BankBook (pool + named banks).
// AUTHORITATIVE going forward; the VST reads this key to see the live bank.
// * kProjExtIndexKey : RETIRED legacy single-bank key. No longer WRITTEN (cleared
// on save); READ once on load to migrate a legacy project into the pool.
// * kProjExtViewKey : the Design-View ViewModeModel JSON.
// * kProjExtTailKey : the docked panel's TailSetting JSON.
// * kProjExtGuidKey : the per-project minted GUID (content-based identity; poll()
// tells a Save-As from a recycled-pointer project switch by it).
// All are FOREVER-STABLE once shipped: changing any strands every already-saved
// project's stored state under that key.
// The namespace + wire-shared key names are the contract with the VST3
// instrument; they live in ext_keys.h (pure, REAPER-free), included here, not
// duplicated. Channel-derived: "reasampler" on stable, "reasampler_beta" on
// beta — a project saved by stable shows empty/default state in beta and vice
// versa; that isolation is deliberate.
//
// Per-key semantics (spellings owned by ext_keys.h): kProjExtBanksKey is the
// whole serialized BankBook, authoritative; kProjExtIndexKey is the retired
// legacy single-bank key (read once to migrate); kProjExtViewKey/TailKey are
// the Design-View and tail JSON; kProjExtGuidKey is the per-project minted
// GUID poll() uses to tell Save-As from a recycled-pointer switch. All are
// FOREVER-STABLE once shipped.
#include "core/version/app_version.h"
#include "ext_keys.h"
namespace reasampler {
// The accessor form of the namespace: ext_keys.h's kProjExtNamespace is the value; this
// is the const char* the SetProjExtState/GetProjExtState calls pass. Kept as an
// accessor (not a literal) because the string is channel-derived at build time.
// Accessor, not a literal, because the string is channel-derived at build time.
inline const char* projExtNamespace() { return version::extStateNamespace().c_str(); }
// The two EXTENSION-ONLY keys — NOT part of the VST wire contract (the instrument
// reads only banks/view/tail/guid), so they stay here rather than in ext_keys.h:
//
// owned_files — the owned-file manifest JSON (project-relative files the capture path
// itself created; Phase B B-cap seam, consumed by Phase R prune to tell the bank system's
// own orphans from hand-dropped files). A SIBLING key alongside banks/view/tail — NOT
// folded into `banks`, so it stays decoupled from membership. FOREVER-STABLE: changing it
// strands every saved project's ownership record (prune falls back to an empty manifest —
// graceful, but the attribution safety net is lost until the next capture rebuilds it).
// Extension-only keys — not part of the VST wire contract, so they live here
// rather than in ext_keys.h.
// Project-relative files the capture path itself created, consumed by prune
// to tell the bank system's own orphans from hand-dropped files. A sibling
// key, not folded into `banks`. FOREVER-STABLE.
inline constexpr const char* kProjExtOwnedKey = "owned_files";
// version — the ReaSampler version that last WROTE this project (Phase V, V1). Written on
// every save, so every saved .rpp records which build produced its state — the seam a
// future within-channel forward migration keys off. An absent key is the explicit
// pre-versioning case, read silently, never an error. FOREVER-STABLE key string.
// The ReaSampler version that last wrote this project. An absent key is the
// pre-versioning case, read silently. FOREVER-STABLE.
inline constexpr const char* kProjExtVersionKey = "version";
} // namespace reasampler