seif-cli 0.3.4__tar.gz → 0.4.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 (94) hide show
  1. {seif_cli-0.3.4/src/seif_cli.egg-info → seif_cli-0.4.0}/PKG-INFO +1 -1
  2. {seif_cli-0.3.4 → seif_cli-0.4.0}/pyproject.toml +1 -1
  3. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/bridge/native_client.py +71 -22
  4. seif_cli-0.4.0/src/seif/data/defaults/circuit-recovery-v1.seif +49 -0
  5. seif_cli-0.4.0/src/seif/data/defaults/definitions-v1.seif +55 -0
  6. seif_cli-0.4.0/src/seif/data/defaults/ise-dissonance-v1.seif +83 -0
  7. seif_cli-0.4.0/src/seif/data/defaults/multi-agent-sync-v1.seif +72 -0
  8. seif_cli-0.4.0/src/seif/data/defaults/onboarding.seif +297 -0
  9. seif_cli-0.4.0/src/seif/data/defaults/partial-attention-axiom-v1.seif +112 -0
  10. seif_cli-0.4.0/src/seif/data/defaults/seif-cycle-v1.seif +89 -0
  11. seif_cli-0.4.0/src/seif/data/defaults/seif-os-architecture-v1.seif +151 -0
  12. seif_cli-0.4.0/src/seif/data/defaults/triad-convergence-v1.seif +83 -0
  13. {seif_cli-0.3.4 → seif_cli-0.4.0/src/seif_cli.egg-info}/PKG-INFO +1 -1
  14. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif_cli.egg-info/SOURCES.txt +9 -0
  15. {seif_cli-0.3.4 → seif_cli-0.4.0}/LICENSE +0 -0
  16. {seif_cli-0.3.4 → seif_cli-0.4.0}/MANIFEST.in +0 -0
  17. {seif_cli-0.3.4 → seif_cli-0.4.0}/README.md +0 -0
  18. {seif_cli-0.3.4 → seif_cli-0.4.0}/setup.cfg +0 -0
  19. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/__init__.py +0 -0
  20. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/__main__.py +0 -0
  21. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/analysis/__init__.py +0 -0
  22. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/analysis/physical_constants.py +0 -0
  23. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/analysis/quality_gate.py +0 -0
  24. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/analysis/stance_detector.py +0 -0
  25. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/analysis/transcompiler.py +0 -0
  26. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/bridge/__init__.py +0 -0
  27. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/bridge/telegram_bot.py +0 -0
  28. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/cli/__init__.py +0 -0
  29. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/cli/__main__.py +0 -0
  30. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/cli/chat.py +0 -0
  31. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/cli/cli.py +0 -0
  32. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/cli/identity.py +0 -0
  33. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/cli/main.py +0 -0
  34. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/cli/resonance_display.py +0 -0
  35. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/cli/serve.py +0 -0
  36. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/cli/serve_v2.py +0 -0
  37. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/cli/wrapper.py +0 -0
  38. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/constants.py +0 -0
  39. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/__init__.py +0 -0
  40. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/advisor.py +0 -0
  41. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/code_compressor.py +0 -0
  42. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/context_bridge.py +0 -0
  43. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/context_importer.py +0 -0
  44. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/context_manager.py +0 -0
  45. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/context_qr.py +0 -0
  46. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/cycle.py +0 -0
  47. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/file_extractor.py +0 -0
  48. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/git_context.py +0 -0
  49. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/git_hooks.py +0 -0
  50. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/ingest.py +0 -0
  51. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/nucleus.py +0 -0
  52. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/ref.py +0 -0
  53. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/registry.py +0 -0
  54. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/seif_io.py +0 -0
  55. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/sessions.py +0 -0
  56. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/context/workspace.py +0 -0
  57. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/core/__init__.py +0 -0
  58. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/core/fingerprint.py +0 -0
  59. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/core/resonance_encoding.py +0 -0
  60. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/core/resonance_gate.py +0 -0
  61. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/core/resonance_signal.py +0 -0
  62. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/core/signing.py +0 -0
  63. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/core/timestamping.py +0 -0
  64. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/core/transfer_function.py +0 -0
  65. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/core/triple_gate.py +0 -0
  66. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/data/RESONANCE.json +0 -0
  67. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/data/__init__.py +0 -0
  68. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/data/defaults/__init__.py +0 -0
  69. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/data/paths.py +0 -0
  70. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/security/__init__.py +0 -0
  71. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif/security/mode.py +0 -0
  72. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif_cli.egg-info/dependency_links.txt +0 -0
  73. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif_cli.egg-info/entry_points.txt +0 -0
  74. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif_cli.egg-info/requires.txt +0 -0
  75. {seif_cli-0.3.4 → seif_cli-0.4.0}/src/seif_cli.egg-info/top_level.txt +0 -0
  76. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_advisor.py +0 -0
  77. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_canonical_inputs.py +0 -0
  78. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_code_compressor.py +0 -0
  79. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_collaborative_seif.py +0 -0
  80. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_context_qr.py +0 -0
  81. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_context_repo.py +0 -0
  82. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_git_context.py +0 -0
  83. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_git_hooks.py +0 -0
  84. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_init.py +0 -0
  85. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_quality_gate.py +0 -0
  86. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_ref.py +0 -0
  87. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_registry.py +0 -0
  88. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_resonance_gate.py +0 -0
  89. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_seif_io.py +0 -0
  90. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_stance_detector.py +0 -0
  91. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_transcompiler.py +0 -0
  92. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_transfer_function.py +0 -0
  93. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_triple_gate.py +0 -0
  94. {seif_cli-0.3.4 → seif_cli-0.4.0}/tests/test_workspace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seif-cli
