diff --git a/.planning/ROADMAP.md b/.planning/ROADMAP.md index 33eb63c..04ddbcb 100644 --- a/.planning/ROADMAP.md +++ b/.planning/ROADMAP.md @@ -34,15 +34,15 @@ Decimal phases appear between their surrounding integers in numeric order. 3. 引擎能执行踩踏触发事件驱动的事件执行链路(对话/开门依赖 A2 内建函数清单,延后到收尾工作) 4. 事件系统保持面向初学者的简单抽象,未引入复杂场景的通用表达能力 -**Plans**: 8/10 plans executed +**Plans**: 9/10 plans executed Plans: - [x] 01-04-PLAN.md - [x] 01-05-PLAN.md - [x] 01-06-PLAN.md - [x] 01-07-PLAN.md -- [ ] 01-08-PLAN.md -- [ ] 01-09-PLAN.md +- [x] 01-08-PLAN.md — GameEventStore add/get/duplicate-warning regression; rawEvent and cycle baselines preserved +- [ ] 01-09-PLAN.md — GameMap point-event-only save aggregation; production registration deferred - [x] 01-10-PLAN.md **Wave 1** @@ -135,7 +135,7 @@ Phases execute in numeric order: 1 → 2 → 3 → 4 → 5 → 6 | Phase | Plans Complete | Status | Completed | |-------|----------------|--------|-----------| -| 1. 事件系统 | 8/10 | In Progress| | +| 1. 事件系统 | 9/10 | In Progress| | | 2. 寻路系统 | 0/TBD | Not started | - | | 3. 数据端完成 | 0/TBD | Not started | - | | 4. 渲染适配与双布局 | 0/TBD | Not started | - | diff --git a/.planning/STATE.md b/.planning/STATE.md index 92bc263..c606586 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -4,16 +4,16 @@ milestone: v1.0 current_phase: 01 current_phase_name: event status: executing -stopped_at: Completed 01-07-PLAN.md; 01-08 and 01-09 deferred by user decision -last_updated: "2026-09-08T16:21:42.803Z" +stopped_at: Completed 01-08-PLAN.md +last_updated: "2026-09-09T02:18:11.542Z" last_activity: 2026-09-08 last_activity_desc: Phase 01 Plan 05 decision recording completed -state_head: ff41ab3d6ce0f2b444a39d4f33b0b63778482618 +state_head: 6e96abb7a2209ac79b901276c7147ebb32abad49 progress: total_phases: 6 completed_phases: 0 total_plans: 10 - completed_plans: 8 + completed_plans: 9 milestone_name: milestone --- @@ -29,7 +29,7 @@ See: .planning/PROJECT.md (updated 2026-09-07) ## Current Position Phase: 01 (event) — EXECUTING -Plan: 8 of 10 +Plan: 9 of 10 Status: Ready to execute next plan Last activity: 2026-09-08 — Phase 01 execution started @@ -64,6 +64,7 @@ Progress: [█████░░░░░] 50% | Phase 01 P06 | 20min | 2 tasks | 4 files | | Phase 01 P10 | 25min | 2 tasks | 5 files | | Phase 01 P07 | 25min | 2 tasks | 5 files | +| Phase 01 P08 | 3min | 1 tasks | 1 files | ## Accumulated Context @@ -84,7 +85,8 @@ Recent decisions affecting current work: - [Phase 01]: Plan 01-06 validates raw map event containers before registration and binds coordinate events to the event layer. - [Phase 01]: Plan 01-10 restores raw tile defaults and implements the approved coordinate point-event lifecycle; map-level aggregation and registration remain deferred. - [Phase 01]: Plan 01-07 dispatches one approved source-aware point/static/dynamic invocation sequence with trigger filtering before cut/reduce. -- [Phase 01]: Plans 01-08 and 01-09 remain unexecuted by explicit user decision: preserve rawEvent/Promise/as adapters/cycles and defer production registration plus unsafe map aggregation. +- [Phase 01]: Plans 01-08 and 01-09 remain unexecuted; their revised scope preserves rawEvent/Promise/as adapters/cycles, tests only eventStore behavior, and isolates GameMap point-event aggregation without production registration. +- [Phase 01]: Plan 01-08 regression-tests GameEventStore through the public barrel and preserves rawEvent, Promise, and eventStore-cycle deferrals. ### Pending Todos @@ -93,8 +95,8 @@ None yet. ### Blockers/Concerns - 数据层 L0–L3 接口设计仍在进行中(由用户主导),DATA-01(Phase 3)依赖接口设计落地 -- 01-08 rawEvent cache-safety and no-as implementation assumptions conflict with the explicit 01-05 user-approved current contract; replan before execution. -- eventStore circular paths are explicitly preserved as the Phase 01 baseline; revise any gate that requires those paths to disappear before execution. +- 01-08 rawEvent cache-safety and no-as implementation assumptions are explicitly removed from the revised executable scope; the 01-05 current contract remains unchanged. +- eventStore circular paths are explicitly preserved as the Phase 01 baseline; the revised 01-08 regression does not require those paths to disappear. ## Deferred Items @@ -104,6 +106,6 @@ None yet. ## Session Continuity -Last session: 2026-09-08T16:21:42.697Z -Stopped at: Completed 01-07-PLAN.md; 01-08 and 01-09 deferred by user decision +Last session: 2026-09-09T02:18:11.503Z +Stopped at: Completed 01-08-PLAN.md Resume file: None diff --git a/.planning/phases/01-event/01-08-SUMMARY.md b/.planning/phases/01-event/01-08-SUMMARY.md new file mode 100644 index 0000000..a9dfa9b --- /dev/null +++ b/.planning/phases/01-event/01-08-SUMMARY.md @@ -0,0 +1,115 @@ +--- +phase: 01-event +plan: 08 +subsystem: event-store-testing +tags: [typescript, vitest, events, event-store, regression] +requires: + - phase: 01-event/01-05 + provides: Approved rawEvent compatibility contract and eventStore cycle deferral baseline +provides: + - Public-barrel GameEventStore add/get regression coverage + - Duplicate-id warning and last-write-wins regression coverage +affects: [phase-01-verification] +actuals: + tokens: 529 + tasks: 1 + commits: 1 +plan_head_before: c3a958c932e4ff9ff819ffc229fd96bb8a560872 +tech-stack: + added: [] + patterns: + - Node-only Vitest fixtures stub the existing logger globals before public-barrel imports +key-files: + created: + - packages-user/data-common/src/store/eventStore.test.ts + modified: [] +key-decisions: + - "Test the real @user/data-common public barrel and preserve the approved eventStore id-only behavior boundary." + - "Keep rawEvent aliasing, Promise/as adapters, and eventStore circular imports unchanged as approved Phase 01 baselines." +patterns-established: + - "Duplicate event ids are asserted as warn(170, id) followed by last-write-wins lookup behavior." +requirements-completed: [EVT-01] +coverage: + - id: D1 + description: "GameEventStore public-barrel add/get, unknown-id, duplicate warning, and overwrite behavior is executable." + requirement: EVT-01 + verification: + - kind: unit + ref: "packages-user/data-common/src/store/eventStore.test.ts" + status: pass + human_judgment: false +duration: 3min +completed: 2026-09-09 +status: complete +--- + +# Phase 01 Plan 08: GameEventStore Regression Summary + +**Public-barrel GameEventStore regression coverage for id lookup, unknown ids, duplicate warnings, and last-write-wins behavior** + +## Performance + +- **Duration:** 3 min +- **Started:** 2026-09-09T10:16:00Z +- **Completed:** 2026-09-09 +- **Tasks:** 1 +- **Files modified:** 1 + +## Accomplishments + +- Verified the real `@user/data-common` public barrel exposes `GameEventStore`. +- Covered add/get behavior, unknown-id `null`, and duplicate-id overwrite behavior. +- Asserted the exact duplicate warning contract `logger.warn(170, id)`. +- Preserved the approved rawEvent, Promise, and eventStore-cycle deferrals without touching production event-store code. + +## Task Commits + +1. **Task 1: 固化公共桶 GameEventStore 的 add/get/重复告警回归** - `6e96abb` (test) + +**Plan metadata:** pending state/summary commit + +## Files Created/Modified + +- `packages-user/data-common/src/store/eventStore.test.ts` - Public-barrel Vitest regression fixture for GameEventStore behavior. + +## Decisions Made + +- Used the existing Node logger globals as test-only stubs before dynamically importing the public barrel. +- Did not modify `eventStore.ts`, event types, barrel exports, rawEvent behavior, Promise contracts, or circular imports. + +## Deviations from Plan + +None - the requested test artifact and task commit were already present at executor start; they were verified rather than duplicated. + +## Verification + +- `pnpm exec vitest run "packages-user/data-common/src/store/eventStore.test.ts"` — passed, 3 tests. +- Tracer feedback re-run of the same focused command — passed, 3 tests. +- No circular-dependency gate or deferred rawEvent/no-as verification was run. + +## Deferred Items + +- rawEvent public aliasing/immutability changes, Promise/no-as cleanup, and eventStore cycle repair remain deferred per 01-05-SUMMARY.md. +- Production event registration and map-id binding remain deferred per 01-04-SUMMARY.md. + +## Issues Encountered + +None. + +## User Setup Required + +None - no external service configuration required. + +## Next Phase Readiness + +Plan 01-09 can proceed with its isolated GameMap point-event-only aggregation work. The eventStore behavior baseline is covered without requiring production registration. + +## Self-Check: PASSED + +- `.planning/phases/01-event/01-08-SUMMARY.md` exists. +- Task commit `6e96abb` is present in git history. +- The focused eventStore Vitest command passed twice, including the tracer feedback re-run. + +--- +*Phase: 01-event* +*Completed: 2026-09-09*