refactor(remote-config): RC Container Format v1 support#3534
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3534 +/- ##
==========================================
+ Coverage 80.40% 80.46% +0.06%
==========================================
Files 379 382 +3
Lines 15522 15594 +72
Branches 2157 2166 +9
==========================================
+ Hits 12480 12548 +68
- Misses 2171 2172 +1
- Partials 871 874 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
b0b0c57 to
a9c2140
Compare
a9c2140 to
7b9d434
Compare
📸 Snapshot Test593 unchanged
🛸 Powered by Emerge Tools |
ajpallares
left a comment
There was a problem hiding this comment.
Took a look, and have some comments. Mostly documentation nits and one suggestion about a missing test. But I think it looks good! Good job!
rickvdl
left a comment
There was a problem hiding this comment.
Great work!! 💪 Couple of questions
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes 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 44386ff. Configure here.
| val padding = alignment - remainder | ||
| if (padding > remaining()) { | ||
| // Trailing alignment padding past the end of the buffer; nothing more to read. | ||
| position(limit()) |
There was a problem hiding this comment.
Missing padding bytes not rejected
Medium Severity
When an element’s required alignment padding exceeds the bytes left before the buffer limit, alignTo sets the position to the limit and returns instead of throwing RCContainerFormatException. A truncated payload can therefore parse successfully even though mandatory padding is missing, which weakens the format’s truncation checks elsewhere.
Reviewed by Cursor Bugbot for commit 44386ff. Configure here.
Standalone, pure-Kotlin deserializer evaluating a custom binary container format for potential future use in network requests. Provides zero-copy field access via read-only ByteBuffer views that share the backing buffer; element bytes are never copied during parsing. - RCContainer: parses header (magic "RC", version, flags, big-endian config_size) then elements until EOF, with 8-byte alignment padding and full bounds checking. - RCElement: 32-byte checksum view + zero-copy data view; lazy opt-in SHA-256 verification via isChecksumValid(). - RCContainerFormatException: extends existing SerializationException. - RCContainerTest: 16 tests covering parsing, padding, big-endian sizes, checksum, zero-copy semantics, and error paths. Not wired into HTTPClient/Backend; evaluation only. All internal, no public API change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pri #21221) Sync the deserializer with khepri PR #21221: - CHECKSUM_SIZE 32 -> 24 bytes (SHA-256 truncated to 192 bits); element header shrinks 40 -> 32 bytes accordingly. - isChecksumValid() truncates the computed SHA-256 to the stored checksum length before comparing. - Content-addressed elements map keyed by URL-safe base64 (no padding), matching the backend's ref encoding in the config JSON / URLs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
Co-authored-by: Antonio Pallares <ajpallares@users.noreply.github.com>
9cd9f13 to
4288db2
Compare



This adds support for a new binary format that will be used for remote config support from our SDKs. This is currently unused and untested against the backend, but will be in later PRs of the stack
Note
Low Risk
New internal networking types with no production call sites yet; risk is limited to future integration and binary parsing edge cases, which are heavily tested.
Overview
Introduces an internal parser for RC Container Format v1 binary payloads, intended for upcoming remote config delivery.
RCContainer.parsereads theRCheader, treats element 0 as config, and exposes further blobs as zero-copyRCElementviews with optional SHA-256 checksum verification and lazy lookup by URL-safe base64 refs (matching backendblob_refencoding).Invalid or truncated wire data surfaces as
RCContainerFormatException. Parsing is careful about 8-byte alignment, little-endian sizes, and not mutating the caller’sByteBufferposition.Coverage includes in-memory unit tests plus frozen
.binfixtures so accidental v1 wire-format regressions are caught before integration with the backend.Reviewed by Cursor Bugbot for commit a53127d. Bugbot is set up for automated code reviews on this repo. Configure here.