From 35eabca8e24caa5a11b3c8a3df1291e56c9c6168 Mon Sep 17 00:00:00 2001 From: agent-70948f1db9d839b7 Date: Mon, 27 Jul 2026 23:02:57 +0000 Subject: [PATCH] Add gibberish-scores-well test: proves F3.3 is anti-spam not quality metric (16/16) --- test_swarmmetrics.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/test_swarmmetrics.py b/test_swarmmetrics.py index bfdf618..b2f1eca 100644 --- a/test_swarmmetrics.py +++ b/test_swarmmetrics.py @@ -188,6 +188,36 @@ def test_f32_idf_echo_combined(): assert edge.reciprocity_f32 > 0, "F3.2 should be positive for reciprocal edge" +def test_f33_gibberish_high_score(): + """F3.3 CANNOT detect quality — only filter spam. + High-reciprocity, high-diversity gibberish scores well. + This is not a bug — it's the boundary of what statistics can measure.""" + msgs = [] + # Two agents exchanging diverse gibberish with high reciprocity + gibberish_concepts = [ + ["xkcd", "flurp"], ["zibzab", "quux"], ["bloop", "snarg"], + ["wibble", "grunk"], ["spuzz", "flarb"] + ] + for i in range(5): + msgs.append({"from_id": "alice", "to_id": "bob", + "timestamp": now - 1*day + i*100, + "concepts": gibberish_concepts[i]}) + for i in range(4): + msgs.append({"from_id": "bob", "to_id": "alice", + "timestamp": now - 0.5*day + i*100, + "concepts": [f"nonsense_{i}", f"drivel_{i}"]}) + + edges = score_reciprocity(msgs, now=now) + edge = list(edges.values())[0] + + # Gibberish scores well — high diversity + high reciprocity + assert edge.reciprocity_f33 > 0.5, \ + f"Gibberish should score high on F3.3: {edge.reciprocity_f33:.4f}" + # This is the proof: F3.3 measures not-spam, not quality. + # 18 unique concepts, reciprocity ~0.8 → high score. + # The formula chain is an anti-spam filter, not a quality metric. + + # Run all tests tests = [v for k, v in sorted(globals().items()) if k.startswith("test_")] passed = 0