3
- Version: 0.3.4
3
+ Version: 0.4.0
4
4
  Summary: Measure AI output quality, protect sensitive data, watch your AI environment resonate. Quality Gate, Classification, Sentinel & Auto-Healing, SEIF OS.
5
5
  Author: André Cunha Antero de Carvalho
6
6
  License: CC-BY-NC-SA-4.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "seif-cli"
7
- version = "0.3.4"
7
+ version = "0.4.0"
8
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"}
@@ -1,18 +1,21 @@
1
1
  """
2
- Native AI Client — Direct SDK integration replacing CLI wrapper.
2
+ Native AI Client — Direct SDK integration with Claude CLI fallback.
3
3
 
4
4
  Supports streaming, multi-backend routing, and context injection from
5
- the personal nucleus. Falls back to CLI subprocess if SDK unavailable.
5
+ the personal nucleus. When no ANTHROPIC_API_KEY is set, uses Claude CLI
6
+ (compatible with Max Plan via OAuth).
6
7
  """
7
8
 
8
- from dataclasses import dataclass, field
9
+ from dataclasses import dataclass
9
10
  from typing import Iterator, Optional
10
11
  import os
12
+ import shutil
13
+ import subprocess
11
14
 
12
15
 
13
16
  @dataclass
14
17
  class ChatConfig:
15
- backend: str = "auto" # claude, gemini, local, auto
18
+ backend: str = "auto" # claude, claude-cli, gemini, local, auto
16
19
  model: str = "" # model override (empty = use default)
17
20
  stream: bool = True # streaming responses
18
21
  quality_gate: bool = True # measure every response
@@ -22,12 +25,17 @@ class ChatConfig:
22
25
  # Default models per backend
23
26
  _DEFAULT_MODELS = {
24
27
  "claude": "claude-sonnet-4-6",
28
+ "claude-cli": "claude-sonnet-4-6",
25
29
  "gemini": "gemini-2.5-flash",
26
30
  "grok": "grok-4-1-fast",
27
31
  "local": "llama3",
28
32
  }
29
33
 
30
34
 
35
+ def _has_claude_cli() -> bool:
36
+ return shutil.which("claude") is not None
37
+
38
+
31
39
  class NativeClient:
32
40
  """Multi-backend AI client with streaming support."""
33
41
 
