feat: Add FDv2 wire format and protocol handler#177
Open
beekld wants to merge 2 commits into
Open
Conversation
beekld
marked this pull request as ready for review
June 25, 2026 17:59
keelerm84
reviewed
Jun 25, 2026
| pub(super) version: u64, | ||
| pub(super) kind: String, | ||
| pub(super) key: String, | ||
| pub(super) object: serde_json::Value, |
Member
There was a problem hiding this comment.
What do we think about using serde's raw value? Might save some cycles if we find we need to discard part of the stream.
Author
There was a problem hiding this comment.
I prefer keeping this as Value to be consistent with how it's written in C++ and Java. I'm open to discussing it further.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b84b315. Configure here.
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
fdv2module:ChangeSet/Selectortypesserde_json::Value; typed deserialization will live in a later translator.Selectorkeeps the deprecatedversionfield alongsidestateGoodbyeandFDv2Erroruse optional fields to tolerate permissively-parsed wire data#[allow(dead_code)]for now: types are covered by unit tests but not yet reachable from the production data path.Note
Low Risk
New isolated code with no production integration yet; behavior is confined to unit tests until the data source adopts it.
Overview
Adds a new
fdv2module (registered inlib.rsbehind#[allow(dead_code)]) so FDv2 is implemented and unit-tested but not yet hooked into streaming/polling.wire.rsdefines serde models for FDv2 SSE payloads (server-intent,put-object,delete-object,payload-transferred,error,goodbye) plus assembledChangeSet/FDv2Changetypes. Flag/segment bodies stay asserde_json::Value; unknown intent codes map toIntentCode::Unknown, andGoodbye/FDv2Erroruse optional fields for tolerant parsing.protocol.rsimplementsFDv2ProtocolHandler, a small state machine that turns those events intoProtocolResultvalues (noop,ChangeSet, errors, or goodbye). It distinguishes full vs partial transfers, allows further put/delete cycles after the firstpayload-transferredwithout a new intent, treatsintent noneas an empty changeset, clears buffered changes on servererrorwhile keeping transfer state, and fully resets ongoodbye(with permissive goodbye JSON parsing).Reviewed by Cursor Bugbot for commit b84b315. Bugbot is set up for automated code reviews on this repo. Configure here.