Skip to content

Commit 2d34fea

Browse files
hyperpolymathclaude
andcommitted
fix(lsp-mcp): replace banned V-lang adapter with Zig unified adapter
V-lang was banned from the hyperpolymath estate 2026-04-10. lsp_adapter.v is removed; lsp_adapter.zig + build.zig replace it. The new adapter provides identical REST/gRPC-compat/GraphQL endpoints: REST port 9016 HTTP/1.1 + JSON gRPC-compat port 9017 HTTP/1.1 transcoding with proto-style paths GraphQL port 9018 POST /graphql keyword dispatch + SDL at /graphql/schema Imports lsp_ffi.zig directly via Zig module system — no shared-library linking required. All FFI session state machine calls preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a0d7543 commit 2d34fea

4 files changed

Lines changed: 787 additions & 175 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// SPDX-License-Identifier: PMPL-1.0-or-later
2+
= SIDELINED: lsp_adapter.v
3+
4+
`lsp_adapter.v` has been sidelined.
5+
6+
*Reason:* V-lang was banned from the hyperpolymath estate on 2026-04-10.
7+
Detection: `v.mod` / `vpkg.json` (`.v` extension not used — Verilog collision).
8+
9+
*Replacement:* `lsp_adapter.zig` + `build.zig` in this same directory.
10+
The Zig adapter provides identical REST/gRPC-compat/GraphQL endpoints
11+
on ports 9016/9017/9018 and imports the `lsp_ffi` module directly.
12+
13+
*Action required:* `git rm adapter/lsp_adapter.v` from the lsp-mcp cartridge root.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
//
4+
// LSP-MCP Cartridge — adapter build configuration (Zig 0.14+).
5+
//
6+
// Builds the `lsp-adapter` binary: the unified REST/gRPC-compat/GraphQL server
7+
// that wraps the lsp_ffi.zig session state machine.
8+
//
9+
// Usage:
10+
// zig build -- build lsp-adapter binary
11+
// zig build run -- build and run (REST :9016, gRPC-compat :9017, GraphQL :9018)
12+
// zig build test -- run unit tests
13+
14+
const std = @import("std");
15+
16+
pub fn build(b: *std.Build) void {
17+
const target = b.standardTargetOptions(.{});
18+
const optimize = b.standardOptimizeOption(.{});
19+
20+
// ── lsp_ffi module (state machine from sibling directory) ──────────────
21+
// Imported directly by the adapter — no shared-library linking needed.
22+
const ffi_mod = b.createModule(.{
23+
.root_source_file = b.path("../ffi/lsp_ffi.zig"),
24+
.target = target,
25+
.optimize = optimize,
26+
});
27+
28+
// ── lsp-adapter executable ─────────────────────────────────────────────
29+
const adapter = b.addExecutable(.{
30+
.name = "lsp-adapter",
31+
.root_source_file = b.path("lsp_adapter.zig"),
32+
.target = target,
33+
.optimize = optimize,
34+
});
35+
adapter.root_module.addImport("lsp_ffi", ffi_mod);
36+
b.installArtifact(adapter);
37+
38+
// ── run step ───────────────────────────────────────────────────────────
39+
const run_cmd = b.addRunArtifact(adapter);
40+
const run_step = b.step("run", "Run lsp-adapter (REST :9016, gRPC :9017, GraphQL :9018)");
41+
run_step.dependOn(&run_cmd.step);
42+
43+
// ── tests ──────────────────────────────────────────────────────────────
44+
const tests = b.addTest(.{
45+
.root_source_file = b.path("lsp_adapter.zig"),
46+
.target = target,
47+
.optimize = optimize,
48+
});
49+
tests.root_module.addImport("lsp_ffi", ffi_mod);
50+
51+
const run_tests = b.addRunArtifact(tests);
52+
const test_step = b.step("test", "Run adapter unit tests");
53+
test_step.dependOn(&run_tests.step);
54+
}

cartridges/lsp-mcp/adapter/lsp_adapter.v

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)