Commit Graph

314 Commits

Author SHA1 Message Date
aa3c7296c7 chore: 将事件执行标记为 ignoreReplay 2026-09-13 20:52:42 +08:00
b623e8ac98 fix: 勇士事件移动时不应记录录像 2026-09-13 20:42:48 +08:00
0ba70e1a63 docs(event-contract): sync with current built-in names and collection design
- built-in names: setBlock/moveBlock/removeBlock/moveHero/stepHero/touchFront/
  insertEvents/insertEvent (class names Event*)
- removeBlock: static by default, dynamic:true also removes dynamic tiles
- touchFront: steps the hero forward; the mover produces the OnTouch on bump
- GameEventSystem.collectEvent owns source collection; mover enter/leave/hit reuse it
- IBlockEventEnv gains required system and nullable heroFloor; utils.ts keeps only
  getPossibleMap/getPossibleLayer
2026-09-13 20:40:15 +08:00
a66be585d1 feat(event): rework built-ins and centralize trigger collection
- rename deleteBlock -> removeBlock (dynamic tiles need dynamic:true),
  moveHeroStep -> stepHero; touchFront steps forward and lets the mover bump
- GameEventSystem.collectEvent owns point/tile source collection; moverImpl
  enter/leave/hit reuse it with OnEnter/OnLeave/OnTouch
- IBlockEventEnv gains required system field and nullable heroFloor
- MapLayer.removeBlock added and setBlock guarded by inMap; GameMap owns floorId
- IObjectMover.push accepts readonly steps
- update event/eventDispatch tests to the current implementation (fixtures
  supply system, hero location snapshots, renamed registrations)

Verified: data type gate 0 in-scope; vitest 19 files / 112 tests pass; prettier
and eslint clean on touched files.
2026-09-13 20:37:32 +08:00
d7837fcc24 docs: sync event/replay contracts with current design
- 03-EVENT-CONTRACT.md: short built-in names, class-based BuiltInFunction,
  single createEventRegistrations(), event/utils.ts (not barrel-exported)
- 03-REPLAY-CONTRACT.md: BaseReplayCommand shape, Teleport code, numeric fixed
  params, move notExecuted batching, CoreState registerReplayCommands, 2001-2008
- scope quick 260913-qtq record to AI changes only
2026-09-13 19:24:54 +08:00
e5f6d492b2 docs(quick-260913-qtq): event built-ins refactor and anon-tokyo import rename 2026-09-13 19:20:24 +08:00
f0fd2f54a1 refactor(event): class-based built-ins, shared utils, single registration
- rewrite every built-in as EventXxx implements BuiltInFunction<P, E>
  (setBlock/moveBlock/deleteBlock/moveHero/moveHeroStep/touchFront/
  insertEvents/insertEvent), matching the EventSetBlock reference style
- move shared helpers to event/utils.ts (getPossibleMap, getPossibleLayer,
  getEventExecutor, enter/exitEventInsert); utils is not exported via index
- move per-class helpers into private methods (EventTouchFront and
  EventInsertEvents collectInvocations)
- use IObjectMover.push for move sequences instead of manual step calls
- registrations.ts: one createEventRegistrations() writing the eight entries
  in order, categories separated by single-line comments
- remove EventBuiltinName; classes own short string names
- update event tests; core.ts uses createEventRegistrations
2026-09-13 19:17:32 +08:00
a701aa6da9 refactor(anon-tokyo): import embedded workspace package everywhere
- rename all anon-tokyo imports to @motajs/anon-tokyo in data-common,
  data-system and data-state
- declare @motajs/anon-tokyo workspace dependency in data-common and
  data-system; refresh pnpm-lock.yaml
2026-09-13 19:17:21 +08:00
5a05eecad1 wip(event): scaffold EventSetBlock class, utils helpers, anon-tokyo workspace dep
- data-state: add @motajs/anon-tokyo workspace dependency
- map.ts: new EventSetBlock BuiltInFunction class (reference style)
- utils.ts: getPossibleMap/getPossibleLayer helpers (not yet wired)

