RIL Database-Language Frontend (L0)
B827 stage L0 is the planned database-language frontend for RIL. This is a
source-only design and evidence boundary, not a product interface, release,
or customer-installation claim. ready: false until the owner repository
ships and proves the parser, checker, compiler, and conformance suite below.
Ownership And Boundary
retvest-rilowns the RIL DATA grammar, parser, static type system, provenance semantics, Postgres planner, and conformance fixtures.retvest-platformowns the temporary hidden Postgres bootstrap engine in production: tenant isolation, roles, migrations, backup/restore, observability, and deployment evidence.retvest-siteowns this public boundary and its claim guard. It does not implement, compile, execute, or attest RIL DATA programs.
L0 adds no public HTTP endpoint, OpenAPI operation, SDK method, or direct SQL escape hatch. Postgres is the temporary hidden bootstrap engine; callers must not depend on Postgres schema, credentials, dialect, or planner output.
Target L0 Input Model
The target RIL DATA surface defines provenance-native tables and three governed operation families:
DATA TABLE <table> {
<column>: <scalar type>
PROVENANCE agent, authority, evidence
}
DATA INSERT <table> WITH AUTHORITY <authority> EVIDENCE <evidence>
DATA READ <table> WHERE <typed predicate>
DATA QUERY <typed projection> FROM <table> WHERE <typed predicate>
This sketch describes the acceptance target, not accepted user syntax. The checker must reject unknown tables or fields, duplicate definitions, invalid scalar values, unbound provenance, cross-tenant references, and operations without the required authority and evidence. It must fail closed before a planner can emit SQL.
Compiler Contract
The L0 planner compiles only checked RIL DATA operations to parameterized Postgres statements and an explicit parameter list. Table and column names come only from the checked schema; user values never become SQL text. Accepted writes bind tenant, agent, authority, and evidence metadata in the same governed transaction. Reads and queries always receive a tenant predicate from the checked operation; an unscoped or ambiguous query is a checker error.
The target is a Gel/EdgeDB-style separation between language semantics and temporary storage implementation. Raw SQL, direct Postgres connections, and backend-specific behavior are outside the L0 language contract.
Required Conformance Evidence
Promotion requires an executable retvest-ril conformance suite that proves:
- grammar-to-AST round trips preserve each valid L0 program;
- checker denials for malformed, ambiguous, untyped, cross-tenant, and provenance-missing operations leave no executable plan;
- valid DEFINE, INSERT, READ, and QUERY programs compile deterministically to parameterized Postgres plans with tenant and provenance bindings; and
- an independent real-Postgres round trip observes exactly the governed rows selected by the compiled plan, while a deliberate planner mutation or missing tenant predicate makes the conformance test fail.
The initial load assumption is no more than 10 DATA operations per second per tenant, with checked reads p99 below 300 ms and writes p99 below one second. The design chooses consistency over availability: a parser, type, authority, or Postgres uncertainty rejects the operation rather than guessing. A Postgres outage is a fail-closed write error and a bounded unavailable read; no cache is an authorization source.
Deliberate Non-Goals
L0 does not start an own-engine effort (RocksDB, Pebble-class storage, or Rust). It also does not claim package availability, a production deployment, database portability, automatic migration, performance at scale, or an "only RIL" customer workflow. Those are later stages after L0 adoption and owner evidence.
Promotion Boundary
Do not describe L0 as implemented, shipped, production-ready, generally available, or usable by customers. Promotion needs the owner conformance output, real-Postgres integration proof, platform operational evidence, and a claim-ledger and launch-readiness update. Public examples must remain metadata-only and must never include tenant data, credentials, evidence bodies, or planner SQL containing customer values.