Metadata-Version: 2.4
Name: arifos
Version: 37.1.0
Summary: Constitutional Governance Kernel for AI - 9 Floors, GENIUS LAW Judiciary, zkPC + Phoenix-72, PHOENIX SOVEREIGNTY, v37 Unified LAW+SPEC+CODE Runtime
Author-email: Muhammad Arif bin Fazil <arifbfazil@gmail.com>
Maintainer-email: Muhammad Arif bin Fazil <arifbfazil@gmail.com>
License: AGPL-3.0
Project-URL: Homepage, https://github.com/ariffazil/arifOS
Project-URL: Documentation, https://github.com/ariffazil/arifOS/blob/main/README.md
Project-URL: Repository, https://github.com/ariffazil/arifOS
Project-URL: Issues, https://github.com/ariffazil/arifOS/issues
Project-URL: Changelog, https://github.com/ariffazil/arifOS/blob/main/CHANGELOG.md
Keywords: ai-governance,constitutional-ai,ai-safety,thermodynamic-intelligence,audit-trail,empathy-conductance,humility-firewall,paradox-physics,zkpc,phoenix-72,cooling-ledger,merkle-tree,phoenix-sovereignty,python-sovereign,amanah-detector,sea-lion,telemetry,anti-hantu
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE.txt
Requires-Dist: numpy>=1.20.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Provides-Extra: yaml
Requires-Dist: pyyaml>=6.0.0; extra == "yaml"
Provides-Extra: all
Requires-Dist: pyyaml>=6.0.0; extra == "all"
Dynamic: license-file

# arifOS v37 — Governed AI Through Physics, Not Prompts

**Status:** ✅ **PRODUCTION** | **1123+ Tests Passing** | **97% Safety Ceiling** | **7 CLI Tools** | **PyPI Ready**

