mdbase runtime

Runtime profile 0.2 adds durable workflow execution to the same record, event, and action contracts used by applications. It defines admission, persistence, retries, recovery, and outcomes for effects whose result cannot be known.

Runtime model

An application can consume a record type, publish an event, or provide an action without becoming a workflow engine. Each layer has one job.

1. Contracts

Record, event, and action artifacts share one identity, SemVer, JSON Schema, digest, registry, and conflict model.

2. Application interoperability

CloudEvents and action envelopes carry exact contract evidence. Source and provider declarations bind live implementations to artifacts. Events are multicast; actions resolve to one provider.

3. Workflow admission

A workflow names compatible contracts. Admission resolves and pins the exact event source, action provider, handler, versions, and digests that the run may use.

4. Execution and recovery

Runs, attempts, leases, checkpoints, timers, cursors, and outcomes survive crashes. The authorization host remains the final boundary for every dispatch.

Workflow requirements and admitted plans

Authors name behavior and a compatible version. The admitted plan records exact immutable bindings before any action runs.

type: runtime_workflow
id: canvas.zone.set-status
version: 1.0.0
name: Set status from canvas zone
enabled: true

triggers:
  - id: drop-on-status-zone
    event:
      id: canvas.drop
      version: ^1.0.0

steps:
  - id: patch-task-status
    action:
      id: mdbase.record.patch
      version: ^2.0.0
    provider:
      application: task-editor
    input:
      path:
        $expr: event.data.record.path
      patch:
        status:
          $expr: event.data.target.value
Compatibility and authorization

A matching schema or SemVer range never grants access. The runtime admits exact candidates, and the embedding host still authorizes the actual event delivery and action dispatch.

Standard runtime records

The mdbase.runtime.standard@0.2.0 pack supplies ordinary mdbase types, contracts, and JSON Schemas. Runtime state stays inspectable with the same collection tools as other records.

RecordsPurpose
runtime_workflow, runtime_policyPortable workflow intent, provider selection, and capability grants
runtime_run, runtime_action_attemptRun state, exact bindings, requests, attempts, and outcomes
runtime_checkpoint, runtime_timerRecovery position, leases, one-shot scheduling, and missed-run policy
runtime_diagnostic, runtime_dead_letterPortable failure evidence and work that needs operator attention

Open the workflow JSON Schema ยท Inspect the complete standard pack

Profiles and implementations

ProfileCovered behaviorDoes not imply
event_action_interop/0.1CloudEvents, declarations, validation, multicast, action resolution, and exact evidencePersistence, retries, timers, or workflow recovery
runtime/0.2Admission, deterministic execution, journals, attempts, leases, recovery, cancellation, and timersAuthorization or unrelated collection profiles
watchCollection change delivery and orderingPortable event contracts or durable workflow behavior

The TypeScript @callumalpass/mdbase-runtime package provides browser-safe record validation and admission. The Rust mdbase-runtime crate supplies durable in-memory, SQLite, and PostgreSQL execution.