Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions connectors/shared/openapi/verisim-api-v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# OpenAPI 3.1 specification for the VeriSimDB REST API.
# Covers all octad CRUD operations, search endpoints, drift monitoring,
# provenance chain management, spatial queries, normalisation triggers,
# and VQL query execution.
# and VCL query execution.

openapi: "3.1.0"

Expand Down Expand Up @@ -44,7 +44,7 @@ tags:
description: Self-normalisation trigger and status
- name: provenance
description: Provenance chain management and verification
- name: vql
- name: vcl
description: VeriSim Query Language execution

paths:
Expand Down Expand Up @@ -947,17 +947,17 @@ paths:
$ref: "../json-schema/error.json"

# ---------------------------------------------------------------------------
# VQL
# VCL
# ---------------------------------------------------------------------------
/api/v1/vql/execute:
/api/v1/vcl/execute:
post:
operationId: executeVql
summary: Execute a VQL query
operationId: executeVcl
summary: Execute a VCL query
description: |
Executes a VeriSim Query Language (VQL) query against the
database. VQL is VeriSimDB's native query language, providing
Executes a VeriSim Query Language (VCL) query against the
database. VCL is VeriSimDB's native query language, providing
cross-modal querying with optional proof requirements.
tags: [vql]
tags: [vcl]
requestBody:
required: true
content:
Expand All @@ -969,7 +969,7 @@ paths:
query:
type: string
description: |
VQL query string. Example:
VCL query string. Example:
`FIND entities WHERE document CONTAINS "neural" AND vector SIMILAR TO [0.1, 0.2, ...] LIMIT 10`
explain:
type: boolean
Expand Down Expand Up @@ -1005,7 +1005,7 @@ paths:
type: object
description: Query execution plan (only when explain=true).
"400":
description: VQL syntax error or invalid query.
description: VCL syntax error or invalid query.
content:
application/json:
schema:
Expand Down
6 changes: 3 additions & 3 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cargo-fuzz = true
# directory per project (it walks up from the cwd to the nearest `fuzz/`, which
# is always this one), so EVERY target ClusterFuzzLite builds must live here —
# a target in rust-core/fuzz is unreachable via `cargo fuzz` and silently
# resolves back to this manifest. fuzz_vql_parser therefore lives here too.
# resolves back to this manifest. fuzz_vcl_parser therefore lives here too.
# rust-core/fuzz is retained only for the native `cargo check` matrix leg in
# rust-ci.yml; the canonical fuzz harnesses are these.
[dependencies]
Expand All @@ -33,8 +33,8 @@ test = false
doc = false

[[bin]]
name = "fuzz_vql_parser"
path = "fuzz_targets/fuzz_vql_parser.rs"
name = "fuzz_vcl_parser"
path = "fuzz_targets/fuzz_vcl_parser.rs"
test = false
doc = false

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: MPL-2.0
//
// Fuzz target for the VQL parser.
// Run with: cargo +nightly fuzz run fuzz_vql_parser
// Fuzz target for the VCL parser.
// Run with: cargo +nightly fuzz run fuzz_vcl_parser
//
// This fuzzer feeds arbitrary byte strings to the VQL parser to find
// This fuzzer feeds arbitrary byte strings to the VCL parser to find
// panics, hangs, or memory safety issues. The parser should gracefully
// reject invalid input without crashing.

Expand All @@ -12,14 +12,14 @@
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
// Only attempt to parse valid UTF-8 strings — the VQL parser
// Only attempt to parse valid UTF-8 strings — the VCL parser
// operates on &str, not raw bytes.
if let Ok(input) = std::str::from_utf8(data) {
// Limit input size to prevent timeouts on extremely long strings
if input.len() <= 4096 {
// The parser should never panic on any valid UTF-8 input.
// We don't care about the result — only that it doesn't crash.
let _ = verisim_api::vql::tokenize(input);
let _ = verisim_api::vcl::tokenize(input);
}
}
});
6 changes: 3 additions & 3 deletions rust-core/fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