Checkpoint of user-authored in-progress event refactor.
2026-09-13 19:04:25 +08:00
b86a060759 feat: 移动器新增 push 方法 2026-09-13 19:01:57 +08:00
ef58f79518 feat: 将 anon-tokyo 内嵌到项目中 2026-09-13 18:49:29 +08:00
46a38fa0c6 refactor: 录像系统指令 2026-09-13 16:38:19 +08:00
dd4e66a335 refactor(replay): rewrite remaining commands and register in CoreState
- ReplayUseItemCommand / ReplayEquipCommand / ReplayUnequipCommand now extend
  BaseReplayCommand with fixed numeric params and per-false-position logger
  error codes (2006-2010); string item/slot params removed, autoUnload is a
  required bool.
- remove isNumber/isItem/isBoolean/isSlot/resolveSlot helpers; all logic now
  lives in the command classes.
- drop createReplayCommandItems/registerReplayCommandItems; CoreState owns a
  private registerReplayCommand() registering the eight stable codes directly.
- prune unused replay boundary types from replay/types.ts.
- fix ReplaySandbox: a replay ending on a run of moves now finalizes the
  trailing run through notExecuted (previously the last move never started).
- rewrite commands.test.ts for the base-class design and direct registration.

Verified: data type gate 0 in-scope; vitest 19 files / 112 tests pass; prettier
and eslint clean on touched files.
2026-09-13 15:39:12 +08:00
37bfb77301 refactor(replay): add command base class and rewrite move/teleport
- BaseReplayCommand with name/paramTypes and assertParameter guard
- add optional IReplayCommand.notExecuted for trailing-step finalization
- sandbox invokes previous command notExecuted when the next command differs
- rewrite ReplayMoveCommand (batched step + notExecuted start/await) and ReplayTeleportCommand
- add replay logger error codes 2001-2005 and warn 175

NOTE: command tests still reference the pre-rewrite class names; updated in follow-up.
2026-09-13 15:16:51 +08:00
8f1e973886 docs: phase 3 completion tracking and handoff cleanup
- record phase 3 completion state and session continuity
- consume one-shot HANDOFF.json
- fix duplicate blocked count in 01-UAT.md
2026-09-13 15:16:51 +08:00
909e8b3f63 docs(phase-3): complete phase execution 2026-09-12 13:39:27 +08:00
42f65a739c docs(03-19): complete replay/event JSDoc normalization plan 2026-09-12 13:28:26 +08:00
521413fea4 style(03-19): normalize touched event JSDoc to multiline
- Convert map, hero, event, and registration-assembly function JSDoc
  into multiline form for every touched declaration
- Preserve export-only barrels, class-owned registration order, direct
  Statement[] insertion, hero front-touch ownership, and Chinese event
  test comments
2026-09-12 13:26:13 +08:00
cabee3cc01 style(03-19): normalize touched replay JSDoc to multiline
- Convert replay command, helper, and registry JSDoc into multiline form
- Add declaration-aware script/check-touched-jsdoc.ts scanner that
  inventories constructors as explicit exemptions and fails any other
  touched top-level function or class method without multiline JSDoc
2026-09-12 13:24:06 +08:00
b1b9603ff6 wip: phase 03 paused after plan 03-18 (03-19 remaining) 2026-09-11 23:15:29 +08:00
d82e19347b docs(03-18): complete event registration ownership plan 2026-09-11 23:14:09 +08:00
a69130c8ad test(03-18): cover event registration ownership and barrel purity
- Assert the real eight-entry class registry, fresh per-group instances,
  and the three-map/three-hero/two-control ownership split
- Prove every class owns its stable name and function, classes originate
  from their owning modules, and hero owns the front-touch registration
- Verify both event barrels stay export-only while prior public event
  symbols remain reachable from the data-state root index
2026-09-11 23:10:37 +08:00
0dc30aace8 refactor(03-18): move event registration assembly out of the barrel
- Add event/registrations.ts as the sole direct-construction assembler for
  the eight class-based registrations in stable map/hero/control order
- Reduce event/index.ts and data-state/src/index.ts to export-only barrels
  that re-export the four public registration creators
- Point CoreState at event/registrations and record the ownership and
  public-export boundaries in the event contract
2026-09-11 23:02:15 +08:00
cb716f699e refactor(03-18): own event registrations as explicit classes
- Replace generic per-invocation registration factories with explicit
  SetBlock/MoveBlock/DeleteBlock, MoveHero/MoveHeroStep/TouchFront, and
  InsertEvents/InsertEvent registration classes
