Skip to content

Commit 5614cc8

Browse files
hyperpolymathclaude
andcommitted
feat(abi): add CartridgeData.idr + orchestrator-lsp-mcp cartridge
CartridgeData.idr: formal catalogue covering 58 cartridges across all 18 capability domains. Feeds Boj.Menu, Boj.CartridgeDispatch, and the Teranga menu system. Hashes set to "sha256:unattested" pending ADR-0003 build pipeline. orchestrator-lsp-mcp: new Development cartridge. Cross-domain LSP orchestrator routing LSP requests across 12 poly-*-lsp servers via a single GenLSP supervisor. Design reference: poly-orchestrator-lsp (polystack, archived). Status Development until Elixir implementation is complete (see README.adoc). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f68a1a6 commit 5614cc8

4 files changed

Lines changed: 515 additions & 0 deletions

File tree

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// SPDX-License-Identifier: PMPL-1.0-or-later
2+
// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
= orchestrator-lsp-mcp
4+
:description: Cross-domain LSP orchestrator for the BoJ cartridge matrix
5+
:status: Development
6+
7+
Status: *Development* — cartridge manifest + ABI layer in place; Elixir implementation pending.
8+
9+
== What it does
10+
11+
Routes LSP requests across all 12 domain-specific poly-*-lsp servers
12+
(cloud, container, IAC, Kubernetes, database, queue, secrets, git, SSG,
13+
proof, observability, browser) via a single GenLSP supervisor. Exposes a
14+
unified `textDocument/*` interface to editors and AI agents — they connect
15+
once and get cross-domain intelligence.
16+
17+
== Architecture
18+
19+
----
20+
Editor / AI agent
21+
│ LSP JSON-RPC
22+
23+
OrchestratorLSP.Server ← GenLSP supervisor
24+
│ routes by domain
25+
├──→ poly-cloud-lsp (AWS/GCP/Azure)
26+
├──→ poly-container-lsp (Podman/OCI)
27+
├──→ poly-iac-lsp (OpenTofu/Pulumi)
28+
├──→ poly-k8s-lsp (Kubernetes)
29+
├──→ poly-db-lsp (21 databases)
30+
├──→ poly-queue-lsp (NATS/RabbitMQ)
31+
├──→ poly-secret-lsp (Vault/SOPS)
32+
├──→ poly-git-lsp (GitHub/GitLab)
33+
├──→ poly-ssg-lsp (60+ SSGs)
34+
├──→ poly-proof-lsp (Coq/Lean/Isabelle)
35+
├──→ poly-observability-lsp (Prometheus/Grafana)
36+
└──→ claude-firefox-lsp (browser)
37+
│ session history
38+
39+
VeriSimDB
40+
----
41+
42+
== Design reference
43+
44+
`polystack/poly-orchestrator-lsp` (archived 2026-04-27) — the 13-file Elixir
45+
implementation is the design reference. Key modules to port:
46+
47+
* `lib/lsp/server.ex` — GenLSP application entry point
48+
* `lib/orchestrator/planner.ex` — domain-routing decision logic
49+
* `lib/orchestrator/executor.ex` — fan-out + response merge
50+
* `lib/orchestrator/lsp_client.ex` — per-domain LSP client pool
51+
* `lib/orchestrator/stack_parser.ex` — reads `.machine_readable/integrations/`
52+
* `lib/verisimdb/client.ex` — session history persistence
53+
54+
== MCP tools
55+
56+
`lsp_orchestrate_start` → `lsp_orchestrate_request` → `lsp_orchestrate_stop`
57+
`lsp_orchestrate_status` — see `cartridge.json` for full schemas.
58+
59+
== Next steps
60+
61+
. Implement `lib/` Elixir modules (port from poly-orchestrator-lsp design)
62+
. Write Zig FFI stub (`ffi/zig/src/main.zig`) for `boj_cartridge_invoke`
63+
. Add ReScript VSCode extension (`panels/`)
64+
. Connect to VeriSimDB session tracking
65+
. Set status → Ready in `Boj.CartridgeData`
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"$schema": "https://boj.dev/schemas/cartridge/v1.json",
3+
"spdx": "PMPL-1.0-or-later",
4+
"copyright": "Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>",
5+
"name": "orchestrator-lsp-mcp",
6+
"version": "0.1.0",
7+
"status": "development",
8+
"description": "Cross-domain LSP orchestrator. Routes LSP requests across all 12 poly-*-lsp servers (cloud, container, iac, k8s, db, queue, secret, git, ssg, proof, observability, browser) via a single GenLSP supervisor. Inspired by poly-orchestrator-lsp (polystack, archived). Wraps the 12 domain servers into one unified textDocument interface with domain-routing based on workspace root and file type.",
9+
"domain": "LSP",
10+
"tier": "Teranga",
11+
"protocols": [
12+
"MCP",
13+
"LSP"
14+
],
15+
"runtime": "elixir",
16+
"auth": {
17+
"method": "none",
18+
"env_var": null,
19+
"credential_source": null
20+
},
21+
"api": {
22+
"base_url": "local://orchestrator-lsp-mcp",
23+
"content_type": "application/json"
24+
},
25+
"design_notes": [
26+
"Supervisor tree: LSPServer + LSPClientPool (×12) + ExecutionRegistry + ExecutionSupervisor",
27+
"Stack parser reads .machine_readable/integrations/*.a2ml to discover active poly-*-lsp endpoints",
28+
"Planner routes each LSP request to the correct domain server(s) — cross-domain queries fan-out",
29+
"VeriSimDB client tracks orchestration session history and capability advertisement",
30+
"VSCode extension (ReScript, not TypeScript) exposes this as a single multi-domain language server"
31+
],
32+
"tools": [
33+
{
34+
"name": "lsp_orchestrate_start",
35+
"description": "Start an orchestrated LSP session spanning one or more domain servers. Returns a session ID that routes LSP requests to the appropriate domain server(s) based on workspace context.",
36+
"inputSchema": {
37+
"type": "object",
38+
"properties": {
39+
"workspace_root": {
40+
"type": "string",
41+
"description": "Workspace root directory path"
42+
},
43+
"domains": {
44+
"type": "array",
45+
"items": { "type": "string" },
46+
"description": "Domain LSP servers to activate (e.g. ['git', 'k8s', 'db']). Empty = all."
47+
}
48+
},
49+
"required": ["workspace_root"]
50+
}
51+
},
52+
{
53+
"name": "lsp_orchestrate_request",
54+
"description": "Forward a raw LSP JSON-RPC request through the orchestrator. The orchestrator routes it to the correct domain server(s) and merges responses.",
55+
"inputSchema": {
56+
"type": "object",
57+
"properties": {
58+
"session_id": {
59+
"type": "string",
60+
"description": "Session ID from lsp_orchestrate_start"
61+
},
62+
"method": {
63+
"type": "string",
64+
"description": "LSP method (e.g. textDocument/completion, textDocument/hover)"
65+
},
66+
"params": {
67+
"type": "object",
68+
"description": "LSP method parameters (JSON)"
69+
}
70+
},
71+
"required": ["session_id", "method", "params"]
72+
}
73+
},
74+
{
75+
"name": "lsp_orchestrate_stop",
76+
"description": "Stop an orchestrated session and shut down all domain LSP servers gracefully.",
77+
"inputSchema": {
78+
"type": "object",
79+
"properties": {
80+
"session_id": {
81+
"type": "string",
82+
"description": "Session ID to stop"
83+
}
84+
},
85+
"required": ["session_id"]
86+
}
87+
},
88+
{
89+
"name": "lsp_orchestrate_status",
90+
"description": "Return the health and capability advertisement of all active domain servers in a session.",
91+
"inputSchema": {
92+
"type": "object",
93+
"properties": {
94+
"session_id": {
95+
"type": "string",
96+
"description": "Session ID"
97+
}
98+
},
99+
"required": ["session_id"]
100+
}
101+
}
102+
],
103+
"ffi": {
104+
"so_path": "ffi/zig-out/lib/liborchestrator_lsp_mcp.so",
105+
"abi_version": "ADR-0006",
106+
"symbols": [
107+
"boj_cartridge_init",
108+
"boj_cartridge_deinit",
109+
"boj_cartridge_name",
110+
"boj_cartridge_version",
111+
"boj_cartridge_invoke"
112+
],
113+
"note": "Zig FFI stub delegates to Elixir GenLSP application via port protocol"
114+
},
115+
"upstream_reference": "polystack/poly-orchestrator-lsp (archived 2026) — design reference only, not copied"
116+
}

0 commit comments

Comments
 (0)