feat: sync version-driven intel coverage
这个提交包含在:
@@ -3,7 +3,18 @@ from __future__ import annotations
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, List
|
||||
|
||||
from intel.config import ENTITIES_DIR, FRAMEWORK_ROOT, GENERATED_DIR, REGISTRY_ROOT, REPRO_MAP_PATH, ROOT, SECURE_CODE_ROOT, SOURCE_MAP_PATH, SYSTEMS_DIR
|
||||
from intel.config import (
|
||||
ENTITIES_DIR,
|
||||
FRAMEWORK_ROOT,
|
||||
GENERATED_DIR,
|
||||
REGISTRY_ROOT,
|
||||
REPRO_MAP_PATH,
|
||||
ROOT,
|
||||
SECURE_CODE_ROOT,
|
||||
SOURCE_MAP_PATH,
|
||||
SYSTEMS_DIR,
|
||||
VERSIONS_DIR,
|
||||
)
|
||||
from intel.render import LANGUAGES, TOPIC_DESCRIPTIONS
|
||||
from intel.utils import load_all_json
|
||||
|
||||
@@ -34,10 +45,33 @@ REQUIRED_ENTITY_FIELDS = {
|
||||
"category",
|
||||
"status",
|
||||
"history_policy",
|
||||
"latest_version",
|
||||
"latest_release_at",
|
||||
"latest_release_url",
|
||||
"version_source_refs",
|
||||
"version_sync_status",
|
||||
"security_version_count",
|
||||
"last_version_synced_at",
|
||||
"latest_version_evidence",
|
||||
"latest_sync_status",
|
||||
"official_source_covered",
|
||||
}
|
||||
|
||||
REQUIRED_VERSION_FIELDS = {
|
||||
"version_id",
|
||||
"entity_id",
|
||||
"root_system_id",
|
||||
"version",
|
||||
"released_at",
|
||||
"release_url",
|
||||
"source_name",
|
||||
"source_confidence",
|
||||
"security_relevant",
|
||||
"reason",
|
||||
"advisory_refs",
|
||||
"is_latest_snapshot",
|
||||
}
|
||||
|
||||
REQUIRED_SYSTEM_FIELDS = {
|
||||
"system_id",
|
||||
"display_name",
|
||||
@@ -62,6 +96,11 @@ REQUIRED_SOURCE_FIELDS = {
|
||||
"request_policy",
|
||||
"health_policy",
|
||||
"parser_hints",
|
||||
"purpose",
|
||||
"entity_type_hint",
|
||||
"auto_catalog",
|
||||
"version_mode",
|
||||
"release_selector",
|
||||
}
|
||||
|
||||
FORBIDDEN_RUNTIME_PATTERNS = [
|
||||
@@ -133,6 +172,14 @@ def validate(source_map: Dict[str, Any]) -> List[str]:
|
||||
if missing:
|
||||
errors.append(f"entity registry missing fields: {item.get('entity_id', 'unknown')} -> {sorted(missing)}")
|
||||
|
||||
version_items = load_all_json(VERSIONS_DIR)
|
||||
if not version_items:
|
||||
errors.append(f"version registry missing: {VERSIONS_DIR}")
|
||||
for item in version_items:
|
||||
missing = REQUIRED_VERSION_FIELDS - set(item.keys())
|
||||
if missing:
|
||||
errors.append(f"version registry missing fields: {item.get('version_id', 'unknown')} -> {sorted(missing)}")
|
||||
|
||||
for path in [
|
||||
GENERATED_DIR / "coverage-matrix.md",
|
||||
GENERATED_DIR / "latest-ingest.md",
|
||||
@@ -148,6 +195,11 @@ def validate(source_map: Dict[str, Any]) -> List[str]:
|
||||
GENERATED_DIR / "entity-queues.json",
|
||||
GENERATED_DIR / "entity-catalog-report.md",
|
||||
GENERATED_DIR / "entity-discovery-backlog.md",
|
||||
GENERATED_DIR / "version-completeness.json",
|
||||
GENERATED_DIR / "version-backlog.json",
|
||||
GENERATED_DIR / "release-index.json",
|
||||
GENERATED_DIR / "version-sync-report.md",
|
||||
GENERATED_DIR / "lab-enqueue-summary.json",
|
||||
GENERATED_DIR / "dashboard" / "index.html",
|
||||
GENERATED_DIR / "dashboard" / "overview" / "index.html",
|
||||
GENERATED_DIR / "dashboard" / "runs" / "index.html",
|
||||
@@ -179,6 +231,7 @@ def validate(source_map: Dict[str, Any]) -> List[str]:
|
||||
GENERATED_DIR / "dashboard" / "docs" / "retired-sources.html",
|
||||
GENERATED_DIR / "dashboard" / "docs" / "entity-catalog-report.html",
|
||||
GENERATED_DIR / "dashboard" / "docs" / "entity-discovery-backlog.html",
|
||||
GENERATED_DIR / "dashboard" / "docs" / "version-sync-report.html",
|
||||
GENERATED_DIR / "dashboard" / "docs" / "repro-map.html",
|
||||
GENERATED_DIR / "dashboard" / "docs" / "coverage-matrix.html",
|
||||
GENERATED_DIR / "dashboard" / "docs" / "design-source.html",
|
||||
@@ -191,6 +244,10 @@ def validate(source_map: Dict[str, Any]) -> List[str]:
|
||||
GENERATED_DIR / "dashboard" / "data" / "entity-completeness.json",
|
||||
GENERATED_DIR / "dashboard" / "data" / "entity-discovery-backlog.json",
|
||||
GENERATED_DIR / "dashboard" / "data" / "entity-queues.json",
|
||||
GENERATED_DIR / "dashboard" / "data" / "version-completeness.json",
|
||||
GENERATED_DIR / "dashboard" / "data" / "version-backlog.json",
|
||||
GENERATED_DIR / "dashboard" / "data" / "release-index.json",
|
||||
GENERATED_DIR / "dashboard" / "data" / "lab-enqueue-summary.json",
|
||||
ROOT / "docs" / "testing-completeness-report.md",
|
||||
ROOT / "08-threat-intel" / "registry" / "source-confidence.md",
|
||||
]:
|
||||
|
||||
在新工单中引用
屏蔽一个用户