From 15c766f0ecb97a484b2a1547577074adc60c8912 Mon Sep 17 00:00:00 2001 From: Raphael Southall <69826455+raphasouthall@users.noreply.github.com> Date: Sun, 23 Aug 2026 18:57:08 +0100 Subject: [PATCH] fix(synthesize): bump SIBLING_THRESHOLD default to 0.75 Live runs 2026-08-23: 0.65 cross-linked unrelated topics and pulled a credential-bearing memory into a cluster; 0.75 gave 10 tight clusters whose 5 live learnings (1834-1838) read well. Calibration comment updated with the evidence. Part of #111 --- src/neurostack/synthesize.py | 7 +++++-- tests/test_synthesize.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/neurostack/synthesize.py b/src/neurostack/synthesize.py index ac91d14..0a26df9 100644 --- a/src/neurostack/synthesize.py +++ b/src/neurostack/synthesize.py @@ -38,10 +38,13 @@ DEFAULT_MIN_SIBLINGS = 3 # Live-calibrated on the prod embedder (embeddinggemma:300m) against the real # memory store: 0.35-0.55 chains dense early-harvest noise into 100+ member -# mega-clusters; 0.65 yields coherent 4-15 member topic groups. Paraphrases +# mega-clusters; 0.65 still cross-linked unrelated topics (one cluster mixed +# neurostack-cloud, KPI-dashboard, AFD, firewall and Citrix observations) and +# pulled credential-bearing rows along; 0.75 yields tight same-topic groups +# whose live learnings read well (issue #111, run of 2026-08-23). Paraphrases # (~0.93) are handled earlier by harvest dedup — synthesis clusters are the # same-topic tier. -SIBLING_THRESHOLD = 0.65 +SIBLING_THRESHOLD = 0.75 # Hard per-cluster member ceiling: one learning cannot faithfully preserve the # facts of an unbounded heap, and the prompt must stay bounded. Oversized # clusters keep the anchor plus its most similar members; the rest stay diff --git a/tests/test_synthesize.py b/tests/test_synthesize.py index f1e513d..963c893 100644 --- a/tests/test_synthesize.py +++ b/tests/test_synthesize.py @@ -152,7 +152,7 @@ def test_missing_embeddings_counted_not_dropped(self, in_memory_db): assert len(clusters) == 1 def test_threshold_default_live_calibrated(self): - assert SIBLING_THRESHOLD == 0.65 + assert SIBLING_THRESHOLD == 0.75 def test_oversized_cluster_capped_keeps_anchor_and_most_similar( self, in_memory_db):