[DO NOT MERGE] refactor(sdk): unify CRDT codec into a parse-once pipeline - #1522
Draft
cyaiox wants to merge 1 commit into
Draft
[DO NOT MERGE] refactor(sdk): unify CRDT codec into a parse-once pipeline#1522cyaiox wants to merge 1 commit into
cyaiox wants to merge 1 commit into
Conversation
Phase 3 of the authoritative-server network refactor — the highest- risk phase, executed with byte-identical wire goldens (the 7 characterization snapshots pass unmodified): - network/codec.ts (server/utils.ts renamed, chunking.ts absorbed) is the sole owner of read/translate/pack; nothing else in the layer parses or packs CRDT bytes - server ingest walks each inbound buffer exactly once: validation consumes the parsed form and broadcast re-packs the retained byte slices — the structural re-parse inside the old chunker is gone (2 parses → 1 per buffer, asserted by a spy-based test) - packChunks: one place chunk boundaries are decided, O(1) size accounting via currentWriteOffset, lazy pull with copy-before-reuse so producers can yield views over a scratch buffer instead of allocating 10KB per message - one oversize error path shared by dumps and broadcasts, always-on, naming component, entity, byte size, and the 12KB ceiling (#8 green) - state.ts dump path now measures the actual emitted slice instead of payload-only bytes (was undercounting headers by ~28B/message) Red defect test #8 flips to passing; #10, #11, #12, #13 verified still red. chunkCrdtMessages survives only as the characterization pin's composition (ponytail marker with removal path). Claude-Session: https://claude.ai/code/session_01Kzo6zwrn1CA79S4RN1dgsU
This was referenced Aug 5, 2026
Draft
Contributor
Test this pull request
|
cyaiox
marked this pull request as draft
August 5, 2026 14:25
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.
Phase 3 of the authoritative-server network refactor — the highest-
risk phase, executed with byte-identical wire goldens (the 7
characterization snapshots pass unmodified):
the sole owner of read/translate/pack; nothing else in the layer
parses or packs CRDT bytes
consumes the parsed form and broadcast re-packs the retained byte
slices — the structural re-parse inside the old chunker is gone
(2 parses → 1 per buffer, asserted by a spy-based test)
accounting via currentWriteOffset, lazy pull with copy-before-reuse
so producers can yield views over a scratch buffer instead of
allocating 10KB per message
naming component, entity, byte size, and the 12KB ceiling (chore: change s3 secrets and comment an installable package to test #8 green)
payload-only bytes (was undercounting headers by ~28B/message)
Red defect test #8 flips to passing; #10, #11, #12, #13 verified still
red. chunkCrdtMessages survives only as the characterization pin's
composition (ponytail marker with removal path).
Claude-Session: https://claude.ai/code/session_01Kzo6zwrn1CA79S4RN1dgsU
🤖 Generated with Claude Code
https://claude.ai/code/session_01Kzo6zwrn1CA79S4RN1dgsU
📚 Stack (splits #1505 — merge top-down within each stack)
Network layer (each PR is one self-contained, independently-green commit):
sdk-commands (independent of the stack above):
After a parent squash-merges, the child needs
git rebase --onto origin/auth-server <old-parent> <child>— ping the session and it gets restacked.