Optimierter Workflow
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user