实现分层实体漏洞知识库与实体级完整度监控

这个提交包含在:
hao
2026-03-19 17:57:45 -07:00
父节点 49fe46ab89
当前提交 1e81279e32
修改 2712 个文件,包含 434447 行新增2774 行删除

查看文件

@@ -6,6 +6,7 @@ from typing import Any, Dict, List
from intel.config import (
ALERTS_PATH,
ENTITY_COMPLETENESS_PATH,
MACHINE_READABLE_SOURCE_KINDS,
MONITORING_DIR,
MONITOR_SUMMARY_PATH,
@@ -363,6 +364,7 @@ def write_monitoring_state(
) -> Dict[str, Any]:
open_alerts = [item for item in alerts if item.get("status") == "open"]
generated_at = source_health.get("generated_at") or isoformat(now_utc())
entity_completeness = read_json(ENTITY_COMPLETENESS_PATH, default={}) or {}
summary = {
"generated_at": generated_at,
"active_source_count": source_health.get("active_source_count", 0),
@@ -387,6 +389,14 @@ def write_monitoring_state(
"error_count": len(validation_errors),
"errors": validation_errors,
},
"entity_coverage": {
"cataloged_entity_total": entity_completeness.get("cataloged_entity_total", 0),
"candidate_entity_total": entity_completeness.get("candidate_entity_total", 0),
"history_full_complete_count": entity_completeness.get("history_full_complete_count", 0),
"workflow_complete_count": entity_completeness.get("workflow_complete_count", 0),
"version_mapped_count": entity_completeness.get("version_mapped_count", 0),
"official_source_covered_count": entity_completeness.get("official_source_covered_count", 0),
},
}
snapshot = {
"generated_at": generated_at,