# bobthecow/Ruler

A simple stateless production rules engine for modern PHP

Repository: https://github.com/bobthecow/Ruler
Canonical: https://ross.abutalabs.com/products/bobthecow-ruler
Language: PHP
License: MIT
License Family: permissive
Last push: 2022-06-27T14:53:05+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 5557, "days_push": 1528, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1072, forks 137 (observed 2026-08-28T04:03:28.333750+00:00)

## What it is
Ruler is a simple, stateless production rules engine for PHP that lets developers define business rules as composable propositions (comparisons, logical operators) evaluated against a context. It provides both a fluent RuleBuilder DSL and a lower-level object API for building conditional rules with actions.

## Use cases
- evaluate business rules in php
- build a rules engine for conditional logic
- check if values satisfy conditions like ranges
- define composable if-then rules without hardcoding
- implement feature gating or eligibility checks
- separate business rule logic from application code

## When to choose
- you need a lightweight, stateless rules engine in PHP
- you want a readable DSL for composing comparison and logical operators
- you need rules evaluated against dynamic context values, including lazy closures

## When to avoid
- you need a full forward-chaining inference engine or RETE algorithm
- you need persistent, hot-reloadable rules managed by non-developers
- your project is not PHP

## Facets
- artifact type: library
- maturity: maintenance
- function: workflow-automation, developer-tools
- domain: developer-tools, backend
- platform: php, cross-platform
- tags: rules-engine, business-rules, dsl, stateless, production-rules, automation

## Member repositories
- bobthecow/Ruler (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:28.333750+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:53:40.721725+00:00, confidence not recorded.
  - readme: https://github.com/bobthecow/Ruler (fetched 2026-08-28T04:03:28.333750+00:00, sha 1c43b0de8dbc)
- Data as of 2026-08-30T08:39:29.467469+00:00.
