Entity / Expressions
Where you write an expression and who answers it
| Question you express | Declared with | Interpreted by |
|---|---|---|
| Which rows a list holds and in what order | Query.where, Query.orderBy | Server SQL; page when placing written rows |
| Which state a row is in | Entity.refine | Queries and writes referencing that state |
| What every stored row must hold | Entity.invariant | Server writer, SQL CHECK, page, and forms |
| Whether a specific write applies now | Write.update(..., { when }) | Writer WHERE clause and page pre-check |
| Who may read or write a row | foldkit-guard rule | Server SQL and client may hints |
| Reusable domain predicate | Expr.operator | Any interpreter supporting its body |
foldkit-entity defines the expression language and its reference evaluator. Authority stays with the server: the server decides list membership and commits writes, while client evaluations serve as immediate UI previews replaced when the server responds.