Skip to content

Repository files navigation

🌀 SpiralSafe

Coherence Engine for Emergent AI Systems

CoherenceVortexφ

 🌱 SPIRALSAFE 🌱 MONO
(core) (tools)
\ /
\ /
\ /
\ /
↘ ↙
🌳 QDI ⚡
↗ (hub) ↖
/ \
/ \
/ \
/ \
🌱 METRICS 🌱 QR
(monitoring) (quick)

You are here: QDI (center hub) · Connected to 5 other repos · Changes flow through vortex

See It Live · How It Works · Quick Start


⚡ The Magic

Every git push triggers automatic quality analysis:

Push → Wave analysis → <60% blocked, >70% snap-in ⚡

No manual code review needed. The vortex handles it.

🚀 Quick Start

bun install # Install
open docs/visualization/live-vortex.html # See the vortex
bun test# Test

That's it. The workflows handle everything else automatically.

🌀 See The Vortex

Open docs/visualization/live-vortex.html and watch:

  • Fibonacci spirals rotating in real-time
  • Commits flowing through phase gates
  • Coherence waves pulsing from center
  • Repositories synchronizing
  • Snap-in events when quality peaks

This is not a metaphor. This is the actual data flow.

💡 How It Works

The VORTEX STRUCTURE

Three spirals interlock to create autonomous quality:

1. Fibonacci Spiral (Math)

FIBONACCI=[1,1,2,3,5,8,13,21,34,55,89,144]chaos_score=(curl×φ+divergence/φ)×FIBONACCI[potential]

Higher structure → Higher Fibonacci weight → Exponential sensitivity

2. Phase Gates (Logic)

KENL → AWI → ATOM → SAIF → Spiral
↑ ↓
└───────────────────────────┘

SAIF loops back to KENL creating infinite improvement

3. Wave Analysis (Physics)

MetricWhat It DetectsOptimal
CurlCircular reasoning<0.3
DivergenceExpansion rate~0.2 (golden ratio)
PotentialStructure depth>0.6
EntropyInformation density>0.5

Combine them → Coherence score 0-100 → Quality emerges

What Happens When You Push

T=0: git push
T=5s: Workflows analyze your commits
T=30s: Coherence calculated: curl, divergence, potential, entropy
T=45s: Score appears: • <60% = ❌ Blocked (with specific fixes)
• 60-70% = ⚠️ Review needed
• >70% = ✨ SNAP-IN (automatic sync across ecosystem)

The Snap-In Moment

When coherence hits 70%, the waveform collapses:

  • Local uncertainty → Remote certainty
  • Superposition → Reality
  • Your work synchronizes across the entire ecosystem

This is quantum collapse made visible.

🎯 Packages

Four tools that work together:

PackageWhat It Does
wave-toolkitAnalyzes text coherence using physics (curl, divergence, potential, entropy)
atom-trailTracks every decision through phase gates (KENL → AWI → ATOM → SAIF → Spiral)
ax-signaturesOptimizes LLM prompts for coherence
quantum-ethicsEthical quantum computing with resource fairness

Quick example:

import{analyzeWave}from'@spiralsafe/wave-toolkit';constresult=analyzeWave("Your text");console.log(result.coherence_score);// 0-100// Above 60 = good, above 70 = excellent

🔍 Debug Like Magic

Every PR gets automatically tagged. Finding issues later becomes trivial:

# Find all changes to wave algorithm
Filter: pkg:wave-toolkit
# See what was merged despite low quality
Filter: coherence:low + is:merged
# Track a feature through all 5 phase gates
Filter: phase:KENL + "your feature"
Filter: phase:ATOM + "your feature"# Analyze snap-in events
cat .vortex-logs/snap-in-*.json | jq '.coherence.coherence_score'

Tags applied automatically:

  • Phase: phase:KENL, phase:AWI, phase:ATOM, phase:SAIF, phase:Spiral
  • Component: pkg:wave-toolkit, pkg:atom-trail, etc.
  • Quality: coherence:high, coherence:review, coherence:low
  • Special: vortex-synchronized, coherence-override

Bugs correlate with tags. High Fibonacci weight (89, 144) = solid code. Low weight (1, 2, 3) = check carefully.

🏗️ Structure

qdi/
├── packages/
│ ├── wave-toolkit/ # Coherence analysis
│ ├── atom-trail/ # Provenance tracking
│ ├── ax-signatures/ # LLM optimization
│ └── quantum-ethics/ # Resource fairness
├── apps/
│ └── mcp-server/ # MCP tools
├── docs/
│ └── visualization/ # Live vortex view
└── .github/
└── workflows/ # Automated quality

🤝 Contributing

Requirements:

  • Tests pass (bun test)
  • No lint errors (bun run lint)
  • PR description coherence ≥60%

Tips for high coherence:

  • Avoid circular reasoning
  • Conclude expansions clearly
  • Use connectives: therefore, moreover, consequently
  • Increase vocabulary diversity

Coding Agent

The repository includes a GitHub Actions-based coding agent for automated ethical review of PRs.

Agent Setup

# Install Python dependencies for quantum simulations
pip install qiskit
# Run agent skills locally
python agent_skills.py simulate
python agent_skills.py check_coherence --threshold 0.6

Agent Commands

CommandDescription
simulateRun Qiskit circuit simulation
check_coherenceVerify coherence threshold (>60%)
cascadeIntegrate provenance for cascading PRs
review_prGenerate automated PR review

See docs/instructions.md for full agent documentation.

Feedback & Contributions

📚 Learn More

🌐 Connect

📜 License

MIT


The right piece at the right time. Everything snaps into reality as a unified whole. 🌀

Built with BunTypeScript

About

QUANTUM DIVIDE INITIATIVE | A monorepo refined Ethical, Quantum Computing Framework - based on Math-Constrained-AI-Infrastructure-as-Code

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages