""" Autonogrammer AI Companion System
Full-stack autonomous programming with RPQE architecture.
Autonogrammer is a production-ready AI companion system for autonomous software development, leveraging Recursively Photonic Quantum Engineering (RPQE) principles to achieve quantum-inspired performance on classical infrastructure.
┌─────────────────────────────────────────────────────────────────┐
│ Autonogrammer Full Stack │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Rust │ │ Python │ │ Elixir │ │
│ │ Core │ │ DSpy │ │ Phoenix │ │
│ └──────────┘ └──────────┘ └──────────┘ │
│ │ │ │ │
│ └─────────────┼──────────────┘ │
│ │ │
│ ┌─────▼──────┐ │
│ │ Nomad │ │
│ │ Scheduler │ │
│ └─────────────┘ │
│ │ │
│ ┌─────▼──────┐ │
│ │ HashiCorp │ │
│ │ Services │ │
│ └─────────────┘ │
└─────────────────────────────────────────────────────────────────┘
- RPQE Architecture: Photonic Coherence, Superposition, Entanglement, Neural Feedback, Gate Recursion
- Multi-Agent Orchestration: CodeGenerator, TestEngineer, ReviewAgent, DebugAgent
- AutoQC Compliance: 10 best practices enforced automatically
- Full-Stack: Rust backend, Python agents, Elixir orchestration
- Enterprise-Ready: Multi-planetary compliance, security, observability
- Docker & Docker Compose
- Python 3.11+
- Rust 1.70+
- Elixir 1.15+
- Nomad/Consul/Vault (optional)
# Clone repository
git clone https://github.com/swcstudio/aicompanion.git
cd aicompanion
# Start all services
docker-compose up -d
# Check services status
docker-compose ps
# View logs
docker-compose logs -f phoenix-app# Python agents
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
# Rust backend
cd rust_backend_core
cargo build --release
# Elixir/Phoenix
cd phoenix_app
mix deps.get
mix phx.server| Spec | Description |
|---|---|
| AUTONOGRAMMER_BLUEPRINT.md | Complete system blueprint |
| CODE_QUALITY_BEST_PRACTICES.md | AutoQC framework |
| RUST_BACKEND_CORE.md | Rust backend details |
| PYTHON_DSPY_UVX.md | Python/DSpy agents |
| PHOENIX_ORCHESTRATION.md | Phoenix orchestration |
| HASHICORP_NOMAD_CLUSTER.md | HashiCorp integration |
The system enforces 10 programming best practices:
- Descriptive Naming Convention
- Magic Number Elimination
- Boundary Input Validation
- Intent-Based Documentation
- Graceful Edge Case Handling
- Dead Code Elimination
- Early Return Pattern
- Function Decomposition
- Conventional Commit Messages
- Critical Path Testing
See CODE_QUALITY_BEST_PRACTICES.md for details.
The system uses advanced mathematical algorithms for optimal test generation based on rigorous algebraic foundations.
The framework implements 7 mathematical domains:
-
Number Theory
- Perfect square detection:
is_perfect_square(n) - Greatest Common Divisor (GCD): Euclidean algorithm
- Least Common Multiple (LCM):
a * b / gcd(a, b) - Fibonacci sequence generation: Dynamic test allocation
- Fibonacci membership check:
5*n² ± 4perfect square test - Coprimality testing: Independent test set generation
- Perfect square detection:
-
Euclidean Geometry
- 2D distance:
√((x2-x1)² + (y2-y1)²) - N-dimensional distance: Multi-dimensional vector space analysis
- Dot products: Vector similarity and alignment
- Vector magnitudes: Test suite complexity measurement
- Cosine similarity: Test coverage independence
- 2D distance:
-
Trigonometry
- Law of Cosines:
cos(θ) = (a² + b² - c²) / 2ab - Entanglement angles: Component coupling analysis
- Orthogonality checks: Test independence via Law of Sines
- Heron's formula: Coverage area calculation
√(s(s-a)(s-b)(s-c)) - Test completeness: Trigonometric phase analysis
- Law of Cosines:
-
Linear Algebra
- Gram-Schmidt orthogonalization: Independent test space generation
- Vector projections: Subspace-based test planning
- Hyperrectangle volumes: Multi-dimensional test coverage measurement
-
Complex Analysis
- Euler's identity verification:
e^(iπ) + 1 = 0 - Complex phase cycles: Test execution frequency analysis
- Harmonic convergence: Fibonacci sequence properties
- Euler's identity verification:
-
Harmonic Analysis
- Harmonic means: Test count optimization
- Convergence analysis: Mathematical stability verification
-
Optimization Theory
- Primitive Pythagorean triples: Euclid's formula
a = m²-n², b = 2mn - Geometric minimization: Optimal test count calculation
- Primitive Pythagorean triples: Euclid's formula
Returns primitive Pythagorean triples using Euclid's formula.
curl "http://localhost:4000/api/v1/math/perfect_triples?count=5"Response:
{
"count": 5,
"triples": [
{"a": 3, "b": 4, "c": 5, "perfect": true},
{"a": 5, "b": 12, "c": 13, "perfect": true},
{"a": 8, "b": 15, "c": 17, "perfect": true}
],
"algorithm": "euclid_formula",
"description": "Primitive Pythagorean triples where a² + b² = c²"
}Returns Fibonacci sequence for natural test allocation.
curl "http://localhost:4000/api/v1/math/fibonacci_sequence?count=10"Response:
{
"count": 10,
"sequence": [1, 1, 2, 3, 5, 8, 13, 21, 34, 55],
"algorithm": "fibonacci",
"harmonic_mean": 0.85,
"description": "Fibonacci-based test allocation strategy"
}Calculate n-dimensional Euclidean distance between test vectors.
curl -X POST "http://localhost:4000/api/v1/math/euclidean_distance" \
-H "Content-Type: application/json" \
-d '{"vector_a": [1.0, 2.0, 3.0], "vector_b": [4.0, 5.0, 6.0]}'Response:
{
"distance": 5.196,
"dimensions": 3,
"algorithm": "euclidean_nd",
"vector_a": [1.0, 2.0, 3.0],
"vector_b": [4.0, 5.0, 6.0]
}Check test coverage independence using Law of Sines.
curl "http://localhost:4000/api/v1/math/orthogonality_check?unit_ratio=0.6&integration_ratio=0.3&e2e_ratio=0.1"Response:
{
"orthogonality_score": 0.15,
"unit_ratio": 0.6,
"integration_ratio": 0.3,
"e2e_ratio": 0.1,
"algorithm": "law_of_sines",
"interpretation": "Test coverage is highly orthogonal (independent)"
}Calculate coupling angle between components using Law of Cosines.
curl "http://localhost:4000/api/v1/math/entanglement_angle?dep_a=5.0&dep_b=3.0&coupling=0.9"Response:
{
"angle": 1.231,
"cosine": 0.9,
"algorithm": "law_of_cosines",
"interpretation": "Moderate coupling (some entanglement)"
}Calculate coverage area using Heron's formula.
curl "http://localhost:4000/api/v1/math/coverage_area?current=3&expected=5&additional=5"Response:
{
"area": 7.0,
"semi_perimeter": 4.33,
"algorithm": "herons_formula",
"current_tests": 3,
"expected_tests": 5,
"additional_tests": 5
}Generated test code includes mathematical comments that explain the derivation:
# Auto-generated test for example.py
#
# Test count: 13
# #alg:triple (3,4,5) = Perfect Pythagorean triple
# #alg:fibonacci 13 = Optimal test count
#
import pytest
from example import *
def test_example(code_sample: str):
"""Test generated code with algebraic derivation"""
# Test implementation
result = calculate_result(code_sample)
assert result is not None, "Implementation should pass"
def calculate_result(code_sample: str) -> Optional[str]:
"""Calculate expected result with algebraic comments"""
# Parse test to extract algebraic formula
# Return expected result based on mathematical derivation
#alg:fornameofpythagora c = √(a² + b²) = √(9² + 12²) = 15 tests
passAnnotation Formats:
#alg:fornameofpythagora c = √(a² + b²)- Basic Pythagorean formula#alg:triple (a,b,c)- When perfect Pythagorean triple detected#alg:fibonacci N- Fibonacci number used for test count#alg:entanglement θ = X.XXX rad- Component coupling angle#alg:orthogonal sin(φ) = X.XXX- Orthogonality metric#alg:euclicean_distance d = X.XXX- N-dimensional distance calculation
This project is licensed under AGPL-3.0. All contributions must be compatible with this license.
Copyright (C) 2006-2024 SWCStudio
Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0)
SPDX-License-Identifier: AGPL-3.0
If you use Autonogrammer in your research, please cite:
@software{autonogrammer2024,
author = {{SWCStudio Development Team}},
title = {{Autonogrammer: AI Companion Systems with RPQE Architecture}},
year = {2024},
version = {2.1.0},
url = {https://github.com/swcstudio/aicompanion},
license = {AGPL-3.0}
}- Repository: https://github.com/swcstudio/aicompanion
- Issues: https://github.com/swcstudio/aicompanion/issues
- Email: dev@swcstudio.com
- DSpy framework team
- HashiCorp for Nomad/Consul/Vault
- The Rust, Python, and Elixir communities
- All contributors to open-source quantum-inspired computing research