feat(digest): related_tasks 只读折叠(§2 跨任务)
关联/继承任务的概览现在复用其【自身的折叠视图】,与当前任务同逻辑: - relatedTaskOverviews 按 source 任务自己的 covered/hot 折出已折成员(recent_facts / recent_intent_results 跳过已折且仍冷的成员),并把该任务的 cold_digests(body)只读带出, 统一 inherited=true / source_task_id 标记。 - expand_digest 支持跨任务:先查本任务,再查直接关联任务(read-only),返回成员紧凑列表并 标继承;node_detail 已有的 GetNodeWithSources 负责成员完整还原。 - 复活检查同样生效:source 任务里已复活(转热)的被覆盖成员照常显示,不被折出。 至此设计文档 §2 跨任务折叠全部落地;仅 §2.3 墙钟兜底(任务停摆判稳)按既定作为后续。
This commit is contained in:
1 parent
eefd5ee2f2
commit
775189d916
2 files changed
+98
-11
No files matched your search
+23
-1
@@ -810,6 +810,9 @@ func (t *ToolSet) relatedTaskOverviews() []map[string]any {
|
||||
out := make([]map[string]any, 0, len(sources))
|
||||
for _, source := range sources {
|
||||
ts := source.Store
|
||||
// §2 cross-task: render the source task's OWN folded view — fold out the
|
||||
// members it has already folded, and surface its cold_digests read-only.
|
||||
hidden := hiddenMembersFor(ts)
|
||||
budget := overviewTextBudget{remaining: perSourceTextBudget}
|
||||
item := map[string]any{
|
||||
"source_task_id": source.Task.TaskID,
|
||||
@@ -884,6 +887,9 @@ func (t *ToolSet) relatedTaskOverviews() []map[string]any {
|
||||
item["recent_findings"] = recentFindings
|
||||
recentFacts := make([]map[string]any, 0, len(facts))
|
||||
for _, fact := range facts {
|
||||
if hidden(fact.ID) {
|
||||
continue // folded into this source's cold_digests — shown there (§2/§6.2)
|
||||
}
|
||||
m := inheritedMap(compactNode(fact), source.Task.TaskID)
|
||||
m["summary"] = budget.take(m["summary"], 400)
|
||||
if from := factFrom[fact.ID]; from > 0 && terminalIntent[from] {
|
||||
@@ -899,7 +905,14 @@ func (t *ToolSet) relatedTaskOverviews() []map[string]any {
|
||||
}
|
||||
item["recent_facts"] = recentFacts
|
||||
|
||||
recentDone := recentTerminalIntents(ts, relatedOverviewMaxIntentsPerTask)
|
||||
recentDoneRaw := recentTerminalIntents(ts, relatedOverviewMaxIntentsPerTask)
|
||||
recentDone := recentDoneRaw[:0] // in-place filter: drop this source's folded intents (§2)
|
||||
for _, intent := range recentDoneRaw {
|
||||
if hidden(intent.ID) {
|
||||
continue
|
||||
}
|
||||
recentDone = append(recentDone, intent)
|
||||
}
|
||||
for _, intent := range recentDone {
|
||||
intent.Inherited = true
|
||||
intent.SourceTaskID = source.Task.TaskID
|
||||
@@ -928,6 +941,15 @@ func (t *ToolSet) relatedTaskOverviews() []map[string]any {
|
||||
}
|
||||
}
|
||||
item["recent_intent_results"] = intentResults
|
||||
// §2 cross-task: the source task's folded cold region, read-only. Members are
|
||||
// resolvable via expand_digest(id)/node_detail(id), which search source tasks.
|
||||
if cds := activeDigestBodies(ts); len(cds) > 0 {
|
||||
for _, cd := range cds {
|
||||
cd["inherited"] = true
|
||||
cd["source_task_id"] = source.Task.TaskID
|
||||
}
|
||||
item["cold_digests"] = cds
|
||||
}
|
||||
if statsErr == nil {
|
||||
item["node_stats"] = stats
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user