fix!: preserve unsigned command types in optimistic previews - #247
Open
patrickleet wants to merge 1 commit into
Open
fix!: preserve unsigned command types in optimistic previews#247patrickleet wants to merge 1 commit into
patrickleet wants to merge 1 commit into
Conversation
Preserve typed nonnegative integer ranges through command derives, portable metadata, generated codecs and U64 projection proofs. Reject inexact browser numbers before optimism or dispatch while preserving native unsigned range and signed codecs. BREAKING CHANGE: manually constructed command/surface fields require unsigned_integer metadata; the protocol fingerprint changes and services and generated clients must be rebuilt together.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unsigned revision commands can now produce typed optimistic projections. Previously, an authored
u64input became the same unrefinedBigIntcodec asi64, so the client compiler could not prove that it was a valid source for a U64 projection slot.The generated field still uses GraphQL
BigIntand TypeScriptnumber, withuint64_safe_integeras its command codec. A preview binding such asinput.expected_revisionnow compiles, and preparation uses the same exact integer for the optimistic projection and dispatched input.u8,u16,u32,u64, and target-widthusize. Browser U64 values stop atNumber.MAX_SAFE_INTEGER; native Rust commands, aggregate state, and U64 projection constants retain their full range.Breaking: manually constructed
CommandTypeFieldandSurfaceTypeFieldvalues requireunsigned_integermetadata. The protocol fingerprint changes, so services and generated clients must be rebuilt together. Derive users need no new annotations.Validation:
cargo test --workspace --all-features --all-targets: 2,257 passed across 95 targets, 20 ignored (broker-dependent tests require their external services).cargo test -p distributed_cli --lib: 251 passednpm test: 394 passednpm run check, package smoke test, publint, and diff checks passed. Rust formatting passed before unrelated baseline formatting-only changes were removed to keep this PR scoped.This PR adds no application UI copy. The documentation describes numeric bounds and regeneration requirements needed to use the API correctly.
cargo clippy --all-targets -- -D warningsis not green: 36 diagnostics (5 CLI, 31 library). Running the identical command with Rust 1.98.1 on a pristine detached checkout of16b571f117d6a9b3c2cdaaee2cfbe00f8a79ff95produced the exact same diagnostic/message-and-file multiset; no new diagnostics were introduced. Existing examples includetoo_many_arguments,needless_borrow,type_complexity, andmanual_async_fn. These unrelated lint changes are not included.Stacked on #246. Its recorded CI at
16b571f117d6a9b3c2cdaaee2cfbe00f8a79ff95already has three failures, before these changes:ECONNRESETduringnpm ci, before tests run.Those failures are not presented as passing validation; this PR's CI is tracked separately.