chore: checkpoint uncommitted work before session store fix

Pre-existing work-in-progress in the tree: karakeep, snippets,
skills-health and redaction ingesters, the opencode.db session sweep,
gossip and metrics changes. Checkpointed as-is so the adapter fix in the
next commit stays reviewable on its own.
This commit is contained in:
2026-11-01 13:33:36 -08:00
parent bb852faa27
commit 0b8ac34aee
43 changed files with 6771 additions and 419 deletions
+6 -5
View File
@@ -251,18 +251,19 @@ func (idx *TFIDFIndex) Cluster(minSharedTerms int, maxTopics int) []TopicCluster
return clusters
}
// Gaps finds topics with high browser activity but no skill coverage
// Gaps finds topics with browsing/bookmark activity but no skill coverage.
func (idx *TFIDFIndex) Gaps(clusters []TopicCluster, skillKeywords map[string]bool) []TopicCluster {
activityScore := func(c TopicCluster) int {
return c.BySource["browser-history"] + c.BySource["karakeep"]
}
var gaps []TopicCluster
for _, c := range clusters {
browserScore := c.BySource["browser-history"]
skillScore := c.BySource["skills-catalog"]
if browserScore > 0 && skillScore == 0 {
if activityScore(c) > 0 && c.BySource["skills-catalog"] == 0 {
gaps = append(gaps, c)
}
}
sort.Slice(gaps, func(i, j int) bool {
return gaps[i].BySource["browser-history"] > gaps[j].BySource["browser-history"]
return activityScore(gaps[i]) > activityScore(gaps[j])
})
return gaps
}