Skip to content

Commit c36f39b

Browse files
claudehyperpolymath
authored andcommitted
fix(wire): retarget stale /vql/execute callers + fuzz target to VCL
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
1 parent d122ec3 commit c36f39b

6 files changed

Lines changed: 20 additions & 20 deletions

File tree

.clusterfuzzlite/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ build_target() {
5353
}
5454

5555
build_target "${SRC}/verisimdb/fuzz" fuzz_octad_id
56-
build_target "${SRC}/verisimdb/fuzz" fuzz_vql_parser
56+
build_target "${SRC}/verisimdb/fuzz" fuzz_vcl_parser
5757

5858
# Optional seed corpora — empty for now, will populate as we discover
5959
# interesting inputs. Comment in once corpora exist:
6060
# cp -r "${SRC}/verisimdb/fuzz/corpus/fuzz_octad_id" "${OUT}/fuzz_octad_id_seed_corpus" 2>/dev/null || true
61-
# cp -r "${SRC}/verisimdb/rust-core/fuzz/corpus/fuzz_vql_parser" "${OUT}/fuzz_vql_parser_seed_corpus" 2>/dev/null || true
61+
# cp -r "${SRC}/verisimdb/rust-core/fuzz/corpus/fuzz_vcl_parser" "${OUT}/fuzz_vcl_parser_seed_corpus" 2>/dev/null || true

examples/load-sample-data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ for vql_file in "${VQL_DIR}"/*.vql; do
157157
# Escape double quotes in the query for JSON payload
158158
ESCAPED_QUERY=$(echo "$QUERY" | sed 's/"/\\"/g')
159159

160-
RESULT=$(curl -sf -X POST "${API_URL}/vql/execute" \
160+
RESULT=$(curl -sf -X POST "${API_URL}/vcl/execute" \
161161
-H "Content-Type: application/json" \
162162
-d "{\"query\": \"${ESCAPED_QUERY}\"}" 2>/dev/null || echo '{"error": "query execution failed or server unreachable"}')
163163

examples/smoke-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fi
122122

123123
# 4. Execute a VQL query — test the query engine
124124
echo "4. VQL query"
125-
VQL_RESP=$(curl -sf -X POST "${API_URL}/vql/execute" \
125+
VQL_RESP=$(curl -sf -X POST "${API_URL}/vcl/execute" \
126126
-H "Content-Type: application/json" \
127127
-d '{"query":"SELECT * FROM hexads LIMIT 5"}' 2>/dev/null || echo "FAILED")
128128

ffi/zig/README.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Targets recent Zig (0.14+).
6868
| GET | `/api/v1/health` | Combined (gateway + Rust + Elixir)
6969
| GET | `/api/v1/octads*` | Rust core
7070
| POST | `/api/v1/octads` | Rust core
71-
| POST | `/api/v1/vql/execute` | Rust core
71+
| POST | `/api/v1/vcl/execute` | Rust core
7272
| GET | `/api/v1/drift/*` | Rust core
7373
| GET/POST | `/api/v1/search/*` | Rust core
7474
| GET | `/api/v1/provenance/*` | Rust core
@@ -90,14 +90,14 @@ type Query {
9090
}
9191
9292
type Mutation {
93-
executeVql(query: String!): VqlResult
93+
executeVcl(query: String!): VclResult
9494
}
9595
----
9696

9797
Variables expected:
9898

9999
* `driftScore` — `variables.entityId` (string)
100-
* `executeVql` — `variables.query` (string)
100+
* `executeVcl` — `variables.query` (string)
101101

102102
== Configuration (env vars)
103103

ffi/zig/src/graphql.zig

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Minimal GraphQL routing — parses { "query": "...", "variables": {} } and
33
// dispatches by query-substring to backend HTTP calls. Matches the V gateway's
44
// field-routing approach: not a full GraphQL parser, but enough to expose
5-
// health / telemetry / octads / driftScore / executeVql.
5+
// health / telemetry / octads / driftScore / executeVcl.
66

77
const std = @import("std");
88
const Config = @import("config.zig").Config;
@@ -93,30 +93,30 @@ pub fn handle(
9393
}
9494
}
9595

96-
// executeVql mutation
97-
if (std.mem.indexOf(u8, query, "executeVql") != null or
96+
// executeVcl mutation
97+
if (std.mem.indexOf(u8, query, "executeVcl") != null or
9898
std.mem.indexOf(u8, query, "mutation") != null)
9999
{
100-
const vql_val = variables.get("query") orelse {
101-
return errorBody(allocator, 200, "VQL mutation requires variables.query");
100+
const vcl_val = variables.get("query") orelse {
101+
return errorBody(allocator, 200, "VCL mutation requires variables.query");
102102
};
103-
if (vql_val != .string) {
103+
if (vcl_val != .string) {
104104
return errorBody(allocator, 200, "variables.query must be a string");
105105
}
106-
const payload = try std.fmt.allocPrint(allocator, "{{\"query\":\"{s}\"}}", .{vql_val.string});
106+
const payload = try std.fmt.allocPrint(allocator, "{{\"query\":\"{s}\"}}", .{vcl_val.string});
107107
defer allocator.free(payload);
108-
const url = try std.fmt.allocPrint(allocator, "{s}/vql/execute", .{cfg.rust_url});
108+
const url = try std.fmt.allocPrint(allocator, "{s}/vcl/execute", .{cfg.rust_url});
109109
defer allocator.free(url);
110110
if (proxy.postJson(allocator, url, payload)) |r| {
111111
defer allocator.free(r.body);
112112
const out = try std.fmt.allocPrint(
113113
allocator,
114-
"{{\"data\":{{\"executeVql\":{s}}}}}",
114+
"{{\"data\":{{\"executeVcl\":{s}}}}}",
115115
.{r.body},
116116
);
117117
return .{ .status = 200, .body = out };
118118
} else |_| {
119-
return dataNull(allocator, "executeVql", "VQL execution failed");
119+
return dataNull(allocator, "executeVcl", "VCL execution failed");
120120
}
121121
}
122122

@@ -150,7 +150,7 @@ pub fn handle(
150150
return errorBody(
151151
allocator,
152152
200,
153-
"Unrecognised query. Supported: health, telemetry, octads, driftScore, executeVql",
153+
"Unrecognised query. Supported: health, telemetry, octads, driftScore, executeVcl",
154154
);
155155
}
156156

ffi/zig/src/router.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// REST route dispatch. Mirrors the V gateway endpoints:
33
// /api/v1/health combined gateway+rust+elixir health
44
// /api/v1/octads* → Rust core /octads*
5-
// /api/v1/vql/execute → Rust core /vql/execute
5+
// /api/v1/vcl/execute → Rust core /vcl/execute
66
// /api/v1/drift/* → Rust core /drift/*
77
// /api/v1/search/* → Rust core /search/*
88
// /api/v1/provenance/* → Rust core /provenance/*
@@ -53,7 +53,7 @@ pub fn route(
5353
if (std.mem.startsWith(u8, subpath, "/octads")) {
5454
return forward(allocator, cfg.rust_url, subpath, method, request_body);
5555
}
56-
if (std.mem.eql(u8, subpath, "/vql/execute") and method == .POST) {
56+
if (std.mem.eql(u8, subpath, "/vcl/execute") and method == .POST) {
5757
return forward(allocator, cfg.rust_url, subpath, method, request_body);
5858
}
5959
if (std.mem.startsWith(u8, subpath, "/drift/") and method == .GET) {

0 commit comments

Comments
 (0)