Skip to content

Implement a compliant SliM V0.5 wire codec - #4

Merged
killertux merged 2 commits into
masterfrom
feat/slim-v05-codec
Sep 10, 2026
Merged

killertux merged 2 commits into
masterfrom
feat/slim-v05-codec

Conversation

@killertux

Copy link
Copy Markdown
Owner

The existing SliM codec used one length rule at every layer, so Unicode messages could be decoded incorrectly and malformed instructions could terminate the server. For example, nested strings were measured as UTF-8 bytes even though SliM V0.5 requires UTF-16 code units, while only the outer frame uses a byte count.

This change separates outer framing from recursive value encoding, adds a recursive SlimValue, validates frame/list structure, supports lengths beyond six digits, and preserves ordinary strings inside nested result lists. Well-formed instruction lists with unknown operations or invalid arity now return MALFORMED_INSTRUCTION for their original ID and allow the rest of the batch to continue.

The public Instruction enum gains a Malformed variant, so downstream exhaustive matches will need to handle it. Typed list instruction arguments and the typed fixture runtime remain follow-up work.

Validation:

  • cargo test --workspace --all-features
  • cargo clippy -p slim_protocol --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • Independent review against the documented SliM V0.5 protocol

@killertux
killertux merged commit 571ef5f into master Sep 10, 2026
10 checks passed
@killertux
killertux deleted the feat/slim-v05-codec branch September 10, 2026 15:17
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