seif-cli 0.1.2__tar.gz → 0.3.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 (123) hide show
  1. seif_cli-0.3.0/PKG-INFO +285 -0
  2. seif_cli-0.3.0/README.md +241 -0
  3. {seif_cli-0.1.2 → seif_cli-0.3.0}/pyproject.toml +22 -14
  4. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/analysis/quality_gate.py +61 -7
  5. seif_cli-0.3.0/src/seif/bridge/__init__.py +6 -0
  6. seif_cli-0.3.0/src/seif/bridge/telegram_bot.py +292 -0
  7. seif_cli-0.3.0/src/seif/cli/__main__.py +9 -0
  8. seif_cli-0.3.0/src/seif/cli/cli.py +3489 -0
  9. seif_cli-0.3.0/src/seif/cli/identity.py +256 -0
  10. seif_cli-0.3.0/src/seif/cli/serve.py +13 -0
  11. seif_cli-0.3.0/src/seif/cli/serve_v2.py +17 -0
  12. seif_cli-0.3.0/src/seif/cli/wrapper.py +478 -0
  13. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/constants.py +75 -11
  14. seif_cli-0.3.0/src/seif/context/code_compressor.py +1124 -0
  15. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/context/context_importer.py +0 -1
  16. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/context/context_manager.py +101 -53
  17. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/context/context_qr.py +6 -1
  18. seif_cli-0.3.0/src/seif/context/file_extractor.py +403 -0
  19. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/context/git_hooks.py +6 -6
  20. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/context/ingest.py +3 -4
  21. seif_cli-0.3.0/src/seif/context/nucleus.py +292 -0
  22. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/context/ref.py +2 -2
  23. seif_cli-0.3.0/src/seif/context/seif_io.py +241 -0
  24. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/context/workspace.py +184 -10
  25. seif_cli-0.3.0/src/seif/core/fingerprint.py +92 -0
  26. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/core/resonance_encoding.py +19 -1
  27. seif_cli-0.3.0/src/seif/core/resonance_gate.py +1113 -0
  28. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/core/resonance_signal.py +5 -2
  29. seif_cli-0.3.0/src/seif/core/signing.py +223 -0
  30. seif_cli-0.3.0/src/seif/core/timestamping.py +138 -0
  31. seif_cli-0.3.0/src/seif/data/RESONANCE.json +631 -0
  32. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/data/paths.py +15 -0
  33. seif_cli-0.3.0/src/seif/security/__init__.py +17 -0
  34. seif_cli-0.3.0/src/seif/security/mode.py +101 -0
  35. seif_cli-0.3.0/src/seif/security/redblue.py +23 -0
  36. seif_cli-0.3.0/src/seif_cli.egg-info/PKG-INFO +285 -0
  37. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif_cli.egg-info/SOURCES.txt +16 -35
  38. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif_cli.egg-info/entry_points.txt +1 -1
  39. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif_cli.egg-info/requires.txt +8 -4
  40. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif_cli.egg-info/top_level.txt +0 -1
  41. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_advisor.py +1 -1
  42. seif_cli-0.3.0/tests/test_code_compressor.py +685 -0
  43. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_collaborative_seif.py +1 -1
  44. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_context_qr.py +7 -2
  45. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_git_hooks.py +1 -1
  46. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_init.py +5 -0
  47. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_resonance_gate.py +29 -0
  48. seif_cli-0.3.0/tests/test_seif_io.py +273 -0
  49. seif_cli-0.1.2/PKG-INFO +0 -214
  50. seif_cli-0.1.2/README.md +0 -173
  51. seif_cli-0.1.2/src/seif/analysis/artifact_analyzer.py +0 -472
  52. seif_cli-0.1.2/src/seif/analysis/audio_analyzer.py +0 -197
  53. seif_cli-0.1.2/src/seif/analysis/giza_engine.py +0 -287
  54. seif_cli-0.1.2/src/seif/analysis/pattern_comparator.py +0 -237
  55. seif_cli-0.1.2/src/seif/analysis/phi_damping.py +0 -347
  56. seif_cli-0.1.2/src/seif/analysis/qr_decoder.py +0 -337
  57. seif_cli-0.1.2/src/seif/analysis/seed_optimizer.py +0 -236
  58. seif_cli-0.1.2/src/seif/bridge/ai_bridge.py +0 -301
  59. seif_cli-0.1.2/src/seif/bridge/conversation_fetcher.py +0 -215
  60. seif_cli-0.1.2/src/seif/bridge/seif_session.py +0 -203
  61. seif_cli-0.1.2/src/seif/bridge/telegram_bot.py +0 -272
  62. seif_cli-0.1.2/src/seif/cli/cli.py +0 -592
  63. seif_cli-0.1.2/src/seif/cli/wrapper.py +0 -201
  64. seif_cli-0.1.2/src/seif/context/autonomous.py +0 -758
  65. seif_cli-0.1.2/src/seif/context/evolution.py +0 -240
  66. seif_cli-0.1.2/src/seif/context/telemetry.py +0 -228
  67. seif_cli-0.1.2/src/seif/core/__init__.py +0 -1
  68. seif_cli-0.1.2/src/seif/core/resonance_gate.py +0 -179
  69. seif_cli-0.1.2/src/seif/data/RESONANCE.json +0 -157
  70. seif_cli-0.1.2/src/seif/data/defaults/claude_implementation.seif +0 -37
  71. seif_cli-0.1.2/src/seif/data/defaults/conversa_md.seif +0 -33
  72. seif_cli-0.1.2/src/seif/data/defaults/paper_thesis.seif +0 -31
  73. seif_cli-0.1.2/src/seif/data/defaults/paper_thesis_full.seif +0 -39
  74. seif_cli-0.1.2/src/seif/generators/__init__.py +0 -1
  75. seif_cli-0.1.2/src/seif/generators/circuit_generator.py +0 -310
  76. seif_cli-0.1.2/src/seif/generators/composite_renderer.py +0 -371
  77. seif_cli-0.1.2/src/seif/generators/dual_qr.py +0 -268
  78. seif_cli-0.1.2/src/seif/generators/fractal_qrcode.py +0 -323
  79. seif_cli-0.1.2/src/seif/generators/glyph_renderer.py +0 -279
  80. seif_cli-0.1.2/src/seif/generators/harmonic_audio.py +0 -341
  81. seif_cli-0.1.2/src/seif/generators/kicad_exporter.py +0 -250
  82. seif_cli-0.1.2/src/seif/generators/spice_netlist.py +0 -472
  83. seif_cli-0.1.2/src/seif_cli.egg-info/PKG-INFO +0 -214
  84. seif_cli-0.1.2/tests/test_autonomous.py +0 -882
  85. seif_cli-0.1.2/tests/test_dual_qr.py +0 -194
  86. seif_cli-0.1.2/tests/test_evolution.py +0 -314
  87. seif_cli-0.1.2/tests/test_fractal_qrcode.py +0 -73
  88. seif_cli-0.1.2/tests/test_ingest.py +0 -165
  89. seif_cli-0.1.2/tests/test_kicad_exporter.py +0 -148
  90. seif_cli-0.1.2/tests/test_phi_damping.py +0 -103
  91. seif_cli-0.1.2/tests/test_seed_optimizer.py +0 -78
  92. seif_cli-0.1.2/tests/test_spice_netlist.py +0 -142
  93. {seif_cli-0.1.2 → seif_cli-0.3.0}/LICENSE +0 -0
  94. {seif_cli-0.1.2 → seif_cli-0.3.0}/MANIFEST.in +0 -0
  95. {seif_cli-0.1.2 → seif_cli-0.3.0}/setup.cfg +0 -0
  96. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/__init__.py +0 -0
  97. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/__main__.py +0 -0
  98. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/analysis/__init__.py +0 -0
  99. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/analysis/physical_constants.py +0 -0
  100. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/analysis/stance_detector.py +0 -0
  101. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/analysis/transcompiler.py +0 -0
  102. {seif_cli-0.1.2/src/seif/bridge → seif_cli-0.3.0/src/seif/cli}/__init__.py +0 -0
  103. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/cli/main.py +0 -0
  104. {seif_cli-0.1.2/src/seif/cli → seif_cli-0.3.0/src/seif/context}/__init__.py +0 -0
  105. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/context/advisor.py +0 -0
  106. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/context/context_bridge.py +0 -0
  107. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/context/git_context.py +0 -0
  108. {seif_cli-0.1.2/src/seif/context → seif_cli-0.3.0/src/seif/core}/__init__.py +0 -0
  109. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/core/transfer_function.py +0 -0
  110. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/core/triple_gate.py +0 -0
  111. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/data/__init__.py +0 -0
  112. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif/data/defaults/__init__.py +0 -0
  113. {seif_cli-0.1.2 → seif_cli-0.3.0}/src/seif_cli.egg-info/dependency_links.txt +0 -0
  114. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_canonical_inputs.py +0 -0
  115. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_context_repo.py +0 -0
  116. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_git_context.py +0 -0
  117. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_quality_gate.py +0 -0
  118. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_ref.py +0 -0
  119. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_stance_detector.py +0 -0
  120. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_transcompiler.py +0 -0
  121. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_transfer_function.py +0 -0
  122. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_triple_gate.py +0 -0
  123. {seif_cli-0.1.2 → seif_cli-0.3.0}/tests/test_workspace.py +0 -0
