# 📖 RULE BOOK — Master Index

> **File:** `rules/RULE_BOOK.md`
> **System:** Rotating Equipment Predictive Maintenance AI
> **Version:** 1.0.0 | April 11, 2026

---

## What is the Rule Book?

The Rule Book is the **authoritative, versioned set of logic rules** that govern every decision the AI system makes. Rules are separated by concern so they can be reviewed, updated, and audited independently.

No business logic is hardcoded in software — all thresholds and decision logic trace back to these rule files and the JSON config files in `/data/`.

---

## Rule Book Files

| File | Covers |
|---|---|
| `rules/anomaly_rules.md` | When to flag an anomaly — thresholds, rates, cross-checks |
| `rules/failure_mode_rules.md` | How to identify WHAT failed — evidence weights |
| `rules/failure_cause_rules.md` | How to identify WHY it failed — inference rules |
| `rules/severity_rules.md` | How to classify severity and what action to recommend |

---

## Rule Format Convention

Every rule follows this standard structure:

```
RULE ID:      Unique identifier (e.g., AR-01, FM-R-03)
NAME:         Short human-readable rule name
TRIGGER:      Conditions that activate this rule
CONDITION:    Full logic expression
ACTION:       What happens when the rule fires
CONFIDENCE:   Confidence points added when rule fires
PRIORITY:     Evaluation order (lower = earlier)
VERSION:      When this rule was last changed
```

---

## Rule Change Protocol

1. Propose change with justification referencing sensor data or incident
2. Update the relevant rule file
3. Increment VERSION field on changed rules
4. Update JSON data file if threshold value changed
5. Revalidate against historical test cases
6. Log change in version history at bottom of rule file

---

## Design Principles

| Principle | Implementation |
|---|---|
| No hardcoded values | All thresholds live in `/data/*.json` |
| Multi-sensor confirmation | No failure mode fires on 1 sensor alone |
| Confidence-gated output | Rules below 55% confidence are suppressed |
| False positive prevention | Persistence filters on all anomaly rules |
| Auditability | Every output traces to a rule ID |
