The README makes claims. This file backs them up.
VeriSimDB does not merely store records. It maintains identity consonance across modal witnesses and federation boundaries. VCL expresses propositions and epistemic requests over that consonance state. VCL-total validates whether proposed identity transitions are admissible.
-
VeriSimDB — the federated consonance engine; maintains identity consonance across the octad of modal witnesses (graph, vector, tensor, semantic, document, temporal, provenance, spatial).
-
VCL — the production consonance language: propositions (
DECLARE/ASSERT/RETRACT) and epistemic requests (INSPECT/VERIFY), plusMERGE/SPLIT/NORMALISE. It is not SQL-with-types and not queries against a passive store. -
VCL-total — this project: the proof-bearing safety substrate behind VCL. It decides whether a proposed identity transition is admissible — well-formed, type-safe, authorised, resource-safe, proof-supported — before it affects live consonance state. The 10 type-safety levels below are how it proves that.
Claim 1: "Satisfies all 10 levels of type safety — the 6 established IO-covered forms and 4 additional forms identified through research"
How it works: VCL-total layers a progressive type-safety pipeline. Levels 1-6 (parse-time, schema-binding, type operations, null-tracking, injection-proof, result-type) are implemented in the Idris2 type checker (src/interface/abi/VQLType.idr) as dependent types. Parse-time safety uses a total parser (Idris2 %default total, no partiality). Schema-binding binds column references to Idris2 dependent records indexed by schema version. Null-tracking threads nullable flags through type-level join algebra. Injection-proof uses parameterized query types that forbid string interpolation by construction. Levels 7-10 (cardinality, effect-tracking, temporal, linearity) use quantitative type theory (QTT) on connection handles, session types for transaction state, modal types for world/scope-indexed queries. The ReScript parser extends VeriSimDB’s surface syntax; the Zig FFI codegen produces C-ABI transition plans that VeriSimDB’s octad (8-modal) consonance engine executes.
Caveat: Levels 7-10 are research-level and incompletely proven. Cardinality inference may have false negatives on complex aggregations. Temporal safety assumes monotonic clocks (breaks on time skew). Linearity is enforced syntactically but not yet proven to match Idris2’s QTT semantics. For production, restrict to levels 1-6 (proven on 49 test cases).
Evidence: src/interface/abi/VQLType.idr defines levels 1-6 with %default total; src/interface/abi/VQLCardinality.idr and src/interface/abi/VQLLinear.idr define levels 7, 10 (incomplete). src/parser/ extends VCL parser. src/interface/ffi/codegen.zig emits query plans. Tests in tests/ cover all 10 levels.
How it works: When a user writes SELECT * FROM users PROOF ATTACHED theorem_name, the parser tags the query with proof metadata. The type checker looks up theorem_name in the proof store and type-checks the proof against the query’s result type. If the proof type-checks in Idris2, a ProvedResult sigma type is returned; otherwise, a compile-time error blocks execution. The 6 proof types (EXISTENCE, INTEGRITY, CONSISTENCY, PROVENANCE, FRESHNESS, AUTHORIZATION) are Idris2 propositions with constructors matching their semantics. This ensures queries are executed only when supporting evidence is present.
Caveat: Proof attachment is manual—users must write proofs. Automated proof synthesis would ease adoption but is beyond current scope. Proof validation happens at compile-time, not runtime, so a mismatch between proof and actual data is undetected.
Evidence: src/interface/abi/VQLProof.idr defines proof types (ExistenceProof, IntegrityProof, etc.). Parser in src/parser/ recognizes PROOF clause. Type checker in src/interface/abi/VQLChecker.idr validates proof attachment. Tests in tests/proof_*.rescript demonstrate all 6 proof types.
| Technology | Learn More |
|---|---|
Idris2 |
Dependent types, totality checking, quantitative type theory (levels 1-10) |
Zig |
FFI codegen to C ABI (zero-copy result sets) |
ReScript |
Parser extending VeriSimDB VCL grammar |
zig |
REST/gRPC/GraphQL API layer |
VeriSimDB |
octad (8-modal) consonance engine execution target |
| Path | Purpose |
|---|---|
|
Idris2 ABI (THE TRUTH): type system, levels 1-10, proof types |
|
Core type checker: parse-time, schema-binding, operations, nullability, injection, results (L1-L6) |
|
Cardinality inference with exactly-one/at-most-one/many (L7) |
|
Read/Write/DDL effects as tracked monad (L8) |
|
Bi-temporal and system-time query bounds (L9) |
|
Linear types on connections and transactions (L10, incomplete) |
|
Proof types: EXISTENCE, INTEGRITY, CONSISTENCY, PROVENANCE, FRESHNESS, AUTHORIZATION |
|
Zig FFI bridge |
|
Compiles type-checked query AST to C-ABI query plan |
|
Marshals query plans to VeriSimDB engine, unmarshals results |
|
ReScript parser extending VeriSimDB VCL surface syntax |
|
Lexer + parser for .vcltotal files, PROOF clause support |
|
zig API layer for external clients |
|
REST endpoint bindings (HTTP API) |
|
gRPC service definitions |
|
GraphQL schema bindings (if enabled) |
|
Test suite: 49 passing tests covering L1-L10 |
|
Level 1: parse-time safety (syntax errors caught) |
|
Level 2: schema-binding (column name mismatch caught) |
|
Level 3: type-incompatible operations (string + int rejected) |
|
Level 4: null-tracking (nullable field projections guarded) |
|
Level 5: injection-proof (parameterized queries only) |
|
Level 6: result-type safety (type known at compile-time) |
|
Level 7: cardinality (exactly-one vs many inferred) |
|
Level 8: effect-tracking (write queries refused in pure context) |
|
Level 9: temporal bounds (time-skew detection) |
|
Level 10: linearity (use-after-close impossible) |
|
Proof attachment tests (all 6 proof types) |
| Project | Integration | | panic-attacker | Scans VCL-total parser for injection vulnerabilities in PROOF clause parsing | verisimdb | VCL-total is the proof-bearing safety substrate for VeriSimDB’s octad (8-modal) consonance engine | typell | VCL-total instantiates TypeLL’s 10-level framework for database queries | panll | PanLL panels visualize VCL-total query execution with proof status