hebbian 0.10.0 → 0.11.1

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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  <img src="https://img.shields.io/badge/TypeScript-6.0-3178C6?style=flat-square&logo=typescript" />
3
3
  <img src="https://img.shields.io/badge/Node.js-22+-339933?style=flat-square&logo=node.js" />
4
4
  <img src="https://img.shields.io/badge/Runtime_Deps-0-brightgreen?style=flat-square" />
5
- <img src="https://img.shields.io/badge/Tests-317-blue?style=flat-square" />
5
+ <img src="https://img.shields.io/badge/Tests-339-blue?style=flat-square" />
6
6
  <img src="https://img.shields.io/badge/MIT-green?style=flat-square" />
7
7
  </p>
8
8
 
@@ -35,19 +35,20 @@ you: don't use console.log, always use the logger utility
35
35
  ```
36
36
 
37
37
  ```bash
38
- # 3. End the session (hooks auto-run hebbian digest)
39
- # Check what hebbian learned:
38
+ # 3. End the session (hooks auto-run)
39
+ # hebbian digest extracts the correction → creates candidate
40
+ # → agent-evaluator auto-fires candidates (no corrections = +1)
41
+
40
42
  hebbian candidates
41
- # ░░█ 1/3 cortex/NO_console_log (0d idle)
43
+ # █░░ 1/3 cortex/NO_console_log (0d idle)
42
44
 
43
- # 4. After 2 more corrections, it graduates:
44
- # 🎓 promoted: cortex/_candidates/NO_console_log → cortex/NO_console_log
45
+ # 4. After 2 more clean sessions, it graduates automatically:
46
+ # 🎓 promoted: cortex/NO_console_log → permanent neuron
45
47
 
46
- # 5. Next session — Claude sees the rule in CLAUDE.md:
47
- # ❌ NO console.log → use logger utility
48
+ # 5. Next session — Claude sees the rule in CLAUDE.md
48
49
  ```
49
50
 
50
- **That's it.** One correction, hebbian learns. Three confirmations, it becomes permanent.
51
+ **That's it.** One correction candidate. Three clean sessions permanent. **No API keys needed.**
51
52
 
52
53
  ---
53
54
 
@@ -59,7 +60,7 @@ hebbian candidates
59
60
  npx hebbian init ./brain
60
61
  npx hebbian grow brainstem/禁fallback --brain ./brain
61
62
  npx hebbian emit claude --brain ./brain # → CLAUDE.md
62
- npx hebbian evolve --dry-run # → LLM proposes brain mutations
63
+ npx hebbian evolve --dry-run # → (optional) LLM proposes brain mutations
63
64
  ```
64
65
 
65
66
  | Before | hebbian |
@@ -79,16 +80,17 @@ npx hebbian evolve --dry-run # → LLM proposes brain mutations
79
80
  ```
80
81
  Claude Code session
81
82
 
82
- SessionStart hook Stop hook
83
-
84
- hebbian emit hebbian digest
85
-
86
- CLAUDE.md ←── brain ──→ _candidates/
87
-
88
- hebbian evolve 3 confirmations
89
- │ │
90
- LLM proposes permanent neuron
91
- grow/fire/prune
83
+ SessionStart hook Stop hook
84
+
85
+ hebbian emit hebbian digest
86
+
87
+ CLAUDE.md ←── brain ──→ corrections → _candidates/
88
+
89
+ "Provisional Rules" agent-evaluator:
90
+ (candidates shown to agent) clean session → fire (+1)
91
+ 3 fires → permanent neuron
92
+
93
+ No API keys. The running agent IS the evaluator.
92
94
  ```
93
95
 
94
96
  ### Candidate Staging (immune system)
