fix: rust starter kit refresh + ci - #112
Merged
Merged
Conversation
The Rust kit (flagged not-up-to-date in the README) had drifted from the current engine wire protocol. Because it uses typed serde structs, the drift caused hard failures rather than the silent no-ops seen in the untyped Go kit. Protocol fixes: - Add the `info` ServerPacketType variant. The engine broadcasts `info` packets while waiting for players; without this variant serde fails to parse them and the agent panics on connect (start() propagates the error via `?`). - Rename the bomb-owner field `owner_unit_id` -> `unit_id` (entity.rs, game_state.rs). The stale name never populated, so get_bomb_for_unit always returned None and the agent could never detonate. - Fix create_detonate_bomb_action to send type "detonate" (was "bomb", which would place a bomb instead of detonating). - Add `stunned` to Unit and `agent_id` to Entity, both present in the current schema (freeze mechanic), and copy them in update_state. Tests (the kit had none): - Add src/tests.rs with serde-conformance tests (info parses, stunned/unit_id/ agent_id deserialize, detonate serializes correctly) and a schema-validation test that checks the fixtures against the engine's canonical ServerPacket schema via a jsonschema dev-dependency. The schema path is taken from BOMBERLAND_SCHEMA_PATH (CI points it at the engine schema) and defaults to a bundled copy for local runs and standalone clones. Tooling: - Bundle the engine's canonical validation.schema.json. - Modernize the Dockerfile base images (rust:1.57-slim-buster -> rust:1-slim- bookworm, debian:buster-slim -> bookworm-slim) so the toolchain can resolve the updated dependency graph; the release build still compiles only the bin target, so the jsonschema dev-dependency is not built into the image.
Mirrors the Go kit's CI. The engine's JSON schema is the source of truth: the workflow validates the Rust fixtures against the engine's canonical schema and re-runs whenever that schema changes. - Triggers on changes to agents/rust/**, the engine schema, and the workflow. - Fails if the kit's bundled schema copy has drifted from the engine's. - Runs `cargo test --locked` with BOMBERLAND_SCHEMA_PATH pointed at the engine schema. GitHub-hosted runners only.
The Rust kit now matches the current engine wire protocol and is validated against the engine's canonical JSON schema in CI (test-rust-agent.yaml).
Public repo — CI only ever runs on GitHub-hosted runners, so the note about never using self-hosted homeserver runners was misleading. Reworded both workflow header comments to just state the runner, keeping the engine workflow's PR-build/no-push note.
thegalah
force-pushed
the
fix/rust-starter-kit-refresh
branch
from
July 25, 2026 17:04
8d51012 to
c2e94d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.