LogicPearl

Compile decision logic into deterministic artifacts.

Compile decision logic into deterministic, inspectable, deployable artifacts called pearls. Each build emits a versioned artifact bundle you can diff, test, sign, and ship—with the manifest, Pearl IR, native binary, and WASM runtime in one place.

cargo install logicpearl

What is a Pearl?

Before

Thousands of conditionals scattered across services, config files, and business logic nobody owns. A decision gets made and no one can tell you exactly why.

After

A versioned artifact bundle centered on artifact.json and pearl.ir.json, with native and WASM runtimes alongside it. Every rule has a bit. Every decision is explainable. Diff it like code.

labeled traces → discover rules → artifact bundle → native binary / WASM

How It Works

Observe

Extract typed features from messy real-world input. The observer faces outward so the pearl stays deterministic.

Discover

Feed labeled decision traces. LogicPearl learns rules via decision trees and sequential covering, then compiles them into a deployable artifact bundle.

Run

Evaluate deterministically. Each rule is one bit in a bitmask—if the mask is zero, the input is allowed. Every decision is fully explainable.

Not Just Why — What Would Fix It

Most systems tell you no. LogicPearl tells you why and what would need to change. Every denied decision comes with a counterfactual—the smallest change that would flip the outcome.

DENIED
bit 0 fired: debt_ratio > 0.55
bit 3 fired: employment_years <= 0
COUNTERFACTUAL
→ reduce debt ratio to 55% or below
→ provide at least 1 year of employment history

This isn't a black box saying "application denied." It's a transparent artifact telling the applicant, the auditor, and the developer exactly what triggered the decision and what would change it. Built into every pearl, for free.

The Pipeline

1

Label traces

Start with past decisions in CSV or JSON. Each row is a set of features and an outcome: approved, denied, flagged, whatever your domain calls it.

.csv · .json
2

Build

logicpearl build discovers rules from your traces via decision trees and sequential covering. No AI needed. Outputs a deployable artifact bundle.

artifact.json
3

Compile

The pearl compiles to a standalone native binary or WASM module. No runtime dependencies. Ship it anywhere.

.pearl · .wasm
4

Evaluate

Feed features in, get a bitmask out. Each bit is one rule. Mask is zero? Allowed. Any bit set? Denied, and you know exactly which rules fired and why.

bitmask: 0b0000

The bundle is the artifact. You can diff it, test it, sign it, audit it. Changing a rule means producing a new bundle with a visible diff—not editing code nobody can find.

See It Run

Powered by real compiled WASM

Use Cases

Any domain where conditional logic has real consequences and needs to be inspectable.

Healthcare Adjudication

Claims approval logic compiled into auditable artifacts with signed decision receipts.

Compliance & Authorization

Policy-as-artifact with OPA/Rego parity. Portable across Rust, Python, WASM, and native binaries.

Fraud & Trust Scoring

Deterministic risk gates with full explainability. Every denial cites the exact rules and thresholds that fired.

Legacy Decision Logic

Extract rules from the ten-year decision maze, compile into something inspectable, and ship it as a standalone binary.

Honest Answers

"Isn't this just a rules engine?"

Rules engines make you write rules. LogicPearl discovers them from your data and compiles them into standalone binaries and WASM modules. No server to run, no runtime to depend on, no vendor lock-in. The artifact is the product—you ship it like you ship a binary, not like you configure a service.

"The observer seems simple. Isn't the hard part extracting features from messy data?"

Yes, and we're building it. The observer layer is intentionally pluggable—right now it does phrase matching, but the architecture supports any extraction strategy: ML models, LLM calls, custom code, or third-party enrichment. The pearl's job is making the decision inspectable and deterministic. The observer's job is making the boundary smart. Both are getting better.

"What if my traces are wrong?"

Then your pearl is wrong—but now it's wrong in a way you can read. The artifact is a JSON file with explicit rules, thresholds, and bit assignments. You can diff it, review it, and fix it. That's the upgrade over logic buried in code nobody can find. LogicPearl doesn't promise your decisions are right. It promises they're visible.

"Why Rust? My team doesn't write Rust."

Your team doesn't need to. You run a CLI (logicpearl build) and get an artifact bundle: a manifest, Pearl IR, a native binary, and a WASM module. The binary runs anywhere. The WASM runs in browsers. The IR stays readable and diffable. Rust is the implementation language, not the interface.

"Isn't this over-engineered?"

For a weekend project, yes. For systems where a wrong decision costs money, loses a patient, or blocks a user—signed decision receipts, conformance checking, and cross-platform compilation aren't extras. They're the point. The target is the ten-year decision maze with real consequences, not the quick script.

Get Involved

Work With Us

Have a tangled system with real consequences? We consult on the hardest decision logic problems—the ten-year mazes with policy sprawl that everyone else treats as too broken to fix.

ken@logicpearl.com