Prepare datamodel for multi-environment - #1765
Merged
Merged
Conversation
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.
prep work for multi-environments
Summary
Testing
bun fmt- Not run.bun lint- Not run.bun typecheck- Not run.bun run test- Not run.Note
High Risk
High risk because it changes server->client contract payloads (server config/lifecycle + orchestration events), introduces new persisted identifiers, and touches core orchestration snapshot/event plumbing plus client routing/state keys.
Overview
Prepares the app for multi-environment support by introducing a persistent server
ExecutionEnvironmentDescriptor(stableenvironmentId, platform, version, capability flags) and threading it intoServerRuntimeStartuplifecycle events andsubscribeServerConfigpayloads.Adds a server-side
RepositoryIdentityResolver(git-remote based, cached) and uses it to enrich project snapshot data and orchestration WS replay/live events withrepositoryIdentity, including concurrent resolution inProjectionSnapshotQuery.Updates desktop IPC/preload to expose a
getLocalEnvironmentBootstrappayload, expands tests to wire the new layers, and adjusts timeouts where needed; the web app starts adopting environment-scoped APIs/keys (e.g.,environmentApi, scoped refs/keys) and updates related browser/logic tests accordingly.Reviewed by Cursor Bugbot for commit aa92532. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Scope all project, thread, and API state to discrete environments to support multi-environment
@t3tools/client-runtimepackage withScopedProjectRef,ScopedThreadRef,KnownEnvironment, and scoped key utilities for identifying resources across environments.AppStatein store.ts so projects, threads, and related state live underenvironmentStateByIdinstead of globally; selectors and reducers updated throughout.NativeApiintoLocalApi(desktop shell/dialogs) andEnvironmentApi(per-environment backend operations); all components and hooks updated to use the appropriate API.RepositoryIdentityResolverserver service that resolves a project's canonical git remote identity from its workspace root, enrichingproject.createdandproject.meta-updatedevents and snapshot data.ServerEnvironmentservice that persists a stableEnvironmentIdper server installation and exposes anExecutionEnvironmentDescriptor(platform, version, capabilities) included in WS handshake and lifecycle events./draft/$draftId) and environment-scoped thread routes (/$environmentId/$threadId), replacing the previous/$threadIdroute; draft promotion to server threads is now a two-step lifecycle.ThreadId/ProjectIdto environment-scoped string keys; persisted state versions are bumped with migration paths.Macroscope summarized aa92532.