seif-cli 0.1.2__tar.gz → 0.2.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.
- seif_cli-0.2.0/PKG-INFO +199 -0
- seif_cli-0.2.0/README.md +155 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/pyproject.toml +21 -14
- seif_cli-0.2.0/src/seif/cli/cli.py +3071 -0
- seif_cli-0.2.0/src/seif/cli/identity.py +261 -0
- seif_cli-0.2.0/src/seif/cli/wrapper.py +470 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/constants.py +75 -11
- seif_cli-0.2.0/src/seif/context/code_compressor.py +1124 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/context/context_importer.py +21 -5
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/context/context_manager.py +123 -60
- seif_cli-0.2.0/src/seif/context/file_extractor.py +403 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/context/ingest.py +20 -6
- seif_cli-0.2.0/src/seif/context/nucleus.py +292 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/context/ref.py +2 -2
- seif_cli-0.2.0/src/seif/context/seif_io.py +241 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/context/workspace.py +184 -10
- seif_cli-0.2.0/src/seif/core/fingerprint.py +92 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/core/resonance_signal.py +10 -2
- seif_cli-0.2.0/src/seif/core/signing.py +223 -0
- seif_cli-0.2.0/src/seif/core/timestamping.py +138 -0
- seif_cli-0.2.0/src/seif/data/RESONANCE.json +301 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/data/paths.py +15 -0
- seif_cli-0.2.0/src/seif/security/__init__.py +17 -0
- seif_cli-0.2.0/src/seif/security/mode.py +103 -0
- seif_cli-0.2.0/src/seif/security/redblue.py +495 -0
- seif_cli-0.2.0/src/seif_cli.egg-info/PKG-INFO +199 -0
- seif_cli-0.2.0/src/seif_cli.egg-info/SOURCES.txt +59 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif_cli.egg-info/entry_points.txt +1 -1
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif_cli.egg-info/requires.txt +8 -4
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif_cli.egg-info/top_level.txt +0 -1
- {seif_cli-0.1.2 → seif_cli-0.2.0}/tests/test_init.py +6 -0
- seif_cli-0.1.2/PKG-INFO +0 -214
- seif_cli-0.1.2/README.md +0 -173
- seif_cli-0.1.2/src/seif/analysis/artifact_analyzer.py +0 -472
- seif_cli-0.1.2/src/seif/analysis/audio_analyzer.py +0 -197
- seif_cli-0.1.2/src/seif/analysis/giza_engine.py +0 -287
- seif_cli-0.1.2/src/seif/analysis/pattern_comparator.py +0 -237
- seif_cli-0.1.2/src/seif/analysis/phi_damping.py +0 -347
- seif_cli-0.1.2/src/seif/analysis/qr_decoder.py +0 -337
- seif_cli-0.1.2/src/seif/analysis/quality_gate.py +0 -201
- seif_cli-0.1.2/src/seif/analysis/seed_optimizer.py +0 -236
- seif_cli-0.1.2/src/seif/bridge/ai_bridge.py +0 -301
- seif_cli-0.1.2/src/seif/bridge/conversation_fetcher.py +0 -215
- seif_cli-0.1.2/src/seif/bridge/seif_session.py +0 -203
- seif_cli-0.1.2/src/seif/bridge/telegram_bot.py +0 -272
- seif_cli-0.1.2/src/seif/cli/cli.py +0 -592
- seif_cli-0.1.2/src/seif/cli/main.py +0 -445
- seif_cli-0.1.2/src/seif/cli/wrapper.py +0 -201
- seif_cli-0.1.2/src/seif/context/autonomous.py +0 -758
- seif_cli-0.1.2/src/seif/context/evolution.py +0 -240
- seif_cli-0.1.2/src/seif/context/git_hooks.py +0 -152
- seif_cli-0.1.2/src/seif/core/__init__.py +0 -1
- seif_cli-0.1.2/src/seif/core/resonance_encoding.py +0 -283
- seif_cli-0.1.2/src/seif/core/triple_gate.py +0 -200
- seif_cli-0.1.2/src/seif/data/RESONANCE.json +0 -157
- seif_cli-0.1.2/src/seif/data/defaults/claude_implementation.seif +0 -37
- seif_cli-0.1.2/src/seif/data/defaults/conversa_md.seif +0 -33
- seif_cli-0.1.2/src/seif/data/defaults/paper_thesis.seif +0 -31
- seif_cli-0.1.2/src/seif/data/defaults/paper_thesis_full.seif +0 -39
- seif_cli-0.1.2/src/seif/generators/__init__.py +0 -1
- seif_cli-0.1.2/src/seif/generators/circuit_generator.py +0 -310
- seif_cli-0.1.2/src/seif/generators/composite_renderer.py +0 -371
- seif_cli-0.1.2/src/seif/generators/dual_qr.py +0 -268
- seif_cli-0.1.2/src/seif/generators/fractal_qrcode.py +0 -323
- seif_cli-0.1.2/src/seif/generators/glyph_renderer.py +0 -279
- seif_cli-0.1.2/src/seif/generators/harmonic_audio.py +0 -341
- seif_cli-0.1.2/src/seif/generators/kicad_exporter.py +0 -250
- seif_cli-0.1.2/src/seif/generators/spice_netlist.py +0 -472
- seif_cli-0.1.2/src/seif_cli.egg-info/PKG-INFO +0 -214
- seif_cli-0.1.2/src/seif_cli.egg-info/SOURCES.txt +0 -96
- seif_cli-0.1.2/tests/test_advisor.py +0 -101
- seif_cli-0.1.2/tests/test_autonomous.py +0 -882
- seif_cli-0.1.2/tests/test_canonical_inputs.py +0 -152
- seif_cli-0.1.2/tests/test_collaborative_seif.py +0 -245
- seif_cli-0.1.2/tests/test_context_qr.py +0 -199
- seif_cli-0.1.2/tests/test_dual_qr.py +0 -194
- seif_cli-0.1.2/tests/test_evolution.py +0 -314
- seif_cli-0.1.2/tests/test_fractal_qrcode.py +0 -73
- seif_cli-0.1.2/tests/test_git_hooks.py +0 -125
- seif_cli-0.1.2/tests/test_ingest.py +0 -165
- seif_cli-0.1.2/tests/test_kicad_exporter.py +0 -148
- seif_cli-0.1.2/tests/test_phi_damping.py +0 -103
- seif_cli-0.1.2/tests/test_ref.py +0 -188
- seif_cli-0.1.2/tests/test_seed_optimizer.py +0 -78
- seif_cli-0.1.2/tests/test_spice_netlist.py +0 -142
- seif_cli-0.1.2/tests/test_transcompiler.py +0 -69
- {seif_cli-0.1.2 → seif_cli-0.2.0}/LICENSE +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/MANIFEST.in +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/setup.cfg +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/__init__.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/__main__.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/analysis/__init__.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/analysis/physical_constants.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/analysis/stance_detector.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/analysis/transcompiler.py +0 -0
- {seif_cli-0.1.2/src/seif/bridge → seif_cli-0.2.0/src/seif/cli}/__init__.py +0 -0
- {seif_cli-0.1.2/src/seif/cli → seif_cli-0.2.0/src/seif/context}/__init__.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/context/advisor.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/context/context_bridge.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/context/context_qr.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/context/git_context.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/context/telemetry.py +0 -0
- {seif_cli-0.1.2/src/seif/context → seif_cli-0.2.0/src/seif/core}/__init__.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/core/resonance_gate.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/core/transfer_function.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/data/__init__.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif/data/defaults/__init__.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/src/seif_cli.egg-info/dependency_links.txt +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/tests/test_context_repo.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/tests/test_git_context.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/tests/test_quality_gate.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/tests/test_resonance_gate.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/tests/test_stance_detector.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/tests/test_transfer_function.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/tests/test_triple_gate.py +0 -0
- {seif_cli-0.1.2 → seif_cli-0.2.0}/tests/test_workspace.py +0 -0
seif_cli-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: seif-cli
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Measure AI output quality, protect sensitive data, and build multi-AI consensus. Works with any LLM.
|
|
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
|
|
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 — Measure, Protect, and Triangulate AI Output
|
|
46
|
+
|
|
47
|
+
> One question. Multiple AIs debate it. You get the answer they all agree on — graded for accuracy, with your data protected.
|
|
48
|
+
|
|
49
|
+
[](https://pypi.org/project/seif-cli/)
|
|
50
|
+
[]()
|
|
51
|
+
[]()
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## The Problem
|
|
56
|
+
|
|
57
|
+
1. **You don't know when AI is making things up.** There's no standard way to measure if a response is grounded in facts or drifting into speculation.
|
|
58
|
+
2. **Sensitive data leaks to AI APIs.** No guardrail prevents your code, credentials, or internal docs from being sent to external services.
|
|
59
|
+
3. **One AI can be wrong.** A single model has blind spots. There's no easy way to get multiple AIs to debate and converge on an answer.
|
|
60
|
+
|
|
61
|
+
## The Solution
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install seif-cli
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 1. Quality Gate — Is the AI making things up?
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
seif --quality-gate "The framework uses quantum entanglement for data transfer" --role ai
|
|
71
|
+
# Grade: D | Stance: DRIFT | Verifiable: 12%
|
|
72
|
+
# Flags: [UNGROUNDED_CLAIMS]
|
|
73
|
+
|
|
74
|
+
seif --quality-gate "Python 3.11 added the tomllib module for TOML parsing" --role ai
|
|
75
|
+
# Grade: A | Stance: GROUNDED | Verifiable: 100%
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Every response gets a grade (A-F) and a stance (GROUNDED, MIXED, or DRIFT). Verifiable claims are counted separately from speculation.
|
|
79
|
+
|
|
80
|
+
### 2. Classification Gate — Is sensitive data leaking?
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
seif --init # scan your project
|
|
84
|
+
seif --export --classification PUBLIC # only export public content
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Content is automatically classified as PUBLIC, INTERNAL, or CONFIDENTIAL. Keywords like `password`, `api_key`, `CVE` auto-escalate to CONFIDENTIAL. The classification gate blocks sensitive data from leaving your environment.
|
|
88
|
+
|
|
89
|
+
Works as a [Claude Code hook](#claude-code-plugin) — blocks writes containing credentials or classified markers in real-time.
|
|
90
|
+
|
|
91
|
+
### 3. Multi-AI Consensus — Let them debate
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
seif --consensus "Should we use microservices or a monolith for a 3-person team?" \
|
|
95
|
+
--backends claude,grok
|
|
96
|
+
# Claude: monolith (velocity, simplicity)
|
|
97
|
+
# Grok: monolith (team size, operational cost)
|
|
98
|
+
# Consensus: CONVERGED — monolith for teams < 5
|
|
99
|
+
|
|
100
|
+
seif --adversarial "Is our auth middleware secure?"
|
|
101
|
+
# Compares response WITH protocol context vs WITHOUT
|
|
102
|
+
# Delta report shows what context changes
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
One question goes to multiple AIs. They analyze independently, compare results, and converge. You get the answer they all agree on.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Quick Start
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
pip install seif-cli
|
|
113
|
+
cd my-project
|
|
114
|
+
seif --init # scan project, extract git context, generate .seif/
|
|
115
|
+
seif --sync # re-sync after code changes
|
|
116
|
+
seif --quality-gate "text" # grade AI output (A-F)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
That's it. Your project now has persistent, classified, quality-measured context.
|
|
120
|
+
|
|
121
|
+
## Claude Code Plugin
|
|
122
|
+
|
|
123
|
+
SEIF works as a plugin for [Claude Code](https://github.com/anthropics/claude-code):
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Copy skills to your project
|
|
127
|
+
cp -r plugins/claude-code/skills/* .claude/skills/
|
|
128
|
+
|
|
129
|
+
# Add hooks to .claude/settings.json (see plugins/claude-code/README.md)
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**What it does:**
|
|
133
|
+
- **Session start**: loads your `.seif/` context automatically
|
|
134
|
+
- **Pre-write**: blocks classified data from being written outside `.seif/`
|
|
135
|
+
- **Slash commands**: `/gate`, `/sync`, `/status`
|
|
136
|
+
|
|
137
|
+
## CLI Commands
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# === Core (pip install seif-cli) ===
|
|
141
|
+
seif --init # initialize .seif context
|
|
142
|
+
seif --sync # re-sync git context
|
|
143
|
+
seif --quality-gate "text" # measure quality (Grade A-F)
|
|
144
|
+
seif --compress # compress project into .seif (93% reduction)
|
|
145
|
+
seif --export # export context as markdown
|
|
146
|
+
|
|
147
|
+
# === Classification ===
|
|
148
|
+
seif --export --classification PUBLIC # only public modules
|
|
149
|
+
seif --autonomous enable # AI persists knowledge autonomously
|
|
150
|
+
|
|
151
|
+
# === Multi-AI (pip install seif-cli[consensus]) ===
|
|
152
|
+
seif --consult "question" # auto-route to best AI
|
|
153
|
+
seif --consensus "q" --backends claude,grok # cross-AI consensus
|
|
154
|
+
seif --adversarial "question" # WITH vs WITHOUT comparison
|
|
155
|
+
|
|
156
|
+
# === Workspace ===
|
|
157
|
+
seif --workspace # multi-project discovery + sync
|
|
158
|
+
seif --scan "git" # auto-generate CLI knowledge from --help
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## How Quality Gate Works
|
|
162
|
+
|
|
163
|
+
The quality gate measures two things:
|
|
164
|
+
|
|
165
|
+
| Component | Weight | What it measures |
|
|
166
|
+
|-----------|--------|-----------------|
|
|
167
|
+
| **Stance Detector** | Primary | Counts verifiable vs interpretive claims. GROUNDED (≥80% verifiable), MIXED (40-80%), DRIFT (<40%) |
|
|
168
|
+
| **Resonance Gate** | Secondary | Structural coherence (experimental) |
|
|
169
|
+
|
|
170
|
+
Grades: **A** (≥0.85) → **B** (≥0.70) → **C** (≥0.55) → **D** (≥0.40) → **F** (<0.40)
|
|
171
|
+
|
|
172
|
+
## Context Persistence
|
|
173
|
+
|
|
174
|
+
SEIF also gives AI persistent memory across sessions — but so does ChatGPT Memory. The difference:
|
|
175
|
+
|
|
176
|
+
| | ChatGPT Memory | SEIF |
|
|
177
|
+
|-|---------------|------|
|
|
178
|
+
| Who controls it | OpenAI | You (local files) |
|
|
179
|
+
| Works with other AIs | No | Yes (any LLM) |
|
|
180
|
+
| Exportable | No | Yes (.seif → markdown) |
|
|
181
|
+
| Quality measured | No | Yes (stance A-F) |
|
|
182
|
+
| Data classified | No | Yes (PUBLIC/INTERNAL/CONFIDENTIAL) |
|
|
183
|
+
| Auditable | No | Yes (hash-chained provenance) |
|
|
184
|
+
|
|
185
|
+
## Project Stats
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
59 modules | 626 tests (33 suites) | 93% context compression
|
|
189
|
+
Classification: PUBLIC / INTERNAL / CONFIDENTIAL with auto-detection
|
|
190
|
+
Quality Gate: Stance detector + resonance gate → Grade A-F
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## Contributing
|
|
194
|
+
|
|
195
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
196
|
+
|
|
197
|
+
## License
|
|
198
|
+
|
|
199
|
+
CC BY-NC-SA 4.0 — [André Cunha Antero de Carvalho](https://github.com/and2carvalho)
|
seif_cli-0.2.0/README.md
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# SEIF — Measure, Protect, and Triangulate AI Output
|
|
2
|
+
|
|
3
|
+
> One question. Multiple AIs debate it. You get the answer they all agree on — graded for accuracy, with your data protected.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/seif-cli/)
|
|
6
|
+
[]()
|
|
7
|
+
[]()
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## The Problem
|
|
12
|
+
|
|
13
|
+
1. **You don't know when AI is making things up.** There's no standard way to measure if a response is grounded in facts or drifting into speculation.
|
|
14
|
+
2. **Sensitive data leaks to AI APIs.** No guardrail prevents your code, credentials, or internal docs from being sent to external services.
|
|
15
|
+
3. **One AI can be wrong.** A single model has blind spots. There's no easy way to get multiple AIs to debate and converge on an answer.
|
|
16
|
+
|
|
17
|
+
## The Solution
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install seif-cli
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### 1. Quality Gate — Is the AI making things up?
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
seif --quality-gate "The framework uses quantum entanglement for data transfer" --role ai
|
|
27
|
+
# Grade: D | Stance: DRIFT | Verifiable: 12%
|
|
28
|
+
# Flags: [UNGROUNDED_CLAIMS]
|
|
29
|
+
|
|
30
|
+
seif --quality-gate "Python 3.11 added the tomllib module for TOML parsing" --role ai
|
|
31
|
+
# Grade: A | Stance: GROUNDED | Verifiable: 100%
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Every response gets a grade (A-F) and a stance (GROUNDED, MIXED, or DRIFT). Verifiable claims are counted separately from speculation.
|
|
35
|
+
|
|
36
|
+
### 2. Classification Gate — Is sensitive data leaking?
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
seif --init # scan your project
|
|
40
|
+
seif --export --classification PUBLIC # only export public content
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Content is automatically classified as PUBLIC, INTERNAL, or CONFIDENTIAL. Keywords like `password`, `api_key`, `CVE` auto-escalate to CONFIDENTIAL. The classification gate blocks sensitive data from leaving your environment.
|
|
44
|
+
|
|
45
|
+
Works as a [Claude Code hook](#claude-code-plugin) — blocks writes containing credentials or classified markers in real-time.
|
|
46
|
+
|
|
47
|
+
### 3. Multi-AI Consensus — Let them debate
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
seif --consensus "Should we use microservices or a monolith for a 3-person team?" \
|
|
51
|
+
--backends claude,grok
|
|
52
|
+
# Claude: monolith (velocity, simplicity)
|
|
53
|
+
# Grok: monolith (team size, operational cost)
|
|
54
|
+
# Consensus: CONVERGED — monolith for teams < 5
|
|
55
|
+
|
|
56
|
+
seif --adversarial "Is our auth middleware secure?"
|
|
57
|
+
# Compares response WITH protocol context vs WITHOUT
|
|
58
|
+
# Delta report shows what context changes
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
One question goes to multiple AIs. They analyze independently, compare results, and converge. You get the answer they all agree on.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Quick Start
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install seif-cli
|
|
69
|
+
cd my-project
|
|
70
|
+
seif --init # scan project, extract git context, generate .seif/
|
|
71
|
+
seif --sync # re-sync after code changes
|
|
72
|
+
seif --quality-gate "text" # grade AI output (A-F)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
That's it. Your project now has persistent, classified, quality-measured context.
|
|
76
|
+
|
|
77
|
+
## Claude Code Plugin
|
|
78
|
+
|
|
79
|
+
SEIF works as a plugin for [Claude Code](https://github.com/anthropics/claude-code):
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Copy skills to your project
|
|
83
|
+
cp -r plugins/claude-code/skills/* .claude/skills/
|
|
84
|
+
|
|
85
|
+
# Add hooks to .claude/settings.json (see plugins/claude-code/README.md)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**What it does:**
|
|
89
|
+
- **Session start**: loads your `.seif/` context automatically
|
|
90
|
+
- **Pre-write**: blocks classified data from being written outside `.seif/`
|
|
91
|
+
- **Slash commands**: `/gate`, `/sync`, `/status`
|
|
92
|
+
|
|
93
|
+
## CLI Commands
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# === Core (pip install seif-cli) ===
|
|
97
|
+
seif --init # initialize .seif context
|
|
98
|
+
seif --sync # re-sync git context
|
|
99
|
+
seif --quality-gate "text" # measure quality (Grade A-F)
|
|
100
|
+
seif --compress # compress project into .seif (93% reduction)
|
|
101
|
+
seif --export # export context as markdown
|
|
102
|
+
|
|
103
|
+
# === Classification ===
|
|
104
|
+
seif --export --classification PUBLIC # only public modules
|
|
105
|
+
seif --autonomous enable # AI persists knowledge autonomously
|
|
106
|
+
|
|
107
|
+
# === Multi-AI (pip install seif-cli[consensus]) ===
|
|
108
|
+
seif --consult "question" # auto-route to best AI
|
|
109
|
+
seif --consensus "q" --backends claude,grok # cross-AI consensus
|
|
110
|
+
seif --adversarial "question" # WITH vs WITHOUT comparison
|
|
111
|
+
|
|
112
|
+
# === Workspace ===
|
|
113
|
+
seif --workspace # multi-project discovery + sync
|
|
114
|
+
seif --scan "git" # auto-generate CLI knowledge from --help
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## How Quality Gate Works
|
|
118
|
+
|
|
119
|
+
The quality gate measures two things:
|
|
120
|
+
|
|
121
|
+
| Component | Weight | What it measures |
|
|
122
|
+
|-----------|--------|-----------------|
|
|
123
|
+
| **Stance Detector** | Primary | Counts verifiable vs interpretive claims. GROUNDED (≥80% verifiable), MIXED (40-80%), DRIFT (<40%) |
|
|
124
|
+
| **Resonance Gate** | Secondary | Structural coherence (experimental) |
|
|
125
|
+
|
|
126
|
+
Grades: **A** (≥0.85) → **B** (≥0.70) → **C** (≥0.55) → **D** (≥0.40) → **F** (<0.40)
|
|
127
|
+
|
|
128
|
+
## Context Persistence
|
|
129
|
+
|
|
130
|
+
SEIF also gives AI persistent memory across sessions — but so does ChatGPT Memory. The difference:
|
|
131
|
+
|
|
132
|
+
| | ChatGPT Memory | SEIF |
|
|
133
|
+
|-|---------------|------|
|
|
134
|
+
| Who controls it | OpenAI | You (local files) |
|
|
135
|
+
| Works with other AIs | No | Yes (any LLM) |
|
|
136
|
+
| Exportable | No | Yes (.seif → markdown) |
|
|
137
|
+
| Quality measured | No | Yes (stance A-F) |
|
|
138
|
+
| Data classified | No | Yes (PUBLIC/INTERNAL/CONFIDENTIAL) |
|
|
139
|
+
| Auditable | No | Yes (hash-chained provenance) |
|
|
140
|
+
|
|
141
|
+
## Project Stats
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
59 modules | 626 tests (33 suites) | 93% context compression
|
|
145
|
+
Classification: PUBLIC / INTERNAL / CONFIDENTIAL with auto-detection
|
|
146
|
+
Quality Gate: Stance detector + resonance gate → Grade A-F
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Contributing
|
|
150
|
+
|
|
151
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
CC BY-NC-SA 4.0 — [André Cunha Antero de Carvalho](https://github.com/and2carvalho)
|
|
@@ -4,45 +4,52 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "seif-cli"
|
|
7
|
-
version = "0.
|
|
8
|
-
description = "
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Measure AI output quality, protect sensitive data, and build multi-AI consensus. Works with any LLM."
|
|
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"
|
|
13
|
+
{name = "André Cunha Antero de Carvalho"},
|
|
14
14
|
]
|
|
15
15
|
keywords = [
|
|
16
|
-
"ai-
|
|
17
|
-
"
|
|
18
|
-
"prompt-
|
|
16
|
+
"ai-quality", "llm-guardrails", "ai-consensus", "data-classification",
|
|
17
|
+
"context-management", "ai-safety", "multi-ai", "quality-gate",
|
|
18
|
+
"prompt-evaluation", "ai-grounding",
|
|
19
19
|
]
|
|
20
20
|
classifiers = [
|
|
21
21
|
"Development Status :: 3 - Alpha",
|
|
22
22
|
"Intended Audience :: Developers",
|
|
23
23
|
"Intended Audience :: Science/Research",
|
|
24
|
-
"Topic :: Scientific/Engineering",
|
|
25
|
-
"Topic :: Software Development ::
|
|
24
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
25
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
26
|
+
"Topic :: Security",
|
|
26
27
|
"Programming Language :: Python :: 3.11",
|
|
27
28
|
"Programming Language :: Python :: 3.12",
|
|
28
29
|
"Programming Language :: Python :: 3.13",
|
|
29
30
|
]
|
|
30
31
|
|
|
31
|
-
# Core
|
|
32
|
+
# Core: quality gate + context + classification (no heavy deps)
|
|
32
33
|
dependencies = [
|
|
33
34
|
"numpy>=2.0",
|
|
34
35
|
"scipy>=1.14",
|
|
35
36
|
]
|
|
36
37
|
|
|
37
38
|
[project.optional-dependencies]
|
|
38
|
-
#
|
|
39
|
-
|
|
39
|
+
# Inter-AI consensus (needs API client)
|
|
40
|
+
consensus = [
|
|
41
|
+
"anthropic>=0.80",
|
|
42
|
+
]
|
|
43
|
+
# Visual generators (fractal QR, glyphs, circuits, audio)
|
|
44
|
+
generators = [
|
|
40
45
|
"matplotlib>=3.9",
|
|
41
46
|
"Pillow>=10.0",
|
|
42
47
|
"opencv-python-headless>=4.8",
|
|
43
48
|
"svgwrite>=1.4",
|
|
49
|
+
]
|
|
50
|
+
# Web interface (Streamlit dashboard)
|
|
51
|
+
web = [
|
|
44
52
|
"streamlit>=1.28",
|
|
45
|
-
"anthropic>=0.80",
|
|
46
53
|
]
|
|
47
54
|
# Telegram bot bridge
|
|
48
55
|
telegram = [
|
|
@@ -56,7 +63,7 @@ qr = [
|
|
|
56
63
|
]
|
|
57
64
|
# Everything
|
|
58
65
|
all = [
|
|
59
|
-
"seif-cli[
|
|
66
|
+
"seif-cli[consensus,generators,web,telegram,qr]",
|
|
60
67
|
]
|
|
61
68
|
|
|
62
69
|
[project.urls]
|
|
@@ -66,8 +73,8 @@ Repository = "https://github.com/and2carvalho/seif"
|
|
|
66
73
|
"Live Demo" = "https://seif-framework.streamlit.app"
|
|
67
74
|
|
|
68
75
|
[project.scripts]
|
|
69
|
-
seif-cli = "seif.cli.cli:main"
|
|
70
76
|
seif = "seif.cli.wrapper:main"
|
|
77
|
+
seif-cli = "seif.cli.wrapper:main"
|
|
71
78
|
|
|
72
79
|
[tool.setuptools.packages.find]
|
|
73
80
|
where = ["src"]
|