ADR-0004: Structured predicates only for rules¶
- Status: Accepted
- Date: 2026-07-25
- Deciders: El
Context¶
Rules must be safe, portable, reviewable, and must not be executable code running inside the shared brain.
Decision¶
Rules are structured data — {fact, operator, value} predicates over a published catalog of facts and actions, combined with AND/OR. No expression language, no eval, no lambda, no embedded scripting. New facts or actions are added to the catalog in code (available to all tenants), then referenced as config. A rule = on
Consequences¶
Safe; portable (pure data on exit); inspectable and versionable; some exotic rules require a catalog extension — a feature, since it forces genuinely new logic through code review; the catalog defines the ceiling of expressibility.
Alternatives considered¶
- A DSL or scripting layer in tenant config — rejected: security hole, un-reviewable, breaks portability and the config-as-data line.