Skip to content

[Brook] Built the Stream handles on the generated Stream resource. - #350

Closed
moetemp wants to merge 12 commits into
moe/brook/v4/p27-examplesfrom
moe/brook/v4/p28-stream-resource
Closed

moetemp wants to merge 12 commits into
moe/brook/v4/p27-examplesfrom
moe/brook/v4/p28-stream-resource

Conversation

@moetemp

@moetemp moetemp commented Oct 22, 2026

Copy link
Copy Markdown
Owner

What changed?

This PR builds the Stream handles on the Stream resource that nexgen n8 generates from the crate's s16 WIT (S84).

The crate pin moves to s16 88abba51 (a WIT change only), scripts/_wit/stream-service.wit is its copy, and NEX_GEN_REVISION is n8 de0c7edd. The regenerated bindings have system/_resources/stream.py with Stream(stream=...) and its append_records, close, read_records and describe methods. create_stream returns a Stream, and CreateStreamResponse is now CreateStreamResult.

WorkflowStream now makes its calls through the resource. publish calls Stream.append_records, close calls Stream.close, and the create uses the generated create_stream. The facade keeps the parts that the resource can't give: typed Topics from the definition, the run's replay and closed-Stream rules, and close-with-run. Activity and client handles read the offset through the generated client's describe_stream. They keep the crate's writer calls (OpenWriter, WriteRecords, CloseWriter), since those are not IDL operations, and the close, which encodes its failure with the codec. The public API, tests and examples are unchanged.

Why?

S84: the Stream handle is a WIT resource, so its calls come from the IDL and stay the same in every SDK.

How did you test it?

pytest tests/contrib/streams, including the examples, on the memory Store and on a scratch redis-server, against the stock dev server. A regen with n8 at this layer gives the committed bindings. poe lint passes.

  • Unit Tests
  • Staging
  • End to End Tests

@moetemp

moetemp commented Oct 25, 2026

Copy link
Copy Markdown
Owner Author

Closing as stale. This layer is folded into the v5 tip, #365, and the upstream review uses a fresh series instead. Plan: https://www.notion.so/4048fc567738814990b7c796ac28fe3f

@moetemp moetemp closed this Oct 25, 2026
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