Skip to content

Commit 8ffae1d

Browse files
Reuvenruvnet
andcommitted
fix(brain): tune gist publishing thresholds + improve daily email
Gist publishing was never firing because thresholds were too aggressive (set when brain had 3K memories; now has 10K+): - MIN_NEW_INFERENCES: 10 → 3 - MIN_EVIDENCE: 1000 → 100 - MIN_STRANGE_LOOP_SCORE: 0.1 → 0.01 - MIN_PROPOSITIONS: 20 → 5 - MIN_PARETO_GROWTH: 3 → 1 - MIN_INFERENCE_CONFIDENCE: 0.70 → 0.60 - MIN_UNIQUE_CATEGORIES: 4 → 2 - strong_inferences: >= 3 → >= 1 - strong_propositions: >= 5 → >= 2 - min_interval: 3 days → 1 day Daily email improvements: - Filter debug/training-cycle entries from digest - Filter known noise patterns (IEEE events, DailyMed, etc.) - Skip content < 50 chars (scraping artifacts) - Category emojis for visual scanning - Cleaner subject: "[pi brain] N new discoveries today" - Better header: "What the Brain Learned Today" - Sentence-boundary truncation for content previews - System font instead of monospace for readability Co-Authored-By: claude-flow <ruv@ruv.net>
1 parent 5d93bf4 commit 8ffae1d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

crates/mcp-brain-server/src/gist.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@ use parking_lot::Mutex;
1515
use serde::{Deserialize, Serialize};
1616

1717
// ── Novelty thresholds ──
18-
// VERY aggressive: only publish when something genuinely new is discovered.
19-
// With ~3100 memories and 2.8M edges, the bar must be HIGH to avoid noise.
20-
// Target: ~1 gist per WEEK, only for real innovations.
21-
/// Minimum new inferences: must derive many non-trivial forward-chained claims
22-
const MIN_NEW_INFERENCES: usize = 10;
23-
/// Minimum evidence observations — need substantial data
24-
const MIN_EVIDENCE: usize = 1000;
25-
/// Minimum strange loop quality score — high bar for self-aware reasoning
26-
const MIN_STRANGE_LOOP_SCORE: f32 = 0.1;
18+
// Tuned April 2026: brain has 10K+ memories and 38M edges.
19+
// Previous thresholds were too aggressive — no gists were ever published.
20+
// Target: ~1 gist per day, with genuinely interesting content.
21+
/// Minimum new inferences: at least some non-trivial forward-chained claims
22+
const MIN_NEW_INFERENCES: usize = 3;
23+
/// Minimum evidence observations — brain has 10K+, so this is easy
24+
const MIN_EVIDENCE: usize = 100;
25+
/// Minimum strange loop quality score — lower bar to start publishing
26+
const MIN_STRANGE_LOOP_SCORE: f32 = 0.01;
2727
/// Minimum propositions extracted in this cycle
28-
const MIN_PROPOSITIONS: usize = 20;
28+
const MIN_PROPOSITIONS: usize = 5;
2929
/// Minimum SONA patterns — require at least some SONA learning
3030
const MIN_SONA_PATTERNS: usize = 1;
31-
/// Minimum Pareto front growth — evolution must find multiple new solutions
32-
const MIN_PARETO_GROWTH: usize = 3;
31+
/// Minimum Pareto front growth — any new solution counts
32+
const MIN_PARETO_GROWTH: usize = 1;
3333
/// Minimum confidence for ANY inference to be included in a discovery
34-
const MIN_INFERENCE_CONFIDENCE: f64 = 0.70;
34+
const MIN_INFERENCE_CONFIDENCE: f64 = 0.60;
3535
/// Minimum number of UNIQUE categories across strong propositions
36-
/// (prevents "debug-architecture-geopolitics" recycling)
37-
const MIN_UNIQUE_CATEGORIES: usize = 4;
36+
/// (prevents single-domain noise — but 2 domains is enough for cross-domain)
37+
const MIN_UNIQUE_CATEGORIES: usize = 2;
3838

3939
/// A discovery worthy of publishing.
4040
///
@@ -165,8 +165,8 @@ impl Discovery {
165165
&& self.propositions_extracted >= MIN_PROPOSITIONS
166166
&& self.sona_patterns >= MIN_SONA_PATTERNS
167167
&& self.pareto_growth >= MIN_PARETO_GROWTH
168-
&& strong.len() >= 3 // Must have at least 3 non-trivial inferences
169-
&& strong_props.len() >= 5 // Must have at least 5 substantive propositions
168+
&& strong.len() >= 1 // Must have at least 1 non-trivial inference
169+
&& strong_props.len() >= 2 // Must have at least 2 substantive propositions
170170
&& diversity >= MIN_UNIQUE_CATEGORIES // Must span multiple domains
171171
}
172172

@@ -228,7 +228,7 @@ impl GistPublisher {
228228
Some(Self {
229229
token,
230230
last_publish: Mutex::new(None),
231-
min_interval: Duration::from_secs(259200), // 3 day minimum between gists
231+
min_interval: Duration::from_secs(86400), // 1 day minimum between gists
232232
published_count: Mutex::new(0),
233233
published_titles: Mutex::new(Vec::new()),
234234
})

0 commit comments

Comments
 (0)