[[bin]]
name = "fuzz_vql_parser"
path = "fuzz_targets/fuzz_vql_parser.rs"
name = "fuzz_vcl_parser"
path = "fuzz_targets/fuzz_vcl_parser.rs"
test = false
doc = false
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: MPL-2.0
//
// Fuzz target for the VQL parser.
// Run with: cargo +nightly fuzz run fuzz_vql_parser
// Fuzz target for the VCL parser.
// Run with: cargo +nightly fuzz run fuzz_vcl_parser
//
// This fuzzer feeds arbitrary byte strings to the VQL parser to find
// This fuzzer feeds arbitrary byte strings to the VCL parser to find
// panics, hangs, or memory safety issues. The parser should gracefully
// reject invalid input without crashing.

Expand All @@ -12,14 +12,14 @@
use libfuzzer_sys::fuzz_target;

fuzz_target!(|data: &[u8]| {
// Only attempt to parse valid UTF-8 strings — the VQL parser
// Only attempt to parse valid UTF-8 strings — the VCL parser
// operates on &str, not raw bytes.
if let Ok(input) = std::str::from_utf8(data) {
// Limit input size to prevent timeouts on extremely long strings
if input.len() <= 4096 {
// The parser should never panic on any valid UTF-8 input.
// We don't care about the result — only that it doesn't crash.
let _ = verisim_api::vql::tokenize(input);
let _ = verisim_api::vcl::tokenize(input);
}
}
});
16 changes: 8 additions & 8 deletions rust-core/verisim-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub mod proof_attempts;
pub mod rbac;
pub mod regenerator;
pub mod transaction;
pub mod vql;
pub mod vcl;

use axum::{
extract::{Path, Query, State},
Expand Down Expand Up @@ -827,8 +827,8 @@ pub fn build_router(state: AppState) -> Router {
post(spatial_bounds_search_handler),
)
.route("/spatial/search/nearest", post(spatial_nearest_handler))
// VQL text query endpoint (used by verisim-repl)
.route("/vql/execute", post(vql::vql_execute_handler))
// VCL text query endpoint (used by verisim-repl)
.route("/vcl/execute", post(vcl::vcl_execute_handler))
// S4 learning loop — ECHIDNA proof attempts (see proof_attempts module docs)
.route(
"/proof_attempts",
Expand Down Expand Up @@ -1530,7 +1530,7 @@ async fn planner_stats_handler(
/// Store query request body
#[derive(Debug, Serialize, Deserialize)]
pub struct StoreQueryRequest {
/// The VQL query text
/// The VCL query text
pub query: String,
/// Optional embedding for the query
pub embedding: Option<Vec<f32>>,
Expand All @@ -1540,7 +1540,7 @@ pub struct StoreQueryRequest {
pub proof_obligations: Option<Vec<String>>,
}

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

// Filter to only query octads (those with "vql_query" type in document fields)
// Filter to only query octads (those with "vcl_query" type in document fields)
let results: Vec<SearchResultResponse> = scored
.iter()
.filter(|(h, _score)| {
h.document
.as_ref()
.map(|d| d.title.starts_with("VQL Query:"))
.map(|d| d.title.starts_with("VCL Query:"))
.unwrap_or(false)
})
.map(|(h, score)| SearchResultResponse {
Expand Down Expand Up @@ -1745,7 +1745,7 @@ async fn query_explain_analyze_handler(
/// Request to create a prepared statement
#[derive(Debug, Serialize, Deserialize)]
pub struct PreparedCreateRequest {
/// The VQL query text
/// The VCL query text
pub query: String,
/// The logical plan for the query
pub plan: LogicalPlan,
Expand Down
2 changes: 1 addition & 1 deletion rust-core/verisim-api/src/rbac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub enum Permission {
Write,
/// Administrative operations (config changes, normalizer triggers, key management).
Admin,
/// Execute queries (VQL execution, query planning, EXPLAIN).
/// Execute queries (VCL execution, query planning, EXPLAIN).
Execute,
}

Expand Down
Loading
Loading