From 2d040d689672aa5281fdf3d22f3f33e9dfde8f96 Mon Sep 17 00:00:00 2001 From: daniel-c-harvey Date: Wed, 22 Jul 2026 20:45:06 -0400 Subject: [PATCH] Docs: reflect Phase D1 landing Rename view_model -> view_mode_model across Design View spec docs; archive D1 to COMPLETED.md; add view_mode_model_tests to CLAUDE.md targets table and pure-core list. --- CLAUDE.md | 4 +++- COMPLETED.md | 26 ++++++++++++++++++++++++++ CONTEXT.md | 4 ++-- PLAN.md | 26 +------------------------- docs/product/design-view.md | 2 +- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 7907bf1..a7d7983 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -22,13 +22,14 @@ Vendors two submodules (see `.gitmodules`): cmake --build build ctest --test-dir build -Four targets: +Five targets: | Target | Kind | Purpose | |---|---|---| | `bank_model_tests` | executable | Pure unit tests for `bank_model` — no REAPER, no DAW. | | `peaks_tests` | executable | Pure unit tests for `peaks` — no REAPER, no DAW. | | `capture_paths_tests` | executable | Pure unit tests for `capture_paths` — no REAPER, no DAW. | +| `view_mode_model_tests` | executable | Pure unit tests for `view_mode_model` — no REAPER, no DAW. | | `reaper_reasampler` | loadable module | The actual extension binary (`.dll` / `.dylib` / `.so`). | ### macOS / Linux: SWELL dialog resources @@ -48,6 +49,7 @@ There is no hot-reload. Copy the built binary into REAPER's `UserPlugins/` folde **Pure core (no REAPER types, unit-testable outside the DAW):** - `bank_model` — `Sample` metadata struct + `BankIndex` (add/remove/query/tier/dedup-by-hash + JSON round-trip). Test it hard — it is the heart. - `peaks` — waveform min/max bin computation from raw PCM. Fed a known signal, asserts envelope. Does not depend on REAPER's peak API. +- `view_mode_model` — Design View mode system: mode registry, GUID-keyed membership, folder-tree-aware visibility derivation, snapshot-based park/restore planner, JSON round-trip. Mirror of `bank_model` for the Design View phase. **REAPER-facing shells:** - `capture` — `ICaptureBackend` interface; `OfflineRenderBackend` (deterministic default) and `RealtimeRecordBackend`. Input: `CaptureRequest`. Output: finished file + populated `Sample` handed to `bank_model`. diff --git a/COMPLETED.md b/COMPLETED.md index 73e1e92..fb285c7 100644 --- a/COMPLETED.md +++ b/COMPLETED.md @@ -115,3 +115,29 @@ folder still resolves the bank). - Project identity: keyed off a **minted GUID** stored in ext state (REAPER exposes no native per-project GUID), not the raw `ReaProject*` — a recycled pointer cannot misread a project switch as a Save-As. - Save-As: **copy** semantics (Daniel's decision) — the `reasampler_bank/` folder is copied under the new `.rpp`; the old project's bank stays intact. Every ext-state write calls `MarkProjectDirty` so captures/GUID changes flush on the normal save. - Known limitation (narrow, accepted): if a user does Save-As, closes the copy *without saving*, then reopens that copy to a *different* folder while the original is also open, identities can collide. Force-saving after Save-As would close the hole but was rejected as violating non-destructive. + +--- + +## D1 — view_mode_model (pure) +**Goal:** REAPER-free mode registry + membership index + folder-tree-aware +visibility derivation + parking/restore planner + JSON round-trip. The heart of the +phase; mirror of `bank_model`. CONTEXT.md §Design View (Module architecture — pure). +**Verify:** CTest green. N-mode model (not a boolean); Arrange + Design seeded. +Restore-planner round-trip (snapshot → park → restore) returns every driven flag to +its captured value. Parent-derivation correct against a supplied folder tree. +JSON round-trip lossless across modes + membership + show-both + snapshots + active +mode. + +- [x] Mode registry: ordered (id, display name, ordinal); Arrange + Design seeded; + add/query more modes (prove N-mode, not binary). +- [x] Membership index: `GUID → { mode ids }` + per-track show-both flag; + add / remove / retag / query; untagged = Arrange. +- [x] Folder-tree-aware visibility derivation: given a supplied parent↔child tree + + active mode, compute the visible set (active leaves, derived-visible parents, + show-both leaves, master always in). +- [x] Parking/restore planner: emit exact (track, flag, value) op-lists for park and + restore from active mode + snapshot record. +- [x] JSON round-trip: modes + membership + show-both + snapshots + active mode. +- [x] Tests: N-mode add/query; parent follows tagged leaf (multi-mode parent); + restore-round-trip returns snapshot values (never hardcoded "on"); show-both leaf + never parked; unknown/stale GUID tolerated; JSON lossless. diff --git a/CONTEXT.md b/CONTEXT.md index 8a188d7..8a74be3 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -239,7 +239,7 @@ the CPU reclaim; surface it at the toggle affordance (tooltip). ## Module architecture (preserve the pure/shell split) Pure (no REAPER types, unit-tested — the mirror of `bank_model`): -- `view_model` — mode registry (id/name/ordinal; Arrange + Design seeded); +- `view_mode_model` — mode registry (id/name/ordinal; Arrange + Design seeded); membership index (`track GUID → { mode ids }` + per-track show-both flag; add / remove / retag / query); **folder-tree-aware** visibility derivation (given the current parent↔child tree supplied by the shell + the active mode, compute the @@ -250,7 +250,7 @@ Pure (no REAPER types, unit-tested — the mirror of `bank_model`): REAPER-facing: - `view` shell — reads `I_FOLDERDEPTH` across the track list to build the - parent↔child tree and feeds it to `view_model`; applies the planner's operations + parent↔child tree and feeds it to `view_mode_model`; applies the planner's operations via `SetMediaTrackInfo_Value` (`B_SHOWINTCP` / `B_SHOWINMIXER` / `B_MAINSEND` / `I_FXEN`) and `TrackFX_GetCount` + per-FX `TrackFX_SetOffline`; snapshots prior flag values before parking; resolves GUIDs via diff --git a/PLAN.md b/PLAN.md index 2875ee3..af95e24 100644 --- a/PLAN.md +++ b/PLAN.md @@ -127,30 +127,6 @@ landed milestone. > spec: **CONTEXT.md §Design View**. Product framing: `docs/product/design-view.md`. > When a point lands, doc-keeper moves it to `COMPLETED.md`. -## D1 — view_model (pure) -**Goal:** REAPER-free mode registry + membership index + folder-tree-aware -visibility derivation + parking/restore planner + JSON round-trip. The heart of the -phase; mirror of `bank_model`. CONTEXT.md §Design View (Module architecture — pure). -**Verify:** CTest green. N-mode model (not a boolean); Arrange + Design seeded. -Restore-planner round-trip (snapshot → park → restore) returns every driven flag to -its captured value. Parent-derivation correct against a supplied folder tree. -JSON round-trip lossless across modes + membership + show-both + snapshots + active -mode. - -- [ ] Mode registry: ordered (id, display name, ordinal); Arrange + Design seeded; - add/query more modes (prove N-mode, not binary). -- [ ] Membership index: `GUID → { mode ids }` + per-track show-both flag; - add / remove / retag / query; untagged = Arrange. -- [ ] Folder-tree-aware visibility derivation: given a supplied parent↔child tree + - active mode, compute the visible set (active leaves, derived-visible parents, - show-both leaves, master always in). -- [ ] Parking/restore planner: emit exact (track, flag, value) op-lists for park and - restore from active mode + snapshot record. -- [ ] JSON round-trip: modes + membership + show-both + snapshots + active mode. -- [ ] Tests: N-mode add/query; parent follows tagged leaf (multi-mode parent); - restore-round-trip returns snapshot values (never hardcoded "on"); show-both leaf - never parked; unknown/stale GUID tolerated; JSON lossless. - ## D2 — view shell (apply flags in the DAW) **Goal:** Read the folder tree and drive REAPER flags per the planner. CONTEXT.md §Design View (view shell, REAPER API surface). @@ -159,7 +135,7 @@ CONTEXT.md §Design View (view shell, REAPER API surface). active ones from snapshot. **Master untouched. `B_MUTE`/`I_SOLO` untouched.** Untagged tracks untouched. Parents follow their tagged descendants. -- [ ] Build parent↔child tree from `I_FOLDERDEPTH`; feed to `view_model`. +- [ ] Build parent↔child tree from `I_FOLDERDEPTH`; feed to `view_mode_model`. - [ ] Snapshot prior flag values (`GetMediaTrackInfo_Value`) before parking. - [ ] Apply park/restore ops (`SetMediaTrackInfo_Value` for the four flags; `TrackFX_GetCount` + per-FX `TrackFX_SetOffline`). Verify flag names/signatures. diff --git a/docs/product/design-view.md b/docs/product/design-view.md index af2bd5b..eae71ec 100644 --- a/docs/product/design-view.md +++ b/docs/product/design-view.md @@ -273,7 +273,7 @@ index, and is togglable per selection. Mirrors the capture pillar's split exactly. -**Pure `view_model` (REAPER-free, unit-tested — the mirror of `bank_model`):** +**Pure `view_mode_model` (REAPER-free, unit-tested — the mirror of `bank_model`):** - Mode registry: ordered set of modes (id, display name, ordinal); Arrange + Design seeded; add/query more. - Membership index: `track GUID → { mode ids }` (normally one; multiple only via