resethiq 0.1.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.
- resethiq-0.1.0/PKG-INFO +22 -0
- resethiq-0.1.0/README.md +86 -0
- resethiq-0.1.0/pyproject.toml +34 -0
- resethiq-0.1.0/resethiq/__init__.py +7 -0
- resethiq-0.1.0/resethiq/api/__init__.py +0 -0
- resethiq-0.1.0/resethiq/api/main.py +6363 -0
- resethiq-0.1.0/resethiq/cli/__init__.py +0 -0
- resethiq-0.1.0/resethiq/cli/main.py +131 -0
- resethiq-0.1.0/resethiq/core/__init__.py +11 -0
- resethiq-0.1.0/resethiq/core/forensics/__init__.py +0 -0
- resethiq-0.1.0/resethiq/core/forensics/audit.py +690 -0
- resethiq-0.1.0/resethiq/core/forensics/bias.py +798 -0
- resethiq-0.1.0/resethiq/core/forensics/caliper.py +705 -0
- resethiq-0.1.0/resethiq/core/forensics/compliance.py +1068 -0
- resethiq-0.1.0/resethiq/core/forensics/compliance_laws.py +463 -0
- resethiq-0.1.0/resethiq/core/forensics/correlation.py +583 -0
- resethiq-0.1.0/resethiq/core/forensics/data_quality.py +1908 -0
- resethiq-0.1.0/resethiq/core/forensics/drift_advanced.py +1128 -0
- resethiq-0.1.0/resethiq/core/forensics/ela.py +659 -0
- resethiq-0.1.0/resethiq/core/forensics/grim.py +627 -0
- resethiq-0.1.0/resethiq/core/forensics/provenance.py +462 -0
- resethiq-0.1.0/resethiq/core/forensics/reality_grounding.py +1780 -0
- resethiq-0.1.0/resethiq/core/forensics/rules_engine.py +492 -0
- resethiq-0.1.0/resethiq/core/forensics/streaming.py +487 -0
- resethiq-0.1.0/resethiq/core/forensics/telemetry.py +1048 -0
- resethiq-0.1.0/resethiq/core/forensics/terminal_digit.py +627 -0
- resethiq-0.1.0/resethiq/core/jobs.py +889 -0
- resethiq-0.1.0/resethiq/core/modules/__init__.py +0 -0
- resethiq-0.1.0/resethiq/core/modules/drift.py +1018 -0
- resethiq-0.1.0/resethiq/core/modules/integrity.py +833 -0
- resethiq-0.1.0/resethiq/core/modules/synthetic.py +1101 -0
- resethiq-0.1.0/resethiq/core/pipeline.py +146 -0
- resethiq-0.1.0/resethiq/dashboard/index.html +17439 -0
- resethiq-0.1.0/resethiq/schemas/__init__.py +21 -0
- resethiq-0.1.0/resethiq/schemas/results.py +249 -0
- resethiq-0.1.0/resethiq.egg-info/PKG-INFO +22 -0
- resethiq-0.1.0/resethiq.egg-info/SOURCES.txt +43 -0
- resethiq-0.1.0/resethiq.egg-info/dependency_links.txt +1 -0
- resethiq-0.1.0/resethiq.egg-info/entry_points.txt +2 -0
- resethiq-0.1.0/resethiq.egg-info/requires.txt +18 -0
- resethiq-0.1.0/resethiq.egg-info/top_level.txt +1 -0
- resethiq-0.1.0/setup.cfg +4 -0
- resethiq-0.1.0/tests/test_drift.py +66 -0
- resethiq-0.1.0/tests/test_integrity.py +80 -0
- resethiq-0.1.0/tests/test_synthetic.py +64 -0
resethiq-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: resethiq
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Cryptographic Data Integrity for the AI Age
|
|
5
|
+
Author-email: Deebyajyoti Dey <deyabhi25@gmail.com>
|
|
6
|
+
Requires-Python: >=3.10
|
|
7
|
+
Requires-Dist: pandas>=2.0
|
|
8
|
+
Requires-Dist: numpy>=1.26
|
|
9
|
+
Requires-Dist: cryptography>=42.0
|
|
10
|
+
Requires-Dist: fastapi>=0.110
|
|
11
|
+
Requires-Dist: uvicorn[standard]>=0.29
|
|
12
|
+
Requires-Dist: pydantic>=2.6
|
|
13
|
+
Requires-Dist: rich>=13.0
|
|
14
|
+
Requires-Dist: typer>=0.12
|
|
15
|
+
Provides-Extra: dev
|
|
16
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
17
|
+
Requires-Dist: pytest-cov; extra == "dev"
|
|
18
|
+
Requires-Dist: httpx>=0.27; extra == "dev"
|
|
19
|
+
Provides-Extra: full
|
|
20
|
+
Requires-Dist: pyarrow>=14.0; extra == "full"
|
|
21
|
+
Requires-Dist: scipy>=1.11; extra == "full"
|
|
22
|
+
Requires-Dist: scikit-learn>=1.4; extra == "full"
|
resethiq-0.1.0/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# ResEthiq — Cryptographic Data Integrity for the AI Age
|
|
2
|
+
|
|
3
|
+
> *Every AI system is only as trustworthy as the data it was trained on.*
|
|
4
|
+
|
|
5
|
+
ResEthiq is a Python library + REST API for auditing, signing, and certifying AI training datasets.
|
|
6
|
+
It catches data fabrication, drift, and manipulation before models are trained on corrupted data.
|
|
7
|
+
|
|
8
|
+
## Pipeline
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
Examine → Freeze → Enforce → Certify
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Modules
|
|
15
|
+
|
|
16
|
+
| Module | What it detects |
|
|
17
|
+
|--------|----------------|
|
|
18
|
+
| **Integrity** | Cryptographic fingerprinting & Ed25519 signing of datasets |
|
|
19
|
+
| **Drift** | Distribution shift between reference and current dataset (KS, PSI, Wasserstein, χ², JS) |
|
|
20
|
+
| **Synthetic** | Fake/GAN-generated data (Benford, entropy, rounding, duplicates, moments) |
|
|
21
|
+
| **GRIM/GRIMMER** | Impossible means & SDs in published statistics |
|
|
22
|
+
| **Caliper / P-value** | P-hacking, p-curve anomalies, excess significance (Ioannidis test) |
|
|
23
|
+
| **Terminal Digit** | Human data fabrication via 0/5 preference in terminal digits |
|
|
24
|
+
| **Correlation Matrix** | Mathematically impossible correlation matrices (not PSD, out-of-range entries) |
|
|
25
|
+
| **ELA** | Image manipulation detection via JPEG Error Level Analysis + copy-move forensics |
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install -r requirements.txt
|
|
31
|
+
uvicorn resethiq.api.main:app --reload
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
API available at `http://localhost:8000/docs`
|
|
35
|
+
|
|
36
|
+
## API Endpoints
|
|
37
|
+
|
|
38
|
+
| Method | Path | Description |
|
|
39
|
+
|--------|------|-------------|
|
|
40
|
+
| GET | `/v1/health` | Health check |
|
|
41
|
+
| POST | `/v1/freeze` | Cryptographically sign a dataset |
|
|
42
|
+
| POST | `/v1/examine/drift` | Detect distribution drift |
|
|
43
|
+
| POST | `/v1/examine/synthetic` | Detect synthetic/fake data |
|
|
44
|
+
| POST | `/v1/pipeline/run` | Run full Examine → Freeze pipeline |
|
|
45
|
+
|
|
46
|
+
## Python Usage
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from resethiq.core.forensics.grim import GRIMEngine
|
|
50
|
+
from resethiq.core.forensics.caliper import PValueForensicsEngine
|
|
51
|
+
from resethiq.core.forensics.terminal_digit import TerminalDigitEngine
|
|
52
|
+
from resethiq.core.forensics.correlation import CorrelationMatrixEngine
|
|
53
|
+
from resethiq.core.forensics.ela import ELAEngine
|
|
54
|
+
|
|
55
|
+
# GRIM test on published means
|
|
56
|
+
engine = GRIMEngine()
|
|
57
|
+
result = engine.test_mean(n=28, mean=3.57)
|
|
58
|
+
print(result.verdict) # INCONSISTENT
|
|
59
|
+
|
|
60
|
+
# P-hacking detection
|
|
61
|
+
pv_engine = PValueForensicsEngine()
|
|
62
|
+
report = pv_engine.analyse(p_values)
|
|
63
|
+
|
|
64
|
+
# Terminal digit forgery
|
|
65
|
+
td_engine = TerminalDigitEngine()
|
|
66
|
+
report = td_engine.analyse(df)
|
|
67
|
+
|
|
68
|
+
# Correlation matrix impossibility
|
|
69
|
+
cm_engine = CorrelationMatrixEngine()
|
|
70
|
+
report = cm_engine.analyse_matrix(R, n_sample=85)
|
|
71
|
+
|
|
72
|
+
# Image manipulation (ELA)
|
|
73
|
+
ela_engine = ELAEngine()
|
|
74
|
+
result = ela_engine.analyse_file("image.jpg")
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Requirements
|
|
78
|
+
|
|
79
|
+
- Python 3.10+
|
|
80
|
+
- See `requirements.txt`
|
|
81
|
+
- For image forensics: `pip install Pillow`
|
|
82
|
+
|
|
83
|
+
## Authors
|
|
84
|
+
|
|
85
|
+
Deebyajyoti Dey — CTO & Co-Founder, ResEthiq
|
|
86
|
+
deyabhi25@gmail.com
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "resethiq"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Cryptographic Data Integrity for the AI Age"
|
|
9
|
+
authors = [{ name = "Deebyajyoti Dey", email = "deyabhi25@gmail.com" }]
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"pandas>=2.0",
|
|
13
|
+
"numpy>=1.26",
|
|
14
|
+
"cryptography>=42.0",
|
|
15
|
+
"fastapi>=0.110",
|
|
16
|
+
"uvicorn[standard]>=0.29",
|
|
17
|
+
"pydantic>=2.6",
|
|
18
|
+
"rich>=13.0",
|
|
19
|
+
"typer>=0.12",
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[project.optional-dependencies]
|
|
23
|
+
dev = ["pytest>=8.0", "pytest-cov", "httpx>=0.27"]
|
|
24
|
+
full = ["pyarrow>=14.0", "scipy>=1.11", "scikit-learn>=1.4"]
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
resethiq = "resethiq.cli.main:app"
|
|
28
|
+
|
|
29
|
+
[tool.setuptools.packages.find]
|
|
30
|
+
where = ["."]
|
|
31
|
+
include = ["resethiq*"]
|
|
32
|
+
|
|
33
|
+
[tool.setuptools.package-data]
|
|
34
|
+
resethiq = ["dashboard/*", "dashboard/**/*"]
|
|
File without changes
|