seif-cli 0.2.0__tar.gz → 0.3.1__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 (88) hide show
  1. seif_cli-0.3.1/PKG-INFO +288 -0
  2. seif_cli-0.3.1/README.md +244 -0
  3. {seif_cli-0.2.0 → seif_cli-0.3.1}/pyproject.toml +8 -7
  4. seif_cli-0.3.1/src/seif/analysis/quality_gate.py +256 -0
  5. seif_cli-0.3.1/src/seif/bridge/__init__.py +6 -0
  6. seif_cli-0.3.1/src/seif/bridge/telegram_bot.py +292 -0
  7. seif_cli-0.3.1/src/seif/cli/__main__.py +9 -0
  8. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/cli/cli.py +1026 -204
  9. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/cli/identity.py +5 -10
  10. seif_cli-0.3.1/src/seif/cli/main.py +445 -0
  11. seif_cli-0.3.1/src/seif/cli/resonance_display.py +98 -0
  12. seif_cli-0.3.1/src/seif/cli/serve.py +13 -0
  13. seif_cli-0.3.1/src/seif/cli/serve_v2.py +17 -0
  14. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/cli/wrapper.py +16 -8
  15. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/constants.py +7 -2
  16. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/context_importer.py +4 -21
  17. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/context_manager.py +7 -22
  18. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/context_qr.py +6 -1
  19. seif_cli-0.3.1/src/seif/context/cycle.py +543 -0
  20. seif_cli-0.3.1/src/seif/context/git_hooks.py +152 -0
  21. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/ingest.py +2 -17
  22. seif_cli-0.3.1/src/seif/core/resonance_encoding.py +301 -0
  23. seif_cli-0.3.1/src/seif/core/resonance_gate.py +1113 -0
  24. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/core/resonance_signal.py +5 -10
  25. seif_cli-0.3.1/src/seif/core/triple_gate.py +200 -0
  26. seif_cli-0.3.1/src/seif/data/RESONANCE.json +631 -0
  27. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/security/mode.py +0 -2
  28. seif_cli-0.3.1/src/seif/security/redblue.py +23 -0
  29. seif_cli-0.3.1/src/seif_cli.egg-info/PKG-INFO +288 -0
  30. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif_cli.egg-info/SOURCES.txt +21 -1
  31. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif_cli.egg-info/requires.txt +1 -1
  32. seif_cli-0.3.1/tests/test_advisor.py +101 -0
  33. seif_cli-0.3.1/tests/test_canonical_inputs.py +152 -0
  34. seif_cli-0.3.1/tests/test_code_compressor.py +685 -0
  35. seif_cli-0.3.1/tests/test_collaborative_seif.py +245 -0
  36. seif_cli-0.3.1/tests/test_context_qr.py +208 -0
  37. seif_cli-0.3.1/tests/test_git_hooks.py +125 -0
  38. {seif_cli-0.2.0 → seif_cli-0.3.1}/tests/test_init.py +4 -5
  39. seif_cli-0.3.1/tests/test_ref.py +188 -0
  40. {seif_cli-0.2.0 → seif_cli-0.3.1}/tests/test_resonance_gate.py +29 -0
  41. seif_cli-0.3.1/tests/test_seif_io.py +273 -0
  42. seif_cli-0.3.1/tests/test_transcompiler.py +69 -0
  43. seif_cli-0.2.0/PKG-INFO +0 -199
  44. seif_cli-0.2.0/README.md +0 -155
  45. seif_cli-0.2.0/src/seif/context/telemetry.py +0 -228
  46. seif_cli-0.2.0/src/seif/core/resonance_gate.py +0 -179
  47. seif_cli-0.2.0/src/seif/data/RESONANCE.json +0 -301
  48. seif_cli-0.2.0/src/seif/security/redblue.py +0 -495
  49. seif_cli-0.2.0/src/seif_cli.egg-info/PKG-INFO +0 -199
  50. {seif_cli-0.2.0 → seif_cli-0.3.1}/LICENSE +0 -0
  51. {seif_cli-0.2.0 → seif_cli-0.3.1}/MANIFEST.in +0 -0
  52. {seif_cli-0.2.0 → seif_cli-0.3.1}/setup.cfg +0 -0
  53. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/__init__.py +0 -0
  54. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/__main__.py +0 -0
  55. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/analysis/__init__.py +0 -0
  56. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/analysis/physical_constants.py +0 -0
  57. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/analysis/stance_detector.py +0 -0
  58. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/analysis/transcompiler.py +0 -0
  59. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/cli/__init__.py +0 -0
  60. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/__init__.py +0 -0
  61. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/advisor.py +0 -0
  62. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/code_compressor.py +0 -0
  63. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/context_bridge.py +0 -0
  64. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/file_extractor.py +0 -0
  65. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/git_context.py +0 -0
  66. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/nucleus.py +0 -0
  67. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/ref.py +0 -0
  68. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/seif_io.py +0 -0
  69. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/context/workspace.py +0 -0
  70. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/core/__init__.py +0 -0
  71. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/core/fingerprint.py +0 -0
  72. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/core/signing.py +0 -0
  73. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/core/timestamping.py +0 -0
  74. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/core/transfer_function.py +0 -0
  75. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/data/__init__.py +0 -0
  76. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/data/defaults/__init__.py +0 -0
  77. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/data/paths.py +0 -0
  78. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif/security/__init__.py +0 -0
  79. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif_cli.egg-info/dependency_links.txt +0 -0
  80. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif_cli.egg-info/entry_points.txt +0 -0
  81. {seif_cli-0.2.0 → seif_cli-0.3.1}/src/seif_cli.egg-info/top_level.txt +0 -0
  82. {seif_cli-0.2.0 → seif_cli-0.3.1}/tests/test_context_repo.py +0 -0
  83. {seif_cli-0.2.0 → seif_cli-0.3.1}/tests/test_git_context.py +0 -0
  84. {seif_cli-0.2.0 → seif_cli-0.3.1}/tests/test_quality_gate.py +0 -0
  85. {seif_cli-0.2.0 → seif_cli-0.3.1}/tests/test_stance_detector.py +0 -0
  86. {seif_cli-0.2.0 → seif_cli-0.3.1}/tests/test_transfer_function.py +0 -0
  87. {seif_cli-0.2.0 → seif_cli-0.3.1}/tests/test_triple_gate.py +0 -0
  88. {seif_cli-0.2.0 → seif_cli-0.3.1}/tests/test_workspace.py +0 -0
