mirror of
https://github.com/motajs/template.git
synced 2026-09-14 02:48:51 +08:00
docs(01-12): complete event gap-closure plan
This commit is contained in:
parent
f423aad84a
commit
ad16141993
@ -34,7 +34,7 @@ Decimal phases appear between their surrounding integers in numeric order.
|
||||
3. 引擎能执行踩踏触发事件驱动的事件执行链路(对话/开门依赖 A2 内建函数清单,延后到收尾工作)
|
||||
4. 事件系统保持面向初学者的简单抽象,未引入复杂场景的通用表达能力
|
||||
|
||||
**Plans**: 11/11 plans executed
|
||||
**Plans**: 12/12 plans executed
|
||||
Plans:
|
||||
|
||||
- [x] 01-04-PLAN.md
|
||||
@ -45,6 +45,7 @@ Plans:
|
||||
- [x] 01-09-PLAN.md — GameMap point-event-only save aggregation; production registration deferred
|
||||
- [x] 01-10-PLAN.md
|
||||
- [x] 01-11-PLAN.md — CoreState legacy map initialization selects eventLayer; existing source-aware movement path remains reachable
|
||||
- [x] 01-12-PLAN.md — Close phase-owned type diagnostics and CRLF/Prettier quality-gate gaps without behavior changes
|
||||
|
||||
**Wave 1**
|
||||
|
||||
@ -62,6 +63,10 @@ Plans:
|
||||
|
||||
- [x] 01-11-PLAN.md — CoreState legacy map initialization selects eventLayer; existing source-aware dispatch remains reachable
|
||||
|
||||
**Wave 9** *(blocked on Wave 8 completion)*
|
||||
|
||||
- [x] 01-12-PLAN.md — Phase-owned type and CRLF/Prettier gap closure
|
||||
|
||||
### Phase 2: 寻路系统
|
||||
|
||||
**Goal**: 引擎支持自动寻路,移动端点击地图即可触发移动
|
||||
@ -140,7 +145,7 @@ Phases execute in numeric order: 1 → 2 → 3 → 4 → 5 → 6
|
||||
|
||||
| Phase | Plans Complete | Status | Completed |
|
||||
|-------|----------------|--------|-----------|
|
||||
| 1. 事件系统 | 11/11 | In Progress| |
|
||||
| 1. 事件系统 | 12/12 | In Progress| |
|
||||
| 2. 寻路系统 | 0/TBD | Not started | - |
|
||||
| 3. 数据端完成 | 0/TBD | Not started | - |
|
||||
| 4. 渲染适配与双布局 | 0/TBD | Not started | - |
|
||||
|
||||
@ -4,16 +4,16 @@ milestone: v1.0
|
||||
current_phase: 01
|
||||
current_phase_name: event
|
||||
status: executing
|
||||
stopped_at: Completed 01-11-PLAN.md
|
||||
last_updated: "2026-09-09T03:01:22.995Z"
|
||||
stopped_at: Completed 01-12-PLAN.md
|
||||
last_updated: "2026-09-09T03:36:51.958Z"
|
||||
last_activity: 2026-09-09
|
||||
last_activity_desc: Phase 01 valid verification gap isolated to CoreState event-layer wiring
|
||||
state_head: 073e009816765605564508a2362598b4e587b5fa
|
||||
last_activity_desc: "Plan 01-12 closed phase-owned type and CRLF/Prettier gaps; unrelated repository type diagnostics remain"
|
||||
state_head: f423aad84a4a6ea3fa04fc0fac4fb33de1a2e0a4
|
||||
progress:
|
||||
total_phases: 6
|
||||
completed_phases: 0
|
||||
total_plans: 11
|
||||
completed_plans: 11
|
||||
total_plans: 12
|
||||
completed_plans: 12
|
||||
milestone_name: milestone
|
||||
---
|
||||
|
||||
@ -29,11 +29,11 @@ See: .planning/PROJECT.md (updated 2026-09-07)
|
||||
## Current Position
|
||||
|
||||
Phase: 01 (event) — EXECUTING
|
||||
Plan: 11 of 11
|
||||
Status: Ready to execute next gap-closure plan
|
||||
Last activity: 2026-09-09 — Phase 01 gap closure plan 01-11 created
|
||||
Plan: 12 of 12 (gap closure complete)
|
||||
Status: Plan complete; phase verification pending unrelated repository type diagnostics
|
||||
Last activity: 2026-09-09 — Plan 01-12 executed; focused type and formatting gaps closed
|
||||
|
||||
Progress: [█████████░] 91%
|
||||
Progress: [█████████░] 92%
|
||||
|
||||
## Performance Metrics
|
||||
|
||||
@ -67,6 +67,7 @@ Progress: [█████████░] 91%
|
||||
| Phase 01 P08 | 3min | 1 tasks | 1 files |
|
||||
| Phase 01 P09 | 8min | 2 tasks | 2 files |
|
||||
| Phase 01 P11 | 13min | 2 tasks | 3 files |
|
||||
| Phase 01 P12 | 20min | 2 tasks | 6 files |
|
||||
|
||||
## Accumulated Context
|
||||
|
||||
@ -93,6 +94,9 @@ Recent decisions affecting current work:
|
||||
- [Phase 01]: Plan 01-09 validates point-event aggregation without production registration, map-id binding, rawEvent changes, or eventStore cycle repair.
|
||||
- [Phase 01]: Phase 01 Plan 11 wires each legacy event alias layer to GameMap.eventLayer without adding serialized registration or map-id binding.
|
||||
- [Phase 01]: Phase 01 Plan 11 preserves source-aware invocation, point-event persistence, rawEvent/cache/Promise/as, and eventStore-cycle deferrals.
|
||||
- [Phase 01]: Gap-closure plan 01-12 repairs only the missing IBlockEventEnv import, focused fixture typing, and reported CRLF/Prettier errors; it preserves all locked deferrals and public contracts.
|
||||
- [Phase 01]: Gap-closure Plan 01-12 imports IBlockEventEnv and types only the focused event/map fixtures without changing runtime behavior or public contracts.
|
||||
- [Phase 01]: Gap-closure Plan 01-12 preserves serialized registration/map-id binding, rawEvent/cache/Promise/as, and eventStore-cycle deferrals.
|
||||
|
||||
### Pending Todos
|
||||
|
||||
@ -103,15 +107,16 @@ None yet.
|
||||
- 数据层 L0–L3 接口设计仍在进行中(由用户主导),DATA-01(Phase 3)依赖接口设计落地
|
||||
- 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.
|
||||
- Plan 01-12 leaves the repository-wide type gate blocked only by pre-existing diagnostics outside the plan-owned files; these are recorded in the phase deferred-items ledger.
|
||||
|
||||
## Deferred Items
|
||||
|
||||
| Category | Item | Status | Deferred At | Milestone |
|
||||
|----------|------|--------|-------------|-----------|
|
||||
| *(none)* | | | | |
|
||||
| quality gate | Pre-existing TypeScript diagnostics outside Plan 01-12 files | deferred | 2026-09-09 | v1.0 |
|
||||
|
||||
## Session Continuity
|
||||
|
||||
Last session: 2026-09-09T03:01:22.954Z
|
||||
Stopped at: Completed 01-11-PLAN.md
|
||||
Last session: 2026-09-09T03:36:51.913Z
|
||||
Stopped at: Completed 01-12-PLAN.md
|
||||
Resume file: None
|
||||
|
||||
160
.planning/phases/01-event/01-12-SUMMARY.md
Normal file
160
.planning/phases/01-event/01-12-SUMMARY.md
Normal file
@ -0,0 +1,160 @@
|
||||
---
|
||||
phase: 01-event
|
||||
plan: 12
|
||||
subsystem: testing
|
||||
tags: [typescript, vitest, eslint, prettier, crlf]
|
||||
|
||||
requires:
|
||||
- phase: 01-event
|
||||
provides: Existing event contracts, source-aware dispatch, map lifecycle, and regression fixtures
|
||||
provides:
|
||||
- Type-correct phase-owned event executor and focused test fixtures
|
||||
- Prettier/CRLF-compliant focused Phase 01 files
|
||||
- Verification evidence for the existing event behavior without runtime changes
|
||||
affects: [phase-01 verification, future event and map work]
|
||||
|
||||
actuals:
|
||||
tokens: 3743
|
||||
tasks: 2
|
||||
commits: 2
|
||||
plan_head_before: ce639663677f7bfe30d10b95ecc9ac8bdd23102b
|
||||
|
||||
tech-stack:
|
||||
added: []
|
||||
patterns:
|
||||
- Explicitly typed test-only environment and malformed raw-event fixtures
|
||||
- Focused Prettier CRLF normalization without production behavior changes
|
||||
|
||||
key-files:
|
||||
created:
|
||||
- .planning/phases/01-event/deferred-items.md
|
||||
modified:
|
||||
- packages-user/data-system/src/event/executor.ts
|
||||
- packages-user/data-system/src/event/eventDispatch.test.ts
|
||||
- packages-user/data-base/src/map/eventPath.test.ts
|
||||
- packages-user/data-base/src/map/mapLifecycle.test.ts
|
||||
- packages-user/data-base/src/map/gameMap.ts
|
||||
- packages-user/data-common/src/store/eventStore.test.ts
|
||||
|
||||
key-decisions:
|
||||
- "Keep all serialized registration/map-id binding, rawEvent/cache/Promise/as, and eventStore-cycle deferrals unchanged."
|
||||
- "Keep the existing isolated runtime mover fixture while using the approved public data-state barrel for its type surface."
|
||||
|
||||
patterns-established:
|
||||
- "Test-only malformed input remains explicitly typed while preserving Reflect.set mutation cases."
|
||||
- "Save/load and resize fixture calls use the already-declared interfaces and compression enum."
|
||||
|
||||
requirements-completed: [EVT-01, EVT-02, EVT-03]
|
||||
|
||||
coverage:
|
||||
- id: D1
|
||||
description: "EventExecutor resolves IBlockEventEnv and focused invocation fixtures use the complete approved environment shape."
|
||||
requirement: EVT-02
|
||||
verification:
|
||||
- kind: unit
|
||||
ref: "pnpm exec vitest run packages-user/data-system/src/event/eventDispatch.test.ts"
|
||||
status: pass
|
||||
human_judgment: false
|
||||
- id: D2
|
||||
description: "Malformed raw-event and map lifecycle fixtures compile against existing interfaces without changing assertions."
|
||||
requirement: EVT-01
|
||||
verification:
|
||||
- kind: unit
|
||||
ref: "pnpm exec vitest run packages-user/data-base/src/map/eventPath.test.ts packages-user/data-base/src/map/mapLifecycle.test.ts"
|
||||
status: pass
|
||||
human_judgment: false
|
||||
- id: D3
|
||||
description: "Reported Phase 01 files pass focused ESLint/Prettier CRLF checks."
|
||||
requirement: EVT-03
|
||||
verification:
|
||||
- kind: other
|
||||
ref: "Focused ESLint commands and git diff --check"
|
||||
status: pass
|
||||
human_judgment: false
|
||||
|
||||
duration: 20min
|
||||
completed: 2026-09-09
|
||||
status: complete
|
||||
---
|
||||
|
||||
# Phase 01 Plan 12: Event type and formatting gap closure Summary
|
||||
|
||||
**Phase-owned event types and focused fixtures are repaired, while the reported files pass the repository CRLF/Prettier quality gate without changing runtime behavior or public contracts.**
|
||||
|
||||
## Performance
|
||||
|
||||
- **Duration:** approximately 20 minutes
|
||||
- **Started:** 2026-09-09T11:20:00Z
|
||||
- **Completed:** 2026-09-09
|
||||
- **Tasks:** 2
|
||||
- **Files modified by the plan:** 6
|
||||
|
||||
## Accomplishments
|
||||
|
||||
- Imported `IBlockEventEnv` into `EventExecutor` and made the source-aware dispatch fixtures use complete `IGameEventInvocation` environments.
|
||||
- Added explicit malformed raw-event case typing and existing resizable/saveable interface typing to the map fixtures.
|
||||
- Normalized the reported map and event-store files to repository Prettier/CRLF formatting; the focused behavioral suite remains 23/23 passing.
|
||||
- Preserved the pre-existing `gameMap.ts` semantic worktree change and did not stage unrelated worktree changes.
|
||||
|
||||
## Task Commits
|
||||
|
||||
Each executable task was committed atomically:
|
||||
|
||||
1. **Task 1: Repair the phase-owned type gate without changing contracts** - `15d9f25` (fix)
|
||||
2. **Task 2: Normalize the reported Phase 01 files to CRLF/Prettier** - `f423aad` (style)
|
||||
|
||||
**Plan metadata:** pending final execution metadata commit.
|
||||
|
||||
## Files Created/Modified
|
||||
|
||||
- `packages-user/data-system/src/event/executor.ts` - imports the existing block-event environment contract.
|
||||
- `packages-user/data-system/src/event/eventDispatch.test.ts` - types the complete invocation environment and isolated mover fixture.
|
||||
- `packages-user/data-base/src/map/eventPath.test.ts` - types raw data and malformed mutators.
|
||||
- `packages-user/data-base/src/map/mapLifecycle.test.ts` - uses declared save/load, compression, and resizable-layer types.
|
||||
- `packages-user/data-base/src/map/gameMap.ts` - formatted with repository CRLF/Prettier settings; its unrelated existing semantic diff remains unstaged.
|
||||
- `packages-user/data-common/src/store/eventStore.test.ts` - normalized to CRLF/Prettier formatting.
|
||||
- `.planning/phases/01-event/deferred-items.md` - records unrelated repository-wide type failures left out of scope.
|
||||
|
||||
## Decisions Made
|
||||
|
||||
- No production registration or map-id binding was added.
|
||||
- No rawEvent immutability/cache, `Promise<unknown>`, no-`as` cleanup, or eventStore cycle repair was added.
|
||||
- The test-only type assertions remain local adapters for pre-existing fixture/interface mismatches; runtime objects and assertions are unchanged.
|
||||
|
||||
## Deviations from Plan
|
||||
|
||||
None - plan executed within the requested scope. The runtime mover fixture loads the existing hero barrel by a relative test-only path after the public-root runtime import exposed an unrelated initialization cycle; its public type surface remains `@user/data-state` as specified.
|
||||
|
||||
## Verification
|
||||
|
||||
- `pnpm exec vitest run packages-user/data-base/src/map/eventPath.test.ts packages-user/data-base/src/map/mapLifecycle.test.ts packages-user/data-common/src/store/eventStore.test.ts packages-user/data-system/src/event/eventDispatch.test.ts packages-user/data-state/src/coreEventLayer.test.ts` — **PASS**, 5 files / 23 tests.
|
||||
- Focused Task 1 ESLint command — **PASS**.
|
||||
- Focused Task 2 ESLint command — **PASS**.
|
||||
- `git diff --check` over the three reported formatting files — **PASS**.
|
||||
- `pnpm check:type` — **BLOCKED by pre-existing diagnostics outside this plan**, including legacy client exports, the TileStore trigger contract, and legacy hero/tile consumers. No diagnostics remain in the six phase-owned files changed by this plan.
|
||||
|
||||
## Issues Encountered
|
||||
|
||||
- The repository-wide type command remains non-zero on unrelated pre-existing files. These were not changed, are recorded in `deferred-items.md`, and were not allowed to expand this gap-closure plan.
|
||||
- The initial public-root runtime mover import triggered an existing initialization cycle in the test process. The fixture now loads the existing hero barrel directly while retaining the approved public-barrel type reference; the focused suite passes.
|
||||
|
||||
## User Setup Required
|
||||
|
||||
None - no external service configuration required.
|
||||
|
||||
## Known Stubs
|
||||
|
||||
None introduced by this plan. Empty objects are existing test-only mocks and are not UI or production data stubs.
|
||||
|
||||
## Next Phase Readiness
|
||||
|
||||
The requested phase-owned import, fixture typing, and focused formatting gaps are closed. Phase 01 remains ready for verification, with the repository-wide unrelated type diagnostics explicitly deferred and all locked Phase 01 deferrals preserved.
|
||||
|
||||
## Self-Check: PASSED
|
||||
|
||||
- All six plan files and this summary exist.
|
||||
- Task commits `15d9f25` and `f423aad` exist in git history.
|
||||
|
||||
---
|
||||
*Phase: 01-event*
|
||||
*Completed: 2026-09-09*
|
||||
6
.planning/phases/01-event/deferred-items.md
Normal file
6
.planning/phases/01-event/deferred-items.md
Normal file
@ -0,0 +1,6 @@
|
||||
# Deferred Items
|
||||
|
||||
- `pnpm check:type` remains red on pre-existing files outside Plan 01-12,
|
||||
including legacy client exports, the TileStore trigger contract, and legacy
|
||||
hero/tile consumers. The plan-owned diagnostics are resolved; these unrelated
|
||||
diagnostics are deferred without runtime or public-contract changes.
|
||||
Loading…
Reference in New Issue
Block a user