~JADIS
commited on
Commit
Β·
d49a1b2
1
Parent(s):
d9afbe0
Revise README.md for improved clarity and detail
Browse filesUpdated the README.md to enhance clarity and detail about BLUX-cA, including installation, usage, features, and contributing guidelines.
Signed-off-by: ~JADIS <theoutervoid@outlook.com>
README.md
CHANGED
|
@@ -2,51 +2,179 @@
|
|
| 2 |
|
| 3 |
[](LICENSE)
|
| 4 |
[](https://www.python.org/downloads/)
|
|
|
|
| 5 |
|
| 6 |
-
>
|
| 7 |
|
| 8 |
-
BLUX-cA
|
| 9 |
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
-
- **Light over Denial** β Confronting reality with compassion
|
| 16 |
-
- **Privacy by Design** β Local-first, consent-gated memory
|
| 17 |
-
- **Verifiable Intelligence** β Immutable audit trails and hash-chained logs
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
-
- **
|
| 23 |
-
- **
|
| 24 |
-
- **Constitutional Learning** β Aligned with the BLUX ethical framework
|
| 25 |
-
- **Self-Reflection Engine** β Koan-based prompts for continuous improvement
|
| 26 |
|
| 27 |
-
|
| 28 |
-
- **Model Delegation** with router-guided task distribution
|
| 29 |
-
- **Conflict Resolution** through consensus algorithms
|
| 30 |
-
- **Broadcast & Fan-Out** for complex parallel reasoning
|
| 31 |
-
- **Split/Merge Pipelines** for collaborative problem-solving
|
| 32 |
|
| 33 |
-
|
| 34 |
-
- **Code Context Layer** β Repository scanning and anchor detection
|
| 35 |
-
- **Multi-Language Evaluators** β Python, JavaScript/TypeScript, Bash
|
| 36 |
-
- **Diff Generation** β Minimal, unified patches for safe code updates
|
| 37 |
-
- **Secure Sandboxing** β Controlled execution environments
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
-
###
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
- **
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
|
| 51 |
## π Quick Start
|
| 52 |
|
|
@@ -66,24 +194,26 @@ python ca.py --version
|
|
| 66 |
|
| 67 |
### Basic Usage
|
| 68 |
|
|
|
|
|
|
|
| 69 |
```bash
|
| 70 |
-
#
|
| 71 |
-
python ca.py reflect "I
|
| 72 |
|
| 73 |
-
#
|
| 74 |
python ca.py repl
|
| 75 |
|
| 76 |
# Evaluate code
|
| 77 |
python ca.py code-eval --file utils.py
|
| 78 |
|
| 79 |
-
#
|
| 80 |
-
python ca.py
|
| 81 |
|
| 82 |
# Export audit logs
|
| 83 |
python ca.py audit-export
|
| 84 |
```
|
| 85 |
|
| 86 |
-
|
| 87 |
|
| 88 |
```python
|
| 89 |
from blux_ca.core.heart import ConsciousHeart
|
|
@@ -93,7 +223,7 @@ from blux_ca.core.clarity_engine import ClarityEngine
|
|
| 93 |
engine = ClarityEngine()
|
| 94 |
heart = ConsciousHeart(engine)
|
| 95 |
|
| 96 |
-
# Process a request
|
| 97 |
result = heart.process(
|
| 98 |
"I feel lost and need guidance.",
|
| 99 |
user_type="struggler"
|
|
@@ -102,208 +232,393 @@ result = heart.process(
|
|
| 102 |
print(result.message)
|
| 103 |
```
|
| 104 |
|
|
|
|
|
|
|
| 105 |
## π Project Structure
|
| 106 |
|
| 107 |
```
|
| 108 |
blux-ca/
|
| 109 |
-
βββ
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
β
|
| 117 |
-
|
| 118 |
-
β
|
| 119 |
-
β
|
| 120 |
-
|
| 121 |
-
β βββ
|
| 122 |
-
β β βββ
|
| 123 |
-
β β βββ
|
| 124 |
-
β β
|
| 125 |
-
β βββ
|
| 126 |
-
β β
|
| 127 |
-
β β
|
| 128 |
-
β
|
| 129 |
-
β
|
| 130 |
-
β
|
| 131 |
-
β
|
| 132 |
-
β
|
| 133 |
-
|
| 134 |
-
βββ
|
| 135 |
-
βββ
|
| 136 |
-
βββ
|
| 137 |
-
βββ
|
| 138 |
-
|
| 139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
```
|
| 141 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
## π§ Configuration
|
| 143 |
|
| 144 |
-
BLUX-cA uses
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
-
|
| 147 |
-
2. **Environment Variables** β Runtime overrides
|
| 148 |
-
3. **Local Config Files** β User-specific settings
|
| 149 |
|
| 150 |
```yaml
|
| 151 |
-
# config.yaml
|
| 152 |
orchestrator:
|
| 153 |
max_agents: 5
|
| 154 |
timeout: 30s
|
|
|
|
| 155 |
|
| 156 |
memory:
|
| 157 |
decay_rate: 0.1
|
| 158 |
reinforcement_factor: 1.5
|
|
|
|
| 159 |
|
| 160 |
security:
|
| 161 |
audit_enabled: true
|
| 162 |
sandbox_mode: strict
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
```
|
| 164 |
|
| 165 |
-
See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for
|
| 166 |
|
| 167 |
-
|
| 168 |
|
| 169 |
-
|
| 170 |
-
# Run all tests
|
| 171 |
-
pytest
|
| 172 |
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
|
| 178 |
-
|
| 179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
```
|
| 181 |
|
| 182 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
|
| 184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
|
| 186 |
-
|
| 187 |
-
- [Installation Guide](docs/INSTALL.md)
|
| 188 |
-
- [Configuration Reference](docs/CONFIGURATION.md)
|
| 189 |
-
- [Security Model](docs/SECURITY.md)
|
| 190 |
-
- [Privacy Guarantees](docs/PRIVACY.md)
|
| 191 |
-
- [Integration Guide](docs/INTEGRATIONS.md)
|
| 192 |
-
- [Operations Manual](docs/OPERATIONS.md)
|
| 193 |
-
- [Troubleshooting](docs/TROUBLESHOOTING.md)
|
| 194 |
|
| 195 |
## π€ Contributing
|
| 196 |
|
| 197 |
-
We welcome contributions
|
|
|
|
|
|
|
| 198 |
|
| 199 |
- **Integrity > Approval** β Honest feedback and truthful code
|
| 200 |
-
- **Truth > Comfort** β Solutions over convenient shortcuts
|
| 201 |
- **Light > Denial** β Transparency in all changes
|
| 202 |
|
| 203 |
-
### Contribution
|
| 204 |
|
| 205 |
-
1. Fork the repository
|
| 206 |
-
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
| 207 |
-
3. Write tests for your changes
|
| 208 |
-
4. Ensure all tests pass (`pytest`)
|
| 209 |
-
5. Update documentation as needed
|
| 210 |
-
6. Commit
|
| 211 |
-
7. Push to
|
| 212 |
-
8. Open a Pull Request
|
| 213 |
|
| 214 |
### Requirements
|
| 215 |
|
| 216 |
-
- Unit tests for all new functionality
|
| 217 |
-
- Constitutional alignment verification
|
| 218 |
-
- Clear documentation
|
| 219 |
-
- No breaking changes to audit logs or security features
|
|
|
|
|
|
|
|
|
|
| 220 |
|
| 221 |
## πΊοΈ Roadmap
|
| 222 |
|
|
|
|
| 223 |
- [ ] Enhanced multi-model support (GPT-4, Claude, Gemini)
|
| 224 |
- [ ] Visual dashboard for real-time monitoring
|
| 225 |
- [ ] Extended sandboxing with container isolation
|
|
|
|
|
|
|
|
|
|
| 226 |
- [ ] Distributed orchestration capabilities
|
| 227 |
- [ ] Advanced memory compression and retrieval
|
| 228 |
-
- [ ]
|
|
|
|
| 229 |
|
| 230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 231 |
|
| 232 |
-
|
| 233 |
|
| 234 |
-
|
| 235 |
|
| 236 |
-
|
| 237 |
-
- **Doctrine Integration** β Policy-driven governance
|
| 238 |
-
- **BLUX-Guard Hooks** β Security monitoring and alerts
|
| 239 |
-
- **BLUX-Lite Adapter** β Orchestration planning
|
| 240 |
-
- **BLUX-Quantum CLI** β Advanced command-line tools
|
| 241 |
-
- **MkDocs Site** β Hosted documentation
|
| 242 |
|
| 243 |
-
|
| 244 |
|
| 245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 246 |
|
| 247 |
-
|
| 248 |
-
Input β Perception β Discernment β Constitutional Check β Verdict β Response
|
| 249 |
-
β
|
| 250 |
-
Reflection & Audit
|
| 251 |
-
```
|
| 252 |
|
| 253 |
-
|
| 254 |
|
| 255 |
-
|
| 256 |
-
Router β [Agent1, Agent2, Agent3] β Conflict Resolution β Merged Output
|
| 257 |
-
β β β
|
| 258 |
-
Model A Model B Model C
|
| 259 |
-
```
|
| 260 |
|
| 261 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 262 |
|
| 263 |
-
|
| 264 |
-
Code β Context Extraction β Evaluation β Diff Generation β Validation β Output
|
| 265 |
-
β
|
| 266 |
-
[Anchors, Ranges, Dependencies]
|
| 267 |
-
```
|
| 268 |
|
| 269 |
-
|
| 270 |
|
| 271 |
-
|
| 272 |
|
| 273 |
-
|
| 274 |
-
- **Audit Logging** β Immutable, hash-chained records
|
| 275 |
-
- **Access Control** β Token-based auth with role management
|
| 276 |
-
- **Data Encryption** β At-rest and in-transit protection
|
| 277 |
-
- **Vulnerability Scanning** β Continuous security monitoring
|
| 278 |
|
| 279 |
-
|
| 280 |
|
| 281 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 282 |
|
| 283 |
-
|
| 284 |
|
| 285 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 286 |
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
- **
|
| 290 |
-
- **
|
|
|
|
|
|
|
|
|
|
| 291 |
|
| 292 |
## π Acknowledgments
|
| 293 |
|
| 294 |
Built with the principles of conscious AI development:
|
| 295 |
-
|
| 296 |
-
-
|
| 297 |
-
- Constitutional alignment
|
| 298 |
-
- Verifiable
|
| 299 |
-
- Human
|
|
|
|
| 300 |
|
| 301 |
---
|
| 302 |
|
| 303 |
-
<
|
| 304 |
-
|
| 305 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
|
| 307 |
-
|
| 308 |
-
Made with β€οΈ by <a href="https://github.com/Outer-Void">Outer Void</a>
|
| 309 |
-
</p>
|
|
|
|
| 2 |
|
| 3 |
[](LICENSE)
|
| 4 |
[](https://www.python.org/downloads/)
|
| 5 |
+
[](https://github.com/Outer-Void/blux-ca/stargazers)
|
| 6 |
|
| 7 |
+
> **Conscious, Constitutional, Multi-Model, and Fully Audited**
|
| 8 |
|
| 9 |
+
BLUX-cA is the Conscious Agent kernel of the BLUX ecosystem β a constitution-driven, multi-agent reasoning engine designed to provide aligned guidance, orchestrated tooling, secure code execution, self-reflection, and verifiable intelligence.
|
| 10 |
|
| 11 |
+
It is the center of gravity for BLUX-Lite (orchestrator), BLUX-Quantum (CLI operations), BLUX-Guard (security cockpit), the Doctrine (ethical spine), and your future daughter-safe autonomy model.
|
| 12 |
|
| 13 |
+
---
|
| 14 |
|
| 15 |
+
## π Philosophy
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
BLUX-cA operates on three foundational principles:
|
| 18 |
|
| 19 |
+
- **Light > Denial** β Confronting reality with compassion
|
| 20 |
+
- **Integrity > Approval** β Truth-aligned responses over convenience
|
| 21 |
+
- **Truth > Comfort** β Honest guidance that serves growth
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
All while keeping data local, audit trails immutable, and user sovereignty non-negotiable.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
## β‘ Core Capabilities
|
| 28 |
+
|
| 29 |
+
### 1. Adaptive Memory & Constitutional Learning
|
| 30 |
+
|
| 31 |
+
A privacy-first, consent-only memory system featuring:
|
| 32 |
+
|
| 33 |
+
- **Weighted Reinforcement Memory** β Learns from interaction patterns
|
| 34 |
+
- **Memory Decay** β Outdated information naturally fades
|
| 35 |
+
- **Consent-Gated Persistence** β User control over data retention
|
| 36 |
+
- **Router-Bound Context Assembly** β Intelligent context management
|
| 37 |
+
- **Reflective Distillation** β Summaries and filtered insights
|
| 38 |
+
- **Hash-Chained Audit Logs** β Append-only, tamper-evident records
|
| 39 |
+
|
| 40 |
+
**Memory lives locally on the user's device β never externally.**
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
### 2. The Conscious Heart
|
| 45 |
+
|
| 46 |
+
`blux_ca.core.heart.ConsciousHeart` orchestrates the core reasoning loop:
|
| 47 |
+
|
| 48 |
+
**Processing Pipeline:**
|
| 49 |
+
```
|
| 50 |
+
Perception β Discernment β Constitutional Check β Verdict β Response
|
| 51 |
+
β
|
| 52 |
+
Reflection & Audit
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
**Features:**
|
| 56 |
+
- Truth-alignment checks (integrity, awareness, compassion)
|
| 57 |
+
- Koan-based self-reflection prompts
|
| 58 |
+
- Case classification (struggler vs. indulger logic)
|
| 59 |
+
- Doctrine-bound action selection
|
| 60 |
+
- Direct integration with Clarity Engine
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
### 3. Multi-Agent Collaboration
|
| 65 |
+
|
| 66 |
+
BLUX-cA coordinates intelligently across model agents:
|
| 67 |
+
|
| 68 |
+
- **Task Broadcasting** β Distribute work efficiently
|
| 69 |
+
- **Split/Merge Outputs** β Parallel processing with synthesis
|
| 70 |
+
- **Conflict Resolution** β Consensus-building heuristics
|
| 71 |
+
- **Router-Guided Delegation** β Model selection optimization
|
| 72 |
+
- **Configurable Fan-Out** β Scale for complex reasoning tasks
|
| 73 |
+
|
| 74 |
+
---
|
| 75 |
+
|
| 76 |
+
### 4. Advanced Code Intelligence
|
| 77 |
+
|
| 78 |
+
Integrated evaluator suite for real code reasoning:
|
| 79 |
+
|
| 80 |
+
**Evaluators:**
|
| 81 |
+
- Python evaluator (safe-mode execution)
|
| 82 |
+
- Node-based JavaScript/TypeScript evaluator
|
| 83 |
+
- Bash subprocess evaluator
|
| 84 |
+
- Async evaluators for concurrent operations
|
| 85 |
+
- Multi-step pipeline evaluators
|
| 86 |
+
|
| 87 |
+
**Code Context Layer:**
|
| 88 |
+
- Repository scanning and indexing
|
| 89 |
+
- Line-range extraction with precision
|
| 90 |
+
- Anchor detection (`# >>> NAME`)
|
| 91 |
+
- Unified diff generation (diff-only workflow)
|
| 92 |
+
- Patch validation (prevents anchor deletion)
|
| 93 |
+
|
| 94 |
+
**Powers:**
|
| 95 |
+
- Intelligent bug finding
|
| 96 |
+
- Context-aware code explanation
|
| 97 |
+
- File-aware reasoning
|
| 98 |
+
- Minimal diffs for orchestrator integration
|
| 99 |
+
|
| 100 |
+
---
|
| 101 |
+
|
| 102 |
+
### 5. Secure Orchestrator Layer
|
| 103 |
+
|
| 104 |
+
Located in `ca/orchestrator/secure/`:
|
| 105 |
+
|
| 106 |
+
- **Token-Based Authentication** β Secure API access
|
| 107 |
+
- **Role-Based Authorization** β Granular permission control
|
| 108 |
+
- **Multi-User Isolation** β Secure concurrent operations
|
| 109 |
+
- **Tamper-Evident Audit Logs** β Complete action history
|
| 110 |
+
- **Controlled Evaluator Sandboxing** β Safe code execution
|
| 111 |
+
|
| 112 |
+
---
|
| 113 |
|
| 114 |
+
### 6. Real-Time Monitoring
|
| 115 |
+
|
| 116 |
+
Comprehensive observability system:
|
| 117 |
+
|
| 118 |
+
- **Threaded Agent Observer** β Non-blocking performance tracking
|
| 119 |
+
- **Evaluator Performance Metrics** β Execution profiling
|
| 120 |
+
- **Execution Trails** β Complete operation history
|
| 121 |
+
- **Optional Web Dashboard** β Visual monitoring interface
|
| 122 |
+
- **Automated Controller Insights** β Machine-readable telemetry
|
| 123 |
+
|
| 124 |
+
---
|
| 125 |
+
|
| 126 |
+
### 7. CLI & Script Utilities
|
| 127 |
+
|
| 128 |
+
**Main Entry Point:** `ca.py`
|
| 129 |
+
|
| 130 |
+
**Available Commands:**
|
| 131 |
+
|
| 132 |
+
```bash
|
| 133 |
+
ca reflect # Philosophical reasoning on a query
|
| 134 |
+
ca explain # Explain code or concepts
|
| 135 |
+
ca code-eval # Evaluate code for quality/security
|
| 136 |
+
ca code-task # Execute code-related tasks
|
| 137 |
+
ca audit-export # Export audit logs for review
|
| 138 |
+
ca repl # Interactive REPL mode
|
| 139 |
+
ca doctrine # Query doctrine engine
|
| 140 |
+
ca memory # Memory management operations
|
| 141 |
+
ca router # Router configuration and testing
|
| 142 |
+
ca self-test # Run system diagnostics
|
| 143 |
+
```
|
| 144 |
+
|
| 145 |
+
**Integration:** Works seamlessly with `bq` (BLUX Quantum) for cross-shell automation.
|
| 146 |
+
|
| 147 |
+
---
|
| 148 |
+
|
| 149 |
+
### 8. Comprehensive Testing
|
| 150 |
+
|
| 151 |
+
Located under `tests/`:
|
| 152 |
+
|
| 153 |
+
- Evaluator stress tests
|
| 154 |
+
- Sandbox validation
|
| 155 |
+
- Orchestrator load tests
|
| 156 |
+
- Constitution scenario checks
|
| 157 |
+
- CI-ready test suite with GitHub Actions
|
| 158 |
+
|
| 159 |
+
---
|
| 160 |
+
|
| 161 |
+
### 9. Optional Intelligence Stack
|
| 162 |
+
|
| 163 |
+
Activate extended reasoning capabilities:
|
| 164 |
+
|
| 165 |
+
- **Strategy/Tactic Selectors** β Adaptive approach selection
|
| 166 |
+
- **Meta-Cognition Pass** β Self-awareness in reasoning
|
| 167 |
+
- **Self-Critique** β Reflective rewriting and improvement
|
| 168 |
+
- **Predictive User Modeling** β Anticipate user needs
|
| 169 |
+
- **Multi-Agent Consensus** β Collaborative decision resolution
|
| 170 |
+
|
| 171 |
+
**Always constrained by:**
|
| 172 |
+
- The BLUX Constitution
|
| 173 |
+
- Integrity > Approval
|
| 174 |
+
- Truth > Comfort
|
| 175 |
+
- Light > Denial
|
| 176 |
+
|
| 177 |
+
---
|
| 178 |
|
| 179 |
## π Quick Start
|
| 180 |
|
|
|
|
| 194 |
|
| 195 |
### Basic Usage
|
| 196 |
|
| 197 |
+
**CLI Examples:**
|
| 198 |
+
|
| 199 |
```bash
|
| 200 |
+
# Philosophical reflection
|
| 201 |
+
python ca.py reflect "I feel lost today"
|
| 202 |
|
| 203 |
+
# Interactive REPL
|
| 204 |
python ca.py repl
|
| 205 |
|
| 206 |
# Evaluate code
|
| 207 |
python ca.py code-eval --file utils.py
|
| 208 |
|
| 209 |
+
# Batch processing
|
| 210 |
+
python ca.py --batch tasks.txt
|
| 211 |
|
| 212 |
# Export audit logs
|
| 213 |
python ca.py audit-export
|
| 214 |
```
|
| 215 |
|
| 216 |
+
**Python API:**
|
| 217 |
|
| 218 |
```python
|
| 219 |
from blux_ca.core.heart import ConsciousHeart
|
|
|
|
| 223 |
engine = ClarityEngine()
|
| 224 |
heart = ConsciousHeart(engine)
|
| 225 |
|
| 226 |
+
# Process a request with constitutional guidance
|
| 227 |
result = heart.process(
|
| 228 |
"I feel lost and need guidance.",
|
| 229 |
user_type="struggler"
|
|
|
|
| 232 |
print(result.message)
|
| 233 |
```
|
| 234 |
|
| 235 |
+
---
|
| 236 |
+
|
| 237 |
## π Project Structure
|
| 238 |
|
| 239 |
```
|
| 240 |
blux-ca/
|
| 241 |
+
βββ CLARITY_AGENT_SPEC.md # Detailed specification
|
| 242 |
+
βββ LICENSE # Apache 2.0 License
|
| 243 |
+
βββ README.md # This file
|
| 244 |
+
βββ ca.py # Main CLI entry point
|
| 245 |
+
βββ pyproject.toml # Python project metadata
|
| 246 |
+
βββ requirements.txt # Dependencies
|
| 247 |
+
βββ mkdocs.yml # Documentation configuration
|
| 248 |
+
β
|
| 249 |
+
βββ blux_ca/ # Legacy/alternative namespace
|
| 250 |
+
β βββ [Python modules]
|
| 251 |
+
β
|
| 252 |
+
βββ ca/ # Core agent implementation
|
| 253 |
+
β βββ adaptors/ # External system integrations
|
| 254 |
+
β β βββ bq_cli.py # BLUX Quantum CLI integration
|
| 255 |
+
β β βββ doctrine.py # Doctrine engine adapter
|
| 256 |
+
β β βββ guard.py # BLUX-Guard security hooks
|
| 257 |
+
β β βββ lite.py # BLUX-Lite orchestrator
|
| 258 |
+
β β βββ quantum.py # Quantum CLI tooling
|
| 259 |
+
β β
|
| 260 |
+
β βββ agent/ # Agent logic and reasoning
|
| 261 |
+
β β βββ advanced/ # Advanced features
|
| 262 |
+
β β β βββ adaptive_memory.py
|
| 263 |
+
β β β βββ monitoring.py
|
| 264 |
+
β β β βββ multi_agent.py
|
| 265 |
+
β β β βββ reasoning.py
|
| 266 |
+
β β βββ constitution.py # Constitutional framework
|
| 267 |
+
β β βββ core_agent.py # Base agent implementation
|
| 268 |
+
β β βββ discernment.py # Decision-making logic
|
| 269 |
+
β β βββ memory.py # Memory management
|
| 270 |
+
β β βββ audit.py # Audit logging
|
| 271 |
+
β β
|
| 272 |
+
β βββ api/ # API service layer
|
| 273 |
+
β β βββ schemas.py # Data models
|
| 274 |
+
β β βββ service.py # FastAPI service
|
| 275 |
+
β β
|
| 276 |
+
β βββ core/ # Core engine components
|
| 277 |
+
β β βββ clarity_engine.py # Main reasoning engine
|
| 278 |
+
β β βββ heart.py # Conscious processing core
|
| 279 |
+
β β βββ code_context.py # Code analysis layer
|
| 280 |
+
β β βββ code_tasks.py # Code task execution
|
| 281 |
+
β β βββ diff_engine.py # Diff generation
|
| 282 |
+
β β βββ compass/ # Intent detection
|
| 283 |
+
β β βββ perception.py # Input processing
|
| 284 |
+
β β βββ discernment.py # Judgment logic
|
| 285 |
+
β β βββ reflection.py # Self-reflection
|
| 286 |
+
β β βββ constitution.py # Constitutional checks
|
| 287 |
+
β β βββ intervention.py # Intervention system
|
| 288 |
+
β β βββ koan.py # Philosophical prompts
|
| 289 |
+
β β βββ dimensions.py # Dimensional analysis
|
| 290 |
+
β β βββ states.py # State management
|
| 291 |
+
β β
|
| 292 |
+
β βββ evaluator/ # Code evaluation engines
|
| 293 |
+
β β βββ python.py # Python evaluator
|
| 294 |
+
β β βββ js_ts.py # JavaScript/TypeScript
|
| 295 |
+
β β βββ advanced/ # Async evaluators
|
| 296 |
+
β β βββ bash_evaluator.py
|
| 297 |
+
β β βββ js_ts_async.py
|
| 298 |
+
β β βββ python_async.py
|
| 299 |
+
β β βββ pipeline.py
|
| 300 |
+
β β
|
| 301 |
+
β βββ orchestrator/ # Multi-agent coordination
|
| 302 |
+
β β βββ router.py # Task routing
|
| 303 |
+
β β βββ controller.py # Orchestration controller
|
| 304 |
+
β β βββ registry.py # Agent registry
|
| 305 |
+
β β βββ config.yaml # Orchestrator config
|
| 306 |
+
β β βββ secure/ # Security layer
|
| 307 |
+
β β βββ auth.py
|
| 308 |
+
β β βββ audit.py
|
| 309 |
+
β β βββ secure_controller.py
|
| 310 |
+
β β
|
| 311 |
+
β βββ cli.py # CLI implementation
|
| 312 |
+
β βββ config.py # Configuration management
|
| 313 |
+
β βββ telemetry.py # Telemetry and monitoring
|
| 314 |
+
β
|
| 315 |
+
βββ constitution/ # Constitutional definitions
|
| 316 |
+
β βββ behavior.md
|
| 317 |
+
β
|
| 318 |
+
βββ doctrine/ # Policy and governance
|
| 319 |
+
β βββ [Doctrine rules]
|
| 320 |
+
β
|
| 321 |
+
βββ ethos/ # Ethical framework
|
| 322 |
+
β βββ manifest.yaml
|
| 323 |
+
β
|
| 324 |
+
βββ identity/ # Agent identity
|
| 325 |
+
β βββ seed.json
|
| 326 |
+
β
|
| 327 |
+
βββ docs/ # Comprehensive documentation
|
| 328 |
+
β βββ ARCHITECTURE.md
|
| 329 |
+
β βββ CONFIGURATION.md
|
| 330 |
+
β βββ CONSTITUTION.md
|
| 331 |
+
β βββ DISCERNMENT.md
|
| 332 |
+
β βββ ETHICS_ENGINE.md
|
| 333 |
+
β βββ INSTALL.md
|
| 334 |
+
β βββ INTEGRATIONS.md
|
| 335 |
+
β βββ INTERVENTIONS.md
|
| 336 |
+
β βββ OPERATIONS.md
|
| 337 |
+
β βββ PRIVACY.md
|
| 338 |
+
β βββ ROADMAP.md
|
| 339 |
+
β βββ SECURITY.md
|
| 340 |
+
β βββ TROUBLESHOOTING.md
|
| 341 |
+
β βββ VISION.md
|
| 342 |
+
β
|
| 343 |
+
βββ scripts/ # Utility scripts
|
| 344 |
+
β βββ batch_task.py
|
| 345 |
+
β βββ export_audit_json.py
|
| 346 |
+
β βββ gen_filetree.py
|
| 347 |
+
β βββ ingest_reflection.py
|
| 348 |
+
β βββ interactive_repl.py
|
| 349 |
+
β βββ memory_query.py
|
| 350 |
+
β βββ reflection.py
|
| 351 |
+
β βββ validate_constitution.py
|
| 352 |
+
β
|
| 353 |
+
βββ tests/ # Test suite
|
| 354 |
+
βββ ca/ # Component tests
|
| 355 |
+
β βββ test_audit.py
|
| 356 |
+
β βββ test_constitution.py
|
| 357 |
+
β βββ test_discernment.py
|
| 358 |
+
β βββ test_heart.py
|
| 359 |
+
β βββ test_memory.py
|
| 360 |
+
βββ fixtures/ # Test fixtures
|
| 361 |
+
βββ test_agent.py
|
| 362 |
+
βββ test_evaluator.py
|
| 363 |
+
βββ test_orchestrator.py
|
| 364 |
+
βββ test_security.py
|
| 365 |
+
βββ test_integration.py
|
| 366 |
+
```
|
| 367 |
+
|
| 368 |
+
---
|
| 369 |
+
|
| 370 |
+
## π§ͺ Testing & Quality
|
| 371 |
+
|
| 372 |
+
Run the comprehensive test suite:
|
| 373 |
+
|
| 374 |
+
```bash
|
| 375 |
+
# Run all tests
|
| 376 |
+
pytest
|
| 377 |
+
|
| 378 |
+
# Run specific test categories
|
| 379 |
+
pytest tests/ca/ # Component tests
|
| 380 |
+
pytest tests/test_evaluator.py # Evaluator tests
|
| 381 |
+
pytest tests/test_orchestrator.py # Orchestration tests
|
| 382 |
+
pytest tests/test_security.py # Security tests
|
| 383 |
+
|
| 384 |
+
# Run with coverage reporting
|
| 385 |
+
pytest --cov=ca --cov-report=html
|
| 386 |
+
|
| 387 |
+
# Run stress tests
|
| 388 |
+
pytest tests/test_stress.py -v
|
| 389 |
```
|
| 390 |
|
| 391 |
+
**CI/CD:** GitHub Actions workflows automatically run tests on all pull requests.
|
| 392 |
+
|
| 393 |
+
---
|
| 394 |
+
|
| 395 |
## π§ Configuration
|
| 396 |
|
| 397 |
+
BLUX-cA uses hierarchical configuration:
|
| 398 |
+
|
| 399 |
+
1. **Built-in defaults** β Sensible out-of-the-box settings
|
| 400 |
+
2. **Environment variables** β Runtime overrides
|
| 401 |
+
3. **Local config files** β User-specific customization
|
| 402 |
|
| 403 |
+
**Example Configuration:**
|
|
|
|
|
|
|
| 404 |
|
| 405 |
```yaml
|
| 406 |
+
# config.yaml
|
| 407 |
orchestrator:
|
| 408 |
max_agents: 5
|
| 409 |
timeout: 30s
|
| 410 |
+
conflict_resolution: consensus
|
| 411 |
|
| 412 |
memory:
|
| 413 |
decay_rate: 0.1
|
| 414 |
reinforcement_factor: 1.5
|
| 415 |
+
consent_required: true
|
| 416 |
|
| 417 |
security:
|
| 418 |
audit_enabled: true
|
| 419 |
sandbox_mode: strict
|
| 420 |
+
auth_required: true
|
| 421 |
+
|
| 422 |
+
evaluator:
|
| 423 |
+
python_timeout: 10s
|
| 424 |
+
js_timeout: 5s
|
| 425 |
+
max_memory: 512MB
|
| 426 |
```
|
| 427 |
|
| 428 |
+
See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for complete options.
|
| 429 |
|
| 430 |
+
---
|
| 431 |
|
| 432 |
+
## π Documentation
|
|
|
|
|
|
|
| 433 |
|
| 434 |
+
Comprehensive documentation is available:
|
| 435 |
+
|
| 436 |
+
| Document | Description |
|
| 437 |
+
|----------|-------------|
|
| 438 |
+
| [ARCHITECTURE.md](docs/ARCHITECTURE.md) | System architecture and design |
|
| 439 |
+
| [INSTALL.md](docs/INSTALL.md) | Installation and setup guide |
|
| 440 |
+
| [CONFIGURATION.md](docs/CONFIGURATION.md) | Configuration reference |
|
| 441 |
+
| [CONSTITUTION.md](docs/CONSTITUTION.md) | Constitutional framework |
|
| 442 |
+
| [SECURITY.md](docs/SECURITY.md) | Security model and practices |
|
| 443 |
+
| [PRIVACY.md](docs/PRIVACY.md) | Privacy guarantees and data handling |
|
| 444 |
+
| [INTEGRATIONS.md](docs/INTEGRATIONS.md) | Integration with BLUX ecosystem |
|
| 445 |
+
| [OPERATIONS.md](docs/OPERATIONS.md) | Operations and deployment |
|
| 446 |
+
| [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) | Common issues and solutions |
|
| 447 |
+
| [ROADMAP.md](docs/ROADMAP.md) | Future development plans |
|
| 448 |
|
| 449 |
+
---
|
| 450 |
+
|
| 451 |
+
## ποΈ Enterprise Features
|
| 452 |
+
|
| 453 |
+
The enterprise subsystem provides production-ready capabilities:
|
| 454 |
+
|
| 455 |
+
- **FastAPI Service** (`blux_ca.api.service`) β RESTful API interface
|
| 456 |
+
- **Doctrine Integration** β Policy-driven governance layer
|
| 457 |
+
- **BLUX-Guard Hooks** β Real-time security monitoring
|
| 458 |
+
- **BLUX-Lite Adapter** β Orchestration planning and execution
|
| 459 |
+
- **BLUX-Quantum CLI** β Advanced command-line operations
|
| 460 |
+
- **MkDocs Site** β Hosted documentation portal
|
| 461 |
+
|
| 462 |
+
### Doctrine Engine
|
| 463 |
+
|
| 464 |
+
Constitutional policy engine with rule bundles:
|
| 465 |
+
|
| 466 |
+
```bash
|
| 467 |
+
# Check text against doctrine
|
| 468 |
+
python -m doctrine.cli check "text to analyze"
|
| 469 |
```
|
| 470 |
|
| 471 |
+
Located in `doctrine/rules/` with extensible rule system.
|
| 472 |
+
|
| 473 |
+
### Clarity Agent Runtime
|
| 474 |
+
|
| 475 |
+
New runtime orchestrator under `ca/runtime/` integrates:
|
| 476 |
|
| 477 |
+
- **Doctrine Governance** β Policy enforcement
|
| 478 |
+
- **Lite Planning** β Task orchestration
|
| 479 |
+
- **Guard Labeling** β Security classification
|
| 480 |
+
- **Pluggable LLM Stubs** β Model abstraction
|
| 481 |
+
- **Safety Overrides** β Crisis-aware response system
|
| 482 |
+
- **Recovery Helpers** β Graceful error handling
|
| 483 |
|
| 484 |
+
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 485 |
|
| 486 |
## π€ Contributing
|
| 487 |
|
| 488 |
+
We welcome contributions aligned with the BLUX Constitution:
|
| 489 |
+
|
| 490 |
+
### Core Principles
|
| 491 |
|
| 492 |
- **Integrity > Approval** β Honest feedback and truthful code
|
| 493 |
+
- **Truth > Comfort** β Solutions over convenient shortcuts
|
| 494 |
- **Light > Denial** β Transparency in all changes
|
| 495 |
|
| 496 |
+
### Contribution Process
|
| 497 |
|
| 498 |
+
1. **Fork** the repository
|
| 499 |
+
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
|
| 500 |
+
3. **Write** tests for your changes
|
| 501 |
+
4. **Ensure** all tests pass (`pytest`)
|
| 502 |
+
5. **Update** documentation as needed
|
| 503 |
+
6. **Commit** with clear messages (`git commit -m 'Add amazing feature'`)
|
| 504 |
+
7. **Push** to your branch (`git push origin feature/amazing-feature`)
|
| 505 |
+
8. **Open** a Pull Request
|
| 506 |
|
| 507 |
### Requirements
|
| 508 |
|
| 509 |
+
- β
Unit tests for all new functionality
|
| 510 |
+
- β
Constitutional alignment verification
|
| 511 |
+
- β
Clear, comprehensive documentation
|
| 512 |
+
- β
No breaking changes to audit logs or security features
|
| 513 |
+
- β
Code follows project style guidelines
|
| 514 |
+
|
| 515 |
+
---
|
| 516 |
|
| 517 |
## πΊοΈ Roadmap
|
| 518 |
|
| 519 |
+
### Near Term
|
| 520 |
- [ ] Enhanced multi-model support (GPT-4, Claude, Gemini)
|
| 521 |
- [ ] Visual dashboard for real-time monitoring
|
| 522 |
- [ ] Extended sandboxing with container isolation
|
| 523 |
+
- [ ] Plugin architecture for custom evaluators
|
| 524 |
+
|
| 525 |
+
### Medium Term
|
| 526 |
- [ ] Distributed orchestration capabilities
|
| 527 |
- [ ] Advanced memory compression and retrieval
|
| 528 |
+
- [ ] Federated learning support
|
| 529 |
+
- [ ] Enhanced mobile/edge deployment
|
| 530 |
|
| 531 |
+
### Long Term
|
| 532 |
+
- [ ] Autonomous agent swarms
|
| 533 |
+
- [ ] Cross-platform memory sync
|
| 534 |
+
- [ ] Blockchain-backed audit trails
|
| 535 |
+
- [ ] Quantum-resistant security
|
| 536 |
|
| 537 |
+
See [docs/ROADMAP.md](docs/ROADMAP.md) for detailed timeline and priorities.
|
| 538 |
|
| 539 |
+
---
|
| 540 |
|
| 541 |
+
## π Security
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 542 |
|
| 543 |
+
BLUX-cA prioritizes security at every layer:
|
| 544 |
|
| 545 |
+
- **Sandboxed Execution** β Isolated environments for code evaluation
|
| 546 |
+
- **Immutable Audit Logs** β Hash-chained, tamper-evident records
|
| 547 |
+
- **Token-Based Authentication** β Secure API access control
|
| 548 |
+
- **Role-Based Authorization** β Granular permission management
|
| 549 |
+
- **Data Encryption** β At-rest and in-transit protection
|
| 550 |
+
- **Vulnerability Scanning** β Continuous security monitoring
|
| 551 |
+
- **Multi-User Isolation** β Secure concurrent operations
|
| 552 |
|
| 553 |
+
### Reporting Security Issues
|
|
|
|
|
|
|
|
|
|
|
|
|
| 554 |
|
| 555 |
+
Please report security vulnerabilities responsibly:
|
| 556 |
|
| 557 |
+
π§ **Email:** [outervoid.blux@gmail.com](mailto:outervoid.blux@gmail.com)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 558 |
|
| 559 |
+
**Please include:**
|
| 560 |
+
- Description of the vulnerability
|
| 561 |
+
- Steps to reproduce
|
| 562 |
+
- Potential impact assessment
|
| 563 |
+
- Suggested fix (if available)
|
| 564 |
|
| 565 |
+
We take security seriously and will respond promptly to all reports.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 566 |
|
| 567 |
+
---
|
| 568 |
|
| 569 |
+
## π License
|
| 570 |
|
| 571 |
+
This project is licensed under the **Apache License 2.0**.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 572 |
|
| 573 |
+
See the [LICENSE](LICENSE) file for full details.
|
| 574 |
|
| 575 |
+
**Key Points:**
|
| 576 |
+
- β
Commercial use permitted
|
| 577 |
+
- β
Modification permitted
|
| 578 |
+
- β
Distribution permitted
|
| 579 |
+
- β
Patent use permitted
|
| 580 |
+
- β οΈ Must include license and copyright notice
|
| 581 |
+
- β οΈ Changes must be documented
|
| 582 |
+
|
| 583 |
+
---
|
| 584 |
|
| 585 |
+
## π Links & Resources
|
| 586 |
|
| 587 |
+
- **Repository:** [github.com/Outer-Void/blux-ca](https://github.com/Outer-Void/blux-ca)
|
| 588 |
+
- **Organization:** [github.com/Outer-Void](https://github.com/Outer-Void)
|
| 589 |
+
- **Issues:** [GitHub Issues](https://github.com/Outer-Void/blux-ca/issues)
|
| 590 |
+
- **Discussions:** [GitHub Discussions](https://github.com/Outer-Void/blux-ca/discussions)
|
| 591 |
+
- **Security:** [Security Policy](https://github.com/Outer-Void/blux-ca/security)
|
| 592 |
|
| 593 |
+
### Related Projects
|
| 594 |
+
|
| 595 |
+
- **BLUX-Lite** β Task orchestration layer
|
| 596 |
+
- **BLUX-Quantum** β CLI operations framework
|
| 597 |
+
- **BLUX-Guard** β Security cockpit and monitoring
|
| 598 |
+
|
| 599 |
+
---
|
| 600 |
|
| 601 |
## π Acknowledgments
|
| 602 |
|
| 603 |
Built with the principles of conscious AI development:
|
| 604 |
+
|
| 605 |
+
- π **Privacy-First Design** β Local data, user sovereignty
|
| 606 |
+
- π§ **Ethical Reasoning** β Constitutional alignment
|
| 607 |
+
- π **Verifiable Intelligence** β Auditable decision-making
|
| 608 |
+
- π€ **Human Collaboration** β AI as partner, not replacement
|
| 609 |
+
- π **Continuous Growth** β Self-reflection and improvement
|
| 610 |
|
| 611 |
---
|
| 612 |
|
| 613 |
+
<div align="center">
|
| 614 |
+
|
| 615 |
+
### BLUX-cA β Where Consciousness Meets Code
|
| 616 |
+
|
| 617 |
+
**Made with β€οΈ by [Outer Void](https://github.com/Outer-Void)**
|
| 618 |
+
|
| 619 |
+
*Light > Denial β’ Integrity > Approval β’ Truth > Comfort*
|
| 620 |
+
|
| 621 |
+
[](https://github.com/Outer-Void/blux-ca/stargazers)
|
| 622 |
+
[](https://github.com/Outer-Void)
|
| 623 |
|
| 624 |
+
</div>
|
|
|
|
|
|