Skip to content

Latest commit

 

History

History
326 lines (277 loc) · 13.2 KB

File metadata and controls

326 lines (277 loc) · 13.2 KB

AxiomCode — Features & Qualities

Natural Language to Formally Verified Code
Domain: axiom-code.com
Version: 0.1.0
License: Proprietary — see LICENSE
Dependencies: Zero (pure Python stdlib + cffi)


Executive Summary

AxiomCode is the world's first zero-dependency, zero-trust, cryptographically secured system that converts natural language descriptions of algorithms into mathematically proven-correct Python and C code. Every generated artifact comes with a verifiable proof certificate, HMAC signature, and tamper-evident audit trail.

Built for commercialization. Designed to surpass Python and agent-based LLM code generators by providing mathematical certainty instead of probabilistic guesses.


Core Features

1. Natural Language to Verified Code

  • Describe algorithms in plain English — no programming knowledge required
  • Automatic Lean 4 specification generation via local or cloud LLMs
  • Formal proof search with Pantograph + Goedel-Prover integration
  • Code extraction to C binaries and Python packages
  • Machine-checked proofs where verification succeeds — every artifact carries an honest verification_status ("verified" only when a proof assistant actually checked the proof; "unverified"/"failed" otherwise). AxiomCode never claims a proof it did not check.

2. Minimal External Dependencies

  • Pure Python stdlib — no pip packages to install (except cffi for bindings)
  • No attack surface from third-party libraries
  • No supply chain vulnerabilities — no requests, no Flask, no SDKs
  • HTTP via stdlib http.client — direct API calls to llama.cpp, OpenAI, Anthropic
  • Crypto via stdlib hashlib, hmac, secrets, plus the audited cryptography package for Ed25519 signatures (publicly verifiable certificates require asymmetric crypto — hand-rolling it would be worse)

3. Zero-Trust Security Model

  • Every output independently verifiable — no blind trust in any component
  • Cryptographic proof certificates — Ed25519-signed attestations of provenance and integrity, with honest per-artifact verification status
  • Binary signing — every C binary and Python package is signed and verifiable
  • Tamper-evident audit log — hash-chained entries detect any modification
  • Encrypted key store — PBKDF2-derived keys, encrypted at rest
  • Secure sandbox — isolated execution with restricted environment
  • Rate limiting — token bucket prevents API abuse

4. Multi-Backend LLM Support

Backend Type Default Model Speed Quality
llama.cpp Local qwen2.5-coder:14b Fast Good
Mistral Local mistral:7b Fast Good
OpenAI Cloud gpt-4o Medium Excellent
Anthropic Cloud claude-sonnet-4 Medium Excellent
  • No SDKs — direct HTTP calls, zero dependency overhead
  • LLM response caching — persistent cache reduces cost and latency
  • Automatic retry with exponential backoff
  • Fallback chain — if local model fails, suggests cloud alternatives

5. Cryptographic Proof Certificates

Every generated algorithm comes with a signed certificate containing:

  • Hash of the Lean 4 specification
  • Hash of the proof term
  • Hash of the compiled C binary
  • Hash of the Python package
  • HMAC signature for authenticity
  • Key ID for verification
  • Timestamp for non-repudiation

Certificates are independently verifiable — anyone can verify the certificate without trusting AxiomCode.

6. Interactive Proof Visualization

  • 2D Port Graph — Incredible Proof Machine style block diagrams
  • Force-Directed Graph — D3.js interactive dependency graphs
  • 3D Spatial Layout — Three.js-ready architecture for future expansion
  • Self-contained HTML — no server required, works offline
  • Click-to-inspect — view any proof step's Lean tactic

7. Version Management & Data Persistence

  • Automatic version tracking — every installation knows its version
  • Upgrade migration — v1 → v2 → vN with automatic data transformation
  • Downgrade support — vN → v2 → v1 with data preservation
  • Automatic backups — every migration creates a restorable backup
  • Rollback capability — one command to restore previous state
  • Migration history — complete audit trail of all version changes
  • Data integrity validation — verify all data matches current schema
  • Multi-step migration paths — BFS-based pathfinding through version graph
  • History retention — all historical data preserved across version changes

8. Commercial Licensing System

  • Root key pair — cryptographic signing key kept secret by AxiomCode
  • Hardware binding — licenses tied to machine fingerprint
  • Offline verification — no phone-home needed
  • 3 tiers — Community (free), Pro ($49/mo), Enterprise (custom)
  • Revocation support — compromised licenses can be invalidated
  • Portable licenses — optional non-hardware-bound licenses

9. Comprehensive CLI (15 Commands)

Command Description
generate Generate verified code from natural language
guide Interactive step-by-step wizard
examples Browse 6 built-in algorithm examples
help Full help, FAQ, and troubleshooting
walkthrough Interactive tutorial for new users
models List available LLM backends and local models
visualize Open interactive proof visualization
publish Publish to PyPI and GitHub Releases
verify Independently verify any generated proof
cert Display cryptographic proof certificate
key create Create encrypted signing key
key list List all signing keys
audit View tamper-evident audit log
version Manage versions, migrate, rollback, validate
license Manage licenses, issue, verify, revoke

10. Production-Ready Packaging

  • Python wheels — pip-installable packages with cffi bindings
  • C shared libraries — .so/.dll files for direct integration
  • PyPI publishing — one command to publish verified packages
  • GitHub Releases — binary distribution with signatures
  • Cross-platform — Windows, Linux, macOS support

