---
name: server_authoritative_impl_spec
description: Concrete implementation spec written to docs/spec-server-authoritative.md - WS protocol, movement system, 3-phase plan with file manifest.
type: project
---

Full implementation spec for server-authoritative architecture delivered at `docs/spec-server-authoritative.md`.

Key decisions codified:
- WSEnvelope `{type, payload}` as universal wire format (replaces raw CombatEvent on WS)
- Hub refactored from `chan CombatEvent` to `chan WSEnvelope` with `SendToHero(heroID, type, payload)`
- Movement: 2 Hz ticks in Engine, 10s position_sync for drift correction
- Encounter: server-decided, 4% chance per tick with 15s cooldown
- Heroes bounce back and forth on 7-town linear chain
- Offline simulator does NOT touch movement fields
- 3 phases: WS+movement (3-5d), server combat (2-3d), deprecate REST (1d)

**Why:** Spec needed as contract for backend and frontend agents to implement independently.
**How to apply:** All agents should reference `docs/spec-server-authoritative.md` for message types, field names, and phase ordering.
