增强系统级实体覆盖摘要与工作台索引

这个提交包含在:
hao
2026-03-20 08:47:16 -07:00
父节点 5e1ea395ef
当前提交 c3a853d2cf
修改 160 个文件,包含 26943 行新增5119 行删除

查看文件

@@ -599,19 +599,55 @@ def build_entity_views(source_map: Dict[str, Any], advisories: List[AdvisoryReco
"system_id": entity["root_system_id"],
"display_name": systems.get(entity["root_system_id"], {}).get("display_name", entity["root_system_id"]),
"cataloged_entity_total": 0,
"child_entity_total": 0,
"candidate_entity_total": 0,
"workflow_complete_count": 0,
"version_mapped_count": 0,
"official_source_covered_count": 0,
"history_full_complete_count": 0,
"latest_green_count": 0,
"version_gap_entity_count": 0,
"workflow_gap_entity_count": 0,
"plugin_total": 0,
"entity_type_counts": {},
"top_entities": [],
"backlog_preview": [],
},
)
summary["cataloged_entity_total"] += 1
if entity["entity_type"] != "system":
summary["child_entity_total"] += 1
summary["entity_type_counts"][entity["entity_type"]] = summary["entity_type_counts"].get(entity["entity_type"], 0) + 1
summary["workflow_complete_count"] += 1 if entity["advisory_count"] and entity["workflow_complete_advisory_count"] >= entity["advisory_count"] else 0
summary["version_mapped_count"] += 1 if entity["advisory_count"] and entity["version_mapped_advisory_count"] >= entity["advisory_count"] else 0
summary["official_source_covered_count"] += 1 if entity["official_source_covered"] else 0
summary["history_full_complete_count"] += 1 if entity.get("history_backfill_status") == "complete" else 0
summary["latest_green_count"] += 1 if entity.get("latest_sync_status") == "green" else 0
summary["version_gap_entity_count"] += 1 if entity.get("advisory_count") and entity.get("version_mapped_advisory_count", 0) < entity.get("advisory_count", 0) else 0
summary["workflow_gap_entity_count"] += 1 if entity.get("advisory_count") and entity.get("workflow_complete_advisory_count", 0) < entity.get("advisory_count", 0) else 0
if entity["entity_type"] in PLUGINISH_ENTITY_TYPES:
summary["plugin_total"] += 1
for system_id, summary in system_summary.items():
ranked_entities = sorted(
[
entity
for entity in entities.values()
if entity["root_system_id"] == system_id and entity["entity_type"] != "system"
],
key=lambda item: (-(item.get("advisory_count") or 0), item["entity_type"], item["display_name"].lower()),
)
summary["top_entities"] = [
{
"entity_id": entity["entity_id"],
"entity_type": entity["entity_type"],
"display_name": entity["display_name"],
"advisory_count": entity.get("advisory_count", 0),
"history_backfill_status": entity.get("history_backfill_status"),
"latest_sync_status": entity.get("latest_sync_status"),
}
for entity in ranked_entities[:5]
]
for candidate in candidate_backlog:
system_summary.setdefault(
candidate["root_system_id"],
@@ -619,13 +655,31 @@ def build_entity_views(source_map: Dict[str, Any], advisories: List[AdvisoryReco
"system_id": candidate["root_system_id"],
"display_name": systems.get(candidate["root_system_id"], {}).get("display_name", candidate["root_system_id"]),
"cataloged_entity_total": 0,
"child_entity_total": 0,
"candidate_entity_total": 0,
"workflow_complete_count": 0,
"version_mapped_count": 0,
"official_source_covered_count": 0,
"history_full_complete_count": 0,
"latest_green_count": 0,
"version_gap_entity_count": 0,
"workflow_gap_entity_count": 0,
"plugin_total": 0,
"entity_type_counts": {},
"top_entities": [],
"backlog_preview": [],
},
)["candidate_entity_total"] += 1
preview = system_summary[candidate["root_system_id"]]["backlog_preview"]
if len(preview) < 5:
preview.append(
{
"candidate_id": candidate["candidate_id"],
"display_name": candidate["display_name"],
"entity_type": candidate["entity_type"],
"risk": candidate["risk"],
}
)
cataloged_entities = [entity for entity in entities.values() if entity.get("status") == "cataloged"]
history_full_complete_count = len(