Skip to content

Commit df51142

Browse files
chore(v→zig): unify API gateway + client SDK in Zig, delete V-lang trees (#66)
## Summary Estate-wide V-lang→Zig remediation per the 2026-05-28 owner directive (Zig is the default for APIs/FFIs/gateways/SDKs; Idris2 owns ABIs). Removes the legacy V-lang API gateway (`v-api-gateway/`) and V client SDK (`connectors/clients/vlang/`) and replaces them with full functional Zig implementations: - **`ffi/zig/`** — unified Zig gateway (REST + GraphQL proxy to Rust core + Elixir orchestration) plus C-ABI FFI library matching the Idris2 ABI in `src/abi/Foreign.idr`. Modules: `config`, `proxy`, `router`, `graphql`, `main`, `ffi`. Real `build.zig` replaces the previous unsubstituted scaffold. - **`connectors/clients/zig/`** — full Zig client SDK mirroring the V SDK 1-to-1: `client`, `types`, `error`, `octad`, `drift`, `provenance`, `search`, `vql`, `federation`. Includes `build.zig` + `build.zig.zon`. - **Config + doc sweep**: ENSAID hook `v build` → `zig build`; SDK lists in `.claude/CLAUDE.md` and `0-AI-MANIFEST.a2ml` updated; README "V API gateway" → "unified Zig API gateway". ## Test plan - [ ] `zig build` under `ffi/zig/` produces `verisimdb-gateway` + `libverisimdb_ffi` - [ ] `zig build` under `connectors/clients/zig/` exposes the `verisimdb_client` module - [ ] Hypatia rule `cicd_rules/vlang_detected` (in the parallel hypatia PR) does NOT flag this repo post-merge 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2fb3544 commit df51142

38 files changed

Lines changed: 1991 additions & 2217 deletions

.claude/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ verisimdb/
390390
│ ├── config/
391391
│ └── mix.exs
392392
├── connectors/ # Federation adapters + client SDKs + test infra
393-
│ ├── clients/ # 6 SDKs: Rust, V, Elixir, ReScript, Julia, Gleam
393+
│ ├── clients/ # 6 SDKs: Rust, Zig, Elixir, ReScript, Julia, Gleam
394394
│ ├── shared/ # JSON Schema, OpenAPI, protobuf
395395
│ └── test-infra/ # selur-compose: 7 databases for integration testing
396396
├── container/ # Containerfiles

.machine_readable/ENSAID_CONFIG.a2ml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
; Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
33
;
44
; ENSAID_CONFIG.a2ml — PanLL configuration for VeriSimDB.
5-
; VeriSimDB is a formally verified database with Idris2 ABI, Zig FFI,
6-
; V-lang API gateway, VQL query language, and a registry subsystem.
5+
; VeriSimDB is a formally verified database with Idris2 ABI, Zig FFI +
6+
; unified API gateway, VQL query language, and a registry subsystem.
77
; This is a key dogfooding project for the full ABI→FFI→Adapter stack.
88

99
; ─────────────────────────────────────────────────────────────────────
@@ -23,15 +23,15 @@ humidity = "dry"
2323
; ─────────────────────────────────────────────────────────────────────
2424
[workspace]
2525
root = "."
26-
watch_extensions = [".idr", ".zig", ".v", ".vql", ".gleam", ".toml"]
27-
; .idr = ABI definitions, .zig = FFI bridge, .v = API gateway,
26+
watch_extensions = [".idr", ".zig", ".vql", ".gleam", ".toml"]
27+
; .idr = ABI definitions, .zig = FFI bridge + API gateway,
2828
; .vql = VeriSimDB Query Language, .gleam = REPL/tooling
2929
ignore_patterns = ["build/", ".git/", "zig-cache/", "zig-out/", "_build/"]
3030
editor = "vscodium"
3131
build_command = "just build"
3232
test_command = "just test"
3333
language_id = "idris2"
34-
; Primary specification language. Implementation spans Zig + V + Gleam.
34+
; Primary specification language. Implementation spans Zig + Gleam.
3535

3636
; ─────────────────────────────────────────────────────────────────────
3737
; [preferences] — developer preferences and UI settings
@@ -52,7 +52,7 @@ panel_layout = "three-column"
5252
enabled = [
5353
"valence-shell", ; Terminal + command execution
5454
"editor-bridge", ; Editor integration
55-
"build-dashboard", ; Multi-language build status (Idris2 + Zig + V)
55+
"build-dashboard", ; Multi-language build status (Idris2 + Zig + Gleam)
5656
"boj", ; BoJ dashboard — VeriSimDB is a BoJ consumer
5757
"database", ; Database inspection — dogfooding VeriSimDB itself
5858
"vm-inspector", ; Query engine / VQL inspection
@@ -64,7 +64,7 @@ enabled = [
6464
]
6565

6666
disabled = [
67-
"network", ; Network handled by V-lang adapter
67+
"network", ; Network handled by Zig gateway
6868
"container", ; Container builds handled externally
6969
"fleet", ; Single-repo work
7070
]
@@ -81,12 +81,12 @@ action = "run_command"
8181
command = "cd ffi/zig && zig build test"
8282
description = "Rebuild and test Zig FFI when Idris2 ABI definitions change"
8383

84-
[workflows.adapter-on-ffi-change]
84+
[workflows.gateway-on-ffi-change]
8585
trigger = "file_save"
8686
match = "ffi/zig/src/*.zig"
8787
action = "run_command"
88-
command = "cd v-api-gateway && v build ."
89-
description = "Rebuild V-lang API gateway when Zig FFI changes"
88+
command = "cd ffi/zig && zig build"
89+
description = "Rebuild unified Zig gateway + FFI when sources change"
9090

9191
[workflows.vql-test-on-save]
9292
trigger = "file_save"

0-AI-MANIFEST.a2ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
(description "Federation adapters (10) and client SDKs (6)")
7171
(location "connectors/")
7272
(adapters "MongoDB" "Redis" "DuckDB" "ClickHouse" "SurrealDB" "SQLite" "Neo4j" "VectorDB" "InfluxDB" "ObjectStorage")
73-
(sdks "Rust" "V" "Elixir" "ReScript" "Julia" "Gleam")))
73+
(sdks "Rust" "Zig" "Elixir" "ReScript" "Julia" "Gleam")))
7474

7575
(critical-invariants
7676
(rule "SCM files ONLY in .machine_readable/ — never root")

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ curl -X POST http://localhost:8080/api/v1/normalizer/trigger/entity-001
389389

390390
=== gRPC (port 50051)
391391

392-
VeriSimDB's gRPC server runs directly on the Rust core (via tonic) on port 50051. The V API gateway does not proxy gRPC traffic — connect directly to the Rust core.
392+
VeriSimDB's gRPC server runs directly on the Rust core (via tonic) on port 50051. The unified Zig API gateway does not proxy gRPC traffic — connect directly to the Rust core.
393393

394394
[source,bash]
395395
----

connectors/clients/vlang/src/client.v

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

connectors/clients/vlang/src/drift.v

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

0 commit comments

Comments
 (0)