From a3d75b0e454de4b59516ec64842ab6031c3fb0d1 Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 22 Oct 2026 14:37:48 +0200 Subject: [PATCH] :bug: Preserve file destinations through undo and redo Keep a namespaced file destination on each history change. Replay changes in order in their target files, including stacked entries and transactions. Keep payload fields named file-id intact, such as set-tokens-source (F111). Snapshot the current file and every library in both composable runners. Name the file in failure signatures; normalize the server synced-at status stamp alongside modified-at. Update golden cases H and AP for this exclusion. The library update regression checks both files through undo and redo and failed against the old code. Common JVM: 1705 tests; JS: 1633; frontend: 1495; backend: 1610; exporter: 14. All pass, with lint and formatting checks for both changed modules. Benchmark vs Phase 1e (lower quantile, ms): world baseline now ratio main-10 1.790 0.993 0.55 main-100 15.415 9.038 0.59 main-1000 153.086 90.145 0.59 three-levels 35.215 18.989 0.54 chain 68.931 35.045 0.51 library-500 83.083 85.830 1.03 many-shapes 4.837 3.344 0.69 variant-100 32.052 33.586 1.05 All worlds pass the 10% regression threshold. AI-assisted-by: GPT-6 --- .../frontend/composable-component-tests.md | 7 ++- .../workspace-state-persistence-subtleties.md | 7 ++- .../test_helpers/composable/comp/runner.cljc | 3 +- .../composable/comp/undo_check.cljc | 35 ++++++++++----- .../app/common/test_helpers/normalize.cljc | 4 +- .../logic/composable_runner_test.cljc | 12 +++--- frontend/src/app/main/data/workspace.cljs | 6 +-- .../src/app/main/data/workspace/undo.cljs | 43 +++++++++++-------- .../composable_tests/golden_master.edn | 4 +- .../composable_tests/interpreter.cljs | 8 ++-- .../data/workspace_remote_cascade_test.cljs | 27 ++++++++++++ 11 files changed, 108 insertions(+), 48 deletions(-) diff --git a/.serena/memories/frontend/composable-component-tests.md b/.serena/memories/frontend/composable-component-tests.md index a4fb3aba7d..82c9ab9327 100644 --- a/.serena/memories/frontend/composable-component-tests.md +++ b/.serena/memories/frontend/composable-component-tests.md @@ -117,7 +117,7 @@ Two pure runners (no store, JVM + CLJS): `common-tests.logic.composable-runner-test`. - Undo/redo round trip (`comp/undo_check.cljc`, alias `uc`), on by default in the pure runner (`:undo-check?`): after each `:user` step that pushed a group, undo must give back the - normalized file before it and redo the file after it (the variant continues from the redone + normalized files before it and redo the files after it (the variant continues from the redone file); a user step that pushed nothing must change nothing (`:no-undo-entry`); at the end, undo back to the last assembly step (the baseline; a case's own undo below it moves it) and redo all. Files compare through `app.common.test-helpers.normalize` (`thn/normalize-file`: @@ -137,6 +137,11 @@ Two pure runners (no store, JVM + CLJS): workspace undo index (`:undo-index`/`:redo-index` phases): a step must add exactly one undo entry or group. File installs (assembly ops) are its baselines; a skipped optional and an inline `Test` are not. The interpreter empties `:workspace-undo` per variant. Frontend snapshots drop `:position-data` under WASM. + Both runners use `uc/snapshot-files` for the current file and every + auxiliary/library file. File differences prefix signatures with + `[:file