omgbase-surface
The omgbase surface, Rust implementation of spec/surface:
what a client sees of an omgbase repository.
- The query binding (
context,query): anoqxDataContextoveromgbase_store::Store— thedocs/blocks/nodes/edgesroots,$repo, the per-target intrinsics, reach-through and relations, the property rule (spec/properties), the row functions (text,under,within,has_edge,semantic, …) — and the §1.4 runner:{ id, path }injection,distinctby projection, top-levellimit/offset, keyset paging with the base64url cursor,values, the consumer scalars, error normalization tofilter_invalid. - The pushdown planner (
planner,translate): the tier-3 seam ofoqx(QueryPlanner/Plan/ROWS_ROOT) over the store — a simple top-level scan's pushablewhereconjuncts ($pathand the mapped intrinsics, doc columns and scalar properties,attrs.<k>and flattened attrs viajson_extract,==/!=as null-safeIS/IS NOT, the relational ops, case-sensitivestartsWith/endsWith/contains) become one SQL statement; the residual finishes in memory over the produced rows. Invisible by construction:tests/spec.rsruns every corpus-backed query case planned AND in memory and fails on any difference, andtests/conformance.rsdoes the same over the reference's conformance list.QueryOptions::in_memoryforces the pure in-memory engine. - Reads (
read):resolve_ref,docs_read(_many),docs_read_at,nodes_get(_many)at the five resolutions, thedocs_outlinewire format,docs_list/docs_treepaging. - History (
history):history_node, block-graindiff, the Myers unifieddiff_unified(unified_diffis the pure text → text function),docs_history;changes_sinceis the store's. - The tool catalog (
catalog):Surface— every tool of the §4 table with its JSON-schema input, repo scoping by slug, server-side ref and heading resolution, CAS pinning, the{ error, message, data?, retriable }envelope,origin.actor = "agent:mcp", a post-mutation hook that dry runs never fire. Transport-agnostic: theomgbasebinary serves it over MCP stdio.
use Store;
use Surface;
use json;
let mut store = open_in_memory?;
let repo = store.create_repo?;
let mut surface = new;
surface.call;
let res = surface.call;
assert_eq!;
# Ok::
Conformance
tests/spec.rs runs every fixture under spec/surface/cases: the
corpus-backed query suites (the reference's alchemy repository observed with
the fixture minter; each query planned and in memory, which must agree),
reads.json (observation scripts whose read steps call the catalog
in-process) and cursor.json; interop.json (§7, run by the omgbase
binary's tests/interop.rs) is shape-checked and skipped. While the port runs behind
the fixtures, tests/spec-passing.txt names the cases that must pass;
SURFACE_SPEC_UPDATE=1 cargo test -p omgbase-surface --test spec rewrites
it. SPEC_VERSION tracks spec/surface/VERSION.
License
MIT.