Skip to content

[Brook K11] Added the SDK calls with no Store, and the sync call. - #221

Closed
moetemp wants to merge 1 commit into
moe/brook/review/streams-k10-witfrom
moe/brook/review/streams-k11-static-calls
Closed

moetemp wants to merge 1 commit into
moe/brook/review/streams-k10-witfrom
moe/brook/review/streams-k11-static-calls

Conversation

@moetemp

@moetemp moetemp commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

What changed?

This PR adds the static calls and the sync call of the Stream runtime. It is the first layer of the thin SDK runtime, which moves Brook's language-neutral runtime out of sdk-python into this crate.

  • call_static runs a pure method with no runtime object. DeriveProducer gives the Producer of an Activity attempt from an ActivityContext, which lang copies from its Activity info. ScopedStreamId gives the id of a named Workflow Stream, for code outside a Workflow.
  • StreamRuntime::call_sync runs a method that never waits, with no async runtime entered, so a finalizer can call it. call runs those methods too.
  • WorkflowTaskAttempt has the field numbers and types of Core's coresdk.activity_task.WorkflowTaskAttempt (C1, fields 1 to 7), so lang passes Core's bytes through. A test encodes Core's message and decodes it as the crate's.
  • testdata/producers.json has the Producer of each Activity kind. gen_vectors.py writes it from its second implementation.

Depends on #220 (K10). Review lane is the Rust reviewers.
Part of the Brook review series.

Why?

Brook ships in Python, TypeScript and .NET, so each rule that isn't tied to a language or to Workflow code moves into this crate once. The Producer rule is the first. It reads C1's previous_attempt and previous_started_time too, so the attempt and time tie-break of the withdrawal rule works for every SDK. sdk-python forwards only the started event id today.

How did you test it?

cargo fmt, cargo clippy -- -D warnings (with and without features), cargo test -p temporalio-streams --all-features and cargo doc pass at this commit.

@moetemp moetemp added the skip-changelog Changelog entry rides another PR label Oct 28, 2026
@moetemp
moetemp marked this pull request as draft October 28, 2026 21:55
@moetemp
moetemp force-pushed the moe/brook/review/streams-k10-wit branch from 53631bb to b5e1532 Compare October 29, 2026 04:06
@moetemp
moetemp force-pushed the moe/brook/review/streams-k11-static-calls branch 3 times, most recently from df49f36 to cc13519 Compare October 29, 2026 09:17
@moetemp
moetemp force-pushed the moe/brook/review/streams-k10-wit branch from 23f4638 to d27b78f Compare October 29, 2026 09:17
Every SDK must derive the Producer of an Activity by one rule, so the rule moves into the crate as a static call.
@moetemp
moetemp force-pushed the moe/brook/review/streams-k11-static-calls branch from cc13519 to ce11ed4 Compare October 29, 2026 10:03
@moetemp
moetemp force-pushed the moe/brook/review/streams-k10-wit branch from d27b78f to 88adfdf Compare October 29, 2026 10:03
@moetemp

moetemp commented Oct 30, 2026

Copy link
Copy Markdown
Owner Author

Parked. Nothing calls these runtime methods yet, since sdk-python does this work in Python. The branch stays, and this layer comes back with its first caller, for example a TypeScript or .NET port or Rust read handles.

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