Metakit / @doeixd/metakit
Subpaths by where code runs
| Import | Runs in | Purpose |
|---|---|---|
@doeixd/metakit | Browser / server | Path, Expr, Transition, Verdict, the 50-op core (Bool, Eq, Null, Ord, Num, Str, Arr + derived helpers), the folds over a list (Arr.any, Arr.sum, …), what each op, fold and way of writing keeps (opProperties, foldProperties, writeProperties). A path to an Option field reads as its value or null. |
@doeixd/metakit/abstract | Browser / server | The synchronous interval and zone checker (Abstract, with its Interval and Zone domains): it answers True, False or Unknown from the bounds of each field, with no Z3 boot. |
@doeixd/metakit/relation | Browser / server | Questions asked of the rows of another kind pointing at a row (Relation.any, every, count, sum, min, max, reduce), with Relation.withRows for typed in-memory evaluation; SQL writes each as a correlated subquery. |
@doeixd/metakit/fn | Browser / server | Fn.make and Fn.params define callable expression functions with optional input and output rules. |
@doeixd/metakit/operation | Browser / server | Declare a custom operation with Operation.define and bind JavaScript with Operation.implement. Use Operation.derived to name a checked function built with Fn. Define a custom operation. |
@doeixd/metakit/operation/sql | Server | Dialect-specific SQL & aggregate lowerings (lowering, lowerings, piece) for custom operations. |
@doeixd/metakit/language | Browser / server | Groups custom operations. Language.compose(a, b) merges two vocabularies and throws on a conflict. Language.complete checks that a JavaScript table implements every operation. Language.readiness(expr, target) returns a report of what the target supports. |
@doeixd/metakit/language/sql | Server | Checks that every operation in a language has a lowering for the chosen SQL dialect. |
@doeixd/metakit/syntax | Browser / server | Pipeable calls (dual, dualLanguage) and checks (testLanguage). |
@doeixd/metakit/artifact | Browser / server | encodeExpr and decodeExpr round-trip portable expressions. fingerprint hashes them, with the Schema each path reads, through Hash, whose rules Content hashes writes out so you can recompute a hash elsewhere. |
@doeixd/metakit/tooling | Dev / build | Index named definitions (SemanticIndex). manifest lists them by hash; semanticDiff of two manifests shows renames, changes and what they affect. |
@doeixd/metakit/domain | Browser / server | Currency-safe Money, fixed-scale Decimal (Decimal.mul and Money.mul round half-even in integers; evaluation, SQL on SQLite and Postgres, the checkers and Rows.sum read them, and a product past the safe range is refused), timezone-free CalendarDay, OrderedEnum, Text (text holding no NUL, which the checkers can prove rules over), and Domain.domainOf. |
@doeixd/metakit/aggregates | Browser / server | Rows.sum (of integers) and Rows.count, kept by O(1) deltas, and Rows.min, Rows.max, Rows.every, Rows.any, which rescan on a delete of the extreme. Imports no SQL. |
@doeixd/metakit/aggregates/sql | Server | RowsSql.toSql(aggregate, options): an aggregate as SQL, its value and whether evaluate refuses. |
@doeixd/metakit/machine | Browser / server | Declarative state machine (dispatch, TEA update, which returns the records a step emits, and footprints); Machine.intent(machine.transitions.Withdraw).can(partial) and Machine.affordances(machine, state) ask what a partial state allows; lift and compose build a parent machine from child machines. Machine.phases(State, state => state.phase) names the values of a string-literal field, or the variants of a union of Schema.TaggedStructs, as phases (phase.Editing); from(phase.Editing).to(phase.Closed) and .choose([...]) build the transitions between them, a variant entered with its fields given as with and written whole, its own fields reached through variant, and within(phase.Confirming, …) scopes a rule to one phase; and Machine.diagram, Machine.reachability and Machine.phaseTable draw the state diagram, list the phases the start cannot reach or never leaves, and say what each message does in each phase. |
@doeixd/metakit/interpreter | Browser / server | Interpreter runs evalExpr and step in Effect. withForeign supplies custom implementations. |
@doeixd/metakit/inspect | Browser / server | Form fieldSpecs and an enriched toJsonSchema, read straight off the Schema. |
@doeixd/metakit/graph | Build / SSR / planner | Static Graph.analyze (affectedBy, deadBindings), SSR Graph.pruneStatic, and Graph.queryReadiness. |
@doeixd/metakit/graph/match | Browser / server | pathsOverlap compares paths. affectedTags names transitions whose writes can affect a reader. |
@doeixd/metakit/graph/prune | Server | pruneStatic splits fixed values from live bindings and tracks the paths needed to resume. |
@doeixd/metakit/graph/readiness | Browser / server | queryReadiness fills in known parameters and checks if the remaining filter can be prepared. |
@doeixd/metakit/policy | Browser / server | Named rules over a row and a principal (Policy.make), and the synchronous checkImplication and checkConsistent. |
@doeixd/metakit/store | Server | What a store guarantees of concurrent writes (StoreCapabilities), and Store.mount, which throws where a store is set up to hold a rule it cannot. |
@doeixd/metakit/store/check | Dev / CI only | checkStore and checkStoreEffect race writers to test a store's declared isolation and locks. |
@doeixd/metakit/temporal | Dev / CI only | Temporal.requirements (what each rule needs of its store), Temporal.obligations (the pairs of transitions whose order a proof leaves open), and Temporal.walk, which runs a scenario's steps in seeded orders. |
@doeixd/metakit/pairs | Dev / CI only | Pairs.pairs (each pair of transitions whose footprints overlap, with Pairs.commutes' answer and the rule behind a True), Pairs.walkPair (both orders from generated states, compared), and Pairs.settle, which walks every pair and returns the result as evidence; Temporal.report(evidence) lists what is open, discharged and decided. |
@doeixd/metakit/sql | Server | Sql.toCheck, Sql.toWhere, Sql.toUpdate as text for Postgres and SQLite. A predicate selects the rows Expr.eval holds true, null included; rows related to a row are read from the tables you give as relations, and a list in a column is refused by name. |
@doeixd/metakit/sql/stored | Server / build | toCheck, toWhere, toValue and toUpdate of /sql, kept in an Artifact.EvidenceStore: a statement compiled before for an unchanged definition, dialect, options and compiler is read back instead of compiled. |
@doeixd/metakit/drizzle | Server (optional drizzle-orm) | Drizzle.toCheck, Drizzle.toWhere, Drizzle.toUpdate: the same lowering as Drizzle SQL over a Drizzle table. |
@doeixd/metakit/prove | Dev / CI only (optional z3-solver) | Prove.invariant, Prove.transition, Prove.policy, Prove.machine (pinning, allowUnknown, replayed counterexamples), and with an Artifact.EvidenceStore provided, only what changed is proved again. |
@doeixd/metakit/conformance | Dev / CI only | checkOpSoundness holds each of the 50 operators to one answer from evaluation, partial evaluation, Expr.judge and the Tier 3 checker over null, absent keys, NaN, the ends of the safe integer range and text holding a NUL; checkOpLowerings holds the Postgres and SQLite lowerings and the Z3 solver to the same answers through runners you pass; checkAllProperties, checkAllFoldProperties and checkAllWriteProperties check what the property tables declare against the evaluator; checkResidualizeSoundness does the same for an expression of yours over values sampled from its Schema; bundleVectors records, for a bundle and environments of its rule's Schemas, the answer a reader of the bundle must give for each call. |
@doeixd/metakit/build | Browser / server | The functions over nodes (wrap, toNode, call, evalNode, residualizeNode, judgeNode, readsOfNode), for a language that builds its own constructors on metakit. |
When to use something else
- Time, concurrency, retries, and I/O: use
Effectdirectly.Transitionis strictly single-step and synchronous; it returns records describing Commands (emits) rather than running effects. - Bidirectional URL or cookie codecs: use
effect/Schematransformations;Expris one-way. - UI trees, layout, and styling: keep DOM/CSS structure in your UI layer and embed
Expr/Transitionwhere you need derived values or disabled states.