From a6b432f106405d295b7fda5c88986d00805da64c Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Fri, 11 Sep 2026 14:14:25 +0800 Subject: [PATCH] docs(03-11): complete save architecture correction plan --- .planning/WINDOWS.md | 18 +-- .../03-data-completion/03-11-SUMMARY.md | 146 ++++++++++++++++++ 2 files changed, 155 insertions(+), 9 deletions(-) create mode 100644 .planning/phases/03-data-completion/03-11-SUMMARY.md diff --git a/.planning/WINDOWS.md b/.planning/WINDOWS.md index 0223196..32272b6 100644 --- a/.planning/WINDOWS.md +++ b/.planning/WINDOWS.md @@ -1,10 +1,10 @@ --- schema_version: 1 -open_count: 11 +open_count: 9 waived_count: 0 -fixed_count: 6 +fixed_count: 8 total_count: 17 -last_updated: 2026-09-11T06:04:34.207Z +last_updated: 2026-09-11T06:11:49.370Z --- # Broken Windows Ledger @@ -21,8 +21,8 @@ last_updated: 2026-09-11T06:04:34.207Z | 4 | 02 | skipped-test | packages-user/data-common/src/common/mover.test.ts | | 4 个 it.skip 坐标回写回归用例(x/y 正交、斜向、传送),待 02-02 修复 mover.ts:651 后翻绿 | fixed | | 2026-09-09T07:51:25.555Z | 2026-09-09T09:34:39.843Z | | 5 | 02 | stub | packages-user/data-system/src/path/system.ts | 254 | interrupt() is an intentional placeholder that only stops the in-flight move; takeover sequencing (stop-then-await per approved option 1) is implemented by 02-03 Task 4 | fixed | | 2026-09-09T09:34:59.707Z | 2026-09-09T13:24:24.755Z | | 6 | 02 | stub | packages-user/data-state/src/hero/moverImpl.ts | 284 | Existing cannotEnter() is intentionally empty because no event trigger corresponds to movement blocked by an impassable mask; D-08 direct OnTouch dispatch handles allowed adjacent no-pass targets. | open | | 2026-09-10T01:38:48.570Z | | -| 7 | 03 | stub | packages-user/data-common/src/save/memory.ts | 90 | MemorySaveSystem.saveAutosaveToDB is an intentional no-op because Node never persists to IndexedDB. | open | | 2026-09-10T07:45:16.944Z | | -| 8 | 03 | stub | packages-user/data-common/src/save/memory.ts | 90 | MemorySaveSystem.saveAutosaveToDB is an intentional no-op because Node never persists to IndexedDB. | open | | 2026-09-10T07:45:32.524Z | | +| 7 | 03 | stub | packages-user/data-common/src/save/memory.ts | 90 | MemorySaveSystem.saveAutosaveToDB is an intentional no-op because Node never persists to IndexedDB. | fixed | | 2026-09-10T07:45:16.944Z | 2026-09-11T06:11:48.592Z | +| 8 | 03 | stub | packages-user/data-common/src/save/memory.ts | 90 | MemorySaveSystem.saveAutosaveToDB is an intentional no-op because Node never persists to IndexedDB. | fixed | | 2026-09-10T07:45:32.524Z | 2026-09-11T06:11:49.370Z | | 9 | 03 | stub | packages-user/data-state/src/legacy/dependencies.ts | 53 | Node legacy dependency boundary intentionally registers no browser loading callbacks. | fixed | | 2026-09-10T07:45:33.228Z | 2026-09-11T06:04:34.207Z | | 10 | 03 | deviation | packages-user/data-base/src/map/mapLayer.ts | 216 | Replaced Map.getOrInsertComputed with explicit Map lookup so the replay event path is Node-safe without a global prototype shim. | open | | 2026-09-10T07:45:33.930Z | | | 11 | 03 | unrun-verify | .planning/phases/03-data-completion/deferred-items.md | | Repository type gate remains non-zero on pre-existing render/legacy and Tile contract diagnostics; owned Node tracer and data tests pass. | fixed | | 2026-09-10T07:45:45.249Z | 2026-09-10T07:58:56.466Z | @@ -114,10 +114,10 @@ last_updated: 2026-09-11T06:04:34.207Z "file": "packages-user/data-common/src/save/memory.ts", "line": 90, "description": "MemorySaveSystem.saveAutosaveToDB is an intentional no-op because Node never persists to IndexedDB.", - "status": "open", + "status": "fixed", "reason": "", "recorded_at": "2026-09-10T07:45:16.944Z", - "resolved_at": null + "resolved_at": "2026-09-11T06:11:48.592Z" }, { "id": 8, @@ -126,10 +126,10 @@ last_updated: 2026-09-11T06:04:34.207Z "file": "packages-user/data-common/src/save/memory.ts", "line": 90, "description": "MemorySaveSystem.saveAutosaveToDB is an intentional no-op because Node never persists to IndexedDB.", - "status": "open", + "status": "fixed", "reason": "", "recorded_at": "2026-09-10T07:45:32.524Z", - "resolved_at": null + "resolved_at": "2026-09-11T06:11:49.370Z" }, { "id": 9, diff --git a/.planning/phases/03-data-completion/03-11-SUMMARY.md b/.planning/phases/03-data-completion/03-11-SUMMARY.md new file mode 100644 index 0000000..a8c6545 --- /dev/null +++ b/.planning/phases/03-data-completion/03-11-SUMMARY.md @@ -0,0 +1,146 @@ +--- +phase: 03-data-completion +plan: 11 +subsystem: data-state-compatibility +tags: [save-system, compatibility, node-regression, data-state] + +requires: + - phase: 03-data-completion + provides: Existing SaveSystem and compatibility loading path restored by Plan 03-10 +provides: + - Phase-3-only MemorySaveSystem implementation and save-barrel export removed + - CoreState regression coverage asserting independent existing SaveSystem instances + - Node replay construction and tracer coverage without a Node-specific save adapter +affects: [03-data-completion, Phase 4 render adaptation, Phase 5 legacy migration] + +actuals: + tokens: 1795 + tasks: 2 + commits: 2 + plan_head_before: 3bd90535a5aa6073079935ae9b0a627a6c3e0f1b +commits: 2 + +tech-stack: + added: [] + patterns: + - CoreState continues to use the existing SaveSystem and compatibility loading callback + - Node regressions verify independent state construction without a parallel persistence implementation + +key-files: + created: [] + modified: + - packages-user/data-common/src/save/index.ts + - packages-user/data-state/test/coreNode.test.ts + - packages-user/data-state/test/nodeTracer.test.ts + - .planning/WINDOWS.md + deleted: + - packages-user/data-common/src/save/memory.ts + +key-decisions: + - "Followed S-01: remove the Phase-3 save adapter while preserving SaveSystem, compression, registration, and compatibility initialization." + - "Did not move save to rendering, add a replacement adapter, or modify user-owned @shouldReplay() placement." + +patterns-established: + - "The existing SaveSystem remains the sole CoreState save implementation." + - "Node tests cover construction and replay behavior without configuring save methods or introducing a test substitute." + +requirements-completed: [DATA-01] + +coverage: + - id: D1 + description: "Phase-3 MemorySaveSystem is absent and the save barrel exports only the existing system/types modules." + requirement: DATA-01 + verification: + - kind: other + ref: "Source checks for deleted adapter, barrel export, SaveSystem, and CoreState selection" + status: pass + human_judgment: false + - id: D2 + description: "Independent CoreState construction and Node replay remain covered with the existing SaveSystem." + requirement: DATA-01 + verification: + - kind: unit + ref: "packages-user/data-state/test/coreNode.test.ts" + status: pass + - kind: unit + ref: "packages-user/data-state/test/nodeTracer.test.ts" + status: pass + - kind: integration + ref: "pnpm test:data-node" + status: pass + human_judgment: false + +duration: 9min +completed: 2026-09-11 +status: complete +--- + +# Phase 3 Plan 11 Summary + +**Phase-3 in-memory save adapter removed while CoreState preserves the existing SaveSystem and compatibility initialization path** + +## Performance + +- **Duration:** 9 min +- **Started:** 2026-09-11T06:04:00Z +- **Completed:** 2026-09-11T06:12:47Z +- **Tasks:** 2 +- **Files modified:** 5 including the broken-windows ledger update + +## Accomplishments + +- Deleted `packages-user/data-common/src/save/memory.ts` and removed only its export from the save barrel. +- Preserved `SaveSystem`, `ISaveSystem`, save compression/configuration, saveable registration, and the existing compatibility `coreInit` loading callback in `CoreState`. +- Updated focused Node regressions to assert independent `SaveSystem` instances while retaining construction, independence, and replay behavior coverage. +- Marked the two obsolete MemorySaveSystem stub entries in `.planning/WINDOWS.md` fixed. +- Left `STATE.md` and `ROADMAP.md` untouched, including their unrelated existing working-tree changes. + +## Task Commits + +Each task was committed atomically: + +1. **Task 1: CORR-03-02 remove the Phase-3 save adapter** - `4f606d9` (fix) +2. **Task 2: CORR-03-02 align CoreState and tracer regressions with existing save behavior** - `5a20674` (test) + +## Files Created/Modified + +- `packages-user/data-common/src/save/index.ts` - Retains only the existing save system and type exports. +- `packages-user/data-common/src/save/memory.ts` - Deleted Phase-3-only in-memory adapter. +- `packages-user/data-state/test/coreNode.test.ts` - Expects the existing SaveSystem for Node construction. +- `packages-user/data-state/test/nodeTracer.test.ts` - Retains independent SaveSystem and replay tracer coverage. +- `.planning/WINDOWS.md` - Closes obsolete adapter-stub entries. + +## Decisions Made + +- Followed S-01 exactly: save remains on the existing SaveSystem and compatibility loading path. +- Did not migrate save to rendering, add an adapter replacement, or alter user-owned `@shouldReplay()` placement. +- Did not modify `STATE.md` or `ROADMAP.md`. + +## Deviations from Plan + +None - plan executed exactly as written. + +## Issues Encountered + +- The first final source-gate callback check used an overly strict text pattern; the check was corrected without changing source and the complete plan gate then passed. +- Test output included the existing Browserslist freshness warning; it did not fail any gate. + +## User Setup Required + +None - no external service configuration required. + +## Next Phase Readiness + +- CORR-03-02 is closed: the Phase-3 save adapter is absent and CoreState still selects the existing SaveSystem. +- Plan 03-15 can proceed without any save architecture changes. + +--- +*Phase: 03-data-completion* +*Completed: 2026-09-11* + +## Self-Check: PASSED + +- Summary file and all modified test/source files exist. +- Task commits `4f606d9` and `5a20674` are present in git history. +- Final source, focused Vitest, and `pnpm test:data-node` gates passed. +- `STATE.md` and `ROADMAP.md` remain unmodified by this plan.