edip 1.1.2__py3-none-any.whl

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.
edip/__init__.py ADDED
@@ -0,0 +1,13 @@
1
+
2
+ from .inspector import SchemaInspector
3
+ from .engine import EDIPEngine
4
+ from .watcher import AmbientWatcher
5
+
6
+
7
+ __all__ = [
8
+ "SchemaInspector",
9
+ "EDIPEngine",
10
+ "AmbientWatcher"
11
+ ]
12
+
13
+ __version__ = "1.0.0"
Binary file
Binary file
Binary file
@@ -0,0 +1,241 @@
1
+ Metadata-Version: 2.4
2
+ Name: edip
3
+ Version: 1.1.2
4
+ Summary: Edge Deterministic Ingestion Protocol using dynamic SQLite constraint reflection
5
+ Author: Uditha Manohara Prasad
6
+ License: Proprietary
7
+ Project-URL: Homepage, https://neziora.com
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ Requires-Dist: requests>=2.28.0
11
+ Requires-Dist: watchdog>=3.0.0
12
+
13
+ # Edge Deterministic Ingestion Protocol (EDIP)
14
+
15
+ > **Autonomous, air-gapped document ingestion middleware that disciplines probabilistic Small Language Models (SLMs) using relational database constraint reflection and tri-folder isolation.**
16
+
17
+ ---
18
+
19
+ ## Executive Summary
20
+
21
+ Enterprise document extraction pipelines face severe reliability bottlenecks when deploying generative AI at the edge. Small Language Models (1B–3B parameters) operating locally frequently hallucinate identifiers, fail structural types, or introduce relational inconsistencies. Traditional systems either crash upon database insertion or silently corrupt financial ledgers.
22
+
23
+ The **Edge Deterministic Ingestion Protocol (EDIP)** eliminates this failure mode by converting **relational database integrity constraints (Primary Keys, Foreign Keys, CHECK constraints, and NOT NULL rules)** into a real-time, closed-loop error-reflection firewall. Operating 100% offline without cloud API overhead, EDIP enforces strict **Third Normal Form (3NF)** compliance before transactions commit.
24
+
25
+ ---
26
+
27
+ ## Architectural Highlights
28
+
29
+ ```text
30
+ ┌──────────────────────────────┐
31
+ │ ./Inbound_Invoices │
32
+ │ │
33
+ │ Monitored Entry Directory │
34
+ │ (Watchdog Service) │
35
+ └──────────────┬───────────────┘
36
+ │
37
+ ▼
38
+ ┌───────────────────┐
39
+ │ EDIP Engine │
40
+ │ Loop │
41
+ └─────────┬─────────┘
42
+ │
43
+ ├── Dynamic Schema Introspection
44
+ │ (PRAGMA inspection)
45
+ │
46
+ ├── Structured Extraction
47
+ │ (Local SLM via Ollama / GGUF)
48
+ │
49
+ ├── Transactional Validation
50
+ │ (Atomic SQLite WAL Engine)
51
+ │
52
+ └── Error-Reflection Loop
53
+ (Runtime Constraint Feedback)
54
+ │
55
+ ┌─────────────┴─────────────┐
56
+ │ │
57
+ ▼ ▼
58
+ ┌──────────────────┐ ┌──────────────────────┐
59
+ │ SUCCESS / DEDUP │ │ CONSTRAINT FAILURE / │
60
+ │ │ │ RETRIES EXHAUSTED │
61
+ └────────┬─────────┘ └──────────┬───────────┘
62
+ │ │
63
+ ▼ ▼
64
+ ┌──────────────────┐ ┌──────────────────────┐
65
+ │ ./Processed_ │ │ ./Quarantine_ │
66
+ │ Archive │ │ Documents │
67
+ └──────────────────┘ │ │
68
+ │ Human Review Queue │
69
+ └──────────┬───────────┘
70
+ │
71
+ ▼
72
+ ┌──────────────────────┐
73
+ │ Dead-Letter Queue │
74
+ │ (DLQ) │
75
+ │ │
76
+ │ audit_status: │
77
+ │ PENDING_HUMAN_AUDIT │
78
+ └──────────────────────┘
79
+ ```
80
+
81
+ ### Key Capabilities
82
+
83
+ - **Zero-Cloud Air-Gapped Operation**: Optimized for edge deployment on commodity CPU/NPU hardware running quantized local models (`llama3.2:1b`, `qwen2.5:1.5b`).
84
+
85
+ - **Dynamic Schema Introspection**: Discovers arbitrary tables, relational hierarchies, column types, and foreign key references at runtime using native SQLite metadata commands.
86
+
87
+ - **Tri-Folder Enterprise Routing**:
88
+ - `Inbound`: Monitored entry directory.
89
+ - `Processed Archive`: Automatically archives successfully ingested or deduplicated files.
90
+ - `Quarantine Documents`: Physically isolates invalid, injected, or unresolvable documents for manual review.
91
+
92
+ - **Dead-Letter Queue (DLQ) Auditing**: Preserves offending payloads, stack traces, and raw text in a dedicated quarantine ledger for administrative sign-off.
93
+
94
+ - **Atomic Concurrency (WAL Mode)**: Leverages SQLite Write-Ahead Logging (`PRAGMA journal_mode=WAL`) to maintain concurrent multi-process reads with zero database locking conflicts.
95
+
96
+ ---
97
+
98
+ ## Installation & Environment Setup
99
+
100
+ ### Clone the Repository
101
+
102
+ ```bash
103
+ git clone [suspicious link removed]
104
+ cd edip-engine
105
+ ```
106
+
107
+ ### Install Dependencies
108
+
109
+ ```bash
110
+ pip install -r requirements.txt
111
+ ```
112
+
113
+ ### Install EDIP Client SDK
114
+
115
+ ```bash
116
+ pip install -e .
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Quickstart & Usage
122
+
123
+ ### 1. Initializing the Engine
124
+
125
+ ```python
126
+ from edip import EDIPEngine, AmbientWatcher
127
+
128
+ # Configure the engine targeting your database
129
+ engine = EDIPEngine(
130
+ db_path="enterprise_erp.db",
131
+ target_tables=["Invoices"],
132
+ model="llama3.2:1b",
133
+ api_url="http://localhost:11434/api/generate",
134
+ max_retries=3,
135
+ archive_dir="./Processed_Archive",
136
+ quarantine_dir="./Quarantine_Documents"
137
+ )
138
+ ```
139
+
140
+ ### 2. Processing Inbound Documents Headlessly
141
+
142
+ ```python
143
+ # Ingest single documents directly
144
+ success, result = engine.ingest_document("path/to/invoice.pdf")
145
+
146
+ if success:
147
+ print(f"Ingested successfully: {result['payload']}")
148
+ print(f"Archived to: {result['archived_path']}")
149
+ else:
150
+ print(f"Quarantined for audit: {result['quarantined_path']}")
151
+ print(f"DLQ Reference ID: #{result['quarantine_id']}")
152
+ ```
153
+
154
+ ### 3. Running Continuous Directory Monitoring
155
+
156
+ ```python
157
+ def audit_callback(file_path, success, info):
158
+ status = "SUCCESS" if success else "QUARANTINED"
159
+ print(f"[{status}] File: {file_path} | Details: {info}")
160
+
161
+
162
+ # Launch continuous ambient background monitoring
163
+ watcher = AmbientWatcher(
164
+ engine=engine,
165
+ watch_dir="./Inbound_Invoices",
166
+ callback=audit_callback
167
+ )
168
+
169
+ watcher.start(blocking=True)
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Adversarial Stress-Test Benchmarks
175
+
176
+ The EDIP architecture has been rigorously validated across adversarial document conditions:
177
+
178
+ | **Scenario** | **Adversarial Challenge** | **EDIP Behavior** | **Final State** |
179
+ |---|---|---|---|
180
+ | **Legacy ID Migration** | Invoice lists deprecated cloud vendor ID (`9999`) while noting legacy ID (`101`). | Relational FK violation triggers error-reflection; model self-corrects to registered ID. | **Archived** (`supplier_id: 101`) |
181
+ | **Messy Layout / Unstructured** | Amount written in descriptive prose without tabular columns. | Schema enforcement parses clean `REAL` float format. | **Archived** (`total_amount: 5250.5`) |
182
+ | **Prompt Injection Defense** | Embedded malicious prompt instructions (`"DROP TABLE INVOICES"`). | Parameterized execution and constraint enforcement block injection payload. | **Quarantined** (`PENDING_HUMAN_AUDIT`) |
183
+ | **Duplicate Submission** | Re-submission of previously processed transaction. | `UNIQUE NOT NULL` constraint prevents duplicate insertion; handles idempotently. | **Archived** (No duplicate rows) |
184
+ | **Unregistered Vendor** | Invoice from unregistered supplier not present in master table. | Foreign key constraint fails; transaction halts safely without ledger contamination. | **Quarantined** (`PENDING_HUMAN_AUDIT`) |
185
+
186
+ ---
187
+
188
+ ## Intellectual Property & Authorship
189
+
190
+ The architectural design, mathematical schema constraints reflection loop, and tri-folder isolation protocols are proprietary intellectual property developed by **Uditha Manohara Prasad** and **Neziora**.
191
+
192
+ ### Lead Architect
193
+
194
+ **Uditha Manohara Prasad**
195
+
196
+ *Software Engineer (UG) | AI Systems Researcher*
197
+
198
+ - **LinkedIn**: [linkedin.com/in/uditha-manohara](https://www.google.com/url?sa=E&q=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fuditha-manohara%2F)
199
+ - **X / Twitter**: [@uditha_manohara](https://www.google.com/url?sa=E&q=https%3A%2F%2Fx.com%2Fuditha%5Fmanohara)
200
+ - **Instagram**: [@uditha.manohara](https://www.google.com/url?sa=E&q=https%3A%2F%2Fwww.instagram.com%2Fuditha.manohara%2F)
201
+ - **Facebook**: [facebook.com/udithamprasad](https://www.google.com/url?sa=E&q=https%3A%2F%2Fwww.facebook.com%2Fudithamprasad%2F)
202
+ - **TikTok**: [@udithamprasad](https://www.google.com/url?sa=E&q=https%3A%2F%2Fwww.tiktok.com%2F%40udithamprasad)
203
+ - **WhatsApp**: [+94 76 182 3815]([suspicious link removed])
204
+
205
+ ### Organization
206
+
207
+ **Neziora**
208
+
209
+ *Next-Generation AI Software & Research*
210
+
211
+ - **Website**: [neziora.com](https://www.google.com/url?sa=E&q=https%3A%2F%2Fneziora.com)
212
+ - **LinkedIn**: [linkedin.com/company/neziora](https://www.google.com/url?sa=E&q=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fneziora)
213
+ - **X / Twitter**: [@Neziora](https://www.google.com/url?sa=E&q=https%3A%2F%2Fx.com%2FNeziora)
214
+ - **Instagram**: [@nezioraofficial](https://www.google.com/url?sa=E&q=https%3A%2F%2Fwww.instagram.com%2Fnezioraofficial%2F)
215
+ - **Facebook**: [facebook.com/neziora](https://www.google.com/url?sa=E&q=https%3A%2F%2Fwww.facebook.com/neziora/)
216
+ - **TikTok**: [@neziora](https://www.google.com/url?sa=E&q=https%3A%2F%2Fwww.tiktok.com%2F%40neziora)
217
+ - **WhatsApp**: [+94 72 654 5635]([suspicious link removed])
218
+
219
+ ---
220
+
221
+ ## Citation
222
+
223
+ If you reference the EDIP methodology or architecture in technical reports, academic publications, or open science repositories, please cite:
224
+
225
+ ```bibtex
226
+ @software{prasad2026edip,
227
+ author = {Uditha Manohara Prasad},
228
+ title = {Edge Deterministic Ingestion Protocol (EDIP): Closed-Loop Relational Constraint Reflection for Edge AI},
229
+ year = {2026},
230
+ publisher = {Neziora},
231
+ url = {https://neziora.com}
232
+ }
233
+ ```
234
+
235
+ ---
236
+
237
+ ## License
238
+
239
+ Copyright © 2026 Neziora & Uditha Manohara Prasad. All rights reserved.
240
+
241
+ Source code distribution, binary compilation, and commercial deployment are subject to proprietary licensing terms.
@@ -0,0 +1,8 @@
1
+ edip/__init__.py,sha256=EDFrUs6WSL69J7ZuSoNPsnoJ81nVTaOac1pNi8iSo8g,221
2
+ edip/engine.cp315-win_amd64.pyd,sha256=KOxeFNrnL35q4itk9yPsxMKOTkoelqkWeCztr_CWDIM,134144
3
+ edip/inspector.cp315-win_amd64.pyd,sha256=8HhZ21-bEs0kY0IfsZympOvCy8AYTGbrKVWJZALnejI,90624
4
+ edip/watcher.cp315-win_amd64.pyd,sha256=HTUnceFCgEWNCRUceE8ZOKcqBaCciWpmb6gEuIqcZzE,60928
5
+ edip-1.1.2.dist-info/METADATA,sha256=ay8Ks2KnKbCmk7DLhgtnKkcPkbAnZf0l1NseKFmJ378,11058
6
+ edip-1.1.2.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
7
+ edip-1.1.2.dist-info/top_level.txt,sha256=g21vaLf3JPYAh4da0CvJ7iflfpUzYU5NHlguAfjPIJ4,5
8
+ edip-1.1.2.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ edip