Skip to content

feat(graph): route javascript/typescript Code nodes to the node worker + multi-language tests - #313

Merged
rbuergi merged 1 commit into
mainfrom
feat/multilang-code-routing
Jul 6, 2026
Merged

rbuergi merged 1 commit into
mainfrom
feat/multilang-code-routing

Conversation

@rbuergi

@rbuergi rbuergi commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

First phase of multi-language Code-node execution on the mesh.

What

A Code node executes by its Language: C# runs in-process on the Activity hub's Roslyn kernel; a foreign language routes to the stable address where that language's worker participant registers. Only python was routed before (→ py/python-kernel). This adds javascript/typescript → node/node-kernel (the node worker in clients/typescript), via a testable CodeNodeType.ResolveKernelAddress(language, activityPath).

Tests — MultiLanguageCodeExecutionTest

  • Dispatch (Theory) — every language maps correctly: python→py/python-kernel; javascript/typescript→node/node-kernel; csharp/null/json/sql/markdown→ in-process (the activity path); case-insensitive.
  • Real end-to-end C# run — a Code node executes and drives its ActivityLog to Succeeded with the captured output — the identical surface every language's output lands on.

CI-safe and fast (13 tests, ~3s). Release -warnaserror clean.

Scope / follow-ups (tracked)

Real python/node interpreter execution is exercised by the worker SDK tests (clients/python, clients/typescript) today; a full mesh integration run lands once a language gate is deployed. Still to come, per the plan:

  1. The Node worker (worker.ts, executes js/ts Code nodes) + Node hub examples (define/run a hub in Node).
  2. Feature-flagged language runtimes (opt-in python/node gates; default: all included).
  3. Ship the pandas example nodes in the Doc partition + run py/pandas + py/python-kernel on memex so the doc examples are live.

🤖 Generated with Claude Code

…r + multi-language tests

A Code node executes on the mesh by its Language. C# runs in-process on the Activity hub's Roslyn
kernel; a foreign language routes to the stable address where that language's worker participant
registers. Previously only `python` was routed (→ py/python-kernel); everything else fell through to
in-process. Extend the dispatch so `javascript`/`typescript` route to `node/node-kernel` (the node
worker, clients/typescript), extracted into a testable CodeNodeType.ResolveKernelAddress(language,
activityPath).

Tests (MultiLanguageCodeExecutionTest):
- ResolveKernelAddress mapping for every language: python → py/python-kernel; javascript/typescript →
  node/node-kernel; csharp / null / json / sql / markdown → in-process (the activity path). Case-
  insensitive. This pins the js/ts additions and the C# default.
- A real end-to-end C# run: a Code node executes and drives its ActivityLog to Succeeded with the
  captured output — the same surface every language's output lands on.

Real python/node INTERPRETER execution is exercised by the worker SDK tests (clients/python,
clients/typescript) and, once a language gate is deployed, an integration run. The node worker itself
+ feature-flagged runtimes + node hub examples are the follow-up phases.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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 first-phase multi-language execution routing for Graph Code nodes by mapping their Language to a stable “kernel” worker address (keeping C# in-process on the Activity hub), and introduces an integration test suite that verifies dispatch and a real C# end-to-end execution path.

Changes:

  • Introduce CodeNodeType.ResolveKernelAddress(language, activityPath) and route SubmitCodeRequest via that mapping (python → py/python-kernel, javascript/typescript → node/node-kernel, otherwise in-process).
  • Add MultiLanguageCodeExecutionTest covering dispatch mappings (theory) and a full C# execution that drives an ActivityLog to Succeeded and captures output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
test/MeshWeaver.AI.Test/MultiLanguageCodeExecutionTest.cs Adds dispatch + end-to-end execution tests for multi-language Code-node routing and C# execution output surfacing.
src/MeshWeaver.Graph/Configuration/CodeNodeType.cs Adds ResolveKernelAddress and uses it to route SubmitCodeRequest to the appropriate language worker kernel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 89 to +91
/// <see cref="CodeConfiguration"/>, validates <c>IsExecutable</c>, dispatches
/// <see cref="SubmitCodeRequest"/> to the internal kernel address, and posts
/// an <see cref="ExecuteScriptResponse"/> with the submission id + output-area
/// <see cref="SubmitCodeRequest"/> to the <see cref="ResolveKernelAddress">language kernel</see>,
/// and posts an <see cref="ExecuteScriptResponse"/> with the submission id + output-area
Comment on lines +24 to +26
/// <para>These pin BOTH halves: the language→kernel dispatch (<see cref="CodeNodeType.ResolveKernelAddress"/>,
/// exercised for every language including the js/ts additions) and a real end-to-end C# run driving the
/// ActivityLog to <c>Succeeded</c> with its output — the same surface every language's output lands on.
@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 3)

802 tests  ±0   802 ✅ ±0   3m 51s ⏱️ +9s
 10 suites ±0     0 💤 ±0 
 10 files   ±0     0 ❌ ±0 

Results for commit 3a622b7. ± Comparison against base commit ab78017.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 5)

870 tests  ±0   690 ✅ ±0   4m 4s ⏱️ -7s
  9 suites ±0   180 💤 ±0 
  9 files   ±0     0 ❌ ±0 

Results for commit 3a622b7. ± Comparison against base commit ab78017.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 1)

1 029 tests  ±0   1 028 ✅ ±0   3m 41s ⏱️ +8s
    8 suites ±0       1 💤 ±0 
    8 files   ±0       0 ❌ ±0 

