Metadata-Version: 2.4
Name: ruledsl
Version: 1.0.2
Summary: Python binding and desktop workbench (authoring & replay companion) for the RuleDSL deterministic rule engine. The engine library ships separately via GitHub Releases.
Author: Tanzer Cakir
License: Copyright (c) 2025 Tanzer Cakir
        Licensor: Tanzer Cakir
        
        The RuleDSL SDK is provided under the PolyForm Free Trial License 1.0.0.
        The complete, unmodified license text follows. Commercial production use
        requires a separate commercial license agreement with the Licensor.
        
        ----------------------------------------------------------------------
        
        # PolyForm Free Trial License 1.0.0
        
        <https://polyformproject.org/licenses/free-trial/1.0.0>
        
        ## Acceptance
        
        In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
        
        ## Copyright License
        
        The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose.  However, you may only make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license), and you may not distribute copies of the software.
        
        ## Changes and New Works License
        
        The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
        
        ## Patent License
        
        The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
        
        ## Fair Use
        
        You may have "fair use" rights for the software under the law. These terms do not limit them.
        
        ## Free Trial
        
        Use to evaluate whether the software suits a particular application for less than 32 consecutive calendar days, on behalf of you or your company, is use for a permitted purpose.
        
        ## No Other Rights
        
        These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else.  These terms do not imply any other licenses.
        
        ## Patent Defense
        
        If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
        
        ## Violations
        
        If you violate any of these terms, or do anything with the software not covered by your licenses, all your licenses end immediately.
        
        ## No Liability
        
        ***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
        
        ## Definitions
        
        The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
        
        **You** refers to the individual or entity agreeing to these terms.
        
        **Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization.  **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise.  Control can be direct or indirect.
        
        **Your licenses** are all the licenses granted to you for the software under these terms.
        
        **Use** means anything you do with the software requiring one of your licenses.
        
Project-URL: Homepage, https://axiom-foundry.github.io/RuleDSL-SDK/
Project-URL: Repository, https://github.com/axiom-foundry/RuleDSL-SDK
Project-URL: Demos, https://axiom-foundry.github.io/RuleDSL-SDK/demos/
Project-URL: Releases, https://github.com/axiom-foundry/RuleDSL-SDK/releases
Keywords: rules,rule-engine,deterministic,bytecode,decisioning,compliance
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# ruledsl

Python binding and desktop **workbench** for [RuleDSL](https://axiom-foundry.github.io/RuleDSL-SDK/) —
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](https://github.com/axiom-foundry/RuleDSL-SDK/releases)
and point the binding at it.

## The workbench — authoring & replay companion

```sh
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

```python
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.

## Version & license

Package versions track the SDK line (`1.0.x` works with engine `1.0.x`, ABI 1).
Licensed under the **PolyForm Free Trial License 1.0.0** — evaluation use;
commercial production use requires a separate agreement (see the
[repository](https://github.com/axiom-foundry/RuleDSL-SDK)).
