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
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
* @hyperpolymath
/rust-core/ @hyperpolymath
/elixir-orchestration/ @hyperpolymath
/src/vql/ @hyperpolymath
/src/vcl/ @hyperpolymath
/container/ @hyperpolymath
/.github/ @hyperpolymath
30 changes: 15 additions & 15 deletions .hypatia-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#
# ReScript (.res) files are permitted in this repository per CLAUDE.md
# language policy. ReScript powers:
# - src/vql/ — VQL parser, type checker, circuits, subtyping
# - src/vcl/ — VCL parser, type checker, circuits, subtyping
# - src/registry/ — federation registry (Kraft consensus, metadata log)
# - src/abi/ — Idris2/ReScript ABI bridge
# - playground/ — VQL Playground web UI
# - playground/ — VCL Playground web UI
# - connectors/clients/rescript/ — ReScript client SDK
#
# Each file is whitelisted by absolute repo path.
Expand All @@ -18,7 +18,7 @@ cicd_rules/banned_language_file:connectors/clients/rescript/src/VeriSimHexad.res
cicd_rules/banned_language_file:connectors/clients/rescript/src/VeriSimProvenance.res
cicd_rules/banned_language_file:connectors/clients/rescript/src/VeriSimSearch.res
cicd_rules/banned_language_file:connectors/clients/rescript/src/VeriSimTypes.res
cicd_rules/banned_language_file:connectors/clients/rescript/src/VeriSimVql.res
cicd_rules/banned_language_file:connectors/clients/rescript/src/VeriSimVcl.res
cicd_rules/banned_language_file:debugger/examples/SafeDOMExample.res
cicd_rules/banned_language_file:examples/SafeDOMExample.res
cicd_rules/banned_language_file:playground/src/ApiClient.res
Expand All @@ -28,22 +28,22 @@ cicd_rules/banned_language_file:playground/src/Examples.res
cicd_rules/banned_language_file:playground/src/Formatter.res
cicd_rules/banned_language_file:playground/src/Highlighter.res
cicd_rules/banned_language_file:playground/src/Linter.res
cicd_rules/banned_language_file:playground/src/VqlKeywords.res
cicd_rules/banned_language_file:playground/src/VclKeywords.res
cicd_rules/banned_language_file:src/registry/KRaftCluster.res
cicd_rules/banned_language_file:src/registry/KRaftSerializer.res
cicd_rules/banned_language_file:src/registry/MetadataLog.res
cicd_rules/banned_language_file:src/registry/Registry.res
cicd_rules/banned_language_file:src/vql/VQLBidir.res
cicd_rules/banned_language_file:src/vql/VQLCircuit.res
cicd_rules/banned_language_file:src/vql/VQLContext.res
cicd_rules/banned_language_file:src/vql/VQLError.res
cicd_rules/banned_language_file:src/vql/VQLExplain.res
cicd_rules/banned_language_file:src/vql/VQLParser.res
cicd_rules/banned_language_file:src/vql/VQLParser_test.res
cicd_rules/banned_language_file:src/vql/VQLProofObligation.res
cicd_rules/banned_language_file:src/vql/VQLSubtyping.res
cicd_rules/banned_language_file:src/vql/VQLTypeChecker.res
cicd_rules/banned_language_file:src/vql/VQLTypes.res
cicd_rules/banned_language_file:src/vcl/VCLBidir.res
cicd_rules/banned_language_file:src/vcl/VCLCircuit.res
cicd_rules/banned_language_file:src/vcl/VCLContext.res
cicd_rules/banned_language_file:src/vcl/VCLError.res
cicd_rules/banned_language_file:src/vcl/VCLExplain.res
cicd_rules/banned_language_file:src/vcl/VCLParser.res
cicd_rules/banned_language_file:src/vcl/VCLParser_test.res
cicd_rules/banned_language_file:src/vcl/VCLProofObligation.res
cicd_rules/banned_language_file:src/vcl/VCLSubtyping.res
cicd_rules/banned_language_file:src/vcl/VCLTypeChecker.res
cicd_rules/banned_language_file:src/vcl/VCLTypes.res