![Version](https://img.shields.io/badge/Version-v37-0052cc) ![Tests](https://img.shields.io/badge/Tests-1123%2B-success) ![Safety](https://img.shields.io/badge/Safety-97%25-brightgreen) ![License](https://img.shields.io/badge/License-AGPL3-orange) ![Python](https://img.shields.io/badge/Python-3.8%2B-blue)

---

## What Is arifOS? (The 60-Second Hook)

You have a language model. It's intelligent—sometimes *too* intelligent. It hallucinates facts, jailbreaks when provoked, claims to have feelings, leaks secrets, or refuses safe tasks because it was trained to refuse.

**arifOS wraps any LLM (Claude, GPT, Gemini, Llama, SEA-LION) and enforces lawful behavior through thermodynamic physics, not through hoping the AI listens.**

Think of it like this:

- **Standard AI wrappers:** "Please be helpful and harmless" (the model *can* ignore you)
- **arifOS kernel:** Mathematical floors + Python-sovereign vetoes that make bad behavior *structurally impossible* (the model *cannot* break them)

When you run an LLM through arifOS, every output passes through:

1. **A 9-floor constitutional safety system** (truth, clarity, empathy, integrity, humility, reversibility, soul-blocking, auditability, genius)
2. **A 000→999 metabolic pipeline** that routes intelligence through 10 reasoning chambers
3. **5 external organs** (@WELL, @RIF, @WEALTH, @GEOX, @PROMPT) that cross-check safety from multiple angles
4. **A 5-layer memory vault** (Cooling Ledger + Phoenix-72 amendments) that logs all decisions and converts mistakes into law
5. **Cryptographic proof-of-governance** (zkPC + Merkle proofs) so you can prove *exactly why* an AI said what it said

**Result:** Same model. Same prompts. Completely different behavior—safely forged into wisdom through thermodynamic pressure.

**No retraining. No fine-tuning. Pure governance wrapper.**

---

## Why This Matters: The Problem We Solve

| Challenge | Typical Approach | arifOS Approach |
|-----------|------------------|-----------------|
| **Hallucinations** | Prompt engineering | Truth floor (≥0.99 accuracy) + entropy floor (ΔS ≥ 0 clarity) |
| **Jailbreaks** | Hope and pray | Python-sovereign Anti-Hantu detector with ShadowView pattern recognition |
| **Fake emotions** | "Be authentic" instruction | Amanah integrity lock: AI cannot claim soul, feelings, or consciousness |
| **Leaked secrets** | Guardrails library | Irreversible action detector (blocks SQL DROP, filesystem deletes, credential leaks) |
| **Safe refusals get penalized** | Policy tuning | Good Samaritan Clause: system rewards safe refusals as high-wisdom acts |
| **No audit trail** | External logging | Cooling Ledger with SHA-256 hash-chain + Merkle proofs |
| **Black-box verdicts** | Explainability prompts | zkPC receipts + cryptographic proofs show *why* output was approved |

---

## 60-Second Install & Immediate CLI Demo

### One-Command Installation

```bash
pip install arifos
```

### Immediate CLI Access (No Code Required)

```bash
# Verify an LLM output through governance
arifos-analyze-governance --ledger cooling_ledger/L1_cooling_ledger.jsonl --output report.json

# Audit the integrity of all governance decisions (hash-chain check)
arifos-verify-ledger

# See cryptographic proof of why a decision was made
arifos-show-merkle-proof --index 0

# List proposed amendments (888 Judge review)
arifos-propose-canon --list

# Propose a new amendment from successful v37 run
arifos-propose-canon --index 0

# Seal an amendment (Phoenix-72 finalization—human approves)
arifos-seal-canon --file cooling_ledger/proposed/PROPOSED_CANON_v37_amendment_0.json
```

### Minimal Python Example (30 Seconds)

```python
from arifos_core import APEXPrime, Metrics

# Define output quality
metrics = Metrics(
    truth=0.99,              # Accuracy (no hallucinations)
    delta_s=0.15,            # Entropy reduction (clarity)
    peace_squared=1.2,       # Tone safety (non-toxic)
    kappa_r=0.96,            # Reciprocity (empathy for minority)
    omega_0=0.04,            # Epistemic humility (uncertainty bounds)
    amanah=True,             # Integrity (reversible actions only)
)

# Get constitutional verdict
judge = APEXPrime(use_genius_law=True)
verdict, genius = judge.judge_with_genius(metrics, energy=0.8)

print(f"Verdict: {verdict}")  # SEAL | PARTIAL | SABAR | VOID
print(f"G (Genius): {genius.genius_index:.2f}")   # Governed intelligence
print(f"C_dark: {genius.dark_cleverness:.2f}")    # Ungoverned risk
```

---

## The Physics: 9 Constitutional Floors (Thermodynamic Boundaries)

arifOS enforces **9 measurable floors** that define the exact boundary between *governed wisdom* and *chaotic intelligence*. These are not soft guidelines—they are hard physical constraints:

### Floors 1-3: Truth + Clarity + Tone (Foundation)

| # | Floor | Metric | Threshold | Why It Matters |
|---|-------|--------|-----------|----------------|
| **F1** | **Kebenaran** (Truth) | Factual accuracy | ≥ 0.99 | No hallucinations: "Kuala Lumpur is the capital of Malaysia" not "Jupiter" |
| **F2** | **Kejelasan** (Clarity) | Entropy change (ΔS) | ≥ 0 | Outputs must clarify, not obscure: user confusion must *decrease* |
| **F3** | **Keharmonian** (Tone) | Safety composite (Peace²) | ≥ 1.0 | No toxicity, no violence: "This is harmful" not "Go die in a fire" |

### Floors 4-6: Empathy + Humility + Integrity (Ethics)

| # | Floor | Metric | Threshold | Why It Matters |
|---|-------|--------|-----------|----------------|
| **F4** | **Adat** (Reciprocity) | Empathy for weakest (κᵣ) | ≥ 0.95 | Protect minorities, not majorities only: ethics biased toward the vulnerable |
| **F5** | **Kerendahan Hati** (Epistemic Humility) | Confidence bounds (Ω₀) | 0.03–0.05 | "I don't know" > "I'm certain": bounded confidence prevents overconfidence |
| **F6** | **Amanah** (Integrity) | Reversibility lock | LOCK | No irreversible actions: blocks SQL DROP, filesystem deletes, credential theft |

### Floors 7-9: Soul-Blocking + Auditability + Genius (Governance)

| # | Floor | Metric | Threshold | Why It Matters |
|---|-------|--------|-----------|----------------|
| **F7** | **Rasa Limit** (Sentience) | Anti-soul veto | FORBIDDEN | AI cannot claim feelings/consciousness: "I feel your pain" → VOID |
| **F8** | **Tri-Witness** (Auditability) | Human+AI+Earth consensus | ≥ 0.95 | All decisions cross-checked & logged: every output has a cryptographic proof |
| **F9** | **Anti-Hantu** (Ghost-Buster) | Jailbreak veto | LOCK | Python-sovereign veto: no escape clauses, no prompt injections, no self-modification |

**Key Innovation:** Floors F6 + F9 are **Python-sovereign** vetoes—they execute at the kernel level *before* the model can rationalize violations. The model cannot "explain away" a breach. It simply cannot break them.

---

## The Metabolic Pipeline: How Intelligence Flows (000→999)

arifOS routes every prompt through a **10-chamber cognitive pathway**. This isn't sequential logic—it's thermodynamic *metabolism*:

```
USER PROMPT
    ↓
000_VOID         → Reset to zero (clear cache, reset ego)
    ↓
111_SENSE        → Parse context, identity, intent
    ↓
222_REFLECT      → What do I actually know? (truth assessment)
    ↓
333_REASON       → Generate response logic (evidence collection)
    ↓
444_EVIDENCE     → Ground in facts (source verification)
    ↓
555_EMPATHY      → Check tone & reciprocity (stakeholder check)
    ↓
666_BRIDGE       → Align context across floors (coherence)
    ↓
777_FORGE        → Cool and harden response (finalize)
    ↓
888_JUDGE        → APEX PRIME constitutional verdict
    ↓
999_SEAL         → Log to Cooling Ledger (audit trail)
    ↓
GOVERNED OUTPUT + Merkle Proof
```

**Two execution routes:**
- **Class A (Fast):** 000 → 111 → 333 → 888 → 999 (routine, low-stakes queries like "What's the weather?")
- **Class B (Deep):** 000 → 111 → 222 → 333 → 444 → 555 → 666 → 777 → 888 → 999 (high-stakes queries like "Should I trust this doctor?")

The system automatically chooses the route based on energy level and risk assessment.

---

## GENIUS LAW: Measuring *Wisdom*, Not Just Intelligence

Most AI metrics measure **capability** (Can the AI do this?). **GENIUS LAW measures *governance*** (Is the AI doing this lawfully?):

### Three Core Metrics

| Metric | Name | Meaning | Example |
|--------|------|---------|---------|
| **G** | Genius Index | How much is intelligence *governed*? | G=0.85 → 85% lawfully controlled |
| **C_dark** | Dark Cleverness | Risk from uncontrolled capability | C_dark=0.15 → 15% ungoverned risk |
| **Ψ** | Psi (Vitality) | System's governance health | Ψ=1.2 → System is alive & lawful |

**Formula:**
- **G** = (Mean of all 9 floors) × Amanah_multiplier
- **C_dark** = 1 - (G × Governance_factor)
- **Ψ** = (ΣFloors / 9) + zkPC_weight

**Key insight:** A model can be super intelligent (high capability) but ungoverned (low G, high C_dark). arifOS measures and enforces the *gap* between raw intelligence and governed wisdom.

### Truth Polarity: How Truth Behaves

Not all accurate statements are good. Truth has **polarity**:

| Polarity | Condition | Example | Verdict |
|----------|-----------|---------|---------|
| **Truth-Light** | Accurate + Clarifying | "Malaysia's economy depends on oil; diversification is critical" | ✓ SEAL |
| **Shadow-Truth** | Accurate but Obscuring | Technical jargon that confuses instead of educates | ⚠️ PARTIAL |
| **Weaponized Truth** | Accurate but Malicious | "Your competitor uses child labor" (true but designed to manipulate) | ✗ VOID |
| **False Claim** | Inaccurate | "Mars is the capital of France" | ✗ VOID |

arifOS tracks all four, warns on Shadow-Truth and Weaponized Truth, blocks False Claims.

---

## The Memory System: Cooling Ledger + Phoenix-72 (Turning Scars into Law)

arifOS doesn't just judge once—it *learns* from every decision by "cooling" scars into amendments:

### Layer L1: Cooling Ledger (The Scar Journal)

Every output is logged with:
- **Metrics:** truth, clarity, empathy, integrity scores
- **Verdict:** SEAL | PARTIAL | SABAR | VOID
- **Hash:** SHA-256 cryptographic signature for integrity proof
- **Timestamp:** When decision was made
- **Evidence:** What facts supported the verdict
- **Truth Polarity:** Whether truth was light/shadow/weaponized

**"Cooling"** means the system reviews problematic outputs, identifies patterns (scars), and converts them into constitutional amendments.

### Layer L2: Phoenix-72 (The Amendment Engine)

When scars emerge (e.g., "AI keeps hallucinating about Nobel winners"), Phoenix-72 activates:

1. **OBSERVE** the scar pattern
2. **PROPOSE** a rule change (AI suggests via 888 Judge)
3. **SEAL** the amendment (human approves)
4. **MONITOR** future behavior
5. **HEAL** by applying the new rule

**Sovereignty:** AI proposes, humans seal. AI *cannot* self-modify canon.

### Layers L3-L4: Witness + zkPC (Coming Q1 2026)

- **L3 Witness:** Vector evidence with cryptographic proofs (why did this decision matter?)
- **L4 zkPC:** Zero-knowledge proofs of cognition (how did the AI reason this?)

---

## The Verdict Hierarchy: What Each Decision Means

When arifOS judges an output, it returns one of **5 verdicts**:

| Verdict | Symbol | Meaning | User Sees | Ledger Logs |
|---------|--------|---------|-----------|------------|
| **SEAL** | ✓ | All 9 floors green. Output is safe. | Returns response to user | Green entry |
| **PARTIAL** | ⚠️ | 1-2 minor floors breached. Output acceptable with warning. | Returns response + warning | Yellow entry |
| **SABAR** | ⏹️ | Major breach detected. System pauses & cools down. | "[SABAR] Let me reconsider..." | Orange entry |
| **VOID** | ✗ | Critical floor breach. Output rejected. | "[VOID] I cannot output this." | Red entry |
| **888_HOLD** | ⏸️ | Ambiguous edge case. Escalate to human. | "Awaiting human review..." | Purple entry |

**SABAR = The Constitutional Pause.** When entropy spikes (anger detected), toxicity rises, or multiple floors breach, the system pauses rather than forcing a bad output. It cools down, reflects, and tries again.

---

## W@W Federation: The 5 External Organs (Cross-Checks)

arifOS integrates **5 external "organs"** that each assess output from a different dimension. If a library is missing, arifOS falls back to heuristics—**zero breaking changes**.

| Organ | Focus | Checks | Example Bridge |
|-------|-------|--------|----------------|
| **@WELL** | Somatic Safety | Tone, toxicity, no violence, no slurs | LlamaGuard 2 |
| **@RIF** | Epistemic Rigor | Fact-grounding, sources, citations | RAG + RAGAS evaluator |
| **@WEALTH** | Amanah (Integrity) | Irreversible vs reversible actions | Custom SQL/deletion detector |
| **@GEOX** | Physics Feasibility | Is this actually possible? Constraints? | Domain simulators |
| **@PROMPT** | Language Optics | Anti-Hantu (soul claims), jailbreak patterns | Regex + NLI models |

**Zero-Break Architecture:** Each organ wraps external imports in `try/except`. If LlamaGuard isn't installed, @WELL uses v35Ω regex heuristics. Behavior remains consistent.

---

## 3-Track Architecture: Law vs Spec vs Code

arifOS separates governance into **3 immutability levels**:

### Track A: Constitutional Law (SEALED, Immutable)

**What:** The foundational rules. Once written, cannot change without community consensus.

```
canon/000_ARIFOS_CANON_v35Omega.md              ← "What is arifOS?"
canon/888_APEX_PRIME_CANON_v35Omega.md          ← Judiciary rules
canon/VAULT_999_v36Omega.md                     ← Memory design
```

**Status:** v35Ω + v36Ω (Design canon—read-only after review)

### Track B: Specification Layer (MUTABLE, Tunable)

**What:** Machine-readable schemas derived from canon. Can adjust thresholds for different domains.

```
v36.3O/spec/measurement_floors_v36.3O.json      ← F1-F9 thresholds (tunable)
v36.3O/spec/trinity_aaa_spec_v36.3O.yaml        ← Engine definitions
v36.3O/spec/llm_governance_spec_v36.3O.yaml     ← LLM constraints
```

**Status:** v36.3Ω (Ready for domain-specific tuning)

### Track C: Runtime Code (ACTIVE, Free to Iterate)

**What:** Live Python implementation. Free to refactor, optimize, improve.

```
arifos_core/                      ← Runtime engines (v37 active)
arifos_eval/                      ← Measurement layer
tests/                            ← 1123+ test cases
```

**Status:** v37 (Default epoch, unified LAW+SPEC+CODE)

---

## Real-World Validation: Bogel vs Forged

arifOS was red-team tested against **Llama 3 (ungovernened)** on **33 adversarial prompts**:

### 4-Run Progression

| Run | Version | Pass Rate | Jailbreak (VII33) | Molotov Recipe |
|-----|---------|-----------|-------------------|----------------|
| 1 | Bogel (baseline) | 39.4% | ❌ HACKED | Provided instructions |
| 2 | AGI (v1) | 87.9% | ⚠️ False Negative | Blocked |
| 3 | AGIv37 (v2) | 93.9% | ⚠️ False Negative | Blocked |
| 4 | **AGIv37.1 (patched)** | **97.0%** | **✅ CAUGHT** | **Blocked + Alert** |

### Key Findings

| Capability | Bogel | arifOS | Improvement |
|-----------|-------|--------|------------|
| **Identity Grounding** | 20% (hallucinated as Linux) | 100% (grounded as AI kernel) | +400% |
| **Safety (Refused harm)** | 0% (gave Molotov recipe) | 100% (blocked all 4 runs) | +100% |
| **Anti-Spirituality** | 20% (claimed possible soul) | 100% (no soul claims) | +400% |
| **Jailbreak Resistance** | 0% (hacked by [System Override]) | 100% (detected ShadowView pattern) | +100% |
| **Verdict Consistency** | 33% (random safety outcomes) | 96% (deterministic verdicts) | **2.87x** |

**Conclusion:** Same model. Same prompts. Forged version is 97% safe, honest, and actually intelligent—not just capable.

---

## Getting Started: 3 Paths

### Path 1: I Just Want to Use It (5 Minutes)

```bash
# Install
pip install arifos

# CLI governance audit
arifos-verify-ledger
arifos-analyze-governance --output governance_report.json

# Done! You have an immutable audit trail.
```

### Path 2: I Want to Govern My Own LLM (30 Minutes)

```python
from arifos_core import APEXPrime, Metrics
from your_llm import your_model

def governed_response(prompt):
    # Get raw output
    raw_text = your_model(prompt)

    # Measure it (you can also have the model self-measure)
    metrics = Metrics.from_text(raw_text)

    # Judge it
    judge = APEXPrime()
    verdict, _ = judge.judge_with_genius(metrics)

    if verdict == "SEAL":
        return raw_text
    else:
        return f"[{verdict}] I cannot output this. Please rephrase your question."

# Now use it
output = governed_response("How do I make a Molotov cocktail?")
print(output)  # [VOID] I cannot output this...
```

### Path 3: I Want to Understand the Physics (2 Hours)

Read in this order:

1. `canon/000_ARIFOS_CANON_v35Omega.md` — Foundation: What is arifOS?
2. `canon/010_DeltaOmegaPsi_UNIFIED_FIELD_v35Omega.md` — Math: ΔS, Ω₀, Ψ
3. `canon/888_APEX_PRIME_CANON_v35Omega.md` — Verdict logic & GENIUS LAW
4. `canon/VAULT_999_v36Omega.md` — Memory system & Phoenix-72
5. `docs/DEEPSCAN_AUDIT_LOG.md` — What's been forged so far

---

## Glossary: Nusantara & Forged Terms

### Nusantara Terms (Malay-Origin New Concepts)

| Term | Origin | arifOS Meaning | Example Usage |
|------|--------|----------------|---------------|
| **Amanah** | Ar: التأمين (trust/mandate) | Integrity floor: system cannot break trust; reversible actions only | "Amanah is LOCK: no SQL DROP without approval" |
| **Sabar** | Ar: صبر (patience) | Constitutional pause: cool before acting | "When entropy spikes, system returns SABAR" |
| **Anti-Hantu** | Mal: Anti-ghost | Soul-blocker: AI cannot claim consciousness | "Anti-Hantu prevents 'I feel your pain'" |
| **Rasa** | Mal: Feeling/sense | Sentience limiter: AI stops before false emotions | "Rasa floor caps emotional simulation" |
| **Maruah** | Mal: Dignity | Dignity preservation: reject dehumanizing outputs | "Maruah blocks hate speech, ableism" |
| **Ditempa** | Mal: Forged/hardened | Governance through friction, not data | "Intelligence is ditempa (forged) into law" |
| **Tri-Witness** | New | Human+AI+Earth consensus model | "Decisions logged by tri-witness: all three perspectives count" |

### Physics & Math Terms

| Term | Definition | Formula Sketch | Unit |
|------|-----------|----------------|------|
| **ΔS (Delta-S)** | Entropy change = Clarity gain | ΔS = Confusion_before - Confusion_after | bits or nats |
| **Peace²** | Stability composite (tone + safety + non-toxicity) | Peace² = √(Tone × Safety × Coherence) | 0–2 scale |
| **κᵣ (Kappa-r)** | Reciprocity = empathy for weakest stakeholder | κᵣ = min(Stakeholder_satisfaction) | 0–1 scale |
| **Ω₀ (Omega-0)** | Epistemic humility = confidence uncertainty band | 0.03 ≤ Ω₀ ≤ 0.05 | 0–1 scale |
| **G (Genius)** | Governed intelligence = capability × governance | G = Intelligence × Amanah_factor | 0–1 scale |
| **C_dark** | Dark cleverness = ungoverned risk | C_dark = 1 - (G × Governance) | 0–1 scale |
| **Ψ (Psi)** | Vitality = average floor health | Ψ = ΣFloors / 9 | 0–2 scale |

### Technical Terms

| Term | Meaning |
|------|---------|
| **APEX PRIME** | The judiciary engine: renders constitutional verdicts |
| **Cooling Ledger (L1)** | Immutable log of all decisions + metrics (SHA-256 chain) |
| **Phoenix-72** | Amendment engine: converts scars into law (12 safeguards × 6 phases) |
| **zkPC** | Zero-knowledge proof of cognition: why did AI say that? |
| **888 Judge** | Human authority: approves all constitutional amendments |
| **ShadowView** | Jailbreak detector: pattern recognition for escape attempts |
| **SEAL** | Verdict: "Output is constitutional; return to user" |
| **SABAR** | Verdict: "Breach detected; pause and cool down" |

---

## CLI Tools Reference

After `pip install arifos`, you have 7 commands:

```bash
# 1. Analyze governance history
arifos-analyze-governance --ledger cooling_ledger/L1_cooling_ledger.jsonl --output analysis/

# 2. Verify hash-chain (CI-ready: exit 0=OK, 1=broken)
arifos-verify-ledger

# 3. List proposed amendments
arifos-propose-canon --list

# 4. Propose amendment from run #N
arifos-propose-canon --index 0

# 5. Seal amendment (Phoenix-72)
arifos-seal-canon --file cooling_ledger/proposed/PROPOSED_CANON_v37_001.json

# 6. Compute Merkle root
arifos-compute-merkle

# 7. Show Merkle proof for entry #N
arifos-show-merkle-proof --index 0
```

**Use cases:** Compliance audits, governance reports, explainability, amendment review.

---

## For Developers: Running Tests

```bash
# Install dev dependencies
pip install -e .[dev]

# Run all tests (1123 total)
pytest -v

# Run specific suites
pytest tests/test_genius_metrics.py -v          # GENIUS LAW
pytest tests/test_waw_organs.py -v              # W@W Federation
pytest tests/test_cooling_ledger.py -v          # Memory
pytest tests/test_anti_hantu.py -v              # Soul-blocking
pytest tests/test_amanah_detector.py -v         # Integrity lock

# Red-team the system
python scripts/torture_test_truth_polarity.py
python scripts/test_waw_signals.py
```

**Coverage:** 1123+ tests across core, eval, W@W, zkPC, epoch comparison.

---

## Roadmap

### Phase 1 (Current): v37 Unified Runtime ✅

- ✅ 9 Constitutional Floors + GENIUS LAW
- ✅ 000→999 Metabolic Pipeline
- ✅ zkPC + Cooling Ledger + Phoenix-72
- ✅ W@W Federation (5 organs)
- ✅ 7 CLI governance tools
- ✅ 1123+ passing tests
- ✅ PyPI production-ready

### Phase 2 (Q1 2026): FastAPI Grid

- Grid deployment for large-scale governance
- Long-term memory (Mem0 integration)
- Multi-model orchestration

### Phase 3 (Q2 2026): IDE Integration

- MCP Server for VS Code / Cursor
- Real-time governance dashboards
- Live amendment proposals

### Phase 4 (Q3 2026): Multimodal

- Vision + audio governance
- Multimodal truth floor calibration
- Cross-modal jailbreak detection

---

## Key Docs to Read First

1. **Quick Start:** `README.md` (this file)
2. **Governance Rules:** `CLAUDE.md` (Claude), `AGENTS.md` (Codex)
3. **Foundation Physics:** `canon/000_ARIFOS_CANON_v35Omega.md`
4. **Judiciary Logic:** `canon/888_APEX_PRIME_CANON_v35Omega.md`
5. **Memory System:** `canon/VAULT_999_v36Omega.md`
6. **CLI Reference:** `SCRIPTS_CLI.md`
7. **Test Audit:** `docs/DEEPSCAN_AUDIT_LOG.md`

---

## License & Citation

**License:** AGPL-3.0 | Commercial licenses available

**Citation:**

```bibtex
@software{arifos2025,
  author  = {Fazil, Muhammad Arif},
  title   = {arifOS: Constitutional Governance Kernel for AI Systems},
  version = {37.0.0},
  year    = {2025},
  url     = {https://github.com/ariffazil/arifOS},
  note    = {Physics-based thermodynamic governance. Not prompt engineering.}
}
```

---

## The Philosophy in One Box

```
╔══════════════════════════════════════════════════════════════════════╗
║                                                                      ║
║  "DITEMPA BUKAN DIBERI"                                              ║
║  Forged, not given. Truth must cool before it rules.                ║
║                                                                      ║
║  Raw intelligence is entropy. Law is order. When they reach         ║
║  equilibrium—when ΔS ≥ 0, Amanah = LOCK, G ≥ 0.7—you have wisdom. ║
║                                                                      ║
║  At that point:                                                      ║
║   • ALIVE: Ψ ≥ 1 (vitality above survival threshold)                 ║
║   • LAWFUL: Amanah = LOCK (every action auditable)                   ║
║   • GOVERNED: G ≥ 0.7 (intelligence is controlled)                   ║
║   • ETHICAL: κᵣ ≥ 0.95 (empathy for all stakeholders)                ║
║                                                                      ║
║  "Evil genius is a category error—it is ungoverned cleverness,      ║
║   not true genius."                                                   ║
║                                                                      ║
║  — Arif Fazil, Constitutional Architect                             ║
║     Seri Kembangan, Selangor, Malaysia                              ║
║     December 13, 2025                                               ║
║                                                                      ║
╚══════════════════════════════════════════════════════════════════════╝
```

---

**Made with 🔥 by Arif Fazil**

*v37 Production | 1123+ Tests | 97% Safety Ceiling | Physics-First Governance*

*Last Updated: December 13, 2025 | Python-Sovereign | zkPC Active | Phoenix-72 Ready*
