Add guild_batch_ml_score and guild_condo_detected to action proto (fields 14, 15)#63
Draft
simonhachey wants to merge 1 commit into
Draft
Conversation
The coordinator decodes rules-input PubSub messages with this repo's
osprey.rpc.actions.v1.Action proto, whose `data` oneof stopped at
field 13 (safety_visual_prediction). The publishing side
(discord_smite_rpc.actions.v1.Action) added two newer actions —
guild_batch_ml_score (field 14) and guild_condo_detected (field 15) —
that were never mirrored here.
When such a message arrives, proto3 drops the unknown field, so
WhichOneof('data') resolves to None: the coordinator can't determine
the action type, the message never reaches rule evaluation, and it is
nacked and eventually dead-lettered. These two actions account for the
entire async rules-input dead-letter backlog.
Mirror the two oneof fields and their message types (plus the
GuildBatchML helper) from discord_smite_rpc, keeping field numbers and
types identical for wire compatibility, and regenerate the Python
bindings. The Rust coordinator picks the fields up from this .proto at
build time (build.rs / prost).
Validated by encoding messages with the publisher's discord_smite_rpc
proto and decoding with the regenerated osprey.rpc proto: WhichOneof
now resolves correctly for both actions and the bytes re-serialize
identically (exact wire-format match).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
The coordinator decodes rules-input PubSub messages with this repo's
osprey.rpc.actions.v1.Actionproto, whosedataoneof stopped at field 13 (safety_visual_prediction). The publishing side (discord_smite_rpc.actions.v1.Action) added two newer actions —guild_batch_ml_score(field 14) andguild_condo_detected(field 15) — that were never mirrored here.When a message for either action arrives, proto3 drops the unknown field, so
WhichOneof('data')isNone;decode_proto_messagethen returnsErr("missing action data")and the message is dropped before it ever reaches a worker / rule evaluation. These two actions account for the rules-input dead-letter backlog.Change
GuildBatchMLScore,GuildCondoDetected) plus theGuildBatchMLhelper fromdiscord_smite_rpc, keeping field numbers and types identical for wire compatibility../gen-protos.sh). The Rust coordinator compiles the new fields from this same.protoat build time (build.rs / prost) — no separate Rust change needed.Validation
guild_batch_ml_scoremessage decodes toWhichOneof('data') == None(the"missing action data"path) in both the Python proto and the prost-compiled Rust coordinator logic; with this change the same bytes resolve toguild_batch_ml_score.discord_smite_rpcproto re-serialize byte-for-byte identically under the regeneratedosprey.rpcproto.guild_batch_ml_score,guild_condo_detected) all decode and resolve correctly under the regenerated proto.cargo checkonosprey_coordinatorcompiles cleanly; the engine extracts the fields and evaluates theguild_batch_ml_scorerules on a real message without error.Note for reviewers
The engine's
osprey.rpcaction proto is maintained separately fromdiscord_smite_rpc; that divergence is what silently broke decoding when these two actions were added upstream. A follow-up to keep the two oneofs in sync (a CI diff check, or vendoring) would prevent the next new action from dead-lettering the same way.🤖 Generated with Claude Code