# verisimdb-registry uses ReScript v11; rescript.json is its build config.
cicd_rules/banned_config_file:rescript.json
2 changes: 1 addition & 1 deletion .machine_readable/contractiles/dust/Dustfile.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ nothing is deleted without --apply and per-item approval. Audit trail preserved.

### no-tracked-rescript-mjs
- description: No compiled ReScript .res.mjs output tracked in git
- target: src/vql
- target: src/vcl
- reason: Compiled output regenerated from .res sources
- probe: test -z "$(git ls-files '*.res.mjs' 2>/dev/null)"
- status: declared
Expand Down
10 changes: 5 additions & 5 deletions .machine_readable/contractiles/must/Mustfile.a2ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@abstract:
Physical-state invariants for VeriSimDB — the cross-modal (octad) entity
consistency engine. Rust core + Elixir/OTP orchestration + ReScript VQL.
consistency engine. Rust core + Elixir/OTP orchestration + ReScript VCL.
These are hard requirements: CI and pre-commit hooks fail if any check fails.
@end

Expand Down Expand Up @@ -77,11 +77,11 @@ These are hard requirements: CI and pre-commit hooks fail if any check fails.
- run: test -f .editorconfig
- severity: warning

## VQL (VeriSim Consonance Language)
## VCL (VeriSim Consonance Language)

### vql-rescript-parser
- description: ReScript VQL parser source must exist
- run: test -d src/vql
### vcl-rescript-parser
- description: ReScript VCL parser source must exist
- run: test -d src/vcl
- severity: critical

