From 2d900050767a79c476f10befc4c2c22739f7500d Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Tue, 27 Jan 2026 23:49:28 -0300 Subject: [PATCH] atlasbot: fix insight scoring --- services/comms/atlasbot-deployment.yaml | 2 +- services/comms/scripts/atlasbot/bot.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/services/comms/atlasbot-deployment.yaml b/services/comms/atlasbot-deployment.yaml index b08f20d..26699b3 100644 --- a/services/comms/atlasbot-deployment.yaml +++ b/services/comms/atlasbot-deployment.yaml @@ -16,7 +16,7 @@ spec: labels: app: atlasbot annotations: - checksum/atlasbot-configmap: manual-atlasbot-82 + checksum/atlasbot-configmap: manual-atlasbot-83 vault.hashicorp.com/agent-inject: "true" vault.hashicorp.com/role: "comms" vault.hashicorp.com/agent-inject-secret-turn-secret: "kv/data/atlas/comms/turn-shared-secret" diff --git a/services/comms/scripts/atlasbot/bot.py b/services/comms/scripts/atlasbot/bot.py index 7e6341e..dd6ea2e 100644 --- a/services/comms/scripts/atlasbot/bot.py +++ b/services/comms/scripts/atlasbot/bot.py @@ -2724,6 +2724,14 @@ def _insight_score( return base +def _score_insight(insight: dict[str, Any], preference: str) -> float: + relevance = _normalize_fraction(insight.get("relevance"), default=0.6) + novelty = _normalize_fraction(insight.get("novelty"), default=0.5) + if preference == "novelty": + return novelty * 0.6 + relevance * 0.4 + return relevance * 0.6 + novelty * 0.4 + + def _select_diverse_insights( candidates: list[dict[str, Any]], *,