Skip to content

Add guild_batch_ml_score and guild_condo_detected to action proto (fields 14, 15)#63

Draft
simonhachey wants to merge 1 commit into
mainfrom
fix/action-proto-add-guild-batch-ml-score-condo-detected
Draft

Add guild_batch_ml_score and guild_condo_detected to action proto (fields 14, 15)#63
simonhachey wants to merge 1 commit into
mainfrom
fix/action-proto-add-guild-batch-ml-score-condo-detected

Conversation

@simonhachey

Copy link
Copy Markdown
Collaborator

Summary

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 a message for either action arrives, proto3 drops the unknown field, so WhichOneof('data') is None; decode_proto_message then returns Err("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

  • Mirror the two oneof fields and their message types (GuildBatchMLScore, GuildCondoDetected) plus the GuildBatchML helper from discord_smite_rpc, keeping field numbers and types identical for wire compatibility.
  • Regenerate the Python bindings (./gen-protos.sh). The Rust coordinator compiles the new fields from this same .proto at build time (build.rs / prost) — no separate Rust change needed.

Validation

  • Causal control (same real message, before/after): with the pre-fix proto, a real dead-lettered guild_batch_ml_score message decodes to WhichOneof('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 to guild_batch_ml_score.
  • Wire compatibility: messages encoded with the publisher's discord_smite_rpc proto re-serialize byte-for-byte identically under the regenerated osprey.rpc proto.
  • Real traffic: sampled production dead-letter messages (guild_batch_ml_score, guild_condo_detected) all decode and resolve correctly under the regenerated proto.
  • cargo check on osprey_coordinator compiles cleanly; the engine extracts the fields and evaluates the guild_batch_ml_score rules on a real message without error.

Note for reviewers

The engine's osprey.rpc action proto is maintained separately from discord_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

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>
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