Results for commit 3a622b7. ± Comparison against base commit ab78017.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 4)

   10 files  ±  0     10 suites  ±0   4m 25s ⏱️ -18s
1 191 tests  - 147  1 191 ✅  - 147  0 💤 ±0  0 ❌ ±0 
1 200 runs   - 175  1 200 ✅  - 175  0 💤 ±0  0 ❌ ±0 

Results for commit 3a622b7. ± Comparison against base commit ab78017.

This pull request removes 166 and adds 19 tests. Note that renamed tests count towards both.
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_FutuReSubPaths_ShouldResolve(path: "FutuRe/Analysis", expectedPrefix: "FutuRe/Analysis", expectedRemainder: null)
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_FutuReSubPaths_ShouldResolve(path: "FutuRe/EuropeRe", expectedPrefix: "FutuRe/EuropeRe", expectedRemainder: null)
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_FutuReSubPaths_ShouldResolve(path: "FutuRe/EuropeRe/LineOfBusiness", expectedPrefix: "FutuRe/EuropeRe/LineOfBusiness", expectedRemainder: null)
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_FutuReSubPaths_ShouldResolve(path: "FutuRe/EuropeRe/Overview", expectedPrefix: "FutuRe/EuropeRe", expectedRemainder: "Overview")
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_FutuRe_ShouldNotReturnNull
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_UnknownDeepPath_ShouldReturnNull
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.AgenticAI.md")
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.ChatCommands.md")
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.ExecuteScript.md")
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.ExecutiveAssistan"···)
…
MeshWeaver.Persistence.Test.DataCubesDocBlocksTest ‑ EveryExecutableBlock_RendersAControl
MeshWeaver.Persistence.Test.DataCubesDocBlocksTest ‑ Page_HasTheExpectedExecutableBlocks
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ Coverage_DoesNotRegress
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.ExecuteScript.md")
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.DataMesh.NodeTypeWit"···)
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.DataMesh.NugetPackag"···)
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.DataMesh.QuerySyntax"···)
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.GUI.ChartGallery.md")
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.GUI.MeshSearch.md")
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.GUI.NodeMenu.md")
…

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 2)

696 tests  ±0   694 ✅ ±0   1m 34s ⏱️ -12s
  9 suites ±0     2 💤 ±0 
  9 files   ±0     0 ❌ ±0 

Results for commit 3a622b7. ± Comparison against base commit ab78017.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Test Results (shard 0)

645 tests  ±0   645 ✅ ±0   4m 52s ⏱️ +34s
 10 suites ±0     0 💤 ±0 
 10 files   ±0     0 ❌ ±0 

Results for commit 3a622b7. ± Comparison against base commit ab78017.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Test Results

   56 files  ±  0     56 suites  ±0   22m 31s ⏱️ +15s
5 233 tests  - 147  5 050 ✅  - 147  183 💤 ±0  0 ❌ ±0 
5 242 runs   - 175  5 059 ✅  - 175  183 💤 ±0  0 ❌ ±0 

Results for commit 3a622b7. ± Comparison against base commit ab78017.

This pull request removes 166 and adds 19 tests. Note that renamed tests count towards both.
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_FutuReSubPaths_ShouldResolve(path: "FutuRe/Analysis", expectedPrefix: "FutuRe/Analysis", expectedRemainder: null)
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_FutuReSubPaths_ShouldResolve(path: "FutuRe/EuropeRe", expectedPrefix: "FutuRe/EuropeRe", expectedRemainder: null)
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_FutuReSubPaths_ShouldResolve(path: "FutuRe/EuropeRe/LineOfBusiness", expectedPrefix: "FutuRe/EuropeRe/LineOfBusiness", expectedRemainder: null)
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_FutuReSubPaths_ShouldResolve(path: "FutuRe/EuropeRe/Overview", expectedPrefix: "FutuRe/EuropeRe", expectedRemainder: "Overview")
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_FutuRe_ShouldNotReturnNull
MeshWeaver.Persistence.Test.ApplicationPageResolutionTest ‑ ResolvePathAsync_UnknownDeepPath_ShouldReturnNull
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.AgenticAI.md")
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.ChatCommands.md")
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.ExecuteScript.md")
MeshWeaver.Persistence.Test.DocumentationCodeBlockCompilationTest ‑ ExecutedCsharpBlocks_MustCompile(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.ExecutiveAssistan"···)
…
MeshWeaver.Persistence.Test.DataCubesDocBlocksTest ‑ EveryExecutableBlock_RendersAControl
MeshWeaver.Persistence.Test.DataCubesDocBlocksTest ‑ Page_HasTheExpectedExecutableBlocks
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ Coverage_DoesNotRegress
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.AI.ExecuteScript.md")
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.DataMesh.NodeTypeWit"···)
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.DataMesh.NugetPackag"···)
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.DataMesh.QuerySyntax"···)
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.GUI.ChartGallery.md")
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.GUI.MeshSearch.md")
MeshWeaver.Persistence.Test.DocExecutableBlocksTest ‑ EveryExecutableBlock_ExecutesInKernel(embeddedResourceName: "MeshWeaver.Documentation.Data.GUI.NodeMenu.md")
…

@rbuergi
rbuergi merged commit aeb27f5 into main Jul 6, 2026
16 checks passed
@rbuergi
rbuergi deleted the feat/multilang-code-routing branch August 5, 2026 10:45
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