refactor(overview): graph_overview 不再平铺 hosts,新增 done_intents_total

- coverage 块移除 hosts 列表(大范围任务里每轮携带最多 500 个 host 字符串,
  对规划决策价值有限),只保留 host_count;具体主机按需 list_assets 查
- 新增顶层 done_intents_total:已结束意图(done/blocked/exhausted)总数,与
  recent_done_intents(≤15 截断视图)平行命名,让 planner 去重时知道有无被截,
  key 即自描述、无需写进提示词
- db: 新增 ExplorationStore.CountFinishedIntents
- 测试:blackboard 继承用例改用 host_count 断言,移除随之无用的 containsString
This commit is contained in:
Autumn-27 committed 2026-09-08 11:19:18 -04:00
1 parent 6b18845939
commit b39284f1c6
3 files changed
+26 -27

No files matched your search

+12
View File
@@ -706,6 +706,18 @@ func (s *ExplorationStore) countByKindFiltered(kind, q string) (int, error) {
return n, err
}
// CountFinishedIntents counts this exploration's intents in a terminal explored
// state (done/blocked/exhausted) — graph_overview's done_intents_total, so the planner
// knows recent_done_intents (capped at a recent window) is a truncated view and
// stays cautious about "already tried" dedup. Excludes 'stopped' (killed/deleted),
// matching exactly what recent_done_intents surfaces.
func (s *ExplorationStore) CountFinishedIntents() (int, error) {
var n int
err := s.db.QueryRow(`SELECT COUNT(*) FROM exploration_nodes
WHERE exploration_id=$1 AND kind='intent' AND state IN ('done','blocked','exhausted')`, s.expID).Scan(&n)
return n, err
}
// GetNode returns one node of this exploration by id (nil, nil if not found).
func (s *ExplorationStore) GetNode(id int64) (*Node, error) {
n, err := scanNode(s.db.QueryRow(`SELECT `+nodeCols+` FROM exploration_nodes WHERE id=$1 AND exploration_id=$2`, id, s.expID))