Skip to content

Commit e994624

Browse files
hyperpolymathclaude
andcommitted
feat(groove): add zig-groove-bridge replacing banned V-lang connector
Rewrites developer-ecosystem/v-ecosystem/connectors/v-groove-bridge/src/main.v in Zig (0.15.2). V-lang is banned estate-wide since 2026-04-10; the V-lang connector was the only way to discover and attach to Groove-aware services from developer-ecosystem, making it a hard blocker for Groove protocol wiring. The new library lives at zig-ecosystem/connectors/zig-groove-bridge/: - src/main.zig — full Dodeca-API (12 surface types), service discovery (known ports + Groove dynamic range 6460–6500), snap-on/snap-off Attachment, attach/attachVerisimdb helpers. 12 unit tests pass. - test/integration_test.zig — offline integration tests (lenient probe, discoverAll, ServiceNotFound guard). Module imported as "groove_bridge". - build.zig — shared lib, static lib, unit + integration test steps. - .gitignore — excludes .zig-cache/ and zig-out/. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 056d1e4 commit e994624

4 files changed

Lines changed: 745 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.zig-cache/
2+
zig-out/
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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+
// zig-groove-bridge — Zig replacement for the banned V-lang v-groove-bridge.
5+
//
6+
// Builds a shared library, a static library, and runs unit/integration tests.
7+
8+
const std = @import("std");
9+
10+
pub fn build(b: *std.Build) void {
11+
const target = b.standardTargetOptions(.{});
12+
const optimize = b.standardOptimizeOption(.{});
13+
14+
// ── Shared library (.so / .dylib / .dll) ─────────────────────────────────
15+
const lib = b.addLibrary(.{
16+
.name = "groove_bridge",
17+
.linkage = .dynamic,
18+
.root_module = b.createModule(.{
19+
.root_source_file = b.path("src/main.zig"),
20+
.target = target,
21+
.optimize = optimize,
22+
}),
23+
.version = .{ .major = 0, .minor = 1, .patch = 0 },
24+
});
25+
b.installArtifact(lib);
26+
27+
// ── Static library (.a) ───────────────────────────────────────────────────
28+
const lib_static = b.addLibrary(.{
29+
.name = "groove_bridge",
30+
.linkage = .static,
31+
.root_module = b.createModule(.{
32+
.root_source_file = b.path("src/main.zig"),
33+
.target = target,
34+
.optimize = optimize,
35+
}),
36+
});
37+
b.installArtifact(lib_static);
38+
39+
// ── Shared source module (re-used across test targets) ────────────────────
40+
const src_module = b.createModule(.{
41+
.root_source_file = b.path("src/main.zig"),
42+
.target = target,
43+
.optimize = optimize,
44+
});
45+
46+
// ── Unit tests ────────────────────────────────────────────────────────────
47+
const unit_tests = b.addTest(.{
48+
.root_module = b.createModule(.{
49+
.root_source_file = b.path("src/main.zig"),
50+
.target = target,
51+
.optimize = optimize,
52+
}),
53+
});
54+
const run_unit_tests = b.addRunArtifact(unit_tests);
55+
const test_step = b.step("test", "Run unit tests");
56+
test_step.dependOn(&run_unit_tests.step);
57+
58+
// ── Integration tests ─────────────────────────────────────────────────────
59+
const integration_mod = b.createModule(.{
60+
.root_source_file = b.path("test/integration_test.zig"),
61+
.target = target,
62+
.optimize = optimize,
63+
});
64+
integration_mod.addImport("groove_bridge", src_module);
65+
66+
const integration_tests = b.addTest(.{
67+
.root_module = integration_mod,
68+
});
69+
const run_integration_tests = b.addRunArtifact(integration_tests);
70+
const integration_step = b.step("test-integration", "Run integration tests (requires live services)");
71+
integration_step.dependOn(&run_integration_tests.step);
72+
73+
// ── Docs ──────────────────────────────────────────────────────────────────
74+
const docs = b.addTest(.{
75+
.root_module = b.createModule(.{
76+
.root_source_file = b.path("src/main.zig"),
77+
.target = target,
78+
.optimize = .Debug,
79+
}),
80+
});
81+
const docs_step = b.step("docs", "Generate documentation");
82+
docs_step.dependOn(&b.addInstallDirectory(.{
83+
.source_dir = docs.getEmittedDocs(),
84+
.install_dir = .prefix,
85+
.install_subdir = "docs",
86+
}).step);
87+
}

0 commit comments

Comments
 (0)