Skip to content

Commit 89f1f95

Browse files
claudehyperpolymath
authored andcommitted
refactor(rust): VCL rename stage B (1/5) — rust-core server + openapi
First sub-stage of the Stage B code rename (#84). Per maintainer decision this is a hard rename including the public endpoint (no back-compat alias). Renamed (git mv + identifiers, 26 files): - verisim-api/src/vql.rs -> vcl.rs; route POST /vql/execute -> /vcl/execute; handler vql_execute_handler -> vcl_execute_handler; `pub mod vql` -> `pub mod vcl` - verisim-planner/src/vql_bridge.rs -> vcl_bridge.rs (AST types VqlAst/VqlQuery/... -> Vcl*); `pub mod vql_bridge` -> vcl_bridge - verisim-repl/src/vql_fmt.rs -> vcl_fmt.rs; REPL binary "vql" -> "vcl"; client POSTs /vcl/execute; .vqlrc -> .vclrc - both fuzz targets fuzz_vql_parser -> fuzz_vcl_parser (file + [[bin]] name + path), importing verisim_api::vcl::tokenize - connectors/shared/openapi/verisim-api-v1.yaml: /api/v1/vcl/execute - tests/integration_test.rs Follow-ups (tracked under #84, intentionally out of this PR): - Client SDKs still call /api/v1/vql/execute (Elixir/Rust/Zig/Julia/ ReScript/playground) -> clients sub-stage. CI unaffected: clients compile against their own string; no live integration test in unit CI. - Elixir-internal contracts (type:vql_query tag, vql_dt_active, the vql-bridge/ JS dir + @parser_script_path) -> Elixir follow-up. Verified locally (cargo cannot build offline here -- oxigraph et al. need network, so the real compile runs on CI): grep-to-zero leaves no vql/VQL/Vql token in rust-core/fuzz/openapi/integration; no other workspace crate imports the renamed modules/types; symmetric 418/418 diff (equal-length token swaps, no structural change). Refs #84. https://claude.ai/code/session_01W9Voe3JceP66Bna9FT4jME
1 parent 7dedbb2 commit 89f1f95

26 files changed

Lines changed: 418 additions & 418 deletions

File tree

connectors/shared/openapi/verisim-api-v1.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# OpenAPI 3.1 specification for the VeriSimDB REST API.
55
# Covers all octad CRUD operations, search endpoints, drift monitoring,
66
# provenance chain management, spatial queries, normalisation triggers,
7-
# and VQL query execution.
7+
# and VCL query execution.
88

99
openapi: "3.1.0"
1010

@@ -44,7 +44,7 @@ tags:
4444
description: Self-normalisation trigger and status
4545
- name: provenance
4646
description: Provenance chain management and verification
47-
- name: vql
47+
- name: vcl
4848
description: VeriSim Query Language execution
4949

5050
paths:
@@ -947,17 +947,17 @@ paths:
947947
$ref: "../json-schema/error.json"
948948

949949
# ---------------------------------------------------------------------------
950-
# VQL
950+
# VCL
951951
# ---------------------------------------------------------------------------
952-
/api/v1/vql/execute:
952+
/api/v1/vcl/execute:
953953
post:
954-
operationId: executeVql
955-
summary: Execute a VQL query
954+
operationId: executeVcl
955+
summary: Execute a VCL query
956956
description: |
957-
Executes a VeriSim Query Language (VQL) query against the
958-
database. VQL is VeriSimDB's native query language, providing
957+
Executes a VeriSim Query Language (VCL) query against the
958+
database. VCL is VeriSimDB's native query language, providing
959959
cross-modal querying with optional proof requirements.
960-
tags: [vql]
960+
tags: [vcl]
961961
requestBody:
962962
required: true
963963
content:
@@ -969,7 +969,7 @@ paths:
969969
query:
970970
type: string
971971
description: |
972-
VQL query string. Example:
972+
VCL query string. Example:
973973
`FIND entities WHERE document CONTAINS "neural" AND vector SIMILAR TO [0.1, 0.2, ...] LIMIT 10`
974974
explain:
975975
type: boolean
@@ -1005,7 +1005,7 @@ paths:
10051005
type: object
10061006
description: Query execution plan (only when explain=true).
10071007
"400":
1008-
description: VQL syntax error or invalid query.
1008+
description: VCL syntax error or invalid query.
10091009
content:
10101010
application/json:
10111011
schema:

fuzz/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cargo-fuzz = true
1212
# directory per project (it walks up from the cwd to the nearest `fuzz/`, which
1313
# is always this one), so EVERY target ClusterFuzzLite builds must live here —
1414
# a target in rust-core/fuzz is unreachable via `cargo fuzz` and silently
15-
# resolves back to this manifest. fuzz_vql_parser therefore lives here too.
15+
# resolves back to this manifest. fuzz_vcl_parser therefore lives here too.
1616
# rust-core/fuzz is retained only for the native `cargo check` matrix leg in
1717
# rust-ci.yml; the canonical fuzz harnesses are these.
1818
[dependencies]
@@ -33,8 +33,8 @@ test = false
3333
doc = false
3434

3535
[[bin]]
36-
name = "fuzz_vql_parser"
37-
path = "fuzz_targets/fuzz_vql_parser.rs"
36+
name = "fuzz_vcl_parser"
37+
path = "fuzz_targets/fuzz_vcl_parser.rs"
3838
test = false
3939
doc = false
4040

Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-License-Identifier: MPL-2.0
22
//
3-
// Fuzz target for the VQL parser.
4-
// Run with: cargo +nightly fuzz run fuzz_vql_parser
3+
// Fuzz target for the VCL parser.
4+
// Run with: cargo +nightly fuzz run fuzz_vcl_parser
55
//
6-
// This fuzzer feeds arbitrary byte strings to the VQL parser to find
6+
// This fuzzer feeds arbitrary byte strings to the VCL parser to find
77
// panics, hangs, or memory safety issues. The parser should gracefully
88
// reject invalid input without crashing.
99

@@ -12,14 +12,14 @@
1212
use libfuzzer_sys::fuzz_target;
1313

1414
fuzz_target!(|data: &[u8]| {
15-
// Only attempt to parse valid UTF-8 strings — the VQL parser
15+
// Only attempt to parse valid UTF-8 strings — the VCL parser
1616
// operates on &str, not raw bytes.
1717
if let Ok(input) = std::str::from_utf8(data) {
1818
// Limit input size to prevent timeouts on extremely long strings
1919
if input.len() <= 4096 {
2020
// The parser should never panic on any valid UTF-8 input.
2121
// We don't care about the result — only that it doesn't crash.
22-
let _ = verisim_api::vql::tokenize(input);
22+
let _ = verisim_api::vcl::tokenize(input);
2323
}
2424
}
2525
});

rust-core/fuzz/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Retained for the native `cargo check` matrix leg in rust-ci.yml. The
44
# ClusterFuzzLite build uses the top-level fuzz/ crate (cargo-fuzz resolves a
5-
# single fuzz dir per project), where fuzz_vql_parser is canonically hosted.
5+
# single fuzz dir per project), where fuzz_vcl_parser is canonically hosted.
66
[package]
77
name = "verisimdb-fuzz"
88
version = "0.0.0"
@@ -23,7 +23,7 @@ path = "../verisim-api"
2323
members = ["."]
2424

2525
[[bin]]
26-
name = "fuzz_vql_parser"
27-
path = "fuzz_targets/fuzz_vql_parser.rs"
26+
name = "fuzz_vcl_parser"
27+
path = "fuzz_targets/fuzz_vcl_parser.rs"
2828
test = false
2929
doc = false
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// SPDX-License-Identifier: MPL-2.0
22
//
3-
// Fuzz target for the VQL parser.
4-
// Run with: cargo +nightly fuzz run fuzz_vql_parser
3+
// Fuzz target for the VCL parser.
4+
// Run with: cargo +nightly fuzz run fuzz_vcl_parser
55
//
6-
// This fuzzer feeds arbitrary byte strings to the VQL parser to find
6+
// This fuzzer feeds arbitrary byte strings to the VCL parser to find
77
// panics, hangs, or memory safety issues. The parser should gracefully
88
// reject invalid input without crashing.
99

@@ -12,14 +12,14 @@
1212
use libfuzzer_sys::fuzz_target;
1313

1414
fuzz_target!(|data: &[u8]| {
15-
// Only attempt to parse valid UTF-8 strings — the VQL parser
15+
// Only attempt to parse valid UTF-8 strings — the VCL parser
1616
// operates on &str, not raw bytes.
1717
if let Ok(input) = std::str::from_utf8(data) {
1818
// Limit input size to prevent timeouts on extremely long strings
1919
if input.len() <= 4096 {
2020
// The parser should never panic on any valid UTF-8 input.
2121
// We don't care about the result — only that it doesn't crash.
22-
let _ = verisim_api::vql::tokenize(input);
22+
let _ = verisim_api::vcl::tokenize(input);
2323
}
2424
}
2525
});

rust-core/verisim-api/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub mod proof_attempts;
1414
pub mod rbac;
1515
pub mod regenerator;
1616
pub mod transaction;
17-
pub mod vql;
17+
pub mod vcl;
1818

1919
use axum::{
2020
extract::{Path, Query, State},
@@ -827,8 +827,8 @@ pub fn build_router(state: AppState) -> Router {
827827
post(spatial_bounds_search_handler),
828828
)
829829
.route("/spatial/search/nearest", post(spatial_nearest_handler))
830-
// VQL text query endpoint (used by verisim-repl)
831-
.route("/vql/execute", post(vql::vql_execute_handler))
830+
// VCL text query endpoint (used by verisim-repl)
831+
.route("/vcl/execute", post(vcl::vcl_execute_handler))
832832
// S4 learning loop — ECHIDNA proof attempts (see proof_attempts module docs)
833833
.route(
834834
"/proof_attempts",
@@ -1530,7 +1530,7 @@ async fn planner_stats_handler(
15301530
/// Store query request body
15311531
#[derive(Debug, Serialize, Deserialize)]
15321532
pub struct StoreQueryRequest {
1533-
/// The VQL query text
1533+
/// The VCL query text
15341534
pub query: String,
15351535
/// Optional embedding for the query
15361536
pub embedding: Option<Vec<f32>>,
@@ -1540,7 +1540,7 @@ pub struct StoreQueryRequest {
15401540
pub proof_obligations: Option<Vec<String>>,
15411541
}
15421542

1543-
/// Store a VQL query as a octad (homoiconicity)
1543+
/// Store a VCL query as a octad (homoiconicity)
15441544
#[instrument(skip(state, request))]
15451545
async fn store_query_handler(
15461546
State(state): State<AppState>,
@@ -1602,13 +1602,13 @@ async fn similar_queries_handler(
16021602
.await
16031603
.map_err(|e| ApiError::Internal(e.to_string()))?;
16041604

1605-
// Filter to only query octads (those with "vql_query" type in document fields)
1605+
// Filter to only query octads (those with "vcl_query" type in document fields)
16061606
let results: Vec<SearchResultResponse> = scored
16071607
.iter()
16081608
.filter(|(h, _score)| {
16091609
h.document
16101610
.as_ref()
1611-
.map(|d| d.title.starts_with("VQL Query:"))
1611+
.map(|d| d.title.starts_with("VCL Query:"))
16121612
.unwrap_or(false)
16131613
})
16141614
.map(|(h, score)| SearchResultResponse {
@@ -1745,7 +1745,7 @@ async fn query_explain_analyze_handler(
17451745
/// Request to create a prepared statement
17461746
#[derive(Debug, Serialize, Deserialize)]
17471747
pub struct PreparedCreateRequest {
1748-
/// The VQL query text
1748+
/// The VCL query text
17491749
pub query: String,
17501750
/// The logical plan for the query
17511751
pub plan: LogicalPlan,

rust-core/verisim-api/src/rbac.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub enum Permission {
4242
Write,
4343
/// Administrative operations (config changes, normalizer triggers, key management).
4444
Admin,
45-
/// Execute queries (VQL execution, query planning, EXPLAIN).
45+
/// Execute queries (VCL execution, query planning, EXPLAIN).
4646
Execute,
4747
}
4848

0 commit comments

Comments
 (0)