@@ -103,6 +105,7 @@ brain/cortex/NO_console_log/3.neuron ← permanent
103
105
  ```
104
106
 
105
107
  - Counter >= 3 → graduates to permanent region
108
+ - Each clean session (no corrections) auto-fires all candidates (+1)
106
109
  - 14 days without a fire → decays (removed)
107
110
  - This prevents hallucinations and one-off corrections from permanently changing behavior
108
111
 
@@ -146,8 +149,8 @@ This adds two hooks to `.claude/settings.local.json`:
146
149
 
147
150
  | Hook | Command | When |
148
151
  |------|---------|------|
149
- | `SessionStart` | `hebbian emit claude` | Injects brain into CLAUDE.md |
150
- | `Stop` | `hebbian digest` | Extracts corrections from conversation |
152
+ | `SessionStart` | `hebbian emit claude` | Injects brain + provisional rules into CLAUDE.md |
153
+ | `Stop` | `hebbian digest` | Extracts corrections, detects tool failures, auto-fires candidates |
151
154
 
152
155
  Check status anytime:
153
156
 
@@ -165,7 +168,7 @@ hebbian automatically learns from failed commands — no explicit correction nee
165
168
  ```bash
166
169
  # During a session, a bash command fails (exit code ≠ 0)
167
170
  # → hebbian digest auto-logs it as a tool-failure episode
168
- # evolve sees the pattern and proposes inhibitory neurons
171
+ # Soft detection: even || true masked errors are caught (command not found, npm error, fatal:)
169
172
 
170
173
  hebbian sessions # see tool-failure episodes in the log
171
174
  ```
@@ -193,7 +196,9 @@ hebbian grow cortex/OTHER_RULE --agent coo --brain ./brain
193
196
 
194
197
  ---
195
198
 
196
- ## LLM Evolution
199
+ ## LLM Evolution (optional)
200
+
201
+ > **Note:** Self-learning works without this. The agent-as-evaluator loop (digest → candidates → auto-fire) requires zero API keys. LLM evolve is an optional power feature for advanced brain mutations.
197
202
 
198
203
  ```bash
199
204
  GEMINI_API_KEY=... hebbian evolve --dry-run --brain ./brain
@@ -204,9 +209,7 @@ GEMINI_API_KEY=... hebbian evolve prune --dry-run --brain ./brain
204
209
 
205
210
  The evolve engine reads the last 100 episodes + current brain state, sends it to Gemini, and proposes up to 10 mutations per cycle. Protected regions (brainstem/limbic/sensors) are blocked.
206
211
 
207
- Actions it can take: `grow` (new neuron), `fire` (strengthen), `signal` (dopamine/bomb), `prune` (weaken), `decay` (mark dormant).
208
-
209
- **Pruning mode** uses a cleanup-focused prompt that only removes: stale neurons (30+ days inactive), high contra ratio (>0.7), redundant duplicates. Run nightly via cron.
212
+ Actions: `grow`, `fire`, `signal`, `prune`, `decay`. **Pruning mode** removes stale neurons (30+ days inactive), high contra ratio (>0.7), redundant duplicates.
210
213
 
211
214
  ---
212
215
 
@@ -238,9 +241,9 @@ hebbian emit <target> [--brain <path>] # claude/cursor/gemini/copilot/generic/a
238
241
  hebbian claude install|uninstall|status
239
242
  hebbian digest [--transcript <path>]
240
243
 
241
- # Evolution
244
+ # Evolution (optional — self-learning works without this)
242
245
  GEMINI_API_KEY=... hebbian evolve [--dry-run]
243
- GEMINI_API_KEY=... hebbian evolve prune [--dry-run] # Pruning mode (청소부)
246
+ GEMINI_API_KEY=... hebbian evolve prune [--dry-run]
244
247
 
245
248
  # Multi-brain (per-agent)
246
249
  hebbian grow cortex/RULE --agent cto # Routes to brain/agents/cto/
@@ -264,7 +267,7 @@ hebbian emit claude --agent coo # Emits from brain/agents/coo/
264
267
 
265
268
  | Feature | .cursorrules / CLAUDE.md | Mem0 / MemOS | hebbian |
266
269
  |---------|--------------------------|-------------|------|
267
- | Self-learning | ❌ manual | ✅ vector DB | ✅ filesystem + tool failures |
270
+ | Self-learning | ❌ manual | ✅ vector DB | ✅ filesystem + agent-evaluator (no API key) |
268
271
  | Infrastructure | $0 | $$$ | **$0** |
269
272
  | Switch AI | Manual migration | Full re-setup | **`cp -r brain/`** |
270
273
  | Immutable guardrails | None | None | **brainstem + bomb** |