feat: share repeated projection material in application contracts - #249
Merged
patrickleet merged 3 commits intoSep 12, 2026
Merged
Conversation
|
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 |
patrickleet
changed the base branch from
fix/surface-contract-unsigned-integer-20260912
to
v5
September 12, 2026 18:04
Refs [[unsigned-surface-metadata-breaks-canonical-typed-m]]
Refs [[tasks/compact-historical-projection-contracts]]
patrickleet
force-pushed
the
feat/compact-historical-projection-selectors-20260912
branch
from
September 12, 2026 20:55
58457c7 to
a00aae0
Compare
Implements [[incidents/distributed-pr249-refresh-continuity-20260912]]
patrickleet
deleted the
feat/compact-historical-projection-selectors-20260912
branch
September 12, 2026 22:28
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.
Applications retaining several generations of event selectors repeat identical operation lists and body schemas for every projection arm. Forge's complete typed manifest crosses the existing 4 MiB cap even though the authoring DSL already shares mutations.
Emit
shared_projection_program_v1in modeled application-contract data only when it is smaller than the expanded form. Canonical tables share complete operation arrays and exact schema strings; every arm ID, selector identity/version, expression, ordering and effect is retained.expand_projection_program_contractaccepts both encodings and reconstructs the original JSON. Validation rejects invalid references, ambiguous inline data, noncanonical/unused table entries and excessive expansion before cloning shared values.Runtime projection IR, program/binding IDs, execution and client projection-program exports remain unchanged. Old expanded artifacts remain readable and byte-stable. Newly shared Surface artifact fingerprints change deterministically; rebuild service/client artifacts together. The complete wire cap stays 4,194,304 bytes and each opaque value/expanded program remains bounded at 1 MiB.
Forge validation at
7cc8f71b6a494da30f785b4933add6d6d853be73, using a Cargo dependency override with no Forge edits:The expanded equivalent contains exactly the same decoded program data; Rust JSON serialization measured both sizes without numeric conversion. Both previously failing full/authorized-content manifest tests now pass.
Validation:
cargo test --all-features --lib: 1,080 passed, 4 ignored.distributed_clisuite: 293 passed, 11 ignored; explicitly enabled CLI manifest integration: 6 passed.git diff --checkpass.Stacked on #248; the change introduces no historical-selector omission, replay exemption, Forge workaround or cap increase.