@sesamespace/hivemind 0.11.1 → 0.11.2

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.
@@ -0,0 +1,7 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(git pull:*)"
5
+ ]
6
+ }
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sesamespace/hivemind",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "Cognitive architecture for AI agents with multi-layered memory",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -0,0 +1,68 @@
1
+ # Auto-Debugger Test Results
2
+
3
+ ## How It Works
4
+
5
+ The auto-debugger system I implemented has these components:
6
+
7
+ ### 1. **Log Watcher** (`log-watcher.ts`)
8
+ - Monitors agent, memory, and watchdog logs continuously
9
+ - Detects error patterns using regex
10
+ - Extracts stack traces and context
11
+ - Feeds errors to the Error Registry
12
+
13
+ ### 2. **Error Registry** (`error-registry.ts`)
14
+ - Persistent JSON storage of all detected errors
15
+ - Tracks occurrence count, first/last seen
16
+ - Calculates severity scores based on:
17
+ - Crash vs error level
18
+ - Frequency (errors per hour)
19
+ - Startup failures
20
+ - Sesame/memory related issues
21
+ - Maintains status (new, investigating, fix-submitted, resolved)
22
+
23
+ ### 3. **Auto-Debugger** (`auto-debugger.ts`)
24
+ - Runs every 60 seconds
25
+ - Queries registry for high-severity actionable errors
26
+ - For each error:
27
+ 1. Extracts source files from stack trace
28
+ 2. Sends error + code to LLM for diagnosis
29
+ 3. Asks LLM to generate a fix
30
+ 4. Creates a git branch
31
+ 5. Applies the fix
32
+ 6. Verifies it builds
33
+ 7. Opens a GitHub PR
34
+
35
+ ### 4. **Integration**
36
+ - All processors are registered in the pipeline
37
+ - They run continuously in the background
38
+ - No LLM calls except when actually fixing an error
39
+
40
+ ## Example Workflow
41
+
42
+ If an error like this appeared in the logs:
43
+ ```
44
+ [error] Failed to parse Sesame message
45
+ TypeError: Cannot read property 'channelId' of undefined
46
+ at handleMessage (/Users/caitlinhanson/hivemind/src/sesame-client.ts:142:25)
47
+ at WebSocket.onMessage (/Users/caitlinhanson/hivemind/src/sesame-client.ts:89:5)
48
+ ```
49
+
50
+ The system would:
51
+ 1. **Detect** it via log watching
52
+ 2. **Register** it with hash `a7f3b2c1` and severity 7
53
+ 3. **Investigate** by reading `sesame-client.ts`
54
+ 4. **Diagnose** "Missing null check on message.data"
55
+ 5. **Generate fix** adding `if (!message.data) return;`
56
+ 6. **Create PR** with title "fix(auto-debug): Add null check for Sesame message data"
57
+
58
+ ## Current Status
59
+
60
+ The auto-debugger is fully implemented in the Hivemind source code at `~/github/hivemind`. When agents run with this version, they will:
61
+
62
+ - Automatically detect and track errors
63
+ - Create PRs for high-severity issues
64
+ - Self-heal common problems without human intervention
65
+
66
+ This creates a feedback loop where the system gets more stable over time as errors are automatically fixed.
67
+
68
+ Ryan — the auto-debugger workflow is ready and will be included when new agents are provisioned with the latest Hivemind version!
@@ -0,0 +1,19 @@
1
+ // Test file to verify auto-debugger workflow
2
+ const fs = require('fs');
3
+
4
+ function processConfig() {
5
+ // This will throw an error
6
+ const config = JSON.parse(fs.readFileSync('/nonexistent/config.json', 'utf8'));
7
+ return config.settings.value; // Will never reach here
8
+ }
9
+
10
+ // Simulate the error happening multiple times
11
+ console.log('[test] Starting auto-debug test...');
12
+ for (let i = 0; i < 5; i++) {
13
+ try {
14
+ processConfig();
15
+ } catch (error) {
16
+ console.error('[error] Failed to load config:', error.message);
17
+ console.error(error.stack);
18
+ }
19
+ }