|
| 1 | +# Player-Point-Change Bootstrap Implementation Plan |
| 2 | + |
| 3 | +> For Hermes: use test-driven-development. Keep slices tiny and push one commit at a time. |
| 4 | +
|
| 5 | +Goal: add the first minimal `PLAYER_POINT_CHANGE` emission after `ENTERGAME` so the selected character gets a deterministic self-only point refresh during the bootstrap transition into `GAME`. |
| 6 | + |
| 7 | +Architecture: freeze a project-owned codec for `PLAYER_POINT_CHANGE`, extend visible-world bootstrap tests to expect the extra frame, then wire the minimal runtime to emit one deterministic self-only point refresh for the selected character. |
| 8 | + |
| 9 | +Tech stack: Go 1.26, existing frame/session/world packages, current authd/gamed bootstrap runtime. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Task 1: Freeze player-point-change packet codec |
| 14 | +Objective: define the server-side `PLAYER_POINT_CHANGE` packet shape. |
| 15 | + |
| 16 | +Files: |
| 17 | +- Modify: `internal/proto/world/world.go` |
| 18 | +- Modify: `internal/proto/world/world_test.go` |
| 19 | + |
| 20 | +Steps: |
| 21 | +1. Write failing tests for: |
| 22 | + - `PLAYER_POINT_CHANGE` encode/decode |
| 23 | + - invalid header rejection |
| 24 | +2. Run: `go test ./internal/proto/world` |
| 25 | +3. Implement the smallest codec set to pass. |
| 26 | +4. Re-run: `go test ./internal/proto/world` |
| 27 | +5. Commit: `feat: add player-point-change packet codec` |
| 28 | + |
| 29 | +## Task 2: Extend visible-world bootstrap in the runtime |
| 30 | +Objective: emit `PLAYER_POINT_CHANGE` after the selected-character visible bootstrap. |
| 31 | + |
| 32 | +Files: |
| 33 | +- Modify: `internal/minimal/factory.go` |
| 34 | +- Modify: `internal/minimal/factory_test.go` |
| 35 | + |
| 36 | +Steps: |
| 37 | +1. Write failing tests for: |
| 38 | + - existing selected character gets the extra point-change frame |
| 39 | + - newly created selected character gets the same sequence |
| 40 | +2. Run: `go test ./internal/minimal` |
| 41 | +3. Implement the smallest selected-character packet builder. |
| 42 | +4. Re-run: `go test ./internal/minimal` |
| 43 | +5. Commit: `feat: add player-point-change bootstrap` |
| 44 | + |
| 45 | +## Task 3: Cover boot composition |
| 46 | +Objective: verify the composed boot flow and TCP harness can emit the extra point-change frame. |
| 47 | + |
| 48 | +Files: |
| 49 | +- Modify: `internal/boot/flow_test.go` |
| 50 | +- Modify: `internal/boot/flow_socket_test.go` |
| 51 | + |
| 52 | +Steps: |
| 53 | +1. Extend visible-world bootstrap tests to expect `PLAYER_POINT_CHANGE`. |
| 54 | +2. Run: `go test ./internal/boot` |
| 55 | +3. Re-run after wiring the test config. |
| 56 | +4. Commit: `test: cover player-point-change bootstrap` |
| 57 | + |
| 58 | +## Task 4: Update docs |
| 59 | +Objective: document the first `PLAYER_POINT_CHANGE` slice. |
| 60 | + |
| 61 | +Files: |
| 62 | +- Modify: `README.md` |
| 63 | +- Modify: `spec/protocol/README.md` |
| 64 | +- Modify: `spec/protocol/visible-world-bootstrap.md` |
| 65 | +- Modify: `spec/protocol/boot-path.md` |
| 66 | +- Modify: `spec/protocol/packet-matrix.md` |
| 67 | +- Create: `spec/protocol/player-point-change-bootstrap.md` |
| 68 | + |
| 69 | +Steps: |
| 70 | +1. Document packet layout and bootstrap order. |
| 71 | +2. Run: `go test ./... && go vet ./...` |
| 72 | +3. Commit: `docs: document player-point-change bootstrap slice` |
| 73 | + |
| 74 | +## Verification |
| 75 | +- `go test ./internal/proto/world` |
| 76 | +- `go test ./internal/minimal` |
| 77 | +- `go test ./internal/boot` |
| 78 | +- `go test ./...` |
| 79 | +- `go vet ./...` |
| 80 | + |
| 81 | +## Scope guardrails |
| 82 | +- Do not add repeated point-change streams yet |
| 83 | +- Do not add other entities yet |
| 84 | +- Do not add combat/inventory-driven point changes yet |
| 85 | +- Keep the slice deterministic and selected-character only |
0 commit comments