# Tasks — Wave A: `@suaveplan/game-server` core foundation ## 0. Pre-flight (non-negotiable) - [x] 0.1 Confirm clean working tree (`git status` reports nothing) and no in-flight worktrees with uncommitted work - [x] 0.2 Account for every `.claude/worktrees/agent-*` — operating inside `agent-a3cb7ed021fa6e13a` for this change - [x] 0.3 `MANIFEST.md` matches `find packages -maxdepth 3 -name package.json` count — verified unchanged (no new packages added; this is an in-package extension) ## 1. Spec authoring - [x] 1.1 Read `../suaveplan/packages/universal/game-server/src/core/` upstream sources - [x] 1.2 Read existing `openspec/changes/enterprise-game-server-core/proposal.md` to align with prior scope decisions - [x] 1.3 Read `openspec/AGENTS.md` Sections 13 and 14 - [x] 1.4 Draft `proposal.md` - [x] 1.5 Source mapping documented in the Parity Checklist - [x] 1.6 Draft `specs/game-server/spec.md` - [x] 1.7 Every `### Requirement:` carries a `**Verified by:**` line ## 2. Implementation - [x] 2.1 `src/core/types/core.types.ts` — `ConnectionStatus`, `PlayerConnection`, `SessionNode`, `SessionData`, `StateChangeEvent`, `GameEvents` - [x] 2.2 `src/core/interfaces/i-game-logic/` — interface + `runIGameLogicConformance` - [x] 2.3 `src/core/interfaces/i-player-manager/` — interface + `runIPlayerManagerConformance` - [x] 2.4 `src/core/interfaces/i-session-manager/` — interface + `runISessionManagerConformance` - [x] 2.5 `src/core/interfaces/i-state-manager/` — interface + `runIStateManagerConformance` - [x] 2.6 `src/core/events/game-events/` — `GAME_EVENT_KEYS` + `isGameEventKey` - [x] 2.7 `src/core/events/game-event-emitter/` — `GameEventEmitter` with all helpers - [x] 2.8 `src/core/abstract-game-logic/` — `AbstractGameLogic` with Clock + IdGenerator + OTel - [x] 2.9 Extend `src/errors/game-server-error.ts` — 6 new codes - [x] 2.10 Extend root `src/index.ts` and `package.json` exports ## 3. Tests - [x] 3.1 Unit tests for every implementation file (one `.test.ts` per `.ts`) - [x] 3.2 Conformance harness tests against compliant + non-compliant reference impls - [x] 3.3 Every `it(...)` carries `{ timeout: 5000 }` - [x] 3.4 OTel assertion via `flushTestMetrics()` from the existing polyfill ## 4. Documentation - [x] 4.1 Sibling `.md` for every implementation `.ts` - [x] 4.2 Existing `README.md` covers the package (Wave A surface auto-discoverable via re-exports; no README rewrite required for the core extension) ## 5. Pre-archive verification (the 5-gate triple) - [ ] 5.1 `bun run check` — Biome 0 errors across the package - [ ] 5.2 `bunx turbo lint typecheck test --filter=@suaveplan/game-server` — green - [ ] 5.3 `bunx turbo test:coverage --filter=@suaveplan/game-server` — 100/100/100/100 - [ ] 5.4 Banned-pattern scan returns empty - [ ] 5.5 `bunx turbo build --filter=@suaveplan/game-server` — green ## 6. Archive (NOT performed in this worktree) - [ ] 6.1 Fold delta into `openspec/specs/game-server/spec.md` (orchestrator step) - [ ] 6.2 Move folder to `openspec/archive/-game-server-core/` (orchestrator step)