Skip to content

fix: plan proto unsigned integers as unsigned - #297

Closed
moetemp wants to merge 6 commits into
moe/up/python-proto-modulesfrom
moe/up/proto-unsigned-ints
Closed

moetemp wants to merge 6 commits into
moe/up/python-proto-modulesfrom
moe/up/proto-unsigned-ints

Conversation

@moetemp

@moetemp moetemp commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

This PR plans a proto uint32 or fixed32 field as u32, and a uint64 or fixed64 field as u64. .NET then types it as uint or ulong, as its proto class does.

TypeScript keeps Long for a 64-bit proto field, and Python output doesn't change.

It's based on #311.

Why?

.NET typed a proto uint64 field as long, but the proto class has ulong, so the model didn't compile. Brook's writer has a uint64 writer-id, so the sample project left the .NET writer out of the build.

How did you test it?

Link to a test plan if any -

  • Unit Tests
  • Staging
  • End to End Tests

cargo validate passes, and the .NET sample project builds Brook's writer.

@moetemp
moetemp requested a review from a team as a code owner October 26, 2026 22:45
@moetemp
moetemp force-pushed the moe/up/proto-unsigned-ints branch 5 times, most recently from 5a2beda to 12b0bcd Compare October 27, 2026 00:19
@moetemp
moetemp force-pushed the moe/up/proto-unsigned-ints branch 2 times, most recently from b71a054 to 431dc01 Compare October 27, 2026 17:43
@moetemp
moetemp force-pushed the moe/up/proto-unsigned-ints branch from 431dc01 to eac4079 Compare October 27, 2026 18:35
@moetemp
moetemp force-pushed the moe/up/proto-unsigned-ints branch from eac4079 to 00379ac Compare October 28, 2026 00:21
Brook's writer uses records of the stream service across packages. The match takes the package
and the interface, since several samples share `temporal:nexus`.
The samples now generate what Brook generates, byte for byte from its WIT. No SDK has the Stream
protos yet, so the sample projects ship their bindings. Today only part of the output builds, and
each fix turns its part on.
This is today's output. Python and TypeScript panic on the record cases, so their outputs keep
their previous content. .NET types each case as the raw proto message, not as its record or enum.
No Temporal API message has a oneof with an enum case, so the sample gets its own proto.
Variant planning kept such a case as the raw proto type. Python and TypeScript panicked on a
record case, and named an enum case's type without defining it. .NET typed the case as the proto
class or enum. The case now plans as the record or enum, as a record field already does. Brook's
stream service now generates for TypeScript, and its .NET read item holds the records.
A proto in temporal/... always became a temporalio module, so a proto that the SDK doesn't have
yet couldn't be imported. --python-proto-module, and python_proto_modules in examples.toml, map a
file path prefix to the module that replaces it. A prefix matches whole path segments, and the
module must be a dotted Python name. Brook's stream service now generates for Python, with the
Stream protos from the sample's own package.
A proto `uint64` field was planned as a signed `s64`, so .NET typed it as `long` against the
`ulong` of its proto class and the model didn't compile. The `writer-id` of Brook's writer sample
shows the fix, and the writer now builds for .NET.
This was referenced Oct 28, 2026
@moetemp
moetemp changed the base branch from main to moe/up/python-proto-modules October 28, 2026 22:57
@moetemp
moetemp force-pushed the moe/up/python-proto-modules branch from 92cfcc2 to 81fd8c7 Compare October 29, 2026 04:00
@moetemp

moetemp commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Closing this. It fixes unsigned proto ints, but Brook doesn't need it anymore, because nexgen no longer generates the stream writer.

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