11. Lean 4 Integration

  • Lake project management — proper Lean 4 build system
  • Custom proof tactics — domain-specific tactics for faster proofs
  • Specification library — reusable correctness specifications
  • Algorithm library — pre-verified sorting, searching, data structures
  • Mathlib integration — access to the largest formal math library

Quality Attributes

Security

Attribute Implementation
Zero-trust Every output independently verifiable
Zero-knowledge LLM prompts never contain sensitive data
Encrypted at rest Keys encrypted with PBKDF2-derived master key
Encrypted in transit TLS for all cloud API calls
Tamper-evident Hash-chained audit log detects any modification
Signed artifacts HMAC signatures on all binaries and certificates
Sandboxed execution Isolated subprocess with restricted environment
Rate limited Token bucket prevents API abuse
No telemetry Zero data collection, zero tracking

Reliability

Attribute Implementation
Retry logic Exponential backoff on all LLM calls
LLM caching Persistent cache with 24h expiry
Graceful degradation Works without Lean 4 (spec only mode)
Backup system Automatic backup before every migration
Rollback support One-command restore to previous state
Data validation Schema version checking on all data
Error handling Every failure path has user-friendly guidance
History retention All data preserved across version changes

Performance

Attribute Implementation
Zero dependency overhead No import time from external packages
LLM caching Eliminates redundant API calls
Rate limiting Prevents API throttling
Efficient HTTP Direct stdlib http.client, no middleware
Fast CLI startup < 100ms to first command
Memory efficient No large dependency trees in memory

Maintainability

Attribute Implementation
Single file core Entire system in cli.py + security.py
Zero dependencies No dependency conflicts, no version pinning
Clear module boundaries core/, visualize/, publish/ re-export from cli.py
Comprehensive tests 37 tests covering all features
Documented Help, FAQ, walkthrough, architecture docs
Version managed Built-in migration system for all future versions

Portability

Attribute Implementation
Python 3.10+ Works on any modern Python installation
Cross-platform Windows, Linux, macOS
No native deps Pure Python (cffi is the only exception)
No system packages Doesn't require apt/yum/brew
Self-contained Everything needed is in the repository

Competitive Advantages

vs. Python LLM Code Generators (Copilot, Cursor, etc.)

Feature AxiomCode Copilot/Cursor
Correctness guarantee Machine-checked proof (when verified; status recorded honestly per artifact) Probabilistic guess
Verification Independent, automated Manual review required
Security Zero-trust, signed, encrypted Trust the model
Dependencies Zero Hundreds
Audit trail Tamper-evident log None
Certificates Cryptographic proof None

vs. Agent-Based LLM Systems

Feature AxiomCode Agent Systems
Determinism Proven correct Stochastic
Attack surface Minimal (stdlib only) Massive (many deps)
Supply chain risk None High
Verification Built-in External
Cost Local model = free API costs per token
Privacy Zero data leaves machine Data sent to API

vs. Traditional Formal Verification Tools

Feature AxiomCode Coq/Isabelle
Learning curve Natural language Years of expertise
Proof automation LLM-guided Manual
Code generation Automatic Manual extraction
Visualization Interactive graphs Text-based
Accessibility Anyone Experts only

Adoption Checklist

For Individual Developers

  • No formal methods knowledge required
  • Works with local LLM (no API costs)
  • CLI is intuitive — python cli.py "binary search"
  • Interactive guide for first-time users
  • Built-in examples to learn from
  • Full help and FAQ system

For Teams

  • Zero dependency conflicts
  • Reproducible builds
  • Cryptographic certificates for compliance
  • Audit log for regulatory requirements
  • Version management with rollback
  • Signed artifacts for supply chain security

For Enterprises

  • Zero-trust architecture
  • Tamper-evident audit trail
  • Encrypted key management
  • Sandboxed execution
  • Rate limiting and abuse prevention
  • Independent verification of all outputs
  • Migration system for version upgrades
  • Backup and rollback capabilities
  • Commercial licensing with hardware binding

Built-In Examples

Algorithm Category Difficulty Proof Complexity
Binary Search Searching Easy Medium
Insertion Sort Sorting Easy Medium
Merge Sort Sorting Medium High
GCD (Euclidean) Number Theory Easy Low
Linked List Reverse Data Structures Medium High
Stack with Max Data Structures Medium Medium

Technical Specifications

Property Value
Language Python 3.10+
Total dependencies 1 (cffi)
Lines of code ~2,000
Test coverage 37 tests passing
CLI commands 15
LLM backends 4
Visualization modes 3
Security features 9
License tiers 3
Version management Full (upgrade/downgrade/rollback)
License Proprietary
Domain axiom-code.com

Roadmap

Phase 1 (Current) — MVP ✅

  • Natural language to Lean 4 spec generation
  • Proof engine integration
  • C and Python code extraction
  • Cryptographic certificates
  • Zero-trust security
  • Interactive visualization
  • Version management
  • Help and documentation system
  • Commercial licensing system
  • Hardware binding
  • Persistence layer with history retention

Phase 2 — Domain Libraries

  • Verified numerical methods library
  • Verified cryptography primitives
  • Verified data structures library
  • Verified systems code patterns
  • 3D proof visualization (Three.js)

Phase 3 — Scale

  • Coq backend support
  • Isabelle/HOL backend support
  • Custom proof automation tactics
  • Graph algorithms
  • Dynamic programming verification
  • Concurrent algorithm verification

Phase 4 — Enterprise

  • Multi-user key management
  • Team certificate verification
  • Compliance reporting
  • CI/CD integration
  • Web dashboard
  • API server mode