3.0 KiB
3.0 KiB
Tasks — game-server plugins (Wave C-1)
0. Pre-flight (non-negotiable)
- 0.1 Confirm clean working tree; only this worktree open
- 0.2 Account for sibling worktrees (none beyond this one)
- 0.3 Confirm
MANIFEST.mdpackage set matchesfind packages -maxdepth 3 -name package.json - 0.4 §0a Sync — fast-forwarded worktree to current
genesisHEAD (orchestrator-supplied SHA predates current merges; verified ancestry viagit log)
1. Spec authoring
- 1.1 Read upstream
BasePlugin.ts+ 7 concrete plugins under/mnt/s/web/suaveplan/packages/universal/game-server/src/plugins/ - 1.2 Read existing
openspec/specs/game-server/spec.md - 1.3 Read
openspec/AGENTS.mdrules 7, 10, 11 - 1.4 Draft
proposal.md - 1.5 Source mapping table with upstream line ranges
- 1.6 Draft
specs/game-server/spec.mdwith## ADDED Requirements - 1.7 Every requirement carries
**Verified by:**
2. Implementation
- 2.1
BasePluginabstract class + lifecycle state machine - 2.2
ABTestPlugin— weighted bucketing with seededRng - 2.3
AnalyticsPlugin— emitter subscription + structured sink - 2.4
FeatureFlagPlugin—FlagManageradapter + evaluation log - 2.5
LoggingPlugin— emitter forwarding + ring buffer - 2.6
PersistencePlugin—StorageLikesave/load + Zod-validated decode - 2.7
RulesPlugin—RuleEngineadapter + history - 2.8
WorkflowPlugin— registry + execute/cancel + history - 2.9 Error-code registry extended with nine plugin codes
- 2.10
package.jsondeps + subpath exports
3. Tests
- 3.1 Unit tests per plugin (
*.test.ts) covering every public method + lifecycle - 3.2 100% statement/branch/function/line coverage on touched modules
- 3.3 Every
it(...)carries{ timeout: 5000 }
4. Documentation
- 4.1 Sibling
.mdfor every implementation file (≥200 words, basic + advanced, full API)
5. Pre-archive verification
- 5.1
bun run check— clean - 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 Build green
6. Pre-archive 7-row checklist
- 6.1 Generics threaded —
WorkflowEngine<TData>andRuleContext<TData>exposed type-safely - 6.2 Zod schemas wired at construction-time boundaries (
AnalyticsPlugin,ABTestPlugin.createExperiment,LoggingPlugin,PersistencePlugin.load,RulesPlugin) - 6.3 Every new error code thrown by at least one production path
- 6.4 Lifecycle-state behaviours tested (assertLive guards after destroy)
- 6.5 OTel
recordPluginLifecycleintegration unchanged — covered by existing plugin-manager tests - 6.6 Lifecycle dedup tested (BasePlugin re-install after destroy rejected)
- 6.7 No retroactive ticks
7. Archive
- 7.1 Fold delta into
openspec/specs/game-server/spec.md(orchestrator task) - 7.2 Archive folder rename (orchestrator task)