更新: 11 个文件 - 2026-03-17 21:30:02
这个提交包含在:
@@ -17,7 +17,7 @@ from intel.normalize import normalize_candidates # noqa: E402
|
||||
from intel.pr import open_pr # noqa: E402
|
||||
from intel.render import render_case_pages, render_generated, render_registry, render_secure_code, render_system_scaffolding # noqa: E402
|
||||
from intel.route import route_advisories # noqa: E402
|
||||
from intel.sources.runner import collect_candidates # noqa: E402
|
||||
from intel.sources.runner import collect_candidates, probe_sources # noqa: E402
|
||||
from intel.utils import isoformat, load_all_json, now_utc, parse_since, read_json, write_json # noqa: E402
|
||||
from intel.validators import validate # noqa: E402
|
||||
|
||||
@@ -167,19 +167,11 @@ def cmd_render(args) -> int:
|
||||
def cmd_source_health(args) -> int:
|
||||
full_source_map = load_source_map()
|
||||
source_map = _filter_source_map(full_source_map, args.system)
|
||||
since_dt = parse_since(args.since, default_days=30)
|
||||
candidates, failures = collect_candidates(
|
||||
source_map,
|
||||
since_dt=since_dt,
|
||||
tier=args.tier,
|
||||
include_undated=args.include_undated,
|
||||
)
|
||||
probes, failures = probe_sources(source_map, tier=args.tier)
|
||||
render_map, advisories, triage = _load_existing_selection(full_source_map, source_map)
|
||||
existing_summary = read_json(GENERATED_DIR / "run-summary.json", default={}) or {}
|
||||
render_generated(render_map, advisories, triage, failures, existing_summary)
|
||||
print(
|
||||
f"Source health checked {len(candidates)} candidates across {len(source_map['systems'])} systems; failures {len(failures)}"
|
||||
)
|
||||
print(f"Source health checked {len(probes)} sources across {len(source_map['systems'])} systems; failures {len(failures)}")
|
||||
for failure in failures:
|
||||
print(f"- {failure}")
|
||||
return 0 if not failures else 1
|
||||
@@ -303,9 +295,7 @@ def main() -> int:
|
||||
render.set_defaults(func=cmd_render)
|
||||
|
||||
source_health = subparsers.add_parser("source-health", help="Check source adapter health without mutating registry advisories")
|
||||
source_health.add_argument("--since", default="30d")
|
||||
source_health.add_argument("--tier", choices=["history-full", "rolling-24m"])
|
||||
source_health.add_argument("--include-undated", action="store_true")
|
||||
source_health.add_argument("--system", action="append")
|
||||
source_health.set_defaults(func=cmd_source_health)
|
||||
|
||||
|
||||
在新工单中引用
屏蔽一个用户