chore(cleanup): purge /command residuals — fakeEngine, canon golden, openapi
Tests · UI / test (pull_request) Has been cancelled
Tests · Integration / integration (pull_request) Successful in 1m46s
Tests · Go / test (pull_request) Successful in 2m4s
Tests · Go / test (push) Successful in 2m28s
Tests · UI / test (push) Successful in 3m22s

Follow-up tidy after the cross-service /command removal (#73):

- Rename the router test double dummyExecutor -> fakeEngine (and the
  newExecutor / setupRouterExecutor helpers -> newFakeEngine /
  setupRouterEngine): it implements handler.Engine now, "executor" was a
  leftover of the removed adapter. Test-only.

- Regenerate the ui/core canon signing golden onto user.games.order
  (request_user_games_command.json -> request_user_games_order.json, fresh
  canonical bytes + Ed25519 signature) and drop the last
  user.games.command references from the Go/TS tests and docs.

- Align game openapi: CommandRequest.cmd no longer carries minItems: 1. It
  is now used only by PUT /api/v1/order, which accepts an empty batch
  (clearing the player's stored order, equivalent to removing every
  command); the contract test freezes the empty-allowed shape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-30 15:16:17 +02:00
parent 40d6ba6ba4
commit bde9d535dc
11 changed files with 67 additions and 63 deletions
+2 -2
View File
@@ -469,7 +469,7 @@ Acceptance criteria:
- canonical-bytes output matches gateway-side output byte-for-byte
for the three Phase-3 message types (`user.account.get`,
`lobby.my.games.list`, `user.games.command`);
`lobby.my.games.list`, `user.games.order`);
- a request signed by `ui/core` is accepted by the gateway's own
verifier in a unit test (`TestParityRequestSignedByUICoreAcceptedByGateway`);
- a response signed by `gateway/authn`'s `Ed25519ResponseSigner` is
@@ -648,7 +648,7 @@ Acceptance criteria (met):
KB measured);
- `WasmCore.signRequest` produces canonical bytes byte-for-byte
identical to the gateway-side fixtures for three message types
(`request_user_account_get`, `request_user_games_command`,
(`request_user_account_get`, `request_user_games_order`,
`request_lobby_my_games_list`);
- `WasmCore` exposes the same `Core` TypeScript types future
`WailsCore` and `CapacitorCore` adapters will satisfy.
+1 -1
View File
@@ -130,7 +130,7 @@ The `canon` test suite combines:
- byte-equality on golden JSON fixtures under
`canon/testdata/` for three request types
(`user.account.get`, `lobby.my.games.list`,
`user.games.command`), one response (`ok`), and one event
`user.games.order`), one response (`ok`), and one event
(`gateway.server_time`);
- mutation tests proving every signed field is bound into the
signature;
+2 -2
View File
@@ -71,7 +71,7 @@ func TestBuildRequestSigningInputChangesWhenSignedFieldChanges(t *testing.T) {
base := canon.RequestSigningFields{
ProtocolVersion: "v1",
DeviceSessionID: "device-session-123",
MessageType: "user.games.command",
MessageType: "user.games.order",
TimestampMS: 123456789,
RequestID: "request-123",
PayloadHash: sha256Sum([]byte("payload")),
@@ -143,7 +143,7 @@ func TestRequestCanonicalBytesFixtures(t *testing.T) {
fixtures := []string{
"request_user_account_get.json",
"request_lobby_my_games_list.json",
"request_user_games_command.json",
"request_user_games_order.json",
}
for _, name := range fixtures {
+1 -1
View File
@@ -22,7 +22,7 @@ func TestVerifyRequestSignature(t *testing.T) {
fields := canon.RequestSigningFields{
ProtocolVersion: "v1",
DeviceSessionID: "device-session-123",
MessageType: "user.games.command",
MessageType: "user.games.order",
TimestampMS: 123456789,
RequestID: "request-123",
PayloadHash: sha256Sum([]byte("payload")),
@@ -1,13 +1,13 @@
{
"message_type": "user.games.command",
"message_type": "user.games.order",
"protocol_version": "v1",
"device_session_id": "device-session-1",
"timestamp_ms": 1700000001000,
"request_id": "req-games-1",
"payload": "games-payload",
"payload_hash_hex": "a8322c99bf424939cd3a1e5a41b5edb67e567bff87c49e8ff229be60976960e0",
"expected_canonical_bytes_hex": "1167616c6178792d726571756573742d7631027631106465766963652d73657373696f6e2d3112757365722e67616d65732e636f6d6d616e640000018bcfe56be80b7265712d67616d65732d3120a8322c99bf424939cd3a1e5a41b5edb67e567bff87c49e8ff229be60976960e0",
"expected_canonical_bytes_hex": "1167616c6178792d726571756573742d7631027631106465766963652d73657373696f6e2d3110757365722e67616d65732e6f726465720000018bcfe56be80b7265712d67616d65732d3120a8322c99bf424939cd3a1e5a41b5edb67e567bff87c49e8ff229be60976960e0",
"private_key_seed_hex": "0303030303030303030303030303030303030303030303030303030303030303",
"public_key_base64": "7UkoxijRwsbq6QM4kFmVYSlZJzpcY/k2NsFGFKyHN9E=",
"expected_signature_hex": "262d5480451560d9b2ca96468b0e962e4288eabb4dff29dbc66c491a37dd92b779d2b89853083a695317f8535e49c402dcfd49a11fd2926f3af42ceb745e2b0a"
"expected_signature_hex": "b4a9a1eb2eb67777469d87ed7c513afd89f0c0a96ca9e0d945cd327830c11a7834ac073f6a872d8121cd7674b9491399a0256210292615bd424d11d0db37200c"
}
@@ -79,7 +79,7 @@ beforeAll(async () => {
describe("WasmCore canon parity with gateway fixtures", () => {
test.each([
"request_user_account_get.json",
"request_user_games_command.json",
"request_user_games_order.json",
"request_lobby_my_games_list.json",
])("%s — canonical bytes byte-for-byte equal", (name) => {
const fixture = readJson<RequestFixture>(name);