exactor-accelerator 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. exactor_accelerator-2.0.0/CHANGELOG.md +53 -0
  2. exactor_accelerator-2.0.0/CONTRIBUTING.md +50 -0
  3. exactor_accelerator-2.0.0/LICENSE +21 -0
  4. exactor_accelerator-2.0.0/MANIFEST.in +11 -0
  5. exactor_accelerator-2.0.0/PKG-INFO +363 -0
  6. exactor_accelerator-2.0.0/README.md +311 -0
  7. exactor_accelerator-2.0.0/docs/COMPARATIVE_BENCHMARK_REPORT.md +488 -0
  8. exactor_accelerator-2.0.0/docs/DOMAIN_IMPLEMENTATION_GUIDE.md +705 -0
  9. exactor_accelerator-2.0.0/docs/EXACTOR_FOREX_COLDSTART_ANALYSIS.md +632 -0
  10. exactor_accelerator-2.0.0/docs/EXECUTIVE_SUMMARY.md +342 -0
  11. exactor_accelerator-2.0.0/docs/PUBLICATION_VIABILITY_ANALYSIS.md +309 -0
  12. exactor_accelerator-2.0.0/docs/ROADMAP_V2.md +639 -0
  13. exactor_accelerator-2.0.0/docs/USE_CASE_GUIDE.md +1464 -0
  14. exactor_accelerator-2.0.0/docs/WHY_EXACTOR_JEV.md +534 -0
  15. exactor_accelerator-2.0.0/exactor_accelerator/__init__.py +56 -0
  16. exactor_accelerator-2.0.0/exactor_accelerator/adapter/__init__.py +10 -0
  17. exactor_accelerator-2.0.0/exactor_accelerator/adapter/jev_schema.py +106 -0
  18. exactor_accelerator-2.0.0/exactor_accelerator/adapter/translator.py +170 -0
  19. exactor_accelerator-2.0.0/exactor_accelerator/api/__init__.py +3 -0
  20. exactor_accelerator-2.0.0/exactor_accelerator/api/server.py +498 -0
  21. exactor_accelerator-2.0.0/exactor_accelerator/config.py +175 -0
  22. exactor_accelerator-2.0.0/exactor_accelerator/core/__init__.py +15 -0
  23. exactor_accelerator-2.0.0/exactor_accelerator/core/exactor_bridge.py +213 -0
  24. exactor_accelerator-2.0.0/exactor_accelerator/core/hypercube.py +375 -0
  25. exactor_accelerator-2.0.0/exactor_accelerator/data/sample_clinical_triage.csv +501 -0
  26. exactor_accelerator-2.0.0/exactor_accelerator/data/sample_customer_churn.csv +501 -0
  27. exactor_accelerator-2.0.0/exactor_accelerator/data/sample_fraud_transactions.csv +501 -0
  28. exactor_accelerator-2.0.0/exactor_accelerator/data/sample_soc_intrusion.json +6502 -0
  29. exactor_accelerator-2.0.0/exactor_accelerator/data/sample_sre_incidents.json +7002 -0
  30. exactor_accelerator-2.0.0/exactor_accelerator/data/sample_support_conversations.csv +501 -0
  31. exactor_accelerator-2.0.0/exactor_accelerator/data/sample_support_conversations.json +6002 -0
  32. exactor_accelerator-2.0.0/exactor_accelerator/engine/__init__.py +4 -0
  33. exactor_accelerator-2.0.0/exactor_accelerator/engine/batch_processor.py +55 -0
  34. exactor_accelerator-2.0.0/exactor_accelerator/engine/deepseek_client.py +165 -0
  35. exactor_accelerator-2.0.0/exactor_accelerator/engine/jev_client.py +239 -0
  36. exactor_accelerator-2.0.0/exactor_accelerator/engine/runtime.py +764 -0
  37. exactor_accelerator-2.0.0/exactor_accelerator/ingestion/__init__.py +5 -0
  38. exactor_accelerator-2.0.0/exactor_accelerator/ingestion/binarizer.py +456 -0
  39. exactor_accelerator-2.0.0/exactor_accelerator/ingestion/loader.py +335 -0
  40. exactor_accelerator-2.0.0/exactor_accelerator/ingestion/semantic_discovery.py +244 -0
  41. exactor_accelerator-2.0.0/exactor_accelerator/ingestion/text_extractor.py +111 -0
  42. exactor_accelerator-2.0.0/exactor_accelerator/ledger/__init__.py +3 -0
  43. exactor_accelerator-2.0.0/exactor_accelerator/ledger/sqlite_wal.py +305 -0
  44. exactor_accelerator-2.0.0/exactor_accelerator/model_persistence.py +123 -0
  45. exactor_accelerator-2.0.0/exactor_accelerator/model_server.py +120 -0
  46. exactor_accelerator-2.0.0/exactor_accelerator/py.typed +1 -0
  47. exactor_accelerator-2.0.0/exactor_accelerator/regime_detector.py +376 -0
  48. exactor_accelerator-2.0.0/exactor_accelerator/sdk.py +343 -0
  49. exactor_accelerator-2.0.0/exactor_accelerator/sklearn_interface.py +360 -0
  50. exactor_accelerator-2.0.0/exactor_accelerator/web/app.js +1345 -0
  51. exactor_accelerator-2.0.0/exactor_accelerator/web/index.html +1196 -0
  52. exactor_accelerator-2.0.0/exactor_accelerator/web/styles.css +295 -0
  53. exactor_accelerator-2.0.0/exactor_accelerator.egg-info/PKG-INFO +363 -0
  54. exactor_accelerator-2.0.0/exactor_accelerator.egg-info/SOURCES.txt +68 -0
  55. exactor_accelerator-2.0.0/exactor_accelerator.egg-info/dependency_links.txt +1 -0
  56. exactor_accelerator-2.0.0/exactor_accelerator.egg-info/entry_points.txt +2 -0
  57. exactor_accelerator-2.0.0/exactor_accelerator.egg-info/requires.txt +25 -0
  58. exactor_accelerator-2.0.0/exactor_accelerator.egg-info/top_level.txt +1 -0
  59. exactor_accelerator-2.0.0/examples/forex_trading_example.py +189 -0
  60. exactor_accelerator-2.0.0/examples/fraud_detection_example.py +194 -0
  61. exactor_accelerator-2.0.0/examples/manufacturing_quality_example.py +204 -0
  62. exactor_accelerator-2.0.0/examples/medical_triage_example.py +210 -0
  63. exactor_accelerator-2.0.0/examples/security_logs_example.py +224 -0
  64. exactor_accelerator-2.0.0/pyproject.toml +101 -0
  65. exactor_accelerator-2.0.0/setup.cfg +4 -0
  66. exactor_accelerator-2.0.0/tests/test_binarizer.py +47 -0
  67. exactor_accelerator-2.0.0/tests/test_exactor_hypercube.py +55 -0
  68. exactor_accelerator-2.0.0/tests/test_jev_adapter.py +37 -0
  69. exactor_accelerator-2.0.0/tests/test_live_memory.py +76 -0
  70. exactor_accelerator-2.0.0/tests/test_text_extraction.py +54 -0
