Repository navigation
Name the compose runtime's hand-written group keys [CLF-649] - #1594
Merged
Merged
Conversation
The keys passed to Composer group APIs in RenderWorkflow and ComposeRenderContext were arbitrary literals. Move them into ComposeGroupKeys as named constants whose values are the String.hashCode of their qualified names, and add a test that enforces that scheme. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use trivial sequential values, shorten the KDoc, drop the per-constant docs and the test, and statically import the constants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zach-klippenstein
marked this pull request as ready for review
October 29, 2026 02:38
tcmulcahy
approved these changes
Oct 29, 2026
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.
Follow-up to this review comment on #1442.
The compose runtime starts a few groups by calling
ComposerAPIs directly, and their keys were made-up literals (23975234and-895982inrenderWorkflowRestartableImpl, which the code said were chosen by mashing the keyboard, andGROUP_KEY = -9287345inComposeRenderContext). This PR moves all three into a new internalComposeGroupKeysobject:RENDER_WORKFLOW_RESTART_GROUP123975234renderWorkflowRestartableImplRENDER_WORKFLOW_SKIP_GROUP2-895982renderSelfbe skippedRENDER_CONTEXT_CHILD_GROUP3ComposeRenderContext.GROUP_KEYrememberA key only has to be unique within its parent group, so plain small values are enough. Compose's own reserved keys (100, 125, 200–207, 1000, -127) don't overlap with these, and the runtime doesn't treat key 0 specially.
Behavior change: the key values are different now, which changes
currentCompositeKeyHashCodefor everything below these groups. The compose runtime uses that hash to key saveable state. As a result, saved state written by an older build won't be restored by this one. That should only matter for state saved by an earlier version of the app, and this runtime is still experimental.No benchmarks were run because the change doesn't touch any hot code: the keys are compile-time constants, same as before.
Testing
./gradlew :workflow-runtime:jvmTestpasses, including the Burst compose-runtime configs.🤖 Generated with Claude Code