Skip to content

Conversation

@noencke
Copy link
Contributor

@noencke noencke commented Dec 5, 2025

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.

Copilot AI review requested due to automatic review settings December 5, 2025 20:08
@noencke noencke requested a review from a team as a code owner December 5, 2025 20:08
Copy link
Contributor

Copilot AI left a 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 ChangeMetadata type that extends CommitMetadata with a getChange() method for local changes
  • Adds applyChange() method to TreeBranchAlpha interface for applying serialized changes
  • Updates event signatures to use ChangeMetadata instead of CommitMetadata

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> [email protected] ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> [email protected] serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> [email protected] check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  243138 links
    1776 destination URLs
    2015 URLs ignored
       0 warnings
       0 errors


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.

2 participants