nexo-brain 1.5.2 → 1.5.3
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 +12 -0
- package/package.json +1 -1
- package/src/scripts/deep-sleep/__pycache__/analyze_session.cpython-314.pyc +0 -0
- package/src/scripts/deep-sleep/__pycache__/apply_findings.cpython-314.pyc +0 -0
- package/src/scripts/deep-sleep/__pycache__/collect_transcripts.cpython-314.pyc +0 -0
- package/src/scripts/nexo-deep-sleep.sh +21 -16
- package/tests/__pycache__/__init__.cpython-314.pyc +0 -0
- package/tests/__pycache__/conftest.cpython-314-pytest-9.0.2.pyc +0 -0
- package/tests/__pycache__/test_cognitive.cpython-314-pytest-9.0.2.pyc +0 -0
- package/tests/__pycache__/test_knowledge_graph.cpython-314-pytest-9.0.2.pyc +0 -0
- package/tests/__pycache__/test_migrations.cpython-314-pytest-9.0.2.pyc +0 -0
package/README.md
CHANGED
|
@@ -130,10 +130,22 @@ Like a human brain, NEXO Brain has automated processes that run while you're not
|
|
|
130
130
|
|------|---------|---------------|
|
|
131
131
|
| 03:00 | Decay + memory consolidation + merge duplicates + dreaming | Deep sleep consolidation |
|
|
132
132
|
| 04:00 | Clean expired data, prune redundant memories | Synaptic pruning |
|
|
133
|
+
| 04:30 | **Deep Sleep** — analyze full session transcripts for uncaptured corrections, protocol violations, missed commitments | REM sleep review |
|
|
133
134
|
| 07:00 | Self-audit, health checks, metrics | Waking up + orientation |
|
|
134
135
|
| 23:30 | Process day's events, extract patterns | Pre-sleep reflection |
|
|
135
136
|
| Boot | Catch-up: run anything missed while computer was off | -- |
|
|
136
137
|
|
|
138
|
+
#### Deep Sleep (v1.5.2)
|
|
139
|
+
|
|
140
|
+
Deep Sleep reads your **complete session transcripts** (not just the diary summary) and finds what the agent missed during the day:
|
|
141
|
+
|
|
142
|
+
- **Uncaptured corrections** — user corrections the agent didn't save as learnings
|
|
143
|
+
- **Protocol violations** — guard_check skipped, trust not adjusted, change_log omitted
|
|
144
|
+
- **Missed commitments** — things mentioned but never tracked as followups
|
|
145
|
+
- **Quality issues** — agent declaring "done" when work wasn't complete
|
|
146
|
+
|
|
147
|
+
Uses Claude CLI in `--bare` mode (no hooks, no CLAUDE.md interference). Catch-up system re-runs yesterday if the Mac was off.
|
|
148
|
+
|
|
137
149
|
If your Mac was asleep during any scheduled process, NEXO Brain catches up in order when it wakes.
|
|
138
150
|
|
|
139
151
|
## Cognitive Cortex
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nexo-brain",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"mcpName": "io.github.wazionapps/nexo",
|
|
5
5
|
"description": "NEXO — Cognitive co-operator for Claude Code. Atkinson-Shiffrin memory, semantic RAG, knowledge graph, HNSW vector indexing, trust scoring, and metacognitive error prevention.",
|
|
6
6
|
"bin": {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# NEXO Deep Sleep — Complete overnight session
|
|
3
|
-
#
|
|
4
|
-
#
|
|
2
|
+
# NEXO Deep Sleep — Complete overnight session analysis
|
|
3
|
+
# Runs at 4:30 AM via LaunchAgent
|
|
4
|
+
# Reads ALL session transcripts from the day, analyzes with Claude CLI,
|
|
5
|
+
# and applies findings (learnings, feedbacks, followups, trust adjustments)
|
|
5
6
|
#
|
|
6
7
|
# Features:
|
|
7
8
|
# - Catch-up: if yesterday was missed (Mac off/asleep), runs it first
|
|
8
|
-
# -
|
|
9
|
-
# -
|
|
10
|
-
#
|
|
11
|
-
# Install: Add as LaunchAgent for daily execution (recommended: 4:30 AM)
|
|
9
|
+
# - Logs to ~/claude/logs/deep-sleep.log
|
|
10
|
+
# - Marks completion in .last-run for watchdog monitoring
|
|
12
11
|
|
|
13
12
|
set -euo pipefail
|
|
14
13
|
|
|
@@ -26,9 +25,11 @@ run_analysis() {
|
|
|
26
25
|
local DATE="$1"
|
|
27
26
|
log "=== Deep Sleep starting for $DATE ==="
|
|
28
27
|
|
|
28
|
+
# Step 1: Collect transcripts
|
|
29
29
|
log "Step 1: Collecting transcripts for $DATE..."
|
|
30
30
|
python3 "$SCRIPT_DIR/deep-sleep/collect_transcripts.py" "$DATE" 2>&1 | tee -a "$LOG_DIR/deep-sleep.log"
|
|
31
31
|
|
|
32
|
+
# Check if transcripts were found
|
|
32
33
|
if [ ! -f "$DEEP_SLEEP_DIR/$DATE-transcripts.json" ]; then
|
|
33
34
|
log "No transcripts file generated for $DATE. Skipping."
|
|
34
35
|
return 0
|
|
@@ -40,6 +41,7 @@ run_analysis() {
|
|
|
40
41
|
return 0
|
|
41
42
|
fi
|
|
42
43
|
|
|
44
|
+
# Step 2: Analyze with Claude CLI
|
|
43
45
|
log "Step 2: Analyzing $SESSIONS sessions with Claude CLI..."
|
|
44
46
|
python3 "$SCRIPT_DIR/deep-sleep/analyze_session.py" "$DATE" 2>&1 | tee -a "$LOG_DIR/deep-sleep.log"
|
|
45
47
|
|
|
@@ -48,6 +50,7 @@ run_analysis() {
|
|
|
48
50
|
return 1
|
|
49
51
|
fi
|
|
50
52
|
|
|
53
|
+
# Step 3: Apply findings
|
|
51
54
|
log "Step 3: Applying findings for $DATE..."
|
|
52
55
|
python3 "$SCRIPT_DIR/deep-sleep/apply_findings.py" "$DATE" 2>&1 | tee -a "$LOG_DIR/deep-sleep.log"
|
|
53
56
|
|
|
@@ -55,22 +58,24 @@ run_analysis() {
|
|
|
55
58
|
return 0
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
# --- Catch-up: check if yesterday was missed ---
|
|
61
|
+
# --- Catch-up: check if the day before yesterday was missed ---
|
|
59
62
|
YESTERDAY=$(date -v-1d +%Y-%m-%d 2>/dev/null || date -d "yesterday" +%Y-%m-%d 2>/dev/null)
|
|
63
|
+
DAY_BEFORE=$(date -v-2d +%Y-%m-%d 2>/dev/null || date -d "2 days ago" +%Y-%m-%d 2>/dev/null)
|
|
60
64
|
LAST_RUN=""
|
|
61
65
|
if [ -f "$LAST_RUN_FILE" ]; then
|
|
62
66
|
LAST_RUN=$(cat "$LAST_RUN_FILE")
|
|
63
67
|
fi
|
|
64
68
|
|
|
65
|
-
if [ -n "$
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
if [ -n "$DAY_BEFORE" ] && [ "$LAST_RUN" != "$DAY_BEFORE" ] && [ "$LAST_RUN" != "$YESTERDAY" ]; then
|
|
70
|
+
# Day before yesterday wasn't analyzed — catch up
|
|
71
|
+
if [ ! -f "$DEEP_SLEEP_DIR/$DAY_BEFORE-analysis.json" ]; then
|
|
72
|
+
log "*** CATCH-UP: $DAY_BEFORE was missed. Running now. ***"
|
|
73
|
+
run_analysis "$DAY_BEFORE" || log "Catch-up for $DAY_BEFORE failed."
|
|
69
74
|
fi
|
|
70
75
|
fi
|
|
71
76
|
|
|
72
|
-
# --- Run
|
|
73
|
-
run_analysis "$
|
|
77
|
+
# --- Run yesterday's analysis (main task — at 4:30 AM, today has no sessions yet) ---
|
|
78
|
+
run_analysis "$YESTERDAY"
|
|
74
79
|
|
|
75
|
-
# Mark completion
|
|
76
|
-
echo "$
|
|
80
|
+
# Mark completion with yesterday's date (what we actually analyzed)
|
|
81
|
+
echo "$YESTERDAY" > "$LAST_RUN_FILE"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|