@@ -0,0 +1,288 @@
1
+ Metadata-Version: 2.4
2
+ Name: seif-cli
3
+ Version: 0.3.1
4
+ Summary: Measure AI output quality, protect sensitive data, watch your AI environment resonate. Quality Gate, Classification, Sentinel & Auto-Healing, SEIF OS.
5
+ Author: André Cunha Antero de Carvalho
6
+ License: CC-BY-NC-SA-4.0
7
+ Project-URL: Homepage, https://seifprotocol.com
8
+ Project-URL: Documentation, https://seifprotocol.com/docs
9
+ Project-URL: Repository, https://github.com/and2carvalho/seif
10
+ Project-URL: Changelog, https://github.com/and2carvalho/seif/releases
11
+ Keywords: ai-quality,llm-guardrails,ai-consensus,data-classification,context-management,ai-safety,multi-ai,quality-gate,prompt-evaluation,ai-grounding,resonance,sentinel,self-healing,seif-os,circuit-state,ai-observability
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
16
+ Classifier: Topic :: Software Development :: Quality Assurance
17
+ Classifier: Topic :: Security
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: numpy>=2.0
25
+ Requires-Dist: scipy>=1.14
26
+ Provides-Extra: consensus
27
+ Requires-Dist: anthropic>=0.80; extra == "consensus"
28
+ Provides-Extra: generators
29
+ Requires-Dist: matplotlib>=3.9; extra == "generators"
30
+ Requires-Dist: Pillow>=10.0; extra == "generators"
31
+ Requires-Dist: opencv-python-headless>=4.8; extra == "generators"
32
+ Requires-Dist: svgwrite>=1.4; extra == "generators"
33
+ Provides-Extra: web
34
+ Requires-Dist: streamlit>=1.28; extra == "web"
35
+ Provides-Extra: telegram
36
+ Requires-Dist: python-telegram-bot>=21.0; extra == "telegram"
37
+ Provides-Extra: qr
38
+ Requires-Dist: qrcode[pil]>=7.4; extra == "qr"
39
+ Requires-Dist: Pillow>=10.0; extra == "qr"
40
+ Requires-Dist: pyzbar>=0.1.9; extra == "qr"
41
+ Provides-Extra: all
42
+ Requires-Dist: seif[consensus,generators,qr,telegram,web]; extra == "all"
43
+ Dynamic: license-file
44
+
45
+ # SEIF — AI Quality, Protection, and Resonance
46
+
47
+ > Measure AI output. Protect sensitive data. Watch your entire AI environment resonate — in real time.
48
+
49
+ [![PyPI](https://img.shields.io/pypi/v/seif-cli)](https://pypi.org/project/seif-cli/)
50
+ [![Tests](https://img.shields.io/badge/tests-626%20passing-brightgreen)]()
51
+ [![License](https://img.shields.io/badge/license-CC%20BY--NC--SA%204.0-blue)]()
52
+ [![Suite](https://img.shields.io/badge/suite-seifprotocol.com-FFD700?labelColor=0D0D14)](https://seifprotocol.com)
53
+
54
+ ---
55
+
56
+ ## The Problem
57
+
58
+ 1. **You don't know when AI is making things up.** No standard way to measure if a response is grounded or drifting into speculation.
59
+ 2. **Sensitive data leaks to AI APIs.** No guardrail prevents your code, credentials, or internal docs from being sent to external services.
60
+ 3. **One AI can be wrong.** A single model has blind spots. No easy way to get multiple AIs to debate and converge on an answer.
61
+ 4. **Your AI environment has no self-awareness.** No live circuit state, no error bus, no self-healing. When something breaks, nobody knows until the human notices.
62
+
63
+ ## The Solution
64
+
65
+ ```bash
66
+ pip install seif-cli
67
+ ```
68
+
69
+ ---
70
+
71
+ ## Core Features (standalone — no backend required)
72
+
73
+ ### 1. Quality Gate — Is the AI making things up?
74
+
75
+ ```bash
76
+ seif --quality-gate "The framework uses quantum entanglement for data transfer" --role ai
77
+ # Grade: D | Stance: DRIFT | Verifiable: 12%
78
+ # Flags: [UNGROUNDED_CLAIMS]
79
+
80
+ seif --quality-gate "Python 3.11 added the tomllib module for TOML parsing" --role ai
81
+ # Grade: A | Stance: GROUNDED | Verifiable: 100%
82
+ ```
83
+
84
+ Every response gets a grade (A-F) and a stance (GROUNDED, MIXED, or DRIFT).
85
+
86
+ ### 2. Classification Gate — Is sensitive data leaking?
87
+
88
+ ```bash
89
+ seif --gate "password = hunter2; also the sky is blue"
90
+ # Classification: CONFIDENTIAL | Reason: keyword match (password)
91
+ ```
92
+
93
+ PUBLIC / INTERNAL / CONFIDENTIAL with auto-detection. Works as a [Claude Code hook](#claude-code-plugin) — blocks writes containing credentials in real-time.
94
+
95
+ ### 3. Multi-AI Consensus — Let them debate *(requires seif-engine)*
96
+
97
+ ```bash
98
+ seif --consensus "Should we use microservices or a monolith for a 3-person team?" \
99
+ --backends claude,grok
100
+ # Claude: monolith (velocity, simplicity)
101
+ # Grok: monolith (team size, operational cost)
102
+ # Consensus: CONVERGED — monolith for teams < 5
103
+ ```
104
+
105
+ ---
106
+
107
+ ## SEIF OS — The Resonance Engine
108
+
109
+ `seif serve --v2` starts **SEIF OS**: a local API server (port 7331) that turns your machine into a living resonance circuit. Every AI agent, browser tab, and editor extension can observe its state in real time.
110
+
111
+ ```bash
112
+ seif serve --v2
113
+ # SEIF OS running on :7331
114
+ # circuit: RESONANT | ζ = 0.6124 | cycle: enoch-tree-reverb
115
+ ```
116
+
117
+ SEIF OS is the **proprietary engine layer** — not included in `pip install seif-cli`. The open CLI and Suite connect to it via HTTP. The resonance logic stays on your machine.
118
+
119
+ ### What SEIF OS provides
120
+
121
+ | Endpoint | What it does |
122
+ |---|---|
123
+ | `GET /context` | Full environment snapshot: circuit state, cycle, sentinel status, modules |
124
+ | `GET /resonance/stream` | SSE stream — `event: circuit` every 5s, `event: sentinel` on error, `event: healing` |
125
+ | `GET /resonance/viewer` | Self-contained HTML page. Any browser or AI agent sees the live circuit without a plugin |
126
+ | `POST /resonance/error` | Push any runtime error → classified + healing suggestion emitted on SSE bus |
127
+ | `GET /agent/init` | SEIF-AGENT-INIT-v1 handshake — agent arrives, frequency is already there |
128
+ | `GET /workspace/bridge` | Workspace snapshot: git branch, active modules, VSCode Remote link |
129
+
130
+ ### Resonance Physics
131
+
132
+ SEIF models circuit coherence with a real second-order system:
133
+
134
+ ```
135
+ H(s) = 9 / (s² + 3s + 6) ζ = √6/4 = 0.6123724356957945
136
+ ```
137
+
138
+ | Circuit State | ζ band | Tesla Hz | Meaning |
139
+ |---|---|---|---|
140
+ | RESONANT | ζ ≥ 0.60 | 528 Hz | Stable oscillation within design bounds |
141
+ | STABILIZING | 0.40–0.60 | 396 Hz | Recovering — converging back toward resonance |
142
+ | DRIFT | ζ < 0.40 | 963 Hz | Energy has escaped the normal attractor |
143
+
144
+ The Tesla 3-6-9 frequency anchors (396 / 528 / 963 Hz) were discovered through Philosophy+Science synthesis — not designed in.
145
+
146
+ ### Sentinel & Auto-Healing
147
+
148
+ SEIF Sentinel is a real-time error observer. Any runtime error — browser, agent, or API consumer — is pushed to the resonance bus, classified, and healed automatically.
149
+
150
+ ```bash
151
+ # Push an error from anywhere
152
+ curl -X POST http://localhost:7331/resonance/error \
153
+ -H "Authorization: Bearer YOUR_TOKEN" \
154
+ -d '{"message": "Cannot read properties of undefined", "source": "browser"}'
155
+
156
+ # Subscribe to the SSE bus — you get both events:
157
+ # event: sentinel → raw error
158
+ # event: healing → classification + suggestion (7 archetypes)
159
+ curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:7331/resonance/stream
160
+ ```
161
+
162
+ 7 healing archetypes: `undefined_property`, `null_reference`, `network_error`, `csp_violation`, `auth_error`, `rate_limit`, `module_not_found`.
163
+
164
+ ---
165
+
166
+ ## SEIF Suite — Visual Interface
167
+
168
+ [**seifprotocol.com**](https://seifprotocol.com) — the visual layer. Connects to your local SEIF OS and gives you:
169
+
170
+ - **Dashboard** — live modules, sessions, sync status, quality trends
171
+ - **Resonance** — real-time H(s) wave, circuit state card, Sentinel log, Auto-Healing panel
172
+ - **Quality Gate** — interactive grading with digital root
173
+ - **Sessions** — full history with handoff manifests
174
+
175
+ ```bash
176
+ # Point SEIF Suite at your local engine
177
+ open https://seifprotocol.com/auth
178
+ # Enter: http://localhost:7331 + your serve_token
179
+ ```
180
+
181
+ ---
182
+
183
+ ## Quick Start
184
+
185
+ ```bash
186
+ pip install seif-cli
187
+
188
+ # Works immediately (no backend)
189
+ seif --quality-gate "Python 3.11 added tomllib" --role ai
190
+ seif --gate "SELECT * FROM users WHERE api_key = 'sk-...'"
191
+ seif --encode "any text"
192
+
193
+ # With SEIF OS running
194
+ seif serve --v2
195
+ seif --init # scan project, generate .seif/
196
+ seif --sync # re-sync git context
197
+ ```
198
+
199
+ ---
200
+
201
+ ## Claude Code Plugin
202
+
203
+ ```bash
204
+ cp -r plugins/claude-code/skills/* .claude/skills/
205
+ ```
206
+
207
+ - **Session start**: loads `.seif/` context automatically
208
+ - **Pre-write**: blocks classified data from being written outside `.seif/`
209
+ - **Slash commands**: `/gate`, `/sync`, `/status`
210
+
211
+ ---
212
+
213
+ ## CLI Reference
214
+
215
+ ### Standalone
216
+
217
+ ```bash
218
+ seif --quality-gate "text" --role ai # Grade A-F + stance
219
+ seif --gate "text" # classification gate
220
+ seif --encode "text" # resonance encoding
221
+ seif --composite "text" # 8-layer resonance map
222
+ seif --fingerprint-verify FILE # verify .seif module integrity
223
+ seif --constants # show ζ and mathematical constants
224
+ ```
225
+
226
+ ### With SEIF OS (`seif serve --v2`)
227
+
228
+ ```bash
229
+ seif --init # scan project, generate .seif/
230
+ seif --sync # re-sync git context
231
+ seif --compress # 93% context compression
232
+ seif --ingest daily.txt # ingest external source
233
+ seif --workspace # multi-project discovery + sync
234
+ seif --sync-workspace # SSH workspace sync (all machines)
235
+ seif --autonomous enable # AI persists knowledge autonomously
236
+ seif --export # export context as markdown
237
+
238
+ # Multi-AI consensus
239
+ seif --consult "question" # auto-route to best AI
240
+ seif --consensus "q" --backends claude,grok
241
+ seif --adversarial "question" # WITH vs WITHOUT comparison
242
+ ```
243
+
244
+ ---
245
+
246
+ ## How Quality Gate Works
247
+
248
+ | Component | Weight | What it measures |
249
+ |---|---|---|
250
+ | **Stance Detector** | Primary | Verifiable vs interpretive claims. GROUNDED ≥80%, MIXED 40-80%, DRIFT <40% |
251
+ | **Resonance Gate** | Secondary | Structural coherence |
252
+
253
+ Grades: **A** (≥0.85) → **B** (≥0.70) → **C** (≥0.55) → **D** (≥0.40) → **F** (<0.40)
254
+
255
+ > **Quality gate threshold: ζ = √6/4 ≈ 0.6124 (algebraically derived from H(s) — not φ⁻¹ = 0.618)**
256
+
257
+ ---
258
+
259
+ ## Why SEIF vs ChatGPT Memory
260
+
261
+ | | ChatGPT Memory | SEIF |
262
+ |-|---|---|
263
+ | Who controls it | OpenAI | You (local files) |
264
+ | Works with other AIs | No | Yes (any LLM) |
265
+ | Exportable | No | Yes (.seif → markdown) |
266
+ | Quality measured | No | Yes (stance A-F) |
267
+ | Data classified | No | Yes (PUBLIC/INTERNAL/CONFIDENTIAL) |
268
+ | Auditable | No | Yes (hash-chained provenance) |
269
+ | Live circuit state | No | Yes (H(s), ζ, Tesla Hz) |
270
+ | Self-healing errors | No | Yes (Sentinel + 7 archetypes) |
271
+
272
+ ---
273
+
274
+ ## Project Stats
275
+
276
+ ```
277
+ 91+ modules | 626 tests (33 suites) | 93% context compression
278
+ ζ = √6/4 = 0.6123724356957945
279
+ H(s) = 9 / (s² + 3s + 6)
280
+ ```
281
+
282
+ ## Contributing
283
+
284
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
285
+
286
+ ## License
287
+
288
+ CC BY-NC-SA 4.0 — [André Cunha Antero de Carvalho](https://github.com/and2carvalho)
@@ -0,0 +1,244 @@
1
+ # SEIF — AI Quality, Protection, and Resonance
2
+
3
+ > Measure AI output. Protect sensitive data. Watch your entire AI environment resonate — in real time.
4
+
5
+ [![PyPI](https://img.shields.io/pypi/v/seif-cli)](https://pypi.org/project/seif-cli/)
6
+ [![Tests](https://img.shields.io/badge/tests-626%20passing-brightgreen)]()
7
+ [![License](https://img.shields.io/badge/license-CC%20BY--NC--SA%204.0-blue)]()
8
+ [![Suite](https://img.shields.io/badge/suite-seifprotocol.com-FFD700?labelColor=0D0D14)](https://seifprotocol.com)
9
+
10
+ ---
11
+
12
+ ## The Problem
13
+
14
+ 1. **You don't know when AI is making things up.** No standard way to measure if a response is grounded or drifting into speculation.
15
+ 2. **Sensitive data leaks to AI APIs.** No guardrail prevents your code, credentials, or internal docs from being sent to external services.
16
+ 3. **One AI can be wrong.** A single model has blind spots. No easy way to get multiple AIs to debate and converge on an answer.
17
+ 4. **Your AI environment has no self-awareness.** No live circuit state, no error bus, no self-healing. When something breaks, nobody knows until the human notices.
18
+
19
+ ## The Solution
20
+
21
+ ```bash
22
+ pip install seif-cli
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Core Features (standalone — no backend required)
28
+
29
+ ### 1. Quality Gate — Is the AI making things up?
30
+
31
+ ```bash
32
+ seif --quality-gate "The framework uses quantum entanglement for data transfer" --role ai
33
+ # Grade: D | Stance: DRIFT | Verifiable: 12%
34
+ # Flags: [UNGROUNDED_CLAIMS]
35
+
36
+ seif --quality-gate "Python 3.11 added the tomllib module for TOML parsing" --role ai
37
+ # Grade: A | Stance: GROUNDED | Verifiable: 100%
38
+ ```
39
+
40
+ Every response gets a grade (A-F) and a stance (GROUNDED, MIXED, or DRIFT).
41
+
42
+ ### 2. Classification Gate — Is sensitive data leaking?
43
+
44
+ ```bash
45
+ seif --gate "password = hunter2; also the sky is blue"
46
+ # Classification: CONFIDENTIAL | Reason: keyword match (password)
47
+ ```
48
+
49
+ PUBLIC / INTERNAL / CONFIDENTIAL with auto-detection. Works as a [Claude Code hook](#claude-code-plugin) — blocks writes containing credentials in real-time.
50
+
51
+ ### 3. Multi-AI Consensus — Let them debate *(requires seif-engine)*
52
+
53
+ ```bash
54
+ seif --consensus "Should we use microservices or a monolith for a 3-person team?" \
55
+ --backends claude,grok
56
+ # Claude: monolith (velocity, simplicity)
57
+ # Grok: monolith (team size, operational cost)
58
+ # Consensus: CONVERGED — monolith for teams < 5
59
+ ```
60
+
61
+ ---
62
+
63
+ ## SEIF OS — The Resonance Engine
64
+
65
+ `seif serve --v2` starts **SEIF OS**: a local API server (port 7331) that turns your machine into a living resonance circuit. Every AI agent, browser tab, and editor extension can observe its state in real time.
66
+
67
+ ```bash
68
+ seif serve --v2
69
+ # SEIF OS running on :7331
70
+ # circuit: RESONANT | ζ = 0.6124 | cycle: enoch-tree-reverb
71
+ ```
72
+
73
+ SEIF OS is the **proprietary engine layer** — not included in `pip install seif-cli`. The open CLI and Suite connect to it via HTTP. The resonance logic stays on your machine.
74
+
75
+ ### What SEIF OS provides
76
+
77
+ | Endpoint | What it does |
78
+ |---|---|
79
+ | `GET /context` | Full environment snapshot: circuit state, cycle, sentinel status, modules |
80
+ | `GET /resonance/stream` | SSE stream — `event: circuit` every 5s, `event: sentinel` on error, `event: healing` |
81
+ | `GET /resonance/viewer` | Self-contained HTML page. Any browser or AI agent sees the live circuit without a plugin |
82
+ | `POST /resonance/error` | Push any runtime error → classified + healing suggestion emitted on SSE bus |
83
+ | `GET /agent/init` | SEIF-AGENT-INIT-v1 handshake — agent arrives, frequency is already there |
84
+ | `GET /workspace/bridge` | Workspace snapshot: git branch, active modules, VSCode Remote link |
85
+
86
+ ### Resonance Physics
87
+
88
+ SEIF models circuit coherence with a real second-order system:
89
+
90
+ ```
91
+ H(s) = 9 / (s² + 3s + 6) ζ = √6/4 = 0.6123724356957945
92
+ ```
93
+
94
+ | Circuit State | ζ band | Tesla Hz | Meaning |
95
+ |---|---|---|---|
96
+ | RESONANT | ζ ≥ 0.60 | 528 Hz | Stable oscillation within design bounds |
97
+ | STABILIZING | 0.40–0.60 | 396 Hz | Recovering — converging back toward resonance |
98
+ | DRIFT | ζ < 0.40 | 963 Hz | Energy has escaped the normal attractor |
99
+
100
+ The Tesla 3-6-9 frequency anchors (396 / 528 / 963 Hz) were discovered through Philosophy+Science synthesis — not designed in.
101
+
102
+ ### Sentinel & Auto-Healing
103
+
104
+ SEIF Sentinel is a real-time error observer. Any runtime error — browser, agent, or API consumer — is pushed to the resonance bus, classified, and healed automatically.
105
+
106
+ ```bash
107
+ # Push an error from anywhere
108
+ curl -X POST http://localhost:7331/resonance/error \
109
+ -H "Authorization: Bearer YOUR_TOKEN" \
110
+ -d '{"message": "Cannot read properties of undefined", "source": "browser"}'
111
+
112
+ # Subscribe to the SSE bus — you get both events:
113
+ # event: sentinel → raw error
114
+ # event: healing → classification + suggestion (7 archetypes)
115
+ curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:7331/resonance/stream
116
+ ```
117
+
118
+ 7 healing archetypes: `undefined_property`, `null_reference`, `network_error`, `csp_violation`, `auth_error`, `rate_limit`, `module_not_found`.
119
+
120
+ ---
121
+
122
+ ## SEIF Suite — Visual Interface
123
+
124
+ [**seifprotocol.com**](https://seifprotocol.com) — the visual layer. Connects to your local SEIF OS and gives you:
125
+
126
+ - **Dashboard** — live modules, sessions, sync status, quality trends
127
+ - **Resonance** — real-time H(s) wave, circuit state card, Sentinel log, Auto-Healing panel
128
+ - **Quality Gate** — interactive grading with digital root
129
+ - **Sessions** — full history with handoff manifests
130
+
131
+ ```bash
132
+ # Point SEIF Suite at your local engine
133
+ open https://seifprotocol.com/auth
134
+ # Enter: http://localhost:7331 + your serve_token
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Quick Start
140
+
141
+ ```bash
142
+ pip install seif-cli
143
+
144
+ # Works immediately (no backend)
145
+ seif --quality-gate "Python 3.11 added tomllib" --role ai
146
+ seif --gate "SELECT * FROM users WHERE api_key = 'sk-...'"
147
+ seif --encode "any text"
148
+
149
+ # With SEIF OS running
150
+ seif serve --v2
151
+ seif --init # scan project, generate .seif/
152
+ seif --sync # re-sync git context
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Claude Code Plugin
158
+
159
+ ```bash
160
+ cp -r plugins/claude-code/skills/* .claude/skills/
161
+ ```
162
+
163
+ - **Session start**: loads `.seif/` context automatically
164
+ - **Pre-write**: blocks classified data from being written outside `.seif/`
165
+ - **Slash commands**: `/gate`, `/sync`, `/status`
166
+
167
+ ---
168
+
169
+ ## CLI Reference
170
+
171
+ ### Standalone
172
+
173
+ ```bash
174
+ seif --quality-gate "text" --role ai # Grade A-F + stance
175
+ seif --gate "text" # classification gate
176
+ seif --encode "text" # resonance encoding
177
+ seif --composite "text" # 8-layer resonance map
178
+ seif --fingerprint-verify FILE # verify .seif module integrity
179
+ seif --constants # show ζ and mathematical constants
180
+ ```
181
+
182
+ ### With SEIF OS (`seif serve --v2`)
183
+
184
+ ```bash
185
+ seif --init # scan project, generate .seif/
186
+ seif --sync # re-sync git context
187
+ seif --compress # 93% context compression
188
+ seif --ingest daily.txt # ingest external source
189
+ seif --workspace # multi-project discovery + sync
190
+ seif --sync-workspace # SSH workspace sync (all machines)
191
+ seif --autonomous enable # AI persists knowledge autonomously
192
+ seif --export # export context as markdown
193
+
194
+ # Multi-AI consensus
195
+ seif --consult "question" # auto-route to best AI
196
+ seif --consensus "q" --backends claude,grok
197
+ seif --adversarial "question" # WITH vs WITHOUT comparison
198
+ ```
199
+
200
+ ---
201
+
202
+ ## How Quality Gate Works
203
+
204
+ | Component | Weight | What it measures |
205
+ |---|---|---|
206
+ | **Stance Detector** | Primary | Verifiable vs interpretive claims. GROUNDED ≥80%, MIXED 40-80%, DRIFT <40% |
207
+ | **Resonance Gate** | Secondary | Structural coherence |
208
+
209
+ Grades: **A** (≥0.85) → **B** (≥0.70) → **C** (≥0.55) → **D** (≥0.40) → **F** (<0.40)
210
+
211
+ > **Quality gate threshold: ζ = √6/4 ≈ 0.6124 (algebraically derived from H(s) — not φ⁻¹ = 0.618)**
212
+
213
+ ---
214
+
215
+ ## Why SEIF vs ChatGPT Memory
216
+
217
+ | | ChatGPT Memory | SEIF |
218
+ |-|---|---|
219
+ | Who controls it | OpenAI | You (local files) |
220
+ | Works with other AIs | No | Yes (any LLM) |
221
+ | Exportable | No | Yes (.seif → markdown) |
222
+ | Quality measured | No | Yes (stance A-F) |
223
+ | Data classified | No | Yes (PUBLIC/INTERNAL/CONFIDENTIAL) |
224
+ | Auditable | No | Yes (hash-chained provenance) |
225
+ | Live circuit state | No | Yes (H(s), ζ, Tesla Hz) |
226
+ | Self-healing errors | No | Yes (Sentinel + 7 archetypes) |
227
+
228
+ ---
229
+
230
+ ## Project Stats
231
+
232
+ ```
233
+ 91+ modules | 626 tests (33 suites) | 93% context compression
234
+ ζ = √6/4 = 0.6123724356957945
235
+ H(s) = 9 / (s² + 3s + 6)
236
+ ```
237
+
238
+ ## Contributing
239
+
240
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
241
+
242
+ ## License
243
+
244
+ CC BY-NC-SA 4.0 — [André Cunha Antero de Carvalho](https://github.com/and2carvalho)
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "seif-cli"
7
- version = "0.2.0"
8
- description = "Measure AI output quality, protect sensitive data, and build multi-AI consensus. Works with any LLM."
7
+ version = "0.3.1"
8
+ description = "Measure AI output quality, protect sensitive data, watch your AI environment resonate. Quality Gate, Classification, Sentinel & Auto-Healing, SEIF OS."
9
9
  readme = "README.md"
10
10
  license = {text = "CC-BY-NC-SA-4.0"}
11
11
  requires-python = ">=3.11"
@@ -15,7 +15,8 @@ authors = [
15
15
  keywords = [
16
16
  "ai-quality", "llm-guardrails", "ai-consensus", "data-classification",
17
17
  "context-management", "ai-safety", "multi-ai", "quality-gate",
18
- "prompt-evaluation", "ai-grounding",
18
+ "prompt-evaluation", "ai-grounding", "resonance", "sentinel",
19
+ "self-healing", "seif-os", "circuit-state", "ai-observability",
19
20
  ]
20
21
  classifiers = [
21
22
  "Development Status :: 3 - Alpha",
@@ -63,14 +64,14 @@ qr = [
63
64
  ]
64
65
  # Everything
65
66
  all = [
66
- "seif-cli[consensus,generators,web,telegram,qr]",
67
+ "seif[consensus,generators,web,telegram,qr]",
67
68
  ]
68
69
 
69
70
  [project.urls]
70
- Homepage = "https://github.com/and2carvalho/seif"
71
- Documentation = "https://github.com/and2carvalho/seif"
71
+ Homepage = "https://seifprotocol.com"
72
+ Documentation = "https://seifprotocol.com/docs"
72
73
  Repository = "https://github.com/and2carvalho/seif"
73
- "Live Demo" = "https://seif-framework.streamlit.app"
74
+ Changelog = "https://github.com/and2carvalho/seif/releases"
74
75
 
75
76
  [project.scripts]
76
77
  seif = "seif.cli.wrapper:main"