Skip to content

Replayed the native stream commits onto the unified Core. - #23

Open
moedash wants to merge 8 commits into
moe/AI-198-st-ext-core-unifiedfrom
moe/AI-198-st-ext-core-all
Open

moedash wants to merge 8 commits into
moe/AI-198-st-ext-core-unifiedfrom
moe/AI-198-st-ext-core-all

Conversation

@moedash

@moedash moedash commented Oct 3, 2026

Copy link
Copy Markdown
Owner

This PR replays the native stream commits onto the unified Core, so one Core speaks both stream prototypes.

What changed?

  • The commits are the main lineage's stream commits in their order: the stream api, the DeliverStreamRecords job, the two command machines and their tests, delivery and replay re-supply with their tests, and the changelog entries. Review the stream content on those PRs. This PR is where the two lineages meet.
  • The stream items sit next to Max's external stream family. The job and command numbers are the same as the main lineage's: deliver_stream_records at 22, subscribe_stream at 31 and append_stream_records at 32, after the channel's 21, 29 and 30. workflow_stream_channels stays at 33.
  • The channel machines, the fold and the scheduled-event guard are the ones already on this branch. The main lineage's case that checks notifications come ahead of a stream range lives in core_tests/channels.rs, which this lineage doesn't have, so it stays there.
  • The changelog gets the stream entries only. The channel entry belongs to the main lineage.
  • A last commit drops the explicit compile root for the record envelope. The command and history protos import stream/v1 from here on, so protoc reaches it through them, as on the main lineage.

Part of AI-198 (epic AI-37).

Why?

One Core that speaks both prototypes lets one Python build run every provider. Replaying the commits keeps the native series out of a second merge, since its branch shares upstream as a base with this one. The vendored api here matches the main lineage's byte for byte, so both lineages put the same numbers on the wire.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

The whole workspace lib suite passes at the head, and so does the coverage reporter run with the ignored tests. cargo fmt --check, cargo lint, cargo test-lint and the CI cargo doc check are clean, and each commit builds. The tree was compared with the earlier all-in-one branch. The stream files match it byte for byte, and the rest differs only by the renumber and the channel files aligned with the main lineage.

Core decodes the stream commands, events, slices and consumed ranges only when its vendored api carries them. The type maps in the protos crate name the two new commands and events, which are not ignorable.
A consumed stream range reaches lang as its own job. The Rust SDKs have no stream API yet, so they fail the activation rather than drop records the server will not send again.
A workflow consumes and produces stream records through bridge commands 31 and 32. Each machine holds a reissued command to its recorded event on replay, and an unnamed append learns its stream name from the first event the server records.
The cases cover each command reaching the server, its round trip through replay, and which reissues replay refuses and which it accepts.
The poll response carries the records for the task about to run and re-supplies what earlier tasks consumed, keyed by the completion that recorded each range. Core hands them over in a fixed order, gives a consuming task its own activation on replay, and fails a task whose recorded range arrived without its records.
The cases cover live delivery, replay across history pages, the lookahead to the closing completion, missing and mismatched records, and notifications ordered ahead of a stream range.
The command and history protos import `stream/v1` from here on, so protoc reaches the envelope
through them, as it does on the main lineage.
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