- Move eventTouchFront, invocation collection, and target resolution into
  the hero event layer while keeping awaited OnTouch behavior
- Keep map and control modules limited to their own registration ownership
2026-09-11 22:59:16 +08:00
febdcdc967 refactor: align state system replay and path contracts 2026-09-11 22:36:09 +08:00
81c3653b90 wip: pause Phase 3 latest correction batch 2026-09-11 22:34:10 +08:00
f6a376137e docs(03-17): complete replay correction plan 2026-09-11 22:32:39 +08:00
4bd6a463d6 test(03-17): cover replay registry construction
- Assert direct stable registry construction
- Guard against formatter suppressions and duplicate directional classes
- Retain deferred movement and pathfinding ordering coverage
2026-09-11 22:22:21 +08:00
df7d1e12c2 fix(03-17): await replay movement completion
- Remove replay-safety decoration from command implementations
- Await directional and pathfinding controller completion
- Collapse directional commands into one parameterized class
2026-09-11 22:21:01 +08:00
3df11049dd wip: pause latest Phase 3 correction planning 2026-09-11 17:35:25 +08:00
2b471b83ed docs(03): create replay and event gap plans 2026-09-11 16:59:17 +08:00
c41b84bef3 chore: clear Phase 3 resume checkpoint 2026-09-11 15:39:21 +08:00
b8d33233b1 docs(phase-3): record structural correction verification 2026-09-11 15:38:00 +08:00
185f5b0b72 docs(03-16): complete circular gate scope correction plan 2026-09-11 15:16:29 +08:00
8d712826a3 test(03-16): prove circular compatibility boundary exits
- cover normalized legacy, client, data, and common cycle classes
- assert real fixture process statuses remain fail-closed
2026-09-11 15:13:53 +08:00
07fd6c9786 fix(03-16): scope circular compatibility cycles explicitly
- classify only all-compatibility cycles outside the approved gate
- preserve fail-closed data and common boundary reporting
2026-09-11 15:10:25 +08:00
5c962520ef fix(03-data-completion): revise circular gate plan coverage 2026-09-11 15:02:41 +08:00
461e11c99e docs(03-15): complete independent replay command class plan 2026-09-11 14:35:11 +08:00
4e318e6ce1 refactor(03-15): order replay class internals consistently
- Keep private command actions before their execute callers per project conventions
2026-09-11 14:32:20 +08:00
f5c6b06c59 test(03-15): cover independent replay command ownership
- Verify distinct command classes, fresh instances, stable order, and extension registration
- Add structural ownership regressions without changing replay or user-owned decorator boundaries
2026-09-11 14:28:24 +08:00
13162b2406 fix(03-15): split replay commands into independent classes
- Replace the shared replay entrance object with eight owned instruction classes
- Preserve stable registration order and replay command extension boundaries
2026-09-11 14:22:01 +08:00
a6b432f106 docs(03-11): complete save architecture correction plan 2026-09-11 14:14:25 +08:00
5a206748b2 test(03-11): align Node save regressions
- Assert CoreState instances use the existing SaveSystem
- Preserve independent construction and replay coverage
2026-09-11 14:10:41 +08:00
4f606d91c7 fix(03-11): remove Phase-3 memory save adapter
- Delete the Phase-3-only in-memory save implementation
- Preserve the existing SaveSystem save barrel exports
2026-09-11 14:09:39 +08:00
3bd90535a5 docs(03-10): record summary metadata 2026-09-11 14:06:16 +08:00
f28aaeafed docs(03-10): close removed legacy ledger entry 2026-09-11 14:05:17 +08:00
97e2e10189 docs(03-10): complete legacy compatibility correction plan 2026-09-11 14:03:22 +08:00
45e3b1f05d fix(03-10): restore direct replay fixture path
- Register the fixture event and maps through existing data APIs
- Await the synchronous mutation marker before the final snapshot
2026-09-11 14:00:02 +08:00
e4e39f7b2b fix(03-10): restore compatibility loading path
- Remove Phase 3 legacy dependency and serialized loading adapters
- Restore SaveSystem, converter, bridge, and loading callback assembly
2026-09-11 13:52:54 +08:00
4d094f988f docs(03-14): complete synchronous replay correction plan 2026-09-11 13:47:18 +08:00