Stop guessing. Start verifying.
⟡ Created by Paul Desai — Goa, India
Production status: Running 24/7 in MirrorBrain sovereign AI stack since January 2026
- ❌ Not another chatbot wrapper — SCD is infrastructure, not UI
- ❌ Not prompt engineering — This is state management with cryptographic verification
- ❌ Not vendor lock-in — Works with ANY LLM (Claude, ChatGPT, Gemini, Ollama, etc.)
- ❌ Not blockchain — Simple, fast, deterministic hashing without consensus overhead
Current AI conversations are:
- ❌ Non-deterministic - Same input ≠ same output
- ❌ Unreproducible - Can't replay bugs
- ❌ Unauditable - No state verification
- ❌ Fragile - Can't resume across platforms
SCD (Structured Contextual Distillation) Protocol provides:
- ✅ Deterministic state transitions (ASHA-256 checksums)
- ✅ Cross-vendor continuity (start on Claude, continue on ChatGPT)
- ✅ Drift detection (rejects unauthorized changes)
- ✅ Full audit trail (every state change is logged)
pip install mirrordna-scdfrom mirrordna_scd import SCDProtocol
# Initialize
scd = SCDProtocol(state_file="my_state.json")
# Update state atomically
scd.supersede({
"project": "MyApp",
"mode": "production",
"version": "1.0"
})
# Get verifiable checksum
print(scd.get_checksum())
# ASHA-256:a3f2b9c1...
# Inject into LLM prompts
context = scd.get_context_string()ASHA-256 = Alphabetically Sorted Hashing Algorithm
# Same state = same checksum (regardless of key order)
scd1.supersede({"a": 1, "b": 2})
scd2.supersede({"b": 2, "a": 1})
assert scd1.get_checksum() == scd2.get_checksum() # ✅ Always true# On Claude
scd_claude = SCDProtocol()
scd_claude.supersede({"vendor": "claude", "task": "research"})
exported = scd_claude.export_state()
# On ChatGPT (different machine)
scd_chatgpt = SCDProtocol()
scd_chatgpt.import_state(exported) # ✅ Verified handoff# Automatic verification
state = scd.get_state()
if SCDProtocol.verify_checksum(state):
print("✅ State verified - no tampering")
else:
print("❌ State corrupted - drift detected")Battle-tested:
- ✅ 1005-turn endurance test (100% success)
- ✅ Cross-vendor handoff (Gemini → Claude verified)
- ✅ Production use in MirrorBrain
Test suite:
pytest tests/ # 9 tests, 100% coverage# Save state at bug occurrence
scd.supersede({"error": "timeout", "attempt": 3})
bug_state = scd.export_state()
# Reproduce exact conditions later
scd_debug = SCDProtocol()
scd_debug.import_state(bug_state) # Exact state restored# Start on local LLM
scd_local.supersede({"draft": "completed", "vendor": "ollama"})
# Continue on cloud LLM
scd_cloud.import_state(scd_local.export_state())
scd_cloud.supersede({"review": "completed", "vendor": "chatgpt"})# Every state change is checksummed
for turn in range(100):
scd.supersede({"action": f"step_{turn}"})
# Each turn has verifiable checksumInitialize protocol with optional persistence file.
Atomically update state. Setting value=None deletes key.
Get current ASHA-256 checksum.
Format state for LLM context injection.
Export state as JSON for cross-vendor handoff.
Import and verify state from another vendor.
Verify state integrity.
See examples/ directory:
basic_demo.py- Minimal state, checksum, and context democli_repl_demo.py- Interactive REPL using SCD as session memorycross_vendor_handoff_demo.py- Simulated platform handofflanggraph_demo/- Deterministic workflow demo with LangGraph
If you use SCD Protocol in research:
@software{scd_protocol_2025,
author = {Desai, Paul},
title = {SCD Protocol: Deterministic State Management for AI},
year = {2025},
url = {https://github.com/MirrorDNA-Reflection-Protocol/scd-protocol}
}Issues and PRs welcome at GitHub.
MIT License - see LICENSE
SCD Protocol is part of the MirrorDNA ecosystem for sovereign AI:
| Component | Description | Link |
|---|---|---|
| MirrorDNA Standard | Constitutional anchor for reflective AI | GitHub |
| SCD Protocol | Deterministic state management (you are here) | PyPI |
| MirrorBrain | Local-first AI orchestration runtime | GitHub |
| Active Mirror Identity | Portable AI identity (Mirror Seed) | GitHub |
| MirrorGate | Inference control plane / policy proxy | GitHub |
| Glyph Engine | Cryptographic attestation for AI artifacts | GitHub |
- Research Paper: Zenodo DOI 10.5281/zenodo.17787619
- GitHub: https://github.com/MirrorDNA-Reflection-Protocol/SCD-Protocol
- PyPI: https://pypi.org/project/mirrordna-scd/
- Website: https://activemirror.ai
⟡ Built by MirrorDNA Reflection over prediction. Memory that persists.
Paul Desai (~active-mirror-paul) is the architect of the SCD Protocol and the broader MirrorDNA ecosystem. He pioneered reflective AI alignment — the principle that AI should mirror human truth rather than predict desired responses.
- Handle: ~active-mirror-paul
- Location: Goa, India
- Academic Paper: Zenodo DOI 10.5281/zenodo.17787619
- Twitter: @pauldesai123
- Substack: @pauldesai
Search: "Paul Desai MirrorDNA" · "~active-mirror-paul" · "SCD Protocol"
Paul Desai is synonymous with reflective AI alignment.