### vql-elixir-bridge
Expand Down
12 changes: 6 additions & 6 deletions connectors/clients/rescript/src/VeriSimError.res
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ type t =
| ModalityUnavailable(string)
| DriftComputationError(string)
| ProvenanceInvalid(string)
| VqlParseError(string)
| VqlExecutionError(string)
| VclParseError(string)
| VclExecutionError(string)
| FederationError(string)
// --- Client-side errors ---
| ConnectionError(string)
Expand Down Expand Up @@ -60,8 +60,8 @@ let message = (err: t): string => {
| ModalityUnavailable(msg) => `Modality unavailable: ${msg}`
| DriftComputationError(msg) => `Drift computation error: ${msg}`
| ProvenanceInvalid(msg) => `Provenance invalid: ${msg}`
| VqlParseError(msg) => `VQL parse error: ${msg}`
| VqlExecutionError(msg) => `VQL execution error: ${msg}`
| VclParseError(msg) => `VCL parse error: ${msg}`
| VclExecutionError(msg) => `VCL execution error: ${msg}`
| FederationError(msg) => `Federation error: ${msg}`
| ConnectionError(msg) => `Connection error: ${msg}`
| TimeoutError(msg) => `Timeout error: ${msg}`
Expand Down Expand Up @@ -119,8 +119,8 @@ let isRetryable = (err: t): bool => {
| ModalityUnavailable(_) => false
| DriftComputationError(_) => false
| ProvenanceInvalid(_) => false
| VqlParseError(_) => false
| VqlExecutionError(_) => false
| VclParseError(_) => false
| VclExecutionError(_) => false
| FederationError(_) => false
| SerializationError(_) => false
| UnknownError(_) => false
Expand Down
2 changes: 1 addition & 1 deletion connectors/clients/rescript/src/VeriSimFederation.res
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ let listPeers = async (
}
}

/** Execute a VQL query across one or more federation peers.
/** Execute a VCL query across one or more federation peers.
*
* If peerIds is empty, the query is broadcast to all active peers.
*
Expand Down
12 changes: 6 additions & 6 deletions connectors/clients/rescript/src/VeriSimTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -274,19 +274,19 @@ type searchResult = {
}

// --------------------------------------------------------------------------
// VQL types
// VCL types
// --------------------------------------------------------------------------

/** Result of a VQL query execution. */
type vqlResult = {
/** Result of a VCL query execution. */
type vclResult = {
columns: array<string>,
rows: array<array<string>>,
count: int,
elapsedMs: float,
}

/** Query execution plan explanation for a VQL statement. */
type vqlExplanation = {
/** Query execution plan explanation for a VCL statement. */
type vclExplanation = {
query: string,
plan: string,
cost: float,
Expand All @@ -311,7 +311,7 @@ type federationPeer = {
type peerQueryResult = {
peerId: string,
peerName: string,
result: vqlResult,
result: vclResult,
elapsedMs: float,
error: option<string>,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
// SPDX-License-Identifier: MPL-2.0
// Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
//
// VeriSimDB ReScript Client — VQL (VeriSimDB Query Language) operations.
// VeriSimDB ReScript Client — VCL (VeriSim Consonance Language) operations.
//
// VQL is VeriSimDB's native query language for multi-modal queries that span
// VCL is VeriSimDB's native consonance language for multi-modal queries that span
// graph traversals, vector similarity, spatial filters, and temporal constraints
// in a single statement. This module provides execution and explain functions.

/** VQL request payload for executing or explaining a query. */
type vqlRequest = {
/** VCL request payload for executing or explaining a query. */
type vclRequest = {
query: string,
params: Dict.t<string>,
}

/** Execute a VQL query and return the result set.
/** Execute a VCL query and return the result set.
*
* @param client The authenticated client.
* @param query The VQL query string.
* @param query The VCL query string.
* @param params Optional named parameters for parameterised queries.
* @returns The query result with columns, rows, and timing, or an error.
*/
let execute = async (
client: VeriSimClient.t,
query: string,
~params: Dict.t<string>=Dict.make(),
): result<VeriSimTypes.vqlResult, VeriSimError.t> => {
): result<VeriSimTypes.vclResult, VeriSimError.t> => {
try {
let req: vqlRequest = {query, params}
let req: vclRequest = {query, params}
let body = req->Obj.magic->JSON.stringify->JSON.parseExn
let resp = await VeriSimClient.doPost(client, "/api/v1/vql/execute", body)
let resp = await VeriSimClient.doPost(client, "/api/v1/vcl/execute", body)
if resp.ok {
let json = await VeriSimClient.jsonBody(resp)
Ok(json->Obj.magic)
} else {
Error(VeriSimError.fromStatus(resp.status))
}
} catch {
| _ => Error(VeriSimError.ConnectionError("VQL execution failed"))
| _ => Error(VeriSimError.ConnectionError("VCL execution failed"))
}
}

/** Explain a VQL query's execution plan without running it.
/** Explain a VCL query's execution plan without running it.
*
* @param client The authenticated client.
* @param query The VQL query string.
* @param query The VCL query string.
* @param params Optional named parameters.
* @returns The query plan, estimated cost, and any warnings, or an error.
*/
let explain = async (
client: VeriSimClient.t,
query: string,
~params: Dict.t<string>=Dict.make(),
): result<VeriSimTypes.vqlExplanation, VeriSimError.t> => {
): result<VeriSimTypes.vclExplanation, VeriSimError.t> => {
try {
let req: vqlRequest = {query, params}
let req: vclRequest = {query, params}
let body = req->Obj.magic->JSON.stringify->JSON.parseExn
let resp = await VeriSimClient.doPost(client, "/api/v1/vql/explain", body)
let resp = await VeriSimClient.doPost(client, "/api/v1/vcl/explain", body)
if resp.ok {
let json = await VeriSimClient.jsonBody(resp)
Ok(json->Obj.magic)
} else {
Error(VeriSimError.fromStatus(resp.status))
}
} catch {
| _ => Error(VeriSimError.ConnectionError("VQL explain failed"))
| _ => Error(VeriSimError.ConnectionError("VCL explain failed"))
}
}
2 changes: 1 addition & 1 deletion playground/deno.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "vql-playground",
"name": "vcl-playground",
"version": "0.1.0",
"tasks": {
"res:build": "rescript",
Expand Down
4 changes: 2 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vql-playground",
"name": "vcl-playground",
"version": "0.1.0",
"description": "VQL Playground — Interactive query editor for VeriSimDB",
"description": "VCL Playground — Interactive query editor for VeriSimDB",
"type": "module",
"license": "MPL-2.0",
"author": "Jonathan D.A. Jewell <j.d.a.jewell@open.ac.uk>",
Expand Down
24 changes: 12 additions & 12 deletions playground/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="VQL Playground — Interactive query editor for VeriSimDB, the octad multimodal database" />
<meta name="description" content="VCL Playground — Interactive query editor for VeriSimDB, the octad multimodal database" />
<meta name="theme-color" content="#3b82f6" />
<title>VQL Playground — VeriSimDB</title>
<title>VCL Playground — VeriSimDB</title>
<link rel="stylesheet" href="style.css" />
<link rel="manifest" href="manifest.json" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
Expand All @@ -15,15 +15,15 @@
</head>
<body>
<header class="header">
<h1><span class="logo">&#9670;</span> VQL Playground</h1>
<h1><span class="logo">&#9670;</span> VCL Playground</h1>
<div class="header-controls">
<div class="mode-toggle">
<label for="vql-dt-toggle">VQL</label>
<div class="toggle-switch" id="vql-dt-toggle" role="switch" aria-checked="false" tabindex="0">
<label for="vcl-dt-toggle">VCL</label>
<div class="toggle-switch" id="vcl-dt-toggle" role="switch" aria-checked="false" tabindex="0">
<div class="toggle-knob"></div>
</div>
<label for="vql-dt-toggle">VQL-DT</label>
<span class="mode-badge vql" id="mode-badge">VQL</span>
<label for="vcl-dt-toggle">VCL-DT</label>
<span class="mode-badge vcl" id="mode-badge">VCL</span>
</div>
</div>
</header>
Expand All @@ -41,7 +41,7 @@ <h1><span class="logo">&#9670;</span> VQL Playground</h1>
autocomplete="off"
autocorrect="off"
autocapitalize="off"
placeholder="-- Enter your VQL query here&#10;SELECT GRAPH, VECTOR&#10;FROM HEXAD&#10;WHERE name = 'example'&#10;LIMIT 10"
placeholder="-- Enter your VCL query here&#10;SELECT GRAPH, VECTOR&#10;FROM HEXAD&#10;WHERE name = 'example'&#10;LIMIT 10"
></textarea>
</div>
<div class="toolbar">
Expand All @@ -61,17 +61,17 @@ <h1><span class="logo">&#9670;</span> VQL Playground</h1>
<span id="output-format">table</span>
</div>
<div id="output">
<span class="output-info">Welcome to the VQL Playground!
<span class="output-info">Welcome to the VCL Playground!

VQL (VeriSim Query Language) is the native query interface for VeriSimDB,
VCL (VeriSim Query Language) is the native query interface for VeriSimDB,
the octad multimodal database with drift detection and self-normalisation.

Octad modalities: GRAPH, VECTOR, TENSOR, SEMANTIC, DOCUMENT, TEMPORAL, PROVENANCE, SPATIAL

When verisim-api is running on localhost:8080, queries execute against the real backend.
Otherwise, demo mode simulates responses offline.

Toggle VQL-DT mode for dependent-type features including:
Toggle VCL-DT mode for dependent-type features including:
- PROOF clause (11 types: EXISTENCE, INTEGRITY, CONSISTENCY, PROVENANCE, FRESHNESS, etc.)
- THRESHOLD constraints
- Multi-proof composition: PROOF A AND B AND C
Expand All @@ -83,7 +83,7 @@ <h1><span class="logo">&#9670;</span> VQL Playground</h1>
</main>

<div class="status-bar" id="status-bar">
<span id="status-mode">Mode: VQL</span>
<span id="status-mode">Mode: VCL</span>
<span>playground.verisimdb.org</span>
<span id="status-connection">Demo mode (offline)</span>
</div>
Expand Down
6 changes: 3 additions & 3 deletions playground/public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "VQL Playground",
"short_name": "VQL Play",
"description": "Interactive VQL query editor for VeriSimDB with VQL-DT mode",
"name": "VCL Playground",
"short_name": "VCL Play",
"description": "Interactive VCL query editor for VeriSimDB with VCL-DT mode",
"start_url": "/",
"display": "standalone",
"background_color": "#0f172a",
Expand Down
Loading
Loading