Skip to content

refactor: source protobuf descriptors from command codecs#911

Draft
ryanditjia wants to merge 4 commits into
Anthony/code-gen-introspect-fixfrom
ryandi/protobuf-descriptor-introspection
Draft

refactor: source protobuf descriptors from command codecs#911
ryanditjia wants to merge 4 commits into
Anthony/code-gen-introspect-fixfrom
ryandi/protobuf-descriptor-introspection

Conversation

@ryanditjia

Copy link
Copy Markdown
Contributor

Summary

  • require every command codec to expose its exact protobuf message descriptor
  • remove reflection over ToProto from Cardinal introspection
  • validate descriptors at codec registration, collect a deterministic dependency-complete FileDescriptorSet, and cache its bytes
  • update generated World Engine command codecs and protobuf-backed test fixtures

Why

This keeps wire metadata attached to the codec that actually owns serialization. It avoids inferring message types through reflection and leaves the descriptor collector reusable when components and events migrate to protobuf.

Stacked on #909.

Validation

  • task lint
  • focused pkg/cardinal descriptor tests
  • command registry, template, and lobby package tests

Review point: Replace lazy sync.Once descriptor construction and the hand-built dynamic protobuf test fixture.

Change: Finalize the catalog before service startup, reject late registration, and use a generated protobuf command fixture with a Taskfile generation command.

Verification: task lint; go test ./pkg/cardinal/...; go test -race ./pkg/cardinal; buf lint; task generate:commandtest-proto.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant