Skip to content

[Brook] Added stream records and the hashes lang owes Core. - #150

Closed
moetemp wants to merge 5 commits into
moe/brook/v2/p1-core-stream-storefrom
moe/brook/v2/p2b-records-wire
Closed

moetemp wants to merge 5 commits into
moe/brook/v2/p1-core-stream-storefrom
moe/brook/v2/p2b-records-wire

Conversation

@moetemp

@moetemp moetemp commented Oct 13, 2026

Copy link
Copy Markdown
Owner

What changed?

This PR adds StreamRecord and the hashes lang takes before Core stores the records.

  • StreamRecord[T], RecordKind, Supersession and Cursor go in temporalio.contrib.streams.
  • _body.py takes the plaintext content_hash and the batch digest, both before the codec. Core stores them unchanged.
  • Only the writer that made the digest compares it. Deterministic protobuf bytes differ across implementations.
  • _wire.py turns a record of Core's read answer into a StreamRecord. A supersession that Core synthesized becomes a SUPERSEDED record.
  • The envelope proto is Core's, so this PR has no proto of its own.

Why?

Only lang has the plaintext. With both hashes taken before the codec, a retry through a codec with a fresh nonce still dedupes (DD-11).

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

tests/contrib/streams/test_records_wire.py also checks the digest against the vector Core's tests pin.

@moetemp moetemp added the skip-changelog Changelog entry rides another PR label Oct 13, 2026
@moetemp

moetemp commented Oct 16, 2026

Copy link
Copy Markdown
Owner Author

Combined into #239.

@moetemp moetemp closed this Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Changelog entry rides another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant