|
|
@@ -203,10 +203,6 @@ def _match_threshold(score: int | float | None, thresholds: list[dict[str, Any]]
|
|
|
|
|
|
|
|
|
def _get_path(data: dict[str, Any], path: str) -> Any:
|
|
|
- if path == "content_engagement_metrics.statistics.total_interactions":
|
|
|
- statistics = _get_path(data, "content_engagement_metrics.statistics")
|
|
|
- if isinstance(statistics, dict):
|
|
|
- return _total_interactions(statistics)
|
|
|
current: Any = data
|
|
|
for part in path.split("."):
|
|
|
if not part:
|
|
|
@@ -394,11 +390,6 @@ def _gate_replay(gate: dict[str, Any]) -> dict[str, Any]:
|
|
|
}
|
|
|
|
|
|
|
|
|
-def _total_interactions(statistics: dict[str, Any]) -> int:
|
|
|
- keys = ["digg_count", "comment_count", "share_count", "collect_count"]
|
|
|
- return sum(int(statistics.get(key) or 0) for key in keys)
|
|
|
-
|
|
|
-
|
|
|
def _evidence_refs(rule_pack: dict[str, Any]) -> list[str]:
|
|
|
refs = ["source_evidence"]
|
|
|
for field in rule_pack.get("input_contract", {}).get("required_fields", []):
|