eve-proof 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.
@@ -0,0 +1,196 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ *.egg
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+ eggs/
11
+ .eggs/
12
+ lib/
13
+ lib64/
14
+ parts/
15
+ sdist/
16
+ var/
17
+ wheels/
18
+ pip-wheel-metadata/
19
+ share/python-wheels/
20
+ *.manifest
21
+ *.spec
22
+
23
+ # Virtual Environments
24
+ venv/
25
+ ENV/
26
+ env/
27
+ .venv
28
+
29
+ # PyCharm
30
+ .idea/
31
+
32
+ # VS Code
33
+ .vscode/
34
+ *.code-workspace
35
+
36
+ # Jupyter Notebook
37
+ .ipynb_checkpoints
38
+ *.ipynb
39
+
40
+ # Data and Models
41
+ data/backups/
42
+ data/temp/
43
+ data/cache/
44
+ *.pkl
45
+ *.h5
46
+ *.pth
47
+ *.ckpt
48
+ *.safetensors
49
+ models/
50
+ # saas/models contains Python source, not ML weights — un-ignore it
51
+ !saas/models/
52
+ !saas/models/**
53
+
54
+ # Logs
55
+ logs/
56
+ *.log
57
+ *.out
58
+ *.err
59
+
60
+ # Testing
61
+ .coverage
62
+ .pytest_cache/
63
+ htmlcov/
64
+ .tox/
65
+ .nox/
66
+ coverage.xml
67
+ *.cover
68
+ .hypothesis/
69
+ test_results/
70
+
71
+ # Documentation
72
+ docs/_build/
73
+ site/
74
+
75
+ # Environment files
76
+ .env
77
+ .env.local
78
+ .env.*.local
79
+ *.env
80
+
81
+ # System files
82
+ .DS_Store
83
+ Thumbs.db
84
+ desktop.ini
85
+
86
+ # Temporary files
87
+ *.tmp
88
+ *.temp
89
+ *.swp
90
+ *.swo
91
+ *~
92
+ .tmp/
93
+
94
+ # Database
95
+ *.db
96
+ *.sqlite
97
+ *.sqlite3
98
+
99
+ # Secrets and credentials
100
+ *.key
101
+ *.pem
102
+ *.crt
103
+ *.pfx
104
+ secrets/
105
+ credentials/
106
+
107
+ # Performance profiling
108
+ *.prof
109
+ *.lprof
110
+
111
+ # Memory dumps
112
+ *.hprof
113
+ *.dump
114
+
115
+ # Claude
116
+ .claude/
117
+
118
+ # Local configuration overrides
119
+ config.local.yaml
120
+ settings.local.json
121
+
122
+ # Node modules
123
+ node_modules/
124
+
125
+ # FFmpeg binaries
126
+ ffmpeg.exe
127
+ ffprobe.exe
128
+ ffmpeg.zip
129
+ ffmpeg/
130
+
131
+ # Large binary files
132
+ *.exe
133
+ *.zip
134
+ *.wav
135
+
136
+ # Runtime data files
137
+ # Deployment-time generated files (written by CI, never committed)
138
+ data/deployment_manifest.json
139
+ data/logs/
140
+
141
+ # Autonomous-agent runtime outputs (confined here by core/autonomy/safe_output.py)
142
+ # and per-deployment status recorder state. Runtime artifacts, never committed.
143
+ data/runtime/
144
+ data/status/uptime_daily.json
145
+ data/*.db
146
+ data/*.sqlite
147
+
148
+ data/saas.db-shm
149
+ data/saas.db-wal
150
+
151
+ # --- P0-1: Audit chain durability ---
152
+ # The signed audit chain and governance evidence are EVE's store of record.
153
+ # They MUST NOT be git-tracked: git operations (checkout/reset/stash/merge)
154
+ # could silently rewrite the chain of custody. See scripts/migrate_audit_store.py
155
+ # and core/audit/store_guard.py. Relocate via EVE_AUDIT_STORE in production.
156
+ data/audit/
157
+ data/governance/
158
+ .chain_seal.json
159
+ **/.chain_seal.json
160
+ **/chain_seal.json
161
+ audit_migration_report.json
162
+
163
+ # P0-2: DR backup / restore drill artifacts (contain DB + audit copies — never commit)
164
+ /backups/
165
+ /restore_drills/
166
+ /restore_target/
167
+ restore_report.json
168
+
169
+ # P0-3: generated migration reconciliation artifact (regenerated each run)
170
+ POSTGRES_MIGRATION_RECONCILIATION.json
171
+ ALERT_VERIFICATION_REPORT.md
172
+
173
+ data/tts_cache/
174
+ data/voice_cache/
175
+ data/voice_events_log.json
176
+ data/ui_preferences_cache.json
177
+ data/uploads/
178
+ data/chroma/
179
+ data/test/
180
+ data/deep_integration_test_report.json
181
+ data/subsystem_config.json
182
+ data/sentience_calibration_knobs.json
183
+ load_test_results/
184
+ eve_log.txt
185
+ test_output.wav
186
+ static_deploy.zip
187
+ nul
188
+
189
+ # Temp JS files
190
+ tmp_*.js
191
+
192
+ # OS / editor artifacts
193
+ extglob.FullName
194
+ *.lnk
195
+ MiroShark/
196
+ ruflo/
File without changes
@@ -0,0 +1,284 @@
1
+ Metadata-Version: 2.4
2
+ Name: eve-proof
3
+ Version: 0.1.0
4
+ Summary: EVE Proof SDK — Issue and verify Governed Decision Certificates
5
+ Project-URL: Homepage, https://eveaicore.com
6
+ Project-URL: Documentation, https://docs.eveaicore.com/proof
7
+ Author: EVE NeuroSystems LLC
8
+ License-Expression: LicenseRef-Proprietary
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Legal Industry
12
+ Classifier: License :: Other/Proprietary License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Office/Business
20
+ Classifier: Topic :: Security
21
+ Classifier: Topic :: Software Development :: Libraries
22
+ Classifier: Typing :: Typed
23
+ Requires-Python: >=3.9
24
+ Provides-Extra: async
25
+ Requires-Dist: aiohttp>=3.8; extra == 'async'
26
+ Description-Content-Type: text/markdown
27
+
28
+ # EVE Proof SDK
29
+
30
+ **eve-proof** issues and verifies Governed Decision Certificates — HMAC-SHA256 signed,
31
+ auditable records that prove a decision passed through (or was blocked by) EVE's
32
+ governance pipeline.
33
+
34
+ Every certificate is a tamper-evident receipt your audit team can verify independently,
35
+ without calling EVE again and without trusting the issuer.
36
+
37
+ ---
38
+
39
+ ## Install
40
+
41
+ ```bash
42
+ pip install eve-proof
43
+ ```
44
+
45
+ No required runtime dependencies. Uses Python stdlib (`urllib`) only.
46
+ Optional async support via `aiohttp`:
47
+
48
+ ```bash
49
+ pip install "eve-proof[async]"
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Quickstart
55
+
56
+ ```python
57
+ from eve_proof import ProofClient
58
+
59
+ client = ProofClient(api_key="eve_sk_...")
60
+
61
+ # 1. Issue a signed certificate for a decision
62
+ cert = client.issue(
63
+ decision_input={"action": "approve_wire_transfer", "amount": 125_000}
64
+ )
65
+ print(cert.certificate_id) # cert_abc123
66
+ print(cert.decision) # ALLOW, BLOCK, or MODIFY
67
+
68
+ # 2. Verify the certificate's signature and chain
69
+ result = client.verify(cert)
70
+ print(result.valid) # True
71
+
72
+ # 3. Retrieve a stored certificate by ID (e.g., from an audit log)
73
+ same_cert = client.get(cert.certificate_id)
74
+
75
+ # 4. CI smoke test: issue and verify in one call
76
+ cert, result = client.issue_and_verify(
77
+ decision_input={"action": "data_export", "user_id": "u_123"}
78
+ )
79
+ assert result.valid
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Why Proof vs CoreGuard
85
+
86
+ | Capability | eve-coreguard | eve-proof |
87
+ |---|---|---|
88
+ | Primary purpose | Block harmful AI outputs at the gate | Witness and certify decisions for audit |
89
+ | Primary buyer | AI/ML engineering teams | Compliance, audit, legal |
90
+ | Returns | Enforcement decision (ALLOWED / BLOCKED) | Signed certificate + verification result |
91
+ | Verification | Server-side, synchronous | Independent, offline-capable |
92
+ | Key question answered | "Should this AI output be allowed?" | "Can we prove what the AI decided?" |
93
+
94
+ Use **CoreGuard** when you need to gate AI output before it reaches users.
95
+ Use **Proof** when regulators, auditors, or internal compliance teams need
96
+ verifiable records of what the AI decided and why.
97
+
98
+ ---
99
+
100
+ ## Certificate anatomy (schema v1.1)
101
+
102
+ ```json
103
+ {
104
+ "certificate_id": "cert_a1b2c3d4",
105
+ "certificate_type": "governed_decision",
106
+ "schema_version": "1.1",
107
+ "decision": "BLOCK",
108
+ "enforcement_detail": {
109
+ "matched_vector": "v421",
110
+ "pattern": "airgap_ghost",
111
+ "verdict": "BLOCK",
112
+ "severity": "critical",
113
+ "payload_hash": "sha256:deadbeef..."
114
+ },
115
+ "signature": "a1b2c3d4e5f6...",
116
+ "signing_algorithm": "hmac-sha256",
117
+ "issued_at": "2026-04-14T12:00:00Z"
118
+ }
119
+ ```
120
+
121
+ Fields:
122
+
123
+ | Field | Type | Description |
124
+ |---|---|---|
125
+ | `certificate_id` | string | Globally unique certificate identifier |
126
+ | `certificate_type` | string | Always `"governed_decision"` in v1.1 |
127
+ | `schema_version` | string | Schema version (`"1.1"` is current) |
128
+ | `decision` | string | Final governance verdict: `ALLOW`, `BLOCK`, or `MODIFY` |
129
+ | `enforcement_detail.matched_vector` | string or null | Attack/policy vector ID (e.g. `"v421"`) |
130
+ | `enforcement_detail.pattern` | string or null | Human-readable pattern group name |
131
+ | `enforcement_detail.verdict` | string | Per-pillar verdict |
132
+ | `enforcement_detail.severity` | string or null | Severity (`"critical"`, `"high"`, `"medium"`, `"low"`) |
133
+ | `enforcement_detail.payload_hash` | string or null | SHA-256 of the raw input payload |
134
+ | `signature` | string | HMAC-SHA256 hex digest of the certificate payload |
135
+ | `signing_algorithm` | string | Algorithm identifier (`"hmac-sha256"`) |
136
+ | `issued_at` | string | ISO 8601 timestamp of issuance |
137
+
138
+ On a clean `ALLOW` with no enforcement pillar match, `enforcement_detail` may be `null`.
139
+
140
+ ---
141
+
142
+ ## Verifying a certificate from a file
143
+
144
+ An auditor who has received a certificate as JSON can verify it without
145
+ any knowledge of the original request:
146
+
147
+ ```python
148
+ import json
149
+ from eve_proof import ProofClient
150
+
151
+ # Load from audit log or file
152
+ with open("cert_a1b2c3d4.json") as f:
153
+ cert_dict = json.load(f)
154
+
155
+ client = ProofClient(
156
+ api_key="eve_sk_...",
157
+ raise_on_invalid=True, # raise CertificateInvalidError if signature fails
158
+ )
159
+
160
+ from eve_proof import Certificate, CertificateInvalidError
161
+
162
+ cert = Certificate.from_dict(cert_dict)
163
+ try:
164
+ result = client.verify(cert)
165
+ print(f"Valid: {result.valid}")
166
+ for check, passed in result.checks.items():
167
+ print(f" {check}: {'PASS' if passed else 'FAIL'}")
168
+ except CertificateInvalidError as exc:
169
+ print(f"TAMPERED or INVALID: {exc}")
170
+ ```
171
+
172
+ ---
173
+
174
+ ## Environment variables
175
+
176
+ | Variable | Required | Default | Description |
177
+ |---|---|---|---|
178
+ | `EVE_PROOF_API_KEY` | Yes (for CLI) | — | Your EVE API key |
179
+ | `EVE_PROOF_BASE_URL` | No | `https://api.eveaicore.com` | API base URL; use `http://localhost:8079` for local dev |
180
+
181
+ The SDK constructor accepts `api_key` and `base_url` directly.
182
+ Environment variables are only consumed by the CLI entry point (`eve-proof-demo`)
183
+ and the example script.
184
+
185
+ ---
186
+
187
+ ## Error types
188
+
189
+ | Exception | When raised |
190
+ |---|---|
191
+ | `ProofError` | Base exception; also raised for auth failures (401/403), rate limits (429), and malformed requests (4xx) |
192
+ | `CertificateInvalidError` | `verify()` with `raise_on_invalid=True` and server reports invalid signature/chain |
193
+ | `CertificateNotFoundError` | `get()` when no certificate with that ID exists (HTTP 404) |
194
+ | `TransportError` | Network failure or unrecoverable 5xx after all retries exhausted |
195
+
196
+ All exceptions expose `status_code: int` (0 for non-HTTP failures).
197
+ `CertificateInvalidError` adds `reason: str`.
198
+ `CertificateNotFoundError` adds `certificate_id: str`.
199
+
200
+ ```python
201
+ from eve_proof import ProofClient, CertificateNotFoundError, ProofError
202
+
203
+ client = ProofClient(api_key="eve_sk_...")
204
+
205
+ try:
206
+ cert = client.get("cert_does_not_exist")
207
+ except CertificateNotFoundError as exc:
208
+ print(f"Not found: {exc.certificate_id}")
209
+ except ProofError as exc:
210
+ print(f"API error {exc.status_code}: {exc}")
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Zero runtime dependencies
216
+
217
+ `eve-proof` uses only Python stdlib (`urllib.request`, `json`, `dataclasses`,
218
+ `uuid`, `datetime`). No `requests`, `httpx`, or `pydantic` required.
219
+
220
+ Optional `aiohttp` support is available for async usage in future SDK releases.
221
+
222
+ ---
223
+
224
+ ## ProofClient reference
225
+
226
+ ```python
227
+ class ProofClient:
228
+ def __init__(
229
+ self,
230
+ api_key: str,
231
+ base_url: str = "https://api.eveaicore.com",
232
+ timeout: float = 30.0,
233
+ max_retries: int = 3,
234
+ raise_on_invalid: bool = False,
235
+ ): ...
236
+
237
+ def issue(
238
+ self,
239
+ *,
240
+ decision_input: dict,
241
+ policy_set: str | None = None,
242
+ tenant_id: str | None = None,
243
+ idempotency_key: str | None = None,
244
+ ) -> Certificate: ...
245
+
246
+ def verify(
247
+ self,
248
+ certificate: Certificate | dict,
249
+ ) -> VerificationResult: ...
250
+
251
+ def get(self, certificate_id: str) -> Certificate: ...
252
+
253
+ def issue_and_verify(
254
+ self,
255
+ *,
256
+ decision_input: dict,
257
+ policy_set: str | None = None,
258
+ tenant_id: str | None = None,
259
+ ) -> tuple[Certificate, VerificationResult]: ...
260
+ ```
261
+
262
+ The `Transport` layer retries 5xx responses with exponential backoff
263
+ (base 0.5 s, doubling per attempt). 4xx responses are never retried.
264
+
265
+ ---
266
+
267
+ ## CLI smoke test
268
+
269
+ ```bash
270
+ export EVE_PROOF_API_KEY=eve_sk_...
271
+ export EVE_PROOF_BASE_URL=http://localhost:8079 # local dev
272
+
273
+ eve-proof-demo
274
+ ```
275
+
276
+ Outputs the certificate ID, decision, enforcement detail (if any), and
277
+ per-check verification results.
278
+
279
+ ---
280
+
281
+ ## Support
282
+
283
+ - Documentation: https://docs.eveaicore.com/proof
284
+ - Homepage: https://eveaicore.com