Optimierter Workflow

This commit is contained in:
2026-08-07 21:55:54 +02:00
parent dc2af7ca75
commit ffee925163
26 changed files with 1128 additions and 131 deletions
+13 -2
View File
@@ -67,18 +67,24 @@ func (e *Engine) researchEvidenceForSources(sources []articleSource) []model.Res
}
snapshot := e.Graph.Snapshot()
externalIDs := map[string]bool{}
groundedByIDs := map[string]bool{}
for _, edge := range snapshot.Edges {
if edge.Status == "rejected" {
continue
}
switch edge.Type {
case "research_evidence":
// Legacy research_evidence edges are only candidate links. They may
// originate from versions that materialised every fetched page before
// final article review. Keep them as lookup candidates, but require the
// external node itself to carry validation_state=grounded below.
if sourceIDs[edge.Target] {
externalIDs[edge.Source] = true
}
case "grounded_by":
if sourceIDs[edge.Source] {
externalIDs[edge.Target] = true
groundedByIDs[edge.Target] = true
}
}
}
@@ -88,9 +94,14 @@ func (e *Engine) researchEvidenceForSources(sources []articleSource) []model.Res
nodes := make([]model.Node, 0, len(externalIDs))
filter := e.effectiveThinkingFilter()
for _, node := range snapshot.Nodes {
if externalIDs[node.ID] && node.Kind == "external" && filter.Matches(node) {
nodes = append(nodes, node)
if !externalIDs[node.ID] || node.Kind != "external" || !filter.Matches(node) {
continue
}
validationState := strings.ToLower(strings.TrimSpace(metadataString(node.Metadata, "validation_state")))
if !groundedByIDs[node.ID] && validationState != "grounded" {
continue
}
nodes = append(nodes, node)
}
sort.SliceStable(nodes, func(i, j int) bool {
if nodes[i].Weight == nodes[j].Weight {