Skip to content

[rush-daemon][WS2.3][2/9] Add warm engine component factory - #5949

Merged
Mo Jazayeri (mojaza) merged 5 commits into
microsoft:mainfrom
mojaza:mojazayeri-microsoft-rushd-ws2-warm-graph
Aug 22, 2026
Merged

[rush-daemon][WS2.3][2/9] Add warm engine component factory#5949
Mo Jazayeri (mojaza) merged 5 commits into
microsoft:mainfrom
mojaza:mojazayeri-microsoft-rushd-ws2-warm-graph

Conversation

@mojaza

Copy link
Copy Markdown
Contributor

Summary

Details

The factory requires the integration to provide an explicit all-project phase/plugin shape, a real nonempty IOperationGraph, its RushSession, an initial IInputsSnapshot, and a refreshable input snapshot provider. It validates that the graph is owned by the loaded Rush configuration, represents every configured project, and contains only declared phases; empty optional plugin shapes remain valid.

Retained watcher invalidations are reconciled serially. Known paths are mapped to operations through the integration, while unknown changes, unhealthy watcher state, and invalidations racing snapshot refresh conservatively invalidate the full graph. Invalidations are acknowledged only after snapshot capture, mapping validation, and graph invalidation succeed. Async disposal rejects new reconciliation, waits for queued reconciliation, and delegates deterministic graph lifetime abort, current-iteration abort, runner closure, plugin cleanup, and snapshot cleanup to the real engine owner.

Limitations: Open #5895 still blocks command-independent plugin/phase shape and per-iteration runner lifetime. This PR therefore remains opt-in and requires an integration-owned real graph; it does not construct an empty or fake graph, duplicate PhasedScriptAction, or add phased request parsing/routing. The standalone executable remains owned by @rushstack/rush-daemon with no apps/rush or rush-lib launcher integration.

How it was tested

  • node common/scripts/install-run-rush.js test --only @rushstack/rush-daemon
  • node common/scripts/install-run-rush.js build --only @rushstack/rush-daemon

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds an opt-in factory for adapting real Rush engine state into warm daemon workspace sessions.

Changes:

  • Adds validated all-project engine construction and invalidation mapping.
  • Serializes reconciliation and coordinates deterministic disposal.
  • Exposes the new beta API with tests and documentation.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
libraries/rush-daemon/src/WorkspaceSession.ts Integrates engine shape and reconciliation.
libraries/rush-daemon/src/WorkspaceEngineComponentFactory.ts Implements the engine factory and lifecycle.
libraries/rush-daemon/src/test/WorkspaceSession.test.ts Tests disposal-time reconciliation rejection.
libraries/rush-daemon/src/test/WorkspaceEngineComponentFactory.test.ts Tests validation, reconciliation, and cleanup.
libraries/rush-daemon/src/test/TestWorkspaceSession.ts Updates the test session implementation.
libraries/rush-daemon/src/index.ts Exports the new beta API.
libraries/rush-daemon/README.md Documents warm-engine integration.
common/reviews/api/rush-daemon.api.md Records the public API surface.
common/changes/@rushstack/rush-daemon/mojazayeri-warm-graph-components_2026-08-19-22-30.json Adds the minor-version change record.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread libraries/rush-daemon/src/WorkspaceEngineComponentFactory.ts
mojazayeri and others added 2 commits August 21, 2026 09:50
Build session integration operations from the freshly loaded Rush configuration and cover serialized concurrent reconciliation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@mojaza
Mo Jazayeri (mojaza) enabled auto-merge (squash) August 21, 2026 18:03
@mojaza Mo Jazayeri (mojaza) changed the title [rush-daemon][WS2.3] Add warm engine component factory [rush-daemon][WS2.3][2/9] Add warm engine component factory Aug 21, 2026
Comment thread libraries/rush-daemon/src/WorkspaceEngineComponentFactory.ts Outdated

@TheLarkInn Sean Larkin (TheLarkInn) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please address the stale engine configuration issue in the inline comment.

Comment thread libraries/rush-daemon/src/WorkspaceEngineComponentFactory.ts
Classify graph-defining invalidations before reconciliation and require whole-session recreation without acknowledging stale state.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

5 participants