Skip to content

chasm: persist links and user_metadata at framework level#10409

Open
Quinn-With-Two-Ns wants to merge 2 commits into
temporalio:mainfrom
Quinn-With-Two-Ns:chasm-link-metadata
Open

chasm: persist links and user_metadata at framework level#10409
Quinn-With-Two-Ns wants to merge 2 commits into
temporalio:mainfrom
Quinn-With-Two-Ns:chasm-link-metadata

Conversation

@Quinn-With-Two-Ns
Copy link
Copy Markdown
Contributor

@Quinn-With-Two-Ns Quinn-With-Two-Ns commented May 28, 2026

What changed?

Add per-request links (keyed by request_id) and user_metadata fields to ChasmComponentAttributes so any CHASM component can store them uniformly without each library defining its own proto field. This first PR just adds support, I will open up follow up PRs to update any existing components use these new fields.

Why?

Per the discussion here we think links and user metadata will be common components across CHASM components so it makes sense for the framework to handle this for us vs each component implementing it themselves.

How did you test it?

  • built
  • run locally and tested manually
  • [] covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Note

Medium Risk
Touches persisted CHASM component attributes and transaction close/replication paths; changes are additive and well-tested but affect core execution state layout.

Overview
Adds framework-level persistence for per-request links and user metadata on any CHASM component via new ChasmComponentAttributes fields (requests keyed by request_id, plus user_metadata).

MutableContext gains SetRequestLinks / SetUserMetadata; Context gains Links, RequestLinks, and UserMetadata. Writes are staged on the tree and flushed into component attributes during CloseTransaction (including versioned-transition bumps and replication updates). Reads prefer in-transaction pending values over persisted data; empty request_id is rejected; metadata for unregistered components is dropped with a warning.

Mocks and unit tests cover dirty-state, replace/remove semantics, and cross-transaction persistence. No individual CHASM libraries are migrated yet.

Reviewed by Cursor Bugbot for commit 279ee3a. Bugbot is set up for automated code reviews on this repo. Configure here.

@Quinn-With-Two-Ns Quinn-With-Two-Ns requested review from a team as code owners May 28, 2026 15:27
@awln-temporal awln-temporal self-requested a review May 28, 2026 15:29
Comment thread chasm/tree.go
Comment thread chasm/context_mock.go
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6c00468d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread chasm/tree.go
Add per-request links (keyed by request_id) and user_metadata fields to
ChasmComponentAttributes so any CHASM component can store them uniformly
without each library defining its own proto field.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 279ee3a. Configure here.

Comment thread chasm/context_mock.go
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.

1 participant