Skip to main content

ruledsl

Python binding and desktop workbench for RuleDSL — a deterministic, embedded business-rule engine with a stable C ABI. Same input, same bytecode, same decision — on every run and every platform.

This package is pure Python (ctypes, zero dependencies). The engine library itself (ruledsl_capi.dll / libruledsl_capi.so) is not inside — download an SDK bundle from GitHub Releases and point the binding at it.

The workbench — authoring & replay companion

pip install ruledsl
ruledsl-workbench --dll path/to/ruledsl_capi.dll

A zero-dependency Tkinter desktop tool for the two human ends of the rule pipeline (it is not a server component — servers embed the C ABI directly):

  • Authoring: edit a ruleset (or File > Open Rules…), run it against sample inputs, read the decision, its output fields, the engine's own evaluation trace (why this decision), and a canonical decision hash. Run 100× asserts every run produced the identical hash — the determinism contract, live.
  • Replay: File > Open Bytecode (Replay)… loads a compiled .axbc exactly as your server ran it (no recompilation; the editor is disabled), and File > Load Inputs from JSON… restores an incident's inputs. Same bytecode, same input → the same decision and trace, on your desk.
  • Deliberately no .axbc export: production artifacts come from ruledslc, which stamps the authenticity manifest.

The binding

from ruledsl import RuleDSL

with RuleDSL("path/to/ruledsl_capi.dll") as engine:   # .so on Linux
    bytecode = engine.compile('rule r1 { when amount > 100; then decline; }')
    decision = engine.evaluate(bytecode, {"amount": 250.0})
    print(decision.action, decision.rule_name)         # DECLINE r1

    trace = []
    engine.evaluate(bytecode, {"amount": 250.0}, on_trace=trace.append)
    print("\n".join(trace))                            # why this decision

Deterministic by contract: the engine never reads the system clock (time-based rules require an explicit now_utc_ms), never touches the network, and returns stable, append-only error codes.

The MCP server — optional [mcp] extra (EXPERIMENTAL)

pip install "ruledsl[mcp]"
ruledsl-mcp --rules path/to/rules --decision-log decisions.jsonl --engine-lib path/to/libruledsl_capi.so

An MCP (Model Context Protocol) stdio server that lets an AI agent invoke deterministic rule evaluation — never produce the decision itself. Exactly three tools (list_rules, evaluate_case, engine_info), a hash-verified rule-library manifest, a mandatory explicit now_utc_ms (the server never reads a clock), and a canonical JSONL decision log with a replayable decision_hash per decision. Requires Python 3.10+; setup and Claude Desktop configuration: MCP quickstart.

Changelog

  • 1.1.0 — MCP server migrated into the package as the optional [mcp] extra + ruledsl-mcp console command (EXPERIMENTAL). Base package unchanged and still zero-dependency.
  • 1.0.3 — workbench: Cases batch runner (JSON/JSONL) + humane explicit clock (ISO-8601 ⇄ epoch-ms echo, Now (UTC) button).
  • 1.0.2 — first public release: binding (on_trace, cached buffers) + workbench (authoring, replay, JSON inputs).

Version & license

Package 1.x targets engine 1.0.x (ABI 1); the minor version moves when the package itself gains capability (e.g. 1.1.0 added the [mcp] extra). Licensed under the PolyForm Free Trial License 1.0.0 — evaluation use; commercial production use requires a separate agreement (see the repository).

Metadata

Release files for ruledsl 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ruledsl 1.1.0
File Size Uploaded
ruledsl-1.1.0.tar.gz 28.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ruledsl 1.1.0
File Interpreter ABI Platform
ruledsl-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 56.7 kB

Release files / ruledsl-1.1.0.tar.gz

Download URL ruledsl-1.1.0.tar.gz
Size 28.3 kB
Tags Source
SHA-256 checksum
How to use checksums
dc5dbf8004dbbe47bc2a5dd8ff339f2f5ce1cc66f580291dea0593a25f1c32bf
BLAKE2b-256 checksum
How to use checksums
8af297cde4881feb40cc19028ea77c22a36557875be9590067b2f9a234fafeee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.

Transparency log

Release files / ruledsl-1.1.0-py3-none-any.whl

Download URL ruledsl-1.1.0-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fb2e1b0b2535e32fcfa55a591b37863118d7fac6b2fbf09b6cfc439cbbfbab28
BLAKE2b-256 checksum
How to use checksums
808cc9a645fbdbe25a124bddf7ab626f53707bc58540552dfe2cfe7a65a676ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 1, 2026.

Transparency log

Release history Release notifications | RSS feed

1.2.0

2 release files

1.1.1

2 release files

This release

1.1.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page