@@ -0,0 +1,285 @@
1
+ Metadata-Version: 2.4
2
+ Name: seif-cli
3
+ Version: 0.3.0
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://github.com/and2carvalho/seif
8
+ Project-URL: Documentation, https://github.com/and2carvalho/seif
9
+ Project-URL: Repository, https://github.com/and2carvalho/seif
10
+ Project-URL: Live Demo, https://seif-framework.streamlit.app
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-cli[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 --autonomous enable # AI persists knowledge autonomously
235
+ seif --export # export context as markdown
236
+
237
+ # Multi-AI consensus
238
+ seif --consult "question" # auto-route to best AI
239
+ seif --consensus "q" --backends claude,grok
240
+ seif --adversarial "question" # WITH vs WITHOUT comparison
241
+ ```
242
+
243
+ ---
244
+
245
+ ## How Quality Gate Works
246
+
247
+ | Component | Weight | What it measures |
248
+ |---|---|---|
249
+ | **Stance Detector** | Primary | Verifiable vs interpretive claims. GROUNDED ≥80%, MIXED 40-80%, DRIFT <40% |
250
+ | **Resonance Gate** | Secondary | Structural coherence |
251
+
252
+ Grades: **A** (≥0.85) → **B** (≥0.70) → **C** (≥0.55) → **D** (≥0.40) → **F** (<0.40)
253
+
254
+ ---
255
+
256
+ ## Why SEIF vs ChatGPT Memory
257
+
258
+ | | ChatGPT Memory | SEIF |
259
+ |-|---|---|
260
+ | Who controls it | OpenAI | You (local files) |
261
+ | Works with other AIs | No | Yes (any LLM) |
262
+ | Exportable | No | Yes (.seif → markdown) |
263
+ | Quality measured | No | Yes (stance A-F) |
264
+ | Data classified | No | Yes (PUBLIC/INTERNAL/CONFIDENTIAL) |
265
+ | Auditable | No | Yes (hash-chained provenance) |
266
+ | Live circuit state | No | Yes (H(s), ζ, Tesla Hz) |
267
+ | Self-healing errors | No | Yes (Sentinel + 7 archetypes) |
268
+
269
+ ---
270
+
271
+ ## Project Stats
272
+
273
+ ```
274
+ 91+ modules | 626 tests (33 suites) | 93% context compression
275
+ ζ = √6/4 = 0.6123724356957945
276
+ H(s) = 9 / (s² + 3s + 6)
277
+ ```
278
+
279
+ ## Contributing
280
+
281
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
282
+
283
+ ## License
284
+
285
+ CC BY-NC-SA 4.0 — [André Cunha Antero de Carvalho](https://github.com/and2carvalho)
@@ -0,0 +1,241 @@
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 --autonomous enable # AI persists knowledge autonomously
191
+ seif --export # export context as markdown
192
+
193
+ # Multi-AI consensus
194
+ seif --consult "question" # auto-route to best AI
195
+ seif --consensus "q" --backends claude,grok
196
+ seif --adversarial "question" # WITH vs WITHOUT comparison
197
+ ```
198
+
199
+ ---
200
+
201
+ ## How Quality Gate Works
202
+
203
+ | Component | Weight | What it measures |
204
+ |---|---|---|
205
+ | **Stance Detector** | Primary | Verifiable vs interpretive claims. GROUNDED ≥80%, MIXED 40-80%, DRIFT <40% |
206
+ | **Resonance Gate** | Secondary | Structural coherence |
207
+
208
+ Grades: **A** (≥0.85) → **B** (≥0.70) → **C** (≥0.55) → **D** (≥0.40) → **F** (<0.40)
209
+
210
+ ---
211
+
212
+ ## Why SEIF vs ChatGPT Memory
213
+
214
+ | | ChatGPT Memory | SEIF |
215
+ |-|---|---|
216
+ | Who controls it | OpenAI | You (local files) |
217
+ | Works with other AIs | No | Yes (any LLM) |
218
+ | Exportable | No | Yes (.seif → markdown) |
219
+ | Quality measured | No | Yes (stance A-F) |
220
+ | Data classified | No | Yes (PUBLIC/INTERNAL/CONFIDENTIAL) |
221
+ | Auditable | No | Yes (hash-chained provenance) |
222
+ | Live circuit state | No | Yes (H(s), ζ, Tesla Hz) |
223
+ | Self-healing errors | No | Yes (Sentinel + 7 archetypes) |
224
+
225
+ ---
226
+
227
+ ## Project Stats
228
+
229
+ ```
230
+ 91+ modules | 626 tests (33 suites) | 93% context compression
231
+ ζ = √6/4 = 0.6123724356957945
232
+ H(s) = 9 / (s² + 3s + 6)
233
+ ```
234
+
235
+ ## Contributing
236
+
237
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
238
+
239
+ ## License
240
+
241
+ CC BY-NC-SA 4.0 — [André Cunha Antero de Carvalho](https://github.com/and2carvalho)
@@ -4,45 +4,53 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "seif-cli"
7
- version = "0.1.2"
8
- description = "S.E.I.F. Your AI never starts from zero. Compressed, verified, collaborative context for any LLM."
7
+ version = "0.3.0"
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"
12
12
  authors = [
13
- {name = "André Cunha Antero de Carvalho", email = "and2carvalho@gmail.com"},
13
+ {name = "André Cunha Antero de Carvalho"},
14
14
  ]
15
15
  keywords = [
16
- "ai-context", "llm-memory", "context-compression", "team-collaboration",
17
- "resonance", "sacred-geometry", "3-6-9", "golden-ratio",
18
- "prompt-engineering", "ai-communication",
16
+ "ai-quality", "llm-guardrails", "ai-consensus", "data-classification",
17
+ "context-management", "ai-safety", "multi-ai", "quality-gate",
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",
22
23
  "Intended Audience :: Developers",
23
24
  "Intended Audience :: Science/Research",
24
- "Topic :: Scientific/Engineering",
25
- "Topic :: Software Development :: Libraries",
25
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
26
+ "Topic :: Software Development :: Quality Assurance",
27
+ "Topic :: Security",
26
28
  "Programming Language :: Python :: 3.11",
27
29
  "Programming Language :: Python :: 3.12",
28
30
  "Programming Language :: Python :: 3.13",
29
31
  ]
30
32
 
31
- # Core dependencies minimal for CLI usage
33
+ # Core: quality gate + context + classification (no heavy deps)
32
34
  dependencies = [
33
35
  "numpy>=2.0",
34
36
  "scipy>=1.14",
35
37
  ]
36
38
 
37
39
  [project.optional-dependencies]
38
- # Full installation (web interface + all generators)
39
- full = [
40
+ # Inter-AI consensus (needs API client)
41
+ consensus = [
42
+ "anthropic>=0.80",
43
+ ]
44
+ # Visual generators (fractal QR, glyphs, circuits, audio)
45
+ generators = [
40
46
  "matplotlib>=3.9",
41
47
  "Pillow>=10.0",
42
48
  "opencv-python-headless>=4.8",
43
49
  "svgwrite>=1.4",
50
+ ]
51
+ # Web interface (Streamlit dashboard)
52
+ web = [
44
53
  "streamlit>=1.28",
45
- "anthropic>=0.80",
46
54
  ]
47
55
  # Telegram bot bridge
48
56
  telegram = [
@@ -56,7 +64,7 @@ qr = [
56
64
  ]
57
65
  # Everything
58
66
  all = [
59
- "seif-cli[full,telegram,qr]",
67
+ "seif-cli[consensus,generators,web,telegram,qr]",
60
68
  ]
61
69
 
62
70
  [project.urls]
@@ -66,8 +74,8 @@ Repository = "https://github.com/and2carvalho/seif"
66
74
  "Live Demo" = "https://seif-framework.streamlit.app"
67
75
 
68
76
  [project.scripts]
69
- seif-cli = "seif.cli.cli:main"
70
77
  seif = "seif.cli.wrapper:main"
78
+ seif-cli = "seif.cli.wrapper:main"
71
79
 
72
80
  [tool.setuptools.packages.find]
73
81
  where = ["src"]