tempus-engine 0.1.0

Deterministic rule execution for decision systems
Documentation

# Tempus Engine

Deterministic rule execution for decision systems.

Built on [jsonlogic-fast](https://github.com/JPatronC92/First-T-Engine) for portable, high-performance JSON-Logic evaluation.

## What Tempus adds over raw JSON-Logic

| jsonlogic-fast                  | Tempus Engine                              |
| ------------------------------- | ------------------------------------------ |
| Evaluate a rule against context | Execute rules with metadata and validation |
| Raw `serde_json::Value` output  | Structured decision results                |
| Performance-first               | Decision-systems-first                     |
| Stateless evaluation            | Foundation for audit, explain, governance  |

## Use cases

- **Fraud scoring** — block, review, or allow transactions based on risk signals
- **Credit eligibility** — approve/deny with deterministic, auditable logic
- **Dynamic pricing** — compute fees and discounts from rule definitions
- **Policy enforcement** — evaluate compliance rules across regulated workflows
- **Feature flags** — gate features with structured rule logic

## Quick start

### Prerequisites

- Rust 1.75+
- Python 3.10+
- [`uv`]https://docs.astral.sh/uv/

### Build and test

```bash
make setup        # Build Python bindings
make test         # Run Rust core tests
make test-python  # Run Python e2e tests (29 tests)
make test-wasm    # Run WASM runtime tests (15 tests)
make ci-local     # Full quality gate
```

## Architecture

```text
┌──────────────────────────────────────────────────┐
│              Tempus Engine (this repo)            │
│  Rule metadata · Rich validation · Domain demos  │
│  Foundation for: explain · audit · time layers   │
└────────────────────┬─────────────────────────────┘
                     │ depends on
┌────────────────────▼─────────────────────────────┐
│           jsonlogic-fast (separate repo)          │
│  Fast, embeddable, cross-runtime JSON-Logic eval  │
│  Rust core · Python bindings · WASM bindings      │
└──────────────────────────────────────────────────┘
```

## Repository structure

```text
Tempus-Engine/
├── engine/               # Rust crate: tempus-engine
│   └── src/
│       ├── lib.rs        # Re-exports jsonlogic-fast + Tempus extensions
│       └── metadata.rs   # Rule metadata (name, version, tags)
├── examples/             # Domain-specific usage examples
│   └── python/
│       ├── fraud_scoring.py
│       └── eligibility.py
├── docs/                 # Product documentation
├── tests/
│   └── python/           # Python e2e tests
└── Makefile
```

## Roadmap

| Phase | What                                          | Status      |
| ----- | --------------------------------------------- | ----------- |
| 1     | Rule metadata, rich validation, domain demos  | In progress |
| 2     | Explain mode (decision trace / audit trail)   | Planned     |
| 3     | Time layer (effective-date rule selection)     | Planned     |
| 4     | Decision database (receipts, replay, hashing) | Planned     |

## License

AGPL-3.0-or-later — [commercial licensing available](https://github.com/JPatronC92).

The underlying evaluation engine ([jsonlogic-fast](https://github.com/JPatronC92/First-T-Engine)) is MIT/Apache-2.0.