Skip to content

feat(ingest): binary-safe envelope parser for attachment items - #265

Merged
ajianaz merged 1 commit into
developfrom
feat/245-binary-envelope-parser
Jun 27, 2026
Merged

feat(ingest): binary-safe envelope parser for attachment items#265
ajianaz merged 1 commit into
developfrom
feat/245-binary-envelope-parser

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Closes #245 · Parent: #233

Summary

Rewrite envelope parser to handle binary attachment payloads via length-delimited reads.

Key Changes

  • New parse_envelope_binary() — byte-based, not line-based
  • Length-based read for attachments (correctly handles embedded newlines)
  • parse_envelope_text() preserved for backward compat
  • 7 new tests including binary round-trip, truncation, gzip, multi-attachment

Tests: 23/23 ingest, all workspace tests pass

- New parse_envelope_binary() works on raw bytes instead of text
- Length-based read for attachment payloads (handles embedded \n, \x00, etc.)
- ItemHeader struct for structured header parsing
- find_newline() helper for byte scanning
- Updated parse_envelope() entry point to use binary parser
- parse_envelope_text() preserved for backward compat
- 7 new tests: mixed items, binary round-trip, truncated, gzip, multi-attachment
- 23/23 ingest tests pass

Closes #245
@ajianaz
ajianaz merged commit 57b1a15 into develop Jun 27, 2026
10 checks passed
@ajianaz
ajianaz deleted the feat/245-binary-envelope-parser branch June 27, 2026 05:58
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.

3b: Binary-safe envelope parser for attachment items

1 participant