|
| 1 | +# Client-Version Loading Slice Implementation Plan |
| 2 | + |
| 3 | +> For Hermes: use test-driven-development. Keep slices tiny and push one commit at a time. |
| 4 | +
|
| 5 | +Goal: accept `CLIENT_VERSION` during `LOADING` as tolerant client metadata so a TMP4 client can send it before `ENTERGAME` without desynchronizing the session. |
| 6 | + |
| 7 | +Architecture: freeze a small control-plane codec for `CLIENT_VERSION`, extend world-entry and boot tests to cover the loading-time no-op path, then document the exact packet layout and phase behavior. |
| 8 | + |
| 9 | +Tech stack: Go 1.26, existing frame/session/control/world-entry packages, current authd/gamed bootstrap runtime. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Task 1: Freeze the `CLIENT_VERSION` packet codec |
| 14 | +Objective: define the fixed-width payload shape and decoding behavior. |
| 15 | + |
| 16 | +Files: |
| 17 | +- Modify: `internal/proto/control/control.go` |
| 18 | +- Modify: `internal/proto/control/control_test.go` |
| 19 | + |
| 20 | +Steps: |
| 21 | +1. Write failing tests for: |
| 22 | + - `CLIENT_VERSION` encode/decode round-trip |
| 23 | + - invalid payload length rejection |
| 24 | +2. Run: `go test ./internal/proto/control` |
| 25 | +3. Implement the smallest codec set to pass. |
| 26 | +4. Re-run: `go test ./internal/proto/control` |
| 27 | +5. Commit: `feat: add client-version control codec` |
| 28 | + |
| 29 | +## Task 2: Accept `CLIENT_VERSION` in `LOADING` |
| 30 | +Objective: tolerate the client metadata packet without changing session state. |
| 31 | + |
| 32 | +Files: |
| 33 | +- Modify: `internal/worldentry/flow.go` |
| 34 | +- Modify: `internal/worldentry/flow_test.go` |
| 35 | + |
| 36 | +Steps: |
| 37 | +1. Write failing tests for: |
| 38 | + - `CLIENT_VERSION` is accepted in `LOADING` |
| 39 | + - the flow returns no frames |
| 40 | + - the session remains in `LOADING` |
| 41 | +2. Run: `go test ./internal/worldentry` |
| 42 | +3. Implement the smallest loading-phase branch to pass. |
| 43 | +4. Re-run: `go test ./internal/worldentry` |
| 44 | +5. Commit: `feat: accept client-version during loading` |
| 45 | + |
| 46 | +## Task 3: Cover boot composition |
| 47 | +Objective: prove the composed boot flow and TCP harness tolerate `CLIENT_VERSION` before `ENTERGAME`. |
| 48 | + |
| 49 | +Files: |
| 50 | +- Modify: `internal/boot/flow_test.go` |
| 51 | +- Modify: `internal/boot/flow_socket_test.go` |
| 52 | + |
| 53 | +Steps: |
| 54 | +1. Add failing unit and socket tests that send `CLIENT_VERSION` in `LOADING` before `ENTERGAME`. |
| 55 | +2. Run: `go test ./internal/boot` |
| 56 | +3. Re-run after wiring the world-entry path. |
| 57 | +4. Commit: `test: cover client-version loading path` |
| 58 | + |
| 59 | +## Task 4: Update docs |
| 60 | +Objective: document the tolerated loading-time metadata path. |
| 61 | + |
| 62 | +Files: |
| 63 | +- Modify: `README.md` |
| 64 | +- Modify: `spec/protocol/README.md` |
| 65 | +- Modify: `spec/protocol/boot-path.md` |
| 66 | +- Modify: `spec/protocol/session-phases.md` |
| 67 | +- Modify: `spec/protocol/select-world-entry.md` |
| 68 | +- Modify: `spec/protocol/packet-matrix.md` |
| 69 | +- Create: `spec/protocol/client-version-loading.md` |
| 70 | + |
| 71 | +Steps: |
| 72 | +1. Document packet layout and no-response behavior. |
| 73 | +2. Run: `go test ./... && go vet ./...` |
| 74 | +3. Commit: `docs: document client-version loading slice` |
| 75 | + |
| 76 | +## Verification |
| 77 | +- `go test ./internal/proto/control` |
| 78 | +- `go test ./internal/worldentry` |
| 79 | +- `go test ./internal/boot` |
| 80 | +- `go test ./...` |
| 81 | +- `go vet ./...` |
| 82 | + |
| 83 | +## Scope guardrails |
| 84 | +- Do not enforce version matching yet. |
| 85 | +- Do not persist the metadata yet. |
| 86 | +- Do not add a server reply packet. |
| 87 | +- Do not broaden acceptance outside `LOADING` in this slice. |
0 commit comments