-
Notifications
You must be signed in to change notification settings - Fork 559
Add serializable SharedTree change #25992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces an alpha API for capturing and applying serialized tree changes, enabling AI sandboxing scenarios with the tree-agent package. Users can now capture an opaque serialized version of tree changes via the getChange() method in the "changed" event, and apply it to different branches that share the same head commit.
Key changes:
- Introduces
ChangeMetadatatype that extendsCommitMetadatawith agetChange()method for local changes - Adds
applyChange()method toTreeBranchAlphainterface for applying serialized changes - Updates event signatures to use
ChangeMetadatainstead ofCommitMetadata
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/dds/tree/src/core/rebase/types.ts | Defines new ChangeMetadata type with conditional getChange() method based on isLocal flag |
| packages/dds/tree/src/core/rebase/index.ts | Exports the new ChangeMetadata type |
| packages/dds/tree/src/core/index.ts | Re-exports ChangeMetadata and ChangeEncodingContext from core module |
| packages/dds/tree/src/index.ts | Exports ChangeMetadata type in public API surface |
| packages/dds/tree/src/simple-tree/api/tree.ts | Adds applyChange() method to TreeBranchAlpha interface and updates TreeBranchEvents signature |
| packages/dds/tree/src/shared-tree/treeCheckout.ts | Implements serialization/deserialization logic with validation and branch state checking |
| packages/dds/tree/src/shared-tree/schematizingTreeView.ts | Delegates applyChange() to underlying checkout |
| packages/dds/tree/src/shared-tree-core/index.ts | Exports additional message codec types |
| packages/dds/tree/src/test/simple-tree/api/tree.spec.ts | Adds comprehensive tests for applying changes across branches and error scenarios |
| packages/dds/tree/api-report/tree.alpha.api.md | Updates API report with new alpha types and methods |
Co-authored-by: Copilot <[email protected]>
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
This introduces an alpha API that allows a user to capture a serialized version of tree changes whenever the view is changed. That (opaque) object can then be applied to a different tree branch later, as long as that branch has the same head commit as the originating branch. This API is necessary to support AI sandboxing scenarios using the tree-agent package.