Skip to content
ContractSpec
Start here

Package manual · platform

·Governance, decisions and approvals

lib.decision-runtime

Deterministic, effect-free DecisionGraph and PredicateSpec runtime.

platformlibraryv2.0.4experimentalservernode
@lssm-tech/lib.decision-runtime
bun add @lssm-tech/lib.decision-runtime
Package source ↗Manifest ↗

Manifest declarations describe the current workspace; they do not verify registry publication or runtime execution.

Package guide

Effect-free runtime for the shared PredicateSpec and immutable DecisionGraphRevision contracts. It validates graphs before execution, produces replayable traces, pins subgraphs by revision and digest, and never evaluates creator-authored code.

This runtime owns branching only. Operations and other business effects remain owned by workflow and product runtimes.

The ./form-decision-graph entry owns Forms document/decision-graph conversion. It uses the canonical Forms document types and local graph validation, preserves page predicates and immutable revision pins, and forwards the legacy contracts-spec/forms/platform-decision-graph identity. FormsRuntime does not depend on this adapter, keeping the package graph acyclic.

evaluateDecisionGraph requires an injected feature gate and fails closed on support.decisioning before validation or evaluation begins. It enforces bounded and cycle-safe inputs, graph and predicate complexity ceilings, decision-table totality, deterministic priority ties, digest-pinned subgraphs, shared trace budgets, and a bounded subgraph depth. Predicate edges are always considered before default edges, independently of creator priority values.

compileDecisionGraphToWorkflow projects an immutable, digest-verified graph into typed Workflow steps and predicates. It preserves deterministic branch order, emits no trusted expression strings, pins subgraphs, and creates effects only for exact outcome operation revisions present in a server-controlled allowlist. Workflow remains the execution and authorization authority.

Decisioning contracts

@lssm-tech/lib.decision-runtime/contracts and ./contracts/<leaf> own the decisioning contract family: evaluation and lifecycle operations, events, input/output/trace schemas, evidence administration, validation and the authority, input-protection, feature-gate and evidence-administration ports. Legacy @lssm-tech/lib.contracts-spec/decisioning imports forward to the same instances.

Relationships

THIS PACKAGElib.decision-runtime36 import paths

Arrows point from a package to its direct dependency. Counts are derived from captured workspace manifests.

7 declarations

Declared capabilities

Lib Decision Runtime

Deterministic, effect-free DecisionGraph and PredicateSpec runtime.

Scripts

  • buildcontractspec-bun-build build
  • build:bundlecontractspec-bun-build transpile
  • build:typescontractspec-bun-build types
  • cleanrimraf dist .turbo
  • lint:checknode ../../../../scripts/biome.cjs check .
  • testbun test
  • prebuildcontractspec-bun-build prebuild
  • typechecktsgo --noEmit