@@ -0,0 +1,53 @@
1
+ # Changelog
2
+
3
+ All notable changes to Exactor Accelerator will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [2.0.0] - 2026-09-28
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+ - **Package renamed**: `exactor-jev` → `exactor-accelerator`
12
+ - **Import path changed**: `import exactor_jev` → `import exactor_accelerator`
13
+ - **Class renames**:
14
+ - `ExactorJevClassifier` → `ExactorAcceleratorClassifier`
15
+ - `ExactorJevMultiLabelClassifier` → `ExactorAcceleratorMultiLabelClassifier`
16
+ - `ExactorJev` → `ExactorAccelerator`
17
+ - `setup.py` removed; `pyproject.toml` is the single source of truth
18
+ - Minimum Python version raised to 3.9
19
+
20
+ ### Added
21
+ - `exactor_accelerator.configure()` — top-level function to set API tokens programmatically
22
+ - `exactor_accelerator.config` module — centralized configuration with env var, `.env` file, and programmatic support
23
+ - `EXACTOR_CORE_TOKEN` environment variable support (replaces `EXACTOR_API_KEY`)
24
+ - `.env.example` template with all configurable tokens
25
+ - `py.typed` marker for PEP 561 type checking support
26
+ - GitHub Actions CI/CD pipeline (lint, test, build, publish)
27
+ - Server dependencies split into `[server]` optional extra
28
+ - DomainRegimeDetector for adaptive threshold adjustment
29
+ - DomainFeatureEngine for domain-specific feature extraction
30
+ - BatchProcessor for high-throughput processing
31
+ - Domain-specific detectors: Fraud, Medical, Forex, Manufacturing, Security
32
+ - Examples for all 5 domains
33
+
34
+ ### Changed
35
+ - `fastapi` and `uvicorn` moved to optional `[server]` dependency group
36
+ - Updated roadmap v2.0 to focus on niches of excellence
37
+ - SDK module relocated from root-level `exactor_jev_sdk.py` to `exactor_accelerator/sdk.py`
38
+
39
+ ### Fixed
40
+ - Improved cold start handling
41
+ - Better regime detection for high-entropy scenarios
42
+
43
+ ## [1.0.0] - 2026-09-26
44
+
45
+ ### Added
46
+ - Initial release of Exactor Accelerator (as `exactor-jev`)
47
+ - Hybrid neuro-symbolic architecture (EXACTOR + Jev)
48
+ - Scikit-learn compatible interface
49
+ - Multi-class and multi-label support
50
+ - Fast-path for <1ms decisions
51
+ - Live memory and incremental learning
52
+ - Comprehensive documentation
53
+ - Benchmark suite with public datasets
@@ -0,0 +1,50 @@
1
+ # Contributing to Exactor Accelerator
2
+
3
+ Thanks for your interest in contributing to Exactor Accelerator!
4
+
5
+ ## Development Setup
6
+
7
+ ```bash
8
+ git clone https://github.com/ExactorResearch/exactor-accelerator.git
9
+ cd exactor-accelerator
10
+ python -m venv .venv
11
+ source .venv/bin/activate # Windows: .venv\Scripts\activate
12
+ pip install -e ".[dev]"
13
+ ```
14
+
15
+ ### Configuration
16
+
17
+ ```bash
18
+ cp .env.example .env
19
+ # Edit .env with your API tokens
20
+ ```
21
+
22
+ ### Running Tests
23
+
24
+ ```bash
25
+ pytest tests/ -v
26
+ ```
27
+
28
+ ### Code Formatting & Linting
29
+
30
+ ```bash
31
+ black exactor_accelerator/
32
+ ruff check exactor_accelerator/
33
+ mypy exactor_accelerator/ --ignore-missing-imports
34
+ ```
35
+
36
+ ## Pull Requests
37
+
38
+ 1. Fork the repository
39
+ 2. Create a branch for your feature (`git checkout -b feature/amazing-feature`)
40
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
41
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
42
+ 5. Open a Pull Request
43
+
44
+ ## Reporting Issues
45
+
46
+ Use [GitHub Issues](https://github.com/ExactorResearch/exactor-accelerator/issues) to report bugs or request features.
47
+
48
+ ## Code of Conduct
49
+
50
+ Be respectful and constructive in all interactions.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ExactorJev Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,11 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include CONTRIBUTING.md
5
+ recursive-include exactor_accelerator *.py *.html *.css *.js *.csv *.json
6
+ recursive-include examples *.py
7
+ recursive-include docs *.md
8
+ recursive-include tests *.py
9
+ global-exclude *.db *.db-wal *.db-shm
10
+ global-exclude __pycache__/*
11
+ global-exclude *.pyc
@@ -0,0 +1,363 @@
1
+ Metadata-Version: 2.4
2
+ Name: exactor-accelerator
3
+ Version: 2.0.0
4
+ Summary: High-speed boolean logic accelerator for TypeSafe AI (Jev) decisions — powered by the EXACTOR engine
5
+ Author-email: Exactor Research <contact@exactor.tech>
6
+ License: MIT
7
+ Project-URL: Homepage, https://exactor.tech
8
+ Project-URL: Documentation, https://exactor.tech/docs
9
+ Project-URL: Repository, https://github.com/ExactorResearch/exactor-accelerator
10
+ Project-URL: Issues, https://github.com/ExactorResearch/exactor-accelerator/issues
11
+ Project-URL: Changelog, https://github.com/ExactorResearch/exactor-accelerator/blob/main/CHANGELOG.md
12
+ Keywords: boolean-minimization,explainable-ai,typesafe,jev,exactor,decision-engine
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Classifier: License :: OSI Approved :: MIT License
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.9
21
+ Classifier: Programming Language :: Python :: 3.10
22
+ Classifier: Programming Language :: Python :: 3.11
23
+ Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
25
+ Classifier: Operating System :: OS Independent
26
+ Classifier: Typing :: Typed
27
+ Requires-Python: >=3.9
28
+ Description-Content-Type: text/markdown
29
+ License-File: LICENSE
30
+ Requires-Dist: pandas>=1.3.0
31
+ Requires-Dist: numpy>=1.21.0
32
+ Requires-Dist: scikit-learn>=1.0.0
33
+ Requires-Dist: scipy>=1.7.0
34
+ Requires-Dist: requests>=2.25.0
35
+ Requires-Dist: pydantic>=1.10.0
36
+ Provides-Extra: server
37
+ Requires-Dist: fastapi>=0.95.0; extra == "server"
38
+ Requires-Dist: uvicorn>=0.20.0; extra == "server"
39
+ Requires-Dist: python-multipart>=0.0.6; extra == "server"
40
+ Provides-Extra: dotenv
41
+ Requires-Dist: python-dotenv>=1.0.0; extra == "dotenv"
42
+ Provides-Extra: dev
43
+ Requires-Dist: pytest>=7.0; extra == "dev"
44
+ Requires-Dist: black>=23.0; extra == "dev"
45
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
46
+ Requires-Dist: mypy>=1.0; extra == "dev"
47
+ Requires-Dist: build>=1.0; extra == "dev"
48
+ Requires-Dist: twine>=4.0; extra == "dev"
49
+ Provides-Extra: all
50
+ Requires-Dist: exactor-accelerator[dev,dotenv,server]; extra == "all"
51
+ Dynamic: license-file
52
+
53
+ # Exactor Accelerator
54
+
55
+ [![PyPI Version](https://img.shields.io/pypi/v/exactor-accelerator.svg)](https://pypi.org/project/exactor-accelerator/)
56
+ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
57
+ [![Python Version](https://img.shields.io/pypi/pyversions/exactor-accelerator.svg)](https://pypi.org/project/exactor-accelerator/)
58
+
59
+ Exactor Accelerator is a high-speed boolean logic layer that accelerates TypeSafe AI (Jev) decisions by combining EXACTOR's boolean minimization with Jev's semantic intelligence.
60
+
61
+ **Accelerates Jev decisions by 4,770-24,000x with 95-100% accuracy, zero production cost, and regulatory explainability.**
62
+
63
+ ## Features
64
+
65
+ - ⚡ **Extreme Speed**: 0.05-0.1ms latency (4,770-24,000x faster than Jev pure)
66
+ - 💰 **Zero Cost**: $0.00 per decision (100% savings vs AI APIs)
67
+ - 🎯 **Accuracy**: 95-100% on structured tasks
68
+ - 🔍 **Explainability**: Auditable boolean formulas (GDPR, HIPAA, SOX compliant)
69
+ - 🔄 **Adaptability**: Automatic regime detection and concept drift handling
70
+ - 🌐 **Multi-Domain**: Fraud, medical, forex, manufacturing, security
71
+
72
+ ## Niches of Excellence
73
+
74
+ Exactor Accelerator is unbeatable in:
75
+
76
+ - **Fraud Detection**: 95-100% accuracy, 0.05-0.1ms
77
+ - **Medical Triage**: 95-100% accuracy, 0.05-0.1ms
78
+ - **Quality Monitoring**: 95-100% accuracy, 50,000+ TPS
79
+ - **Security Logs**: 95-100% accuracy, 0.05-0.1ms
80
+ - **Forex Technical**: 80-100% accuracy, 0.05-0.1ms
81
+
82
+ ## Installation
83
+
84
+ ```bash
85
+ pip install exactor-accelerator
86
+ ```
87
+
88
+ ## Configuration
89
+
90
+ Exactor Accelerator connects to the [EXACTOR Core engine](https://exactor.tech) for cloud-accelerated boolean minimization. Set your token using any of these methods:
91
+
92
+ ### Option 1: Environment Variable (recommended for production)
93
+
94
+ ```bash
95
+ export EXACTOR_CORE_TOKEN="your-token-here"
96
+ export JEV_API_KEY="your-jev-key" # Optional: TypeSafe Jev API
97
+ export DEEPSEEK_API_KEY="your-key" # Optional: LLM explainer
98
+ ```
99
+
100
+ ### Option 2: `.env` File
101
+
102
+ ```bash
103
+ cp .env.example .env
104
+ # Edit .env with your tokens
105
+ ```
106
+
107
+ ### Option 3: Programmatic Configuration
108
+
109
+ ```python
110
+ import exactor_accelerator
111
+
112
+ exactor_accelerator.configure(
113
+ exactor_core_token="your-token-here",
114
+ jev_api_key="your-jev-key", # Optional
115
+ deepseek_api_key="your-key", # Optional
116
+ )
117
+ ```
118
+
119
+ ### Option 4: Per-Instance Token
120
+
121
+ ```python
122
+ from exactor_accelerator import ExactorAccelerator
123
+
124
+ engine = ExactorAccelerator(
125
+ exactor_token="your-token-here",
126
+ use_cloud_exactor=True,
127
+ )
128
+ ```
129
+
130
+ > **Note:** Without an EXACTOR Core token, the library falls back to the built-in Hypercube Gray-code Reducer engine, which provides the same deterministic boolean minimization locally.
131
+
132
+ ## Quick Start
133
+
134
+ ```python
135
+ from exactor_accelerator import ExactorAcceleratorClassifier
136
+ from exactor_accelerator.feature_engine import get_feature_engine
137
+ from exactor_accelerator.regime_detector import get_regime_detector
138
+ import pandas as pd
139
+
140
+ # Load data
141
+ df = pd.read_csv("your_data.csv")
142
+
143
+ # Enrich with domain-specific features
144
+ feature_engine = get_feature_engine(domain="fraud")
145
+ df_enriched = feature_engine.extract_all(df)
146
+
147
+ # Train model
148
+ clf = ExactorAcceleratorClassifier(domain="fraud", fast_path=True)
149
+ clf.fit(df_enriched.drop("target", axis=1), df_enriched["target"])
150
+
151
+ # Predict
152
+ prediction = clf.predict(new_data)
153
+ ```
154
+
155
+ ## Examples by Domain
156
+
157
+ - [Fraud Detection](examples/fraud_detection_example.py)
158
+ - [Medical Triage](examples/medical_triage_example.py)
159
+ - [Forex Trading](examples/forex_trading_example.py)
160
+ - [Quality Monitoring](examples/manufacturing_quality_example.py)
161
+ - [Security Logs](examples/security_logs_example.py)
162
+
163
+ ## Documentation
164
+
165
+ - [Use Case Guide](docs/USE_CASE_GUIDE.md)
166
+ - [Why Exactor Accelerator](docs/WHY_EXACTOR_JEV.md)
167
+ - [Domain Implementation Guide](docs/DOMAIN_IMPLEMENTATION_GUIDE.md)
168
+ - [Roadmap v2.0](docs/ROADMAP_V2.md)
169
+ - [Executive Summary](docs/EXECUTIVE_SUMMARY.md)
170
+
171
+ ## Roadmap
172
+
173
+ See [ROADMAP_V2.md](docs/ROADMAP_V2.md) for details.
174
+
175
+ ## Contributing
176
+
177
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for details.
178
+
179
+ ## License
180
+
181
+ MIT License - see [LICENSE](LICENSE) for details.
182
+
183
+ ---
184
+
185
+ ## 1. Resumen Ejecutivo y Arquitectura
186
+
187
+ Esta arquitectura integra el motor de minimización booleana **EXACTOR** (SMLE) con el modelo de decisiones tipadas **Jev** (TypeSafe AI). El sistema opera bajo un paradigma de **Memoria Viva e Incremental**: arranca con una ingesta opcional de datos históricos de entrenamiento en la puesta en marcha, y evoluciona orgánicamente con cada nueva consulta en tiempo real, eliminando por completo las pesadas fases de reentrenamiento estático fuera de línea.
188
+
189
+ ```
190
+ [ FASE A: INGESTA INICIAL ]
191
+ Archivos Históricos (CSV / JSON / Logs)
192
+ │
193
+ ▼
194
+ [ Binarización Adaptativa en B^k ]
195
+ │
196
+ ▼
197
+ [ Motor Lógico EXACTOR Core (Rust) ] ──▶ Reglas Puras (AND, OR, XOR, NOT)
198
+ │
199
+ ▼
200
+ [ Adaptador Dinámico Exactor ➔ Jev ] ──▶ Esquema Tipado (Noul, Choice, Score)
201
+ │
202
+ ▼
203
+ [ FASE B: OPERACIÓN EN TIEMPO REAL ]
204
+ Consulta en Producción ──▶ [ Jev System One (70-500ms, RLCD) ]
205
+ │
206
+ ┌────────────────────┴────────────────────┐
207
+ ▼ ▼
208
+ [ Confianza >= Umbral ] [ SQLite WAL Ledger ]
209
+ │ (Memoria Colectiva)
210
+ ▼ │
211
+ [ EJECUCIÓN AUTÓNOMA ] ▼
212
+ [ Ventana Deslizante ]
213
+ │
214
+ ▼
215
+ [ ACTUALIZACIÓN DIFERENCIAL ]
216
+ (Evolución en Caliente)
217
+ ```
218
+
219
+ ---
220
+
221
+ ## 2. Flujo Operativo del Sistema
222
+
223
+ ### Fase A: Puesta en Marcha (Ingesta Inicial de Entrenamiento)
224
+ 1. **Carga de Datos Históricos**: El usuario o administrador sube un archivo inicial (CSV o JSON) con registros históricos (logs, transacciones o datos tabulares) en la interfaz web o mediante la API REST.
225
+ 2. **Binarización Adaptativa**: El motor de preprocesamiento transforma las variables continuas y categóricas en proposiciones discretas ($0$ y $1$) proyectadas sobre el hipercubo booleano $\mathbb{B}^k$ ($k \le 64$).
226
+ 3. **Descubrimiento Lógico (Exactor Core)**: El motor en Rust procesa la matriz binarizada y destila un conjunto inicial de reglas lógicas puras inmutables (AND, OR, XOR, NOT) con 100% de precisión, auditabilidad y trazabilidad sin cajas negras.
227
+ 4. **Calibración del Esquema Jev**: Las reglas iniciales se traducen automáticamente al esquema de preguntas tipadas (`Choice`, `Score`, `Noul`) que consume la API de Jev.
228
+
229
+ ### Fase B: Operación Continua y Memoria Viva (Sin Reentrenamiento)
230
+ 1. **Captura del Mundo Real**: Cada nueva consulta, log o interacción del usuario en producción entra al sistema de forma desestructurada.
231
+ 2. **Evaluación Ultrarrápida (Jev)**: Jev procesa el estado y evalúa las preguntas tipadas en milisegundos (70–500 ms) utilizando distribuciones de probabilidad calibradas (**RLCD - Reinforcement Learning for Calibrated Decisions**) alineadas con las reglas del negocio.
232
+ 3. **Registro en el Ledger de Memoria**: Cada interacción se almacena automáticamente en una base de datos ligera (**SQLite en modo WAL**), alimentando la memoria colectiva del sistema de forma incremental.
233
+ 4. **Actualización Diferencial (Exactor Incremental)**: De forma periódica o mediante actualizaciones incrementales, el motor Exactor procesa la ventana deslizante de interacciones recientes para ajustar las reglas lógicas **en caliente**, permitiendo que el sistema aprenda orgánicamente con cada consulta.
234
+
235
+ ---
236
+
237
+ ## 3. Especificación de Componentes Técnicos
238
+
239
+ ### Componente 1: Subsistema de Ingesta y Binarización (`exactor_jev.ingestion`)
240
+ - **Función**: Convertir datos continuos y texto libre en matrices de proposiciones booleanas limpias.
241
+ - **Entrada**: Archivos CSV/JSON (en puesta en marcha) o flujos de eventos por streaming/webhooks (en producción).
242
+ - **Salida**: Matriz de minitérminos estructurada con variables discretizadas y una columna objetivo (target).
243
+ - **Archivos**: `binarizer.py`, `loader.py`.
244
+
245
+ ### Componente 2: El Motor Lógico (`exactor_jev.core`)
246
+ - **Función**: Ejecutar la minimización booleana utilizando códigos Gray y el algoritmo de reducción en pila (`reducir`).
247
+ - **Características**: Operación en el hipercubo booleano ($\mathbb{B}^k$) sin aritmética de punto flotante, garantizando reglas explicables y auditables libres de cajas negras.
248
+ - **Soporte nativo de XOR**: Detección de paridad y simetría no lineal.
249
+ - **Archivos**: `hypercube.py`, `exactor_bridge.py`.
250
+
251
+ ### Componente 3: El Adaptador Dinámico (`exactor_jev.adapter`)
252
+ - **Función**: Traducir las fórmulas lógicas generadas por Exactor en objetos de preguntas tipadas para la API de Jev (`typesafe-sdk` / `@typesafe-ai/sdk`).
253
+ - **Estructura del Payload**:
254
+ ```json
255
+ {
256
+ "model": "jev-latest",
257
+ "state": { "evento": "datos de la consulta actual en tiempo real" },
258
+ "questions": {
259
+ "criterio_logico": {
260
+ "type": "noul",
261
+ "instructions": "¿Se cumple la condición booleana derivada del análisis histórico?"
262
+ },
263
+ "accion_recomendada": {
264
+ "type": "choice",
265
+ "instructions": "¿Qué acción de negocio debe ejecutarse?",
266
+ "criteria": {
267
+ "EJECUCION_AUTONOMA": "Confianza alta",
268
+ "REVISION_HUMANA": "Incertidumbre",
269
+ "DESCARTAR": "Condición no cumplida"
270
+ }
271
+ },
272
+ "calibracion_criticidad": {
273
+ "type": "score",
274
+ "instructions": "Nivel de impacto en escala ordinal continua."
275
+ }
276
+ }
277
+ }
278
+ ```
279
+ - **Archivos**: `jev_schema.py`, `translator.py`.
280
+
281
+ ### Componente 4: Capa de Decisión y Memoria Viva (`exactor_jev.ledger` & `exactor_jev.engine`)
282
+ - **Función**: Retornar la respuesta probabilística calibrada al cliente y registrar la interacción para el aprendizaje incremental.
283
+ - **Acción de Negocio**: Si la confianza de Jev supera el umbral preestablecido (ej. 80%), el software ejecuta la acción de forma autónoma.
284
+ - **Ledger Concurrente**: SQLite configurado con `PRAGMA journal_mode = WAL;` y `PRAGMA synchronous = NORMAL;` para transacciones sin bloqueo.
285
+ - **Archivos**: `sqlite_wal.py`, `jev_client.py`, `runtime.py`.
286
+
287
+ ---
288
+
289
+ ## 4. Estructura del Proyecto
290
+
291
+ ```
292
+ exactor-jev/
293
+ ├── exactor_jev/
294
+ │ ├── ingestion/ # Componente 1: Ingesta & Binarización
295
+ │ │ ├── binarizer.py # Discretizador adaptativo hacia B^k
296
+ │ │ └── loader.py # Parsers CSV/JSON y datasets sintéticos
297
+ │ ├── core/ # Componente 2: Motor Lógico Exactor
298
+ │ │ ├── hypercube.py # Hipercubo, Gray Code & reducción en pila
299
+ │ │ └── exactor_bridge.py # Despachador a exactor-core Rust / local
300
+ │ ├── adapter/ # Componente 3: Adaptador Exactor -> Jev
301
+ │ │ ├── jev_schema.py # Primitivas Noul, Choice, Score
302
+ │ │ └── translator.py # Generador de payload oficial TypeSafe
303
+ │ ├── ledger/ # Componente 4A: Memoria Viva (SQLite WAL)
304
+ │ │ └── sqlite_wal.py # Base de datos con Write-Ahead Logging
305
+ │ ├── engine/ # Componente 4B: Runtime y Cliente Jev
306
+ │ │ ├── jev_client.py # Cliente TypeSafe API + Simulador RLCD
307
+ │ │ └── runtime.py # Orquestador maestro HybridRuntime
308
+ │ ├── api/ # API REST FastAPI
309
+ │ │ └── server.py # Endpoints OpenAPI y static hosting
310
+ │ ├── web/ # Panel de Control Web (Glassmorphic)
311
+ │ │ ├── index.html # Dashboard 4 fases con telemetría en vivo
312
+ │ │ ├── styles.css # Estética ciber-lógica de alta gama
313
+ │ │ └── app.js # Lógica cliente, tacómetro RLCD y feed WAL
314
+ │ └── data/ # Datasets de demostración
315
+ │ ├── sample_fraud_transactions.csv
316
+ │ └── sample_sre_incidents.json
317
+ ├── tests/ # Suite de pruebas automatizadas
318
+ │ ├── test_binarizer.py
319
+ │ ├── test_exactor_hypercube.py
320
+ │ ├── test_jev_adapter.py
321
+ │ └── test_live_memory.py
322
+ ├── run_demo.py # Script de demostración integral por consola
323
+ ├── run_server.py # Lanzador del servidor Web & API
324
+ └── requirements.txt # Dependencias Python
325
+ ```
326
+
327
+ ---
328
+
329
+ ## 5. Instrucciones de Uso
330
+
331
+ ### 1. Ejecución de Pruebas Automatizadas
332
+ ```bash
333
+ python -m unittest discover -s tests -p "test_*.py"
334
+ ```
335
+
336
+ ### 2. Ejecución de la Demostración por Consola
337
+ Demuestra el ciclo de vida completo en 1 clic:
338
+ ```bash
339
+ python run_demo.py
340
+ ```
341
+
342
+ ### 3. Lanzar el Servidor Web & Panel de Control
343
+ ```bash
344
+ python run_server.py
345
+ ```
346
+ - **Panel de Control Web**: [http://localhost:8000](http://localhost:8000)
347
+ - **Documentación Interactiva Swagger**: [http://localhost:8000/docs](http://localhost:8000/docs)
348
+
349
+ ---
350
+
351
+ ## 6. Endpoints de la API REST
352
+
353
+ | Método | Endpoint | Descripción |
354
+ |---|---|---|
355
+ | `GET` | `/api/system/status` | Estado del motor, versión de regla activa y conteo del ledger |
356
+ | `POST` | `/api/ingest/file` | Fase A: Carga de dataset CSV/JSON y descubrimiento lógico |
357
+ | `POST` | `/api/ingest/sample` | Fase A: Carga instantánea de presets (fraud / sre) |
358
+ | `GET` | `/api/exactor/rules` | Fórmulas booleanas canónicas destiladas por Exactor |
359
+ | `GET` | `/api/jev/schema` | Esquema calibrado de preguntas tipadas (`Noul`, `Choice`, `Score`) |
360
+ | `POST` | `/api/query` | Fase B: Consulta en tiempo real con Jev, disparo autónomo y registro WAL |
361
+ | `GET` | `/api/ledger` | Stream de interacciones auditadas del SQLite WAL |
362
+ | `POST` | `/api/ledger/feedback`| Inyección de feedback humano / ground truth para una consulta |
363
+ | `POST` | `/api/differential/update` | Disparo de actualización diferencial sobre ventana deslizante |