atlasbot: fix insight scoring

This commit is contained in:
Brad Stein 2026-01-27 23:49:28 -03:00
parent a10050e4c7
commit 2d90005076
2 changed files with 9 additions and 1 deletions

View File

@ -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"

View File

@ -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]],
*,