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:
1 parent
6b18845939
commit
b39284f1c6
3 files changed
+26
-27
No files matched your search
+8
-9
@@ -412,6 +412,12 @@ func (t *ToolSet) graphOverviewData() map[string]any {
|
||||
}
|
||||
out["running_intents"] = compactIntents(running, parentsOf, yieldsOf)
|
||||
out["recent_done_intents"] = compactIntents(recentDone, parentsOf, yieldsOf)
|
||||
// done_intents_total:已结束意图(done/blocked/exhausted)总数,与 recent_done_intents
|
||||
// 平行命名——后者只是它的最新窗口(≤15)截断视图。两键并排即自描述:"看到的是 N/总数",
|
||||
// 让 planner 去重时别把"没显示"当成"没派过",无需在提示词里另行解释。
|
||||
if dt, err := t.ts.CountFinishedIntents(); err == nil {
|
||||
out["done_intents_total"] = dt
|
||||
}
|
||||
out["frontier_open"] = len(fr)
|
||||
// findings (confirmed vulns) and facts (worker exploration results) are
|
||||
// now distinct node kinds. recent_facts surfaces fact summaries (esp.
|
||||
@@ -532,16 +538,9 @@ func (t *ToolSet) graphOverviewData() map[string]any {
|
||||
m["scope"] = scope
|
||||
}
|
||||
if hosts, err := t.as.HostsByTaskWithSources(t.taskID); err == nil {
|
||||
const hostContextLimit = 500
|
||||
visible := hosts
|
||||
if len(visible) > hostContextLimit {
|
||||
visible = visible[:hostContextLimit]
|
||||
}
|
||||
m["hosts"] = visible
|
||||
// 只给主机总数,不再把 host 列表平铺进 graph_overview(大范围任务里那是每轮
|
||||
// 都重复携带的大量字符串,对规划决策价值有限);具体主机按需 list_assets 查。
|
||||
m["host_count"] = len(hosts)
|
||||
if len(visible) < len(hosts) {
|
||||
m["hosts_truncated"] = true
|
||||
}
|
||||
}
|
||||
if len(m) > 0 {
|
||||
out["coverage"] = m
|
||||
|
||||
Reference in new issue
Block a user