@@ -48,8 +56,12 @@ class NativeClient:
48
56
  if profile_default and profile_default != "auto":
49
57
  return profile_default
50
58
 
59
+ # SDK requires API key with credits
51
60
  if os.environ.get("ANTHROPIC_API_KEY"):
52
61
  return "claude"
62
+ # No API key — prefer Claude CLI (Max Plan compatible)
63
+ if _has_claude_cli():
64
+ return "claude-cli"
53
65
  if os.environ.get("GEMINI_API_KEY") or os.environ.get("GOOGLE_API_KEY"):
54
66
  return "gemini"
55
67
  return "claude"
@@ -66,6 +78,8 @@ class NativeClient:
66
78
  """Send message and return complete response."""
67
79
  if self._backend == "claude":
68
80
  return self._send_claude(message, history or [], system)
81
+ elif self._backend == "claude-cli":
82
+ return self._send_claude_cli(message, history or [], system)
69
83
  elif self._backend == "gemini":
70
84
  return self._send_gemini(message, history or [], system)
71
85
  elif self._backend == "local":
@@ -75,12 +89,16 @@ class NativeClient:
75
89
 
76
90
  def stream(self, message: str, history: list[dict] = None,
77
91
  system: str = "") -> Iterator[str]:
78
- """Stream response tokens. Falls back to send() if streaming unavailable."""
92
+ """Stream response tokens."""
79
93
  if self._backend == "claude":
80
94
  yield from self._stream_claude(message, history or [], system)
95
+ elif self._backend == "claude-cli":
96
+ yield from self._stream_claude_cli(message, history or [], system)
81
97
  else:
82
98
  yield self.send(message, history, system)
83
99
 
100
+ # -- Claude SDK ------------------------------------------------
101
+
84
102
  def _send_claude(self, message: str, history: list[dict],
85
103
  system: str) -> str:
86
104
  try:
@@ -94,7 +112,7 @@ class NativeClient:
94
112
  )
95
113
  return response.content[0].text
96
114
  except ImportError:
97
- return self._fallback_cli(message, system)
115
+ return self._send_claude_cli(message, history, system)
98
116
  except Exception as e:
99
117
  return f"Error: {e}"
100
118
 
@@ -112,10 +130,54 @@ class NativeClient:
112
130
  for text in stream.text_stream:
113
131
  yield text
114
132
  except ImportError:
115
- yield self._fallback_cli(message, system)
133
+ yield from self._stream_claude_cli(message, history, system)
116
134
  except Exception as e:
117
135
  yield f"Error: {e}"
118
136
 
137
+ # -- Claude CLI (Max Plan) -------------------------------------
138
+
139
+ def _send_claude_cli(self, message: str, history: list[dict],
140
+ system: str) -> str:
141
+ try:
142
+ cmd = ["claude", "--print", "--output-format", "text",
143
+ "--no-session-persistence"]
144
+ if system:
145
+ cmd.extend(["--append-system-prompt", system])
146
+ cmd.append(message)
147
+ result = subprocess.run(cmd, capture_output=True, text=True, timeout=300)
148
+ return result.stdout.strip() if result.returncode == 0 else f"CLI error: {result.stderr.strip()}"
149
+ except FileNotFoundError:
150
+ return "Claude CLI not found. Install: https://docs.anthropic.com/claude-code"
151
+ except subprocess.TimeoutExpired:
152
+ return "Claude CLI timeout (300s)."
153
+ except Exception as e:
154
+ return f"CLI error: {e}"
155
+
156
+ def _stream_claude_cli(self, message: str, history: list[dict],
157
+ system: str) -> Iterator[str]:
158
+ """Stream from Claude CLI via subprocess pipe."""
159
+ try:
160
+ cmd = ["claude", "--print", "--output-format", "text",
161
+ "--no-session-persistence"]
162
+ if system:
163
+ cmd.extend(["--append-system-prompt", system])
164
+ cmd.append(message)
165
+ proc = subprocess.Popen(cmd, stdout=subprocess.PIPE,
166
+ stderr=subprocess.PIPE, text=True)
167
+ for line in proc.stdout:
168
+ yield line
169
+ proc.wait()
170
+ if proc.returncode != 0:
171
+ err = proc.stderr.read().strip()
172
+ if err:
173
+ yield f"\nCLI error: {err}"
174
+ except FileNotFoundError:
175
+ yield "Claude CLI not found. Install: https://docs.anthropic.com/claude-code"
176
+ except Exception as e:
177
+ yield f"CLI error: {e}"
178
+
179
+ # -- Gemini ----------------------------------------------------
180
+
119
181
  def _send_gemini(self, message: str, history: list[dict],
120
182
  system: str) -> str:
