docs(serder): #79 research write-up — pluggable serialization backend seam#138
Merged
Merged
Conversation
… seam design Research-first deliverable for #79: status-quo allocation audit (3x to_string per serialize, 2-3x from_slice + re-render per deserialize), body-encoder seam design with fixed-width slot backpatching, crate survey (zero new deps), cross-backend conformance strategy, and a latent version-string size-overflow defect to fix under this card. Refs #79 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Merging this PR will not alter performance
Comparing Footnotes
|
…d in #139 Answers the review question 'why do we need serde at all?': deserialization happens once at the edge and the write path uses none of serde's data model, so the end state is a serde-free production path with serde_json demoted to a dev-dependency oracle. Read path becomes a strict canonical parser (borrowed fields + SAID offsets, feeding C-a #129); strictness is itself a conformance feature — the whitespace-acceptance defect fixed in #139 is the proof case. Staged migration spelled out in §6. Co-Authored-By: Claude Fable 5 <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
Research-phase deliverable for #79 (research-first card: no production code lands until this write-up is reviewed). Adds
docs/superpowers/specs/2026-07-10-79-serialization-backend-seam-design.mdcovering the five required research sections:serde_json::to_string()three times (measure → size-correct → SAID-splice) with per-fieldValueclones; deserialize parses 2–3Valuetrees and re-renders the whole event to verify SAIDs. No serde derives exist on any domain type, and every event-body scalar is a JSON string (hex sn/bt, qb64), so the serde data model is incidental — the load-bearing requirements are spec field order and byte determinism.&mut Vec<u8>and reports the fixed-width version-size + SAID slot ranges (EventLayout). Both slots are fixed-width, so the optimized backend does one render + two in-place backpatches + one hash. Three options analysed; body-encoder seam recommended.serialize()keeps its signature with serde_json as the unchanged default; the seam +serialize_withare additive (PATCH under 0.x).Notable research finding
VersionString::to_str()(cesr/src/serder/version.rs:161–170) formats the size with an unguarded{:06x}: a size above 0xFF_FFFF silently emits ≥7 hex digits, breaking the documented 17-byte version-string invariant. The design requires a runtimeErrguard + bug-probe test, landing with the seam work.Scope decisions called out for review
Refs #79
🤖 Generated with Claude Code