F+Foldkit Plus
HomeLearnPackagesComponentsPrimitivesDemosBlogGitHub ↗

Metakit

Guides

@doeixd/metakit

  • Overview
  • Before and after
  • What the example did
  • Subpaths by where code runs
  • Next

Why rules should be data

  • Overview
  • The cliff: opaque JavaScript closures
  • The natural extension: keep Effect Schema, make the rules data
  • Five implications you get from that single change

Write a rule once

  • Overview
  • 1. Attach an inspectable invariant to an Effect Schema
  • 2. Generate SQL CHECK and WHERE from the same rule
  • 3. Declare a guarded transition and disable actions early
  • 4. Prove that every transition preserves the schema invariants
  • 5. Write a generic helper over a Schema

Domain types and row aggregates

  • Overview
  • Currency-safe money (Money) and fixed-scale decimals (Decimal)
  • Timezone-free dates (CalendarDay)
  • Ordered statuses (OrderedEnum)
  • Row aggregates (@doeixd/metakit/aggregates)

Prune SSR payloads and gate queries

  • Overview
  • Compute static affectedBy maps and dead bindings
  • Build one machine from the machines of its parts
  • Shrink SSR resume payloads (Graph.pruneStatic)
  • Gate dependent queries (queryReadiness)

Verify a state machine

  • Overview
  • Pin critical transitions and allow opaque ones explicitly
  • What causes report.ok to be false
  • A rule over text stays undecided
  • A transition is refuted by a null, or by a number past 2^53 − 1
  • Prove.* fails with SolverUnavailableError
  • Prove only what changed since the last run
  • Reading a counterexample witness

What a proof of one step cannot check

  • Overview
  • Refuse a store that cannot hold a rule
  • List the orders a proof leaves open
  • Discharge an obligation with a walk

API

  • @doeixd/metakit
  • @doeixd/metakit/abstract
  • @doeixd/metakit/domain
  • @doeixd/metakit/aggregates
  • @doeixd/metakit/aggregates/sql
  • @doeixd/metakit/artifact
  • @doeixd/metakit/drizzle
  • @doeixd/metakit/fn
  • @doeixd/metakit/machine
  • @doeixd/metakit/inspect
  • @doeixd/metakit/interpreter
  • @doeixd/metakit/graph
  • @doeixd/metakit/graph/match
  • @doeixd/metakit/graph/prune
  • @doeixd/metakit/graph/readiness
  • @doeixd/metakit/policy
  • @doeixd/metakit/operation
  • @doeixd/metakit/operation/sql
  • @doeixd/metakit/language
  • @doeixd/metakit/language/sql
  • @doeixd/metakit/store
  • @doeixd/metakit/store/check
  • @doeixd/metakit/syntax
  • @doeixd/metakit/pairs
  • @doeixd/metakit/temporal
  • @doeixd/metakit/tooling
  • @doeixd/metakit/sql
  • @doeixd/metakit/sql/stored
  • @doeixd/metakit/prove
  • @doeixd/metakit/conformance
  • @doeixd/metakit/build
  • @doeixd/metakit/relation

Open source, MIT
Foldkit 0.170 · Effect 4

Metakit / @doeixd/metakit/store/check

checkStoreEffect

function · packages/metakit/src/storeCheck.ts:97

function checkStoreEffect<E, R>(
  declared: StoreCapabilities,
  adapter: EffectStoreAdapter<E, R>,
  options?: {
    readonly runs?: number
  },
): Effect.Effect<StoreReport, E, R>

Effect-native store capability probe: opens two Scope-managed connections per run and races concurrent writers against declared StoreCapabilities.

Previous@doeixd/metakit/store/check

Edit on GitHub ↗

This site is a Foldkit Plus application, rendered at build time with foldkit-ssr. Its source

FoldkitEffectGitHub

Menu

HomeLearnPackagesComponentsPrimitivesDemosBlogGitHub ↗

Metakit

Guides

@doeixd/metakit
  • Overview
  • Before and after
  • What the example did
  • Subpaths by where code runs
  • Next
Why rules should be data
  • Overview
  • The cliff: opaque JavaScript closures
  • The natural extension: keep Effect Schema, make the rules data
  • Five implications you get from that single change
Write a rule once
  • Overview
  • 1. Attach an inspectable invariant to an Effect Schema
  • 2. Generate SQL CHECK and WHERE from the same rule
  • 3. Declare a guarded transition and disable actions early
  • 4. Prove that every transition preserves the schema invariants
  • 5. Write a generic helper over a Schema
Domain types and row aggregates
  • Overview
  • Currency-safe money (Money) and fixed-scale decimals (Decimal)
  • Timezone-free dates (CalendarDay)
  • Ordered statuses (OrderedEnum)
  • Row aggregates (@doeixd/metakit/aggregates)
Prune SSR payloads and gate queries
  • Overview
  • Compute static affectedBy maps and dead bindings
  • Build one machine from the machines of its parts
  • Shrink SSR resume payloads (Graph.pruneStatic)
  • Gate dependent queries (queryReadiness)
Verify a state machine
  • Overview
  • Pin critical transitions and allow opaque ones explicitly
  • What causes report.ok to be false
  • A rule over text stays undecided
  • A transition is refuted by a null, or by a number past 2^53 − 1
  • Prove.* fails with SolverUnavailableError
  • Prove only what changed since the last run
  • Reading a counterexample witness
What a proof of one step cannot check
  • Overview
  • Refuse a store that cannot hold a rule
  • List the orders a proof leaves open
  • Discharge an obligation with a walk

API

  • @doeixd/metakit
  • @doeixd/metakit/abstract
  • @doeixd/metakit/domain
  • @doeixd/metakit/aggregates
  • @doeixd/metakit/aggregates/sql
  • @doeixd/metakit/artifact
  • @doeixd/metakit/drizzle
  • @doeixd/metakit/fn
  • @doeixd/metakit/machine
  • @doeixd/metakit/inspect
  • @doeixd/metakit/interpreter
  • @doeixd/metakit/graph
  • @doeixd/metakit/graph/match
  • @doeixd/metakit/graph/prune
  • @doeixd/metakit/graph/readiness
  • @doeixd/metakit/policy
  • @doeixd/metakit/operation
  • @doeixd/metakit/operation/sql
  • @doeixd/metakit/language
  • @doeixd/metakit/language/sql
  • @doeixd/metakit/store
  • @doeixd/metakit/store/check
  • @doeixd/metakit/syntax
  • @doeixd/metakit/pairs
  • @doeixd/metakit/temporal
  • @doeixd/metakit/tooling
  • @doeixd/metakit/sql
  • @doeixd/metakit/sql/stored
  • @doeixd/metakit/prove
  • @doeixd/metakit/conformance
  • @doeixd/metakit/build
  • @doeixd/metakit/relation

Open source, MIT
Foldkit 0.170 · Effect 4