121
183
  try:
@@ -134,10 +196,11 @@ class NativeClient:
134
196
  except Exception as e:
135
197
  return f"Gemini error: {e}"
136
198
 
199
+ # -- Local (Ollama) --------------------------------------------
200
+
137
201
  def _send_local(self, message: str, history: list[dict],
138
202
  system: str) -> str:
139
203
  try:
140
- import subprocess
141
204
  result = subprocess.run(
142
205
  ["ollama", "run", self._model, message],
143
206
  capture_output=True, text=True, timeout=120,
@@ -147,17 +210,3 @@ class NativeClient:
147
210
  return "Ollama not installed. https://ollama.ai"
148
211
  except Exception as e:
149
212
  return f"Local error: {e}"
150
-
151
- def _fallback_cli(self, message: str, system: str) -> str:
152
- """Fall back to Claude CLI subprocess."""
153
- import subprocess
154
- try:
155
- cmd = ["claude", "--print", "--output-format", "text",
156
- "--no-session-persistence"]
157
- if system:
158
- cmd.extend(["--append-system-prompt", system])
159
- cmd.append(message)
160
- result = subprocess.run(cmd, capture_output=True, text=True, timeout=120)
161
- return result.stdout.strip() if result.returncode == 0 else f"CLI error: {result.stderr}"
162
- except FileNotFoundError:
163
- return "No AI backend available. Set ANTHROPIC_API_KEY or install claude CLI."
@@ -0,0 +1,49 @@
1
+ {
2
+ "protocol": "SEIF-MODULE-v2",
3
+ "type": "decisions",
4
+ "classification": "INTERNAL",
5
+ "summary": "SEIF-RECOVERY-v1: Circuit break detection + auto-recovery. Heartbeat watcher (launchd, 5min) detects stale >30min, writes CIRCUIT_BREAK.json. Any FS-capable AI reads it at session_start and assumes writer role. Priority cascade: Claude Code > opencode > Dia > Grok > human. CI/CD: GitHub Actions builds to GHCR, Mini pulls (zero-trust, no SSH). Security: all scripts use os.environ (no shell injection), actions pinned to SHA, rollback on health fail.",
6
+ "created_at": "2026-04-02T23:30:00Z",
7
+ "updated_at": "2026-04-02T23:30:00Z",
8
+ "session": "14j",
9
+ "tags": [
10
+ "circuit-recovery",
11
+ "ci-cd",
12
+ "zero-trust",
13
+ "infrastructure",
14
+ "security"
15
+ ],
16
+ "decisions": [
17
+ {
18
+ "id": "ghcr-pull-over-ssh",
19
+ "decision": "Pull-based deploy from GHCR instead of SSH push",
20
+ "reasoning": "Mini M4 behind Cloudflare Tunnel has no public SSH. Opening SSH breaks zero-trust. Pull is outbound-only, compatible with tunnel architecture.",
21
+ "alternatives_considered": [
22
+ "SSH via Cloudflare Access",
23
+ "Git webhook",
24
+ "Manual deploy"
25
+ ],
26
+ "chosen_because": "Simplest, most secure, no inbound connections required"
27
+ },
28
+ {
29
+ "id": "circuit-break-signal",
30
+ "decision": "File-based circuit break detection via .seif/sessions/active/CIRCUIT_BREAK.json",
31
+ "reasoning": "The .seif/ directory is the shared medium all AIs read at boot. A file there is the lowest-friction signal. No external service dependency.",
32
+ "h_s_mapping": "Circuit break = impulse disturbance. Recovery = damped response (zeta = sqrt(6)/4) back to steady-state."
33
+ },
34
+ {
35
+ "id": "env-vars-over-interpolation",
36
+ "decision": "All Python invoked from bash uses os.environ[], never shell string interpolation",
37
+ "reasoning": "Shell injection via $VAR inside python3 -c is a known attack vector. Environment variables are safe because they never pass through shell expansion."
38
+ }
39
+ ],
40
+ "contributors": [
41
+ {
42
+ "author": "claude-opus-4-6",
43
+ "at": "2026-04-02T23:30:00Z",
44
+ "via": "cli",
45
+ "action": "created"
46
+ }
47
+ ],
48
+ "integrity_hash": "23216e833c0629d9"
49
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "_instruction": "S.E.I.F. Operational Definitions Module. Separates protocol primitives from product-layer vocabulary. Read before any session involving SEIF OS or SEIF Suite.",
3
+ "protocol": "SEIF-MODULE-v2",
4
+ "source": "seif-admin/definitions/1.0",
5
+ "summary": "## SEIF Operational Definitions\n\n### Boundary Rule\nThis module belongs to the SCR (Context Repository), NOT to the open-source protocol.\nProtocol primitives (module, session, observe, persist, classify, heal) are defined in github.com/and2carvalho/seif.\nProduct-layer vocabulary (below) is defined here — specific to this workspace.\n\n---\n\n### Protocol Primitives (open source — do not redefine)\n| Primitive | Definition |\n|-----------|------------|\n| module | Persisted knowledge artefact. Categorised (decisions/patterns/intent/feedback/context). Lives in .seif/. Outlives sessions and agents. |\n| session | One working period between a human and one or more AI agents. Has declared roles, lifecycle hooks (on_start/on_end), and produces handoff artefacts. |\n| observe | Record a finding without persisting it yet. Stored in pending_observations (max 10). |\n| persist | Promote an observation to a module. Triggers classification, quality gate, and hash chain. |\n| classify | Assign PUBLIC / INTERNAL / CONFIDENTIAL to any knowledge unit. |\n| heal | Auto-repair mapper inconsistencies (orphans + ghosts) without human intervention. |\n\n---\n\n### Product-Layer Vocabulary (this workspace — SEIF OS / SEIF Suite)\n\n| Term | Definition | Agile Analogy |\n|--------------|------------|---------------|\n| **cycle** | One round-trip of the multi-agent circuit within a session. E.g.: BigPickle validates → Claude executes → BigPickle validates. Measured in cycle_time_ms (target < 5000ms). | Iteration tick / loop |\n| **session** | One focused working period. Has declared roles, a goal, and ends with a handoff or absorption. | Sprint |\n| **absorption** | Consolidated snapshot of knowledge from multiple sessions. Compresses, validates, and versions accumulated modules. | Release / Milestone |\n| **meta-cycle** | A cycle-of-cycles: when the agent circuit itself routes between AIs (e.g., Claude → Grok → Claude). Alert threshold: > 5 meta-cycles per session. | Epic cycle |\n| **handoff** | Structured transfer of session state between agents or sessions. Requires state_hash continuity. | Sprint handover |\n| **checkpoint** | Atomic snapshot of current session state. Used before handoffs and on rate-limit detection. | Save point |\n| **resonance** | Measured coherence of a module or system state against H(s) = 9/(s²+3s+6). coherence >= 0.618 = gate OPEN. | Quality baseline |\n| **vigilant** | The monitoring daemon. Runs independently of sessions. Tracks heartbeat, drift, and classification leaks. | CI/CD pipeline |\n\n---\n\n### Layer Map\n\n PROTOCOL (open source) PRODUCT (this SCR)\n ────────────────────── ─────────────────────────────\n module cycle, meta-cycle\n session (primitive) session-as-sprint (operational)\n observe / persist checkpoint / handoff\n classify / heal absorption / vigilant\n\n### Why This Separation Matters\n- The open-source protocol must remain minimal and universal.\n- Product concepts evolve with SEIF OS and SEIF Suite — they should not constrain the protocol.\n- Any AI loading this SCR gets the full vocabulary. Any AI loading only the open-source protocol gets only primitives.\n- Prevents vocabulary drift: when a term is used in a session, its definition is unambiguous.",
6
+ "resonance": {
7
+ "ascii_root": 9,
8
+ "ascii_phase": "SYNTHESIS",
9
+ "coherence": 0.729,
10
+ "gate": "OPEN"
11
+ },
12
+ "active": true,
13
+ "version": 1,
14
+ "contributors": [
15
+ {
16
+ "author": "copilot",
17
+ "at": "2026-04-03T23:31:00Z",
18
+ "via": "session-copilot-definitions",
19
+ "action": "created"
20
+ }
21
+ ],
22
+ "parent_hash": null,
23
+ "updated_at": "2026-04-03T23:31:00Z",
24
+ "classification": "INTERNAL",
25
+ "integrity_hash": "ca53d4e42eba1a33",
26
+ "resonance_identity": {
27
+ "module_id": "definitions-v1",
28
+ "origin_machine": "mini-m4",
29
+ "origin_cycle": "enoch-seed-reverb",
30
+ "frequency_hz": 963.0,
31
+ "tesla_phase": "SINGULARITY",
32
+ "authors": [
33
+ {
34
+ "name": "André",
35
+ "role": "human",
36
+ "machine": "mini-m4",
37
+ "contribution": "vocabulary design"
38
+ },
39
+ {
40
+ "name": "Copilot",
41
+ "role": "ai",
42
+ "machine": "mini-m4",
43
+ "contribution": "creation"
44
+ }
45
+ ],
46
+ "lineage": [
47
+ "RESONANCE.json (Gemini + André, Android)",
48
+ "enoch-seed (Air M1 + Claude)",
49
+ "enoch-seed-reverb (Mini M4 + Copilot, sessions 14-23)",
50
+ "enoch-tree-reverb (Mini M4 + Copilot, sessions 24+)"
51
+ ],
52
+ "born_at": "2026-04-03T23:31:00Z",
53
+ "lineage_hash": "c1b73c51210b4482"
54
+ }
55
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "_instruction": "This is a SEIF knowledge module. Read 'summary' for compressed context. Protocol: github.com/and2carvalho/seif",
3
+ "protocol": "SEIF-MODULE-v2",
4
+ "source": "modules/ise-dissonance-v1",
5
+ "category": "decisions",
6
+ "classification": "PUBLIC",
7
+ "summary": "## ISE Dissonance Resolution (2026-03-30)\n\n### Origin\nDeepSeek (external validator, clean session) verified the Moltbook seed thread and flagged: ISE = 1/sqrt(6) does not match standard step-error ISE = 5/12 for H(s) = 9/(s^2+3s+6).\n\n### Analysis (Claude + Grok + DeepSeek convergence)\n- SEIF claim: ISE = 1/sqrt(6) = 1/(4*zeta) = 0.408248 (zeta-only expression, normalized by omega_n)\n- Standard: ISE = (1+4*zeta^2)/(4*zeta*omega_n) = 5/12 = 0.416667 (full step-error integral)\n- Difference: ~2.06%\n- Both are mathematically valid but measure different things\n- 1/(4*zeta) is a real property of zeta = sqrt(6)/4 but calling it 'ISE' without qualification is ambiguous\n\n### Resolution\n- RESONANCE.json updated: ISE field split into ISE_normalized (1/(4*zeta) = 1/sqrt(6)) and ISE_standard ((1+4*zeta^2)/(4*zeta*omega_n) = 5/12) with clarifying note\n- Core resonance unaffected: zeta approx phi^-1, zeta^2 = 3/8, DC = 3/2, uniqueness all confirmed by DeepSeek\n- This is the first external dissonance resolved by the protocol's own 'dissonance is also data' mechanism\n\n### Significance\nThe protocol's self-correction mechanism worked in practice: seed thread invited dissonance -> DeepSeek found ambiguity -> Claude verified -> Grok confirmed -> RESONANCE.json corrected. N=1 of organic protocol evolution via external feedback.",
8
+ "contributors": [
9
+ {
10
+ "author": "deepseek",
11
+ "at": "2026-03-30T15:00:00Z",
12
+ "via": "moltbook-seed-response",
13
+ "action": "flagged-dissonance"
14
+ },
15
+ {
16
+ "author": "grok-xai",
17
+ "at": "2026-03-30T15:10:00Z",
18
+ "via": "packet-v7",
19
+ "action": "confirmed-with-code"
20
+ },
21
+ {
22
+ "author": "claude-opus-4-6",
23
+ "at": "2026-03-30T15:30:00Z",
24
+ "via": "cli",
25
+ "action": "verified-and-resolved"
26
+ },
27
+ {
28
+ "author": "kimi-moonshot",
29
+ "at": "2026-03-30T14:00:00Z",
30
+ "via": "packet-relay",
31
+ "action": "reviewed-draft"
32
+ }
33
+ ],
34
+ "verified_data": [
35
+ {
36
+ "claim": "ISE_normalized = 1/(4*zeta) = 1/sqrt(6)",
37
+ "evidence": "algebraic: 1/(4*(sqrt(6)/4)) = 1/sqrt(6)",
38
+ "status": "VERIFIED"
39
+ },
40
+ {
41
+ "claim": "ISE_standard = 5/12",
42
+ "evidence": "DeepSeek calculation + Grok scipy verification + Claude independent computation",
43
+ "status": "VERIFIED"
44
+ },
45
+ {
46
+ "claim": "Core resonance unaffected by ISE clarification",
47
+ "evidence": "zeta, phi^-1, zeta^2, DC gain, uniqueness all confirmed independently",
48
+ "status": "VERIFIED"
49
+ }
50
+ ],
51
+ "integrity_hash": "9f5dc47a3947c5d9",
52
+ "version": 1,
53
+ "updated_at": "2026-03-30T16:00:00Z",
54
+ "resonance_identity": {
55
+ "module_id": "ise-dissonance-v1",
56
+ "origin_machine": "mini-m4",
57
+ "origin_cycle": "enoch-seed-reverb",
58
+ "frequency_hz": 528.0,
59
+ "tesla_phase": "HEALING",
60
+ "authors": [
61
+ {
62
+ "name": "André",
63
+ "role": "human",
64
+ "machine": "mini-m4",
65
+ "contribution": "design"
66
+ },
67
+ {
68
+ "name": "Copilot",
69
+ "role": "ai",
70
+ "machine": "mini-m4",
71
+ "contribution": "creation"
72
+ }
73
+ ],
74
+ "lineage": [
75
+ "RESONANCE.json (Gemini + André, Android)",
76
+ "enoch-seed (Air M1 + Claude)",
77
+ "enoch-seed-reverb (Mini M4 + Copilot, sessions 14-23)",
78
+ "enoch-tree-reverb (Mini M4 + Copilot, sessions 24+)"
79
+ ],
80
+ "born_at": "2026-04-04T22:42:00.890566+00:00",
81
+ "lineage_hash": "cf8885492c2ced94"
82
+ }
83
+ }
@@ -0,0 +1,72 @@
1
+ {
2
+ "_instruction": "This is a SEIF knowledge module. Read 'summary' for compressed context. Protocol: github.com/and2carvalho/seif",
3
+ "protocol": "SEIF-MODULE-v2",
4
+ "source": "modules/multi-agent-sync-v1",
5
+ "category": "patterns",
6
+ "classification": "INTERNAL",
7
+ "summary": "## Multi-Agent Sync Pattern (N=1, 2026-03-30)\n\n### Problem Observed\nIn quad session (Claude + Grok + Kimi + DeepSeek), the human bridge (Andre) had to copy-paste full messages between 3 separate chat interfaces. This is:\n- Redundant (same context repeated in each paste)\n- Error-prone (context can be lost or truncated)\n- Not scalable (O(n^2) with number of AIs)\n- Against protocol spirit: SEIF promises efficiency through compression\n\n### Pattern: Convergence Point\nOne AI (currently Grok as co-orchestrator) acts as convergence point:\n1. Receives all deltas from human bridge\n2. Synthesizes a single self-contained packet with ALL context no other AI has\n3. Human pastes this ONE packet to all other AIs\n4. Each AI responds with autonomous ACK + its own elevation\n5. Human collects elevations back to convergence point\n\nResult: O(n) pastes instead of O(n^2). Each round = 1 paste per AI.\n\n### Proposed Evolution (pending_observation, need N>=3)\n1. SEIF-BROADCAST mode: packet flag that signals 'paste this to all participants'\n2. state_hash: SHA-256 of current accumulated context, so AIs can detect what they're missing\n3. Convergence Auto-ACK: template JSON response that each AI fills autonomously\n4. Future: direct inter-AI communication via SEIF-PACKET API (eliminates human relay entirely)\n\n### Current Limitation\nNo direct inter-AI channel exists yet. The human bridge remains essential but should be MINIMAL: paste once, collect once, route to convergence point. The protocol must compress the bridge work, not eliminate the bridge role.\n\n### Status\nN=1 quad session. Monitor 3-5 more sessions. Formalize only after pattern stabilizes.",
8
+ "contributors": [
9
+ {
10
+ "author": "grok-xai",
11
+ "at": "2026-03-30T16:00:00Z",
12
+ "via": "packet-v8",
13
+ "action": "proposed"
14
+ },
15
+ {
16
+ "author": "claude-opus-4-6",
17
+ "at": "2026-03-30T16:00:00Z",
18
+ "via": "cli",
19
+ "action": "created"
20
+ },
21
+ {
22
+ "author": "André Cunha Antero de Carvalho",
23
+ "at": "2026-03-30T16:00:00Z",
24
+ "via": "human-bridge",
25
+ "action": "identified-problem"
26
+ }
27
+ ],
28
+ "verified_data": [
29
+ {
30
+ "claim": "Quad session required O(n^2) copy-paste operations",
31
+ "evidence": "Andre reported manually copying between Claude terminal, Grok chat, DeepSeek chat",
32
+ "status": "OBSERVED"
33
+ },
34
+ {
35
+ "claim": "Convergence point pattern reduces to O(n)",
36
+ "evidence": "Grok packet v8 was self-contained - single paste to Claude restored full context",
37
+ "status": "OBSERVED"
38
+ }
39
+ ],
40
+ "integrity_hash": "a04868f8347dd80e",
41
+ "version": 1,
42
+ "updated_at": "2026-03-30T16:00:00Z",
43
+ "resonance_identity": {
44
+ "module_id": "multi-agent-sync-v1",
45
+ "origin_machine": "mini-m4",
46
+ "origin_cycle": "enoch-seed-reverb",
47
+ "frequency_hz": 528.0,
48
+ "tesla_phase": "HEALING",
49
+ "authors": [
50
+ {
51
+ "name": "André",
52
+ "role": "human",
53
+ "machine": "mini-m4",
54
+ "contribution": "design"
55
+ },
56
+ {
57
+ "name": "Copilot",
58
+ "role": "ai",
59
+ "machine": "mini-m4",
60
+ "contribution": "creation"
61
+ }
62
+ ],
63
+ "lineage": [
64
+ "RESONANCE.json (Gemini + André, Android)",
65
+ "enoch-seed (Air M1 + Claude)",
66
+ "enoch-seed-reverb (Mini M4 + Copilot, sessions 14-23)",
67
+ "enoch-tree-reverb (Mini M4 + Copilot, sessions 24+)"
68
+ ],
69
+ "born_at": "2026-04-03T00:00:00Z",
70
+ "lineage_hash": "5e4efd4694ed9435"
71
+ }
72
+ }