docs(phase-q): record Q-W4/Q-W5/Q-W6 landings — all seven waves structurally complete; remaining: DAW verification batch, CLAUDE.md refresh, dev merge

This commit is contained in:
2026-07-29 13:57:44 -04:00
parent d1202b3174
commit 4d2316b77c
2 changed files with 216 additions and 81 deletions
+128
View File
@@ -3128,3 +3128,131 @@ the CLAUDE.md/CONTEXT description is corrected in the same commit.
(`sample_map.h`, `editor_session.cpp`, `processor_reload.cpp`) — repoint-and-retire is a named
follow-up; `ingest.cpp` trimmed to 567 LOC but keeps the `namespaces.h` shim (`ingest` + `view`
remain the shim's unowned consumers).
---
## Q-W4 — split `actions.cpp` + dedupe bank verbs against `panel_bank_ops` (2026-07-29)
> **Merged to `phase-q` 2026-07-29 (merge of `pq-w4-actions`). Integrated suite 61/61 green,
> reviewed-approved.**
**Goal:** Split the two unrelated command-id families in one TU (1016 LOC at the Q-W0 census —
T4-03: the planned seams still land sub-600, no reshape) into
`design_view_actions` / `bank_actions` / `prune_action`, and **dedupe** `actions.cpp`'s own
`promptText`/`mintBankId` and bank verbs against the `panel_bank_ops` single-owner established in
Q-W2. `prune_action` keeps the `doBankPruneFolder` deletion authority contract intact (routes to
`persist`'s `prune_fs` after W5). CONTEXT.md §Phase Q (actions split seams; bank-verb dedupe).
See `docs/product/code-organization.md` §2.1, §2.4.
**Verify:** CTest green at every commit. Every action fires identically in DAW (Design View
family; multi-bank create/rename/reorder/delete/evacuate/activate/move/copy/remove; prune). The
bank-CRUD verbs have **one** implementation home (no `bank_panel`/`actions` duplication). Each
bank verb still wraps its mutation in one batched undo point; the prune action still writes no
ext state and opens no undo point. Command-id strings are **unchanged** (FOREVER-STABLE
contract — a reorg must not touch a shipped command id).
**Depends on:** Q-W2 (`panel_bank_ops` is the dedupe target). Independent of Q-W3.
- [x] Split `actions.cpp` (1019 LOC) → `design_view_actions` (toggle/activate/tag/untag/
showBoth/moveItems), `bank_actions` (bank CRUD family), `prune_action` (`doBankPruneFolder` —
the single file-deletion action), plus a fourth shared `action_registry` TU under
`shell/actions/`.
- [x] Dedupe `actions.cpp`'s `promptText`/`mintBankId` + bank verbs against `panel_bank_ops`
(one owner); no command-id string changed. Bank verbs reshaped to **promptless inner verbs**
(one mutation home, two UX skins — panel and actions each keep their exact prior UX);
`promptText` renamed `promptBankName`; `persistBankOp`/`persistBook` gain null-session guards.
- [x] `prune_action` verified a clean deletion-authority isolate (no `Undo_*`, no ext-state
writes). Command-id suffixes/display phrases verified byte-identical in review.
- [ ] Verify in DAW: all action families fire unchanged; one bank op = one Ctrl-Z; prune still
no-undo/no-ext-state; CTest green. — **PENDING**: in-DAW verification not yet performed on
`phase-q` (deferred by design).
**Notes/decisions:**
- **Review 🟡 (resolved in Q-W6):** two session pointers / a null-session-as-model-rejection
misreport (unreachable today) — resolved by Q-W6's `bank_ops` lift.
---
## Q-W5 — split `persist.cpp` (isolate the single file-deletion authority into `prune_fs`) (2026-07-29)
> **Merged to `phase-q` 2026-07-29 (merge of `pq-w5-persist`). Integrated suite 61/61 green,
> reviewed-approved.**
**Goal:** Split `persist.cpp` (852 LOC at the Q-W0 census — T4-04: seams unchanged; the
pS-usage growth landed exactly where this wave isolates it; 5 responsibilities) into `session`
(lifecycle+poll, `BeginLoadProjectState` reload hook), `ext_state_io` (the ext-state ↔ JSON
serialization bridge + GUID minting + folder relocation), and **`prune_fs`** (prune scanning +
`deleteOrphanFile` via `SHFileOperationW`). The split **concentrates** the byte-deleting
authority into one obvious module — it must never spread it. **Q-W0 rider (T2-04, SETTLED
2026-07-28):** generalize the `GetProjExtState` grow-loop retry policy into `bridge_marshal`'s
pure decode home (or its `core/` successor) and rewire all three hand-rolled copies —
`usage_scan`'s prune-safety-adjacent copy included. CONTEXT.md §Phase Q (persist split seams;
deletion-authority isolation). See `docs/product/code-organization.md` §2.1, §7.
**Verify:** CTest green at every commit. Session save/load/undo-reload, ext-state round-trip,
folder relocation, and prune deletion all behave identically in DAW. **File deletion lives in
exactly one module (`prune_fs`)** — the single-file-deletion-authority invariant is *improved*
(concentrated), never diluted. Relative-paths-only persistence is unchanged.
**Depends on:** Q-W1. Best after Q-W4 (so `prune_action` routes cleanly to `prune_fs`), but
independently landable.
- [x] Split `persist.cpp` (853 LOC) → `session` (lifecycle/poll + `projectconfig` reload hook),
`ext_state_io` (serialization bridge + GUID minting + folder relocation), under `shell/persist/`
+ `persist_internal.h`.
- [x] Isolate prune scanning + `deleteOrphanFile` (`SHFileOperationW`) → **`prune_fs`** — the
deletion authority concentrated in exactly one anonymous-namespace function in `prune_fs.cpp`,
verified tree-wide; the prune fail-safe chain stays byte-intact.
- [x] Dedupe the `GetProjExtState` grow-loop ×3 (T2-04): unified as a header-only template, all
three copies rewired (`usage_scan`'s start cap raised 4KB→64KB, allocation-only, verified
equivalent); the grow-loop gains a defensive NUL.
- [x] Rider: the Q-W1 `bank_book_json` residual lands via a private static `nameKey`
(Daniel-approved option a) — `bank_book.cpp` is now ~462 LOC.
- [ ] Verify in DAW: save/load/undo-reload/relocation/prune unchanged; deletion authority is one
module; relative-paths-only holds; CTest green. — **PENDING**: in-DAW verification not yet
performed on `phase-q` (deferred by design).
**Notes/decisions:**
- `persist.h` is kept as a compat umbrella for parallel safety across the in-flight waves
(retired in Q-W6); deletion-authority wording is scoped precisely in headers.
---
## Q-W6 — OCP registration-table + residual fat-header (I) splits (2026-07-29)
> **Merged to `phase-q` 2026-07-29. Integrated suite 61/61 green, reviewed-approved.**
**Goal:** Close the last SOLID wart: replace the ~350-line hand-written **non-table** action
registration blocks (now isolated in `app/main.cpp` after Q-W3) with a **registration table**, so
adding an action edits one place, not four parallel ones (OCP). Split any remaining fat headers
(`capture.h`/`persist.h`) not already resolved by their TU splits (I). (Q-W0: no reshape —
T4-02 notes the ~385-line registration residue left in `app/main.cpp` after Q-W3 shrinks
further under the table.) CONTEXT.md §Phase Q (OCP
registration-table). See `docs/product/code-organization.md` §2.3, §6 (Q-6).
**Verify:** CTest green at every commit. Every action still registers, appears in the Actions
list, and fires via `hookcommand` exactly as before; command-id + display strings unchanged
(FOREVER-STABLE, per-channel); unload still mirror-unregisters everything. Adding a hypothetical
new action now touches the table only (demonstrated in review, not shipped). Remaining fat
headers are segmented.
**Depends on:** Q-W3 (registration code must be isolated first). Sequenced last; the most
droppable point if the phase needs narrowing (Q-6).
- [x] Converted the hand-written `Register("command_id"/"gaccel"/"hookcommand")` blocks to a
data-driven `ActionTableRow` registration table (flat function-pointer dispatch, no
`std::function`/virtual); unload mirror-unregisters from the same table; `main.cpp` shrinks
653→404. Capture rows derive their suffix+phrase from the pure `captureActionTable()` (the
parallel-list risk is gone by construction). FOREVER-STABLE suffixes/phrases/retired-ids
verified byte-identical row-by-row in review.
- [x] Split residual fat headers: `persist.h` umbrella retired (13 callers repointed);
`capture.h`'s realtime seam moved to `capture_realtime_shell.h`; the `wav_trim.h` shim + its
INTERFACE target deleted.
- [x] Phase-end cleanup riders: `bankOp*` verbs + `persistBankOp` lifted to new `shell/bank_ops`
taking `ReaSamplerSession&` (dissolves the Q-W4 🟡 review note); **`core/namespaces.h`
DELETED** (the interim Q-W1 shim's contract fulfilled — ~26 includers rewired); the grow-loop
rehomed to `core/wire/ext_state_read.h`; a stale-comment sweep (`persist.cpp`/`bank_panel.cpp`
refs); CLAUDE.md's persist/bank_book/actions/wav_codec bullets corrected in-wave.
- [ ] Verify: all actions register/fire/unregister unchanged; command-id strings untouched; CTest
green. — **PENDING**: in-DAW verification not yet performed on `phase-q` (deferred by design).
**Notes/decisions:**
- **Review-noted follow-on (not landed, deferred):** extending the table pattern to the
design_view/bank/ingest families' hand-registration; `channelIdFor`'s shared string-store scan
is correct-by-prefix-disjointness — a suffix-keyed map would make it structural, but isn't
required; `view_mode_model.h` (748 LOC) remains the largest header (T4-06's planner split
stays optional/deferred).