Overview
The Yggdrasil rule engine is a deterministic, audit-ready enforcement system that evaluates compliance rules against your dataset without ML models in the critical path. Every violation is traceable, reproducible, and explainable.Execution Flow
The rule engine follows a multi-stage pipeline:1. Normalization
Raw CSV data is normalized using the confirmed column mapping:2. Sampling
For datasets exceeding 50,000 rows, the engine samples the first 50K records:3. Rule Routing
Rules are routed by theirtype field:
4. Condition Evaluation
All rules use a recursive condition evaluator that supports nestedAND/OR logic:
5. Confidence Scoring
Each violation receives a confidence score (0–1) based on multiple factors:6. Ranking
Violations are sorted by confidence before being returned:Noise Gate
To prevent system overload, the engine caps stored violations per rule:Key Design Principles
Deterministic Enforcement
No ML models in the critical path. Rules are pure boolean logic evaluated against each record. This ensures:- Reproducibility: Same input → same output
- Audit-readiness: Every decision is traceable
- No drift: Model retraining never changes past results
Explainability by Default
Every violation includes:- The exact policy excerpt it violates
- Evidence from your data
- A deterministic explanation (template-generated, not LLM)
Signal Specificity Framework
Rules extracted from PDFs must combine multiple signals (behavioral + temporal + relational) to reach a minimum specificity threshold of 2.0 before they can fire. Single-threshold rules are rejected to minimize false positives.Bayesian Feedback Loop
When you approve or dismiss a violation, that feedback updates a per-rule precision model:Implementation
The rule engine is implemented in two core files:rule-executor.ts(/home/daytona/workspace/source/src/lib/engine/rule-executor.ts:1): Orchestration layerin-memory-backend.ts(/home/daytona/workspace/source/src/lib/engine/in-memory-backend.ts:1): Execution backend
Next Steps
Rule Types
Learn about WINDOWED vs SINGLE-TX rules
Operators
Supported operators and type coercion
Confidence Scoring
How violations are scored and ranked
Explainability
Deterministic violation explanations