Entity / One domain declaration

Who owns what across the domain

ResponsibilityOwner
Product fields, relations, derived countsfoldkit-entity (define, relate, derived)
Single-field format rulesEffect Schema on the field
Cross-field and transition invariantsfoldkit-entity (Entity.invariant)
Named lifecycle statesfoldkit-entity (Entity.refine)
Operation-level writes and preconditionsDeclared Write (Mutation.update / Write)
Filtered and sorted queriesQuery and Expr declarations
Read and write authorization rulesfoldkit-guard using the same Expr
SQL tables and column mappingsServer (foldkit-remote-drizzle's bind)
Browser row cache and optimistic layersClient (foldkit-remote in Model)
Form drafts and submit validationfoldkit-form in parent Model
Editor open state and save statusfoldkit-crud reading Remote

Two boundaries keep the domain predictable:

  • Declarations stay explicit: Adding an Entity or relation adds no automatic endpoints or CRUD lists; every query and write exists only where you declare it.
  • The server writer decides: Client evaluations and forms compute early hints and optimistic layers from the same rules, while the server's database statement makes the binding decision.