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
checkOperation | Run generated checks for every claim declared on op against table, returning a report and Temporal.Discharges for the obligations registry. Idempotence,… |
lawObligations | Collect every law obligation reachable from a Language, Machine, Transition, Expr, or list of Operations, for each OperationImplementations table (and… |
relationalContext | What a case's Expr.viewer reads: who asks, or a visitor where nobody does. |
Values
cases | |
heldWorlds | What 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. |
Outcome | What an implementation said of one call: a value, or that it refused it. |
primitiveCases | Bodies calling the kernel's primitive operators (Text.startsWith, Expr.add, Expr.sub). An interpreter runs these once it implements them: the in-memory one… |
primitiveRefusals | As refusals, for bodies calling the kernel's primitive operators. |
refusals | |
Relational | A 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 | |
Subject | The one Entity every case reads, with a column of each kind that matters. |
Variant | |
variantCases | |
variantRows |
Interfaces
ConformanceCase | |
ConformanceRefusal | A 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. |
ConformanceRow | How 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… |
Disagreement | A call the implementations did not agree on, with what each said. |
HeldWorld | The tables a holder has, from what the reader may see of each, and which rows it judges. |
OperatorReport | |
RelationalCase | |
RelationalTable | One Entity's rows: those the reader may see, and those its visibility rule hides. |
VariantRow | A stored row: every field of every case, null where the row is of another. |
Types
RelationalRow | A row as the suite writes one: fields, and each one relation as the id it points at. |
Runner | One 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. |