From 40383a14bb4f613b603b30be8a2e288084dd8911 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 14 Jun 2026 02:41:18 +0000 Subject: [PATCH] fix(wire): retarget stale /vql/execute callers + fuzz target to VCL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Completes the endpoint hard-rename (stage 1/5) for the callers it missed. After the rust core route /vql/execute -> /vcl/execute (no alias), these still pointed at the removed path: - ffi/zig GraphQL gateway: full VQL->VCL sweep — outbound call to the rust core (graphql.zig), the gateway's own inbound /vcl/execute route (router.zig), and its GraphQL surface (executeVql -> executeVcl, VqlResult -> VclResult). The API-surface rename is a deliberate breaking change, consistent with the hard-rename applied everywhere else. - examples/load-sample-data.sh, examples/smoke-test.sh: curl endpoint only. - .clusterfuzzlite/build.sh: fuzz_vql_parser -> fuzz_vcl_parser (both fuzz/Cargo.toml and rust-core/fuzz/Cargo.toml already use fuzz_vcl_parser). Deferred (different rename axis): examples/vql-queries/ dir, *.vql fixtures, and "VQL" comments/seed-data prose -> tracked with the *.vql fixture-naming stage. No Zig toolchain here; verified statically (length-preserving token swaps, zero residual vql in scope, no dangling executeVql/VqlResult references). https://claude.ai/code/session_01W9Voe3JceP66Bna9FT4jME --- .clusterfuzzlite/build.sh | 4 ++-- examples/load-sample-data.sh | 2 +- examples/smoke-test.sh | 2 +- ffi/zig/README.adoc | 6 +++--- ffi/zig/src/graphql.zig | 22 +++++++++++----------- ffi/zig/src/router.zig | 4 ++-- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.clusterfuzzlite/build.sh b/.clusterfuzzlite/build.sh index 35dd119..01b26e1 100755 --- a/.clusterfuzzlite/build.sh +++ b/.clusterfuzzlite/build.sh @@ -53,9 +53,9 @@ build_target() { } build_target "${SRC}/verisimdb/fuzz" fuzz_octad_id -build_target "${SRC}/verisimdb/fuzz" fuzz_vql_parser +build_target "${SRC}/verisimdb/fuzz" fuzz_vcl_parser # Optional seed corpora — empty for now, will populate as we discover # interesting inputs. Comment in once corpora exist: # cp -r "${SRC}/verisimdb/fuzz/corpus/fuzz_octad_id" "${OUT}/fuzz_octad_id_seed_corpus" 2>/dev/null || true -# cp -r "${SRC}/verisimdb/rust-core/fuzz/corpus/fuzz_vql_parser" "${OUT}/fuzz_vql_parser_seed_corpus" 2>/dev/null || true +# cp -r "${SRC}/verisimdb/rust-core/fuzz/corpus/fuzz_vcl_parser" "${OUT}/fuzz_vcl_parser_seed_corpus" 2>/dev/null || true diff --git a/examples/load-sample-data.sh b/examples/load-sample-data.sh index 3b9f989..c33f2c1 100755 --- a/examples/load-sample-data.sh +++ b/examples/load-sample-data.sh @@ -157,7 +157,7 @@ for vql_file in "${VQL_DIR}"/*.vql; do # Escape double quotes in the query for JSON payload ESCAPED_QUERY=$(echo "$QUERY" | sed 's/"/\\"/g') - RESULT=$(curl -sf -X POST "${API_URL}/vql/execute" \ + RESULT=$(curl -sf -X POST "${API_URL}/vcl/execute" \ -H "Content-Type: application/json" \ -d "{\"query\": \"${ESCAPED_QUERY}\"}" 2>/dev/null || echo '{"error": "query execution failed or server unreachable"}') diff --git a/examples/smoke-test.sh b/examples/smoke-test.sh index e8c4080..9be2b71 100755 --- a/examples/smoke-test.sh +++ b/examples/smoke-test.sh @@ -122,7 +122,7 @@ fi # 4. Execute a VQL query — test the query engine echo "4. VQL query" -VQL_RESP=$(curl -sf -X POST "${API_URL}/vql/execute" \ +VQL_RESP=$(curl -sf -X POST "${API_URL}/vcl/execute" \ -H "Content-Type: application/json" \ -d '{"query":"SELECT * FROM hexads LIMIT 5"}' 2>/dev/null || echo "FAILED") diff --git a/ffi/zig/README.adoc b/ffi/zig/README.adoc index 7f8764a..9631172 100644 --- a/ffi/zig/README.adoc +++ b/ffi/zig/README.adoc @@ -68,7 +68,7 @@ Targets recent Zig (0.14+). | GET | `/api/v1/health` | Combined (gateway + Rust + Elixir) | GET | `/api/v1/octads*` | Rust core | POST | `/api/v1/octads` | Rust core -| POST | `/api/v1/vql/execute` | Rust core +| POST | `/api/v1/vcl/execute` | Rust core | GET | `/api/v1/drift/*` | Rust core | GET/POST | `/api/v1/search/*` | Rust core | GET | `/api/v1/provenance/*` | Rust core @@ -90,14 +90,14 @@ type Query { } type Mutation { - executeVql(query: String!): VqlResult + executeVcl(query: String!): VclResult } ---- Variables expected: * `driftScore` — `variables.entityId` (string) -* `executeVql` — `variables.query` (string) +* `executeVcl` — `variables.query` (string) == Configuration (env vars) diff --git a/ffi/zig/src/graphql.zig b/ffi/zig/src/graphql.zig index 6afb3ba..af3f092 100644 --- a/ffi/zig/src/graphql.zig +++ b/ffi/zig/src/graphql.zig @@ -2,7 +2,7 @@ // Minimal GraphQL routing — parses { "query": "...", "variables": {} } and // dispatches by query-substring to backend HTTP calls. Matches the V gateway's // field-routing approach: not a full GraphQL parser, but enough to expose -// health / telemetry / octads / driftScore / executeVql. +// health / telemetry / octads / driftScore / executeVcl. const std = @import("std"); const Config = @import("config.zig").Config; @@ -93,30 +93,30 @@ pub fn handle( } } - // executeVql mutation - if (std.mem.indexOf(u8, query, "executeVql") != null or + // executeVcl mutation + if (std.mem.indexOf(u8, query, "executeVcl") != null or std.mem.indexOf(u8, query, "mutation") != null) { - const vql_val = variables.get("query") orelse { - return errorBody(allocator, 200, "VQL mutation requires variables.query"); + const vcl_val = variables.get("query") orelse { + return errorBody(allocator, 200, "VCL mutation requires variables.query"); }; - if (vql_val != .string) { + if (vcl_val != .string) { return errorBody(allocator, 200, "variables.query must be a string"); } - const payload = try std.fmt.allocPrint(allocator, "{{\"query\":\"{s}\"}}", .{vql_val.string}); + const payload = try std.fmt.allocPrint(allocator, "{{\"query\":\"{s}\"}}", .{vcl_val.string}); defer allocator.free(payload); - const url = try std.fmt.allocPrint(allocator, "{s}/vql/execute", .{cfg.rust_url}); + const url = try std.fmt.allocPrint(allocator, "{s}/vcl/execute", .{cfg.rust_url}); defer allocator.free(url); if (proxy.postJson(allocator, url, payload)) |r| { defer allocator.free(r.body); const out = try std.fmt.allocPrint( allocator, - "{{\"data\":{{\"executeVql\":{s}}}}}", + "{{\"data\":{{\"executeVcl\":{s}}}}}", .{r.body}, ); return .{ .status = 200, .body = out }; } else |_| { - return dataNull(allocator, "executeVql", "VQL execution failed"); + return dataNull(allocator, "executeVcl", "VCL execution failed"); } } @@ -150,7 +150,7 @@ pub fn handle( return errorBody( allocator, 200, - "Unrecognised query. Supported: health, telemetry, octads, driftScore, executeVql", + "Unrecognised query. Supported: health, telemetry, octads, driftScore, executeVcl", ); } diff --git a/ffi/zig/src/router.zig b/ffi/zig/src/router.zig index 407f038..7dc2143 100644 --- a/ffi/zig/src/router.zig +++ b/ffi/zig/src/router.zig @@ -2,7 +2,7 @@ // REST route dispatch. Mirrors the V gateway endpoints: // /api/v1/health combined gateway+rust+elixir health // /api/v1/octads* → Rust core /octads* -// /api/v1/vql/execute → Rust core /vql/execute +// /api/v1/vcl/execute → Rust core /vcl/execute // /api/v1/drift/* → Rust core /drift/* // /api/v1/search/* → Rust core /search/* // /api/v1/provenance/* → Rust core /provenance/* @@ -53,7 +53,7 @@ pub fn route( if (std.mem.startsWith(u8, subpath, "/octads")) { return forward(allocator, cfg.rust_url, subpath, method, request_body); } - if (std.mem.eql(u8, subpath, "/vql/execute") and method == .POST) { + if (std.mem.eql(u8, subpath, "/vcl/execute") and method == .POST) { return forward(allocator, cfg.rust_url, subpath, method, request_body); } if (std.mem.startsWith(u8, subpath, "/drift/") and method == .GET) {