Entity / API

foldkit-entity/conformance

The conformance suite for a query body: what data-query-DESIGN §6.0.1 says each operator means, as cases an interpreter can be run against.

Exported rather than kept in this repository's tests, because the interpreter most worth checking against it is one written elsewhere: run every case through yours and compare the ids, in order, against expected.

§18 names portable-kernel conformance as what the reference interpreter is for. This is that, extracted: one set of cases, run against every interpreter rather than each interpreter having its own tests that happen to agree. foldkit-remote-server runs them over rows in memory; foldkit-remote-drizzle compiles them to SQL and runs them against a real SQLite. A body that means two things fails in whichever is wrong.

The cases are chosen to make interpreters disagree, which is the only kind that tests anything. A fixture whose values are all lowercase cannot tell a case-sensitive contains from a case-insensitive one — that is not a hypothetical, it is how contains reached a released package meaning three different things.

Namespaces

Functions

checkOperationRun generated checks for every claim declared on op against table, returning a report and Temporal.Discharges for the obligations registry. Idempotence,…
lawObligationsCollect every law obligation reachable from a Language, Machine, Transition, Expr, or list of Operations, for each OperationImplementations table (and…
relationalContextWhat a case's Expr.viewer reads: who asks, or a visitor where nobody does.

Values

cases
heldWorldsWhat a holder might have, first everything the reader may see. Each later one lacks something a case reads, so some judgement in it is unknown.
OutcomeWhat an implementation said of one call: a value, or that it refused it.
primitiveCasesBodies calling the kernel's primitive operators (Text.startsWith, Expr.add, Expr.sub). An interpreter runs these once it implements them: the in-memory one…
primitiveRefusalsAs refusals, for bodies calling the kernel's primitive operators.
refusals
RelationalA member is on a team or none; a badge is a member's; a pin is a team's. Stored as foreign keys named after each relation plus _id.
relationalCases
relationalTables
rows
SubjectThe one Entity every case reads, with a column of each kind that matters.
Variant
variantCases
variantRows

Interfaces

ConformanceCase
ConformanceRefusalA body whose answer no two interpreters agree on, so every interpreter must refuse it rather than answer. Run each through yours and expect a failure.
ConformanceRowHow a row looks to an interpreter reading values, and to SQL as a table. The index signature is what lets one be read by key without a cast, which is how an…
DisagreementA call the implementations did not agree on, with what each said.
HeldWorldThe tables a holder has, from what the reader may see of each, and which rows it judges.
OperatorReport
RelationalCase
RelationalTableOne Entity's rows: those the reader may see, and those its visibility rule hides.
VariantRowA stored row: every field of every case, null where the row is of another.

Types

RelationalRowA row as the suite writes one: fields, and each one relation as the id it points at.
RunnerOne way to run a call: its value, or a throw for a call it refuses. A call of a predicate answers its truth, unknown as null.