(
*,
user_id: str,
push_id: str,
paper_number: int,
paper: Dict[str, Any],
action: str,
action_type: str,
category: str,
)
| 2272 | def get_daily_push_task(task_id: str = "", user_id: str = "") -> Dict[str, Any]: |
| 2273 | with _DAILY_TASK_LOCK: |
| 2274 | task = _DAILY_TASKS.get(str(task_id or "").strip()) |
| 2275 | if task is None and str(user_id or "").strip(): |
| 2276 | task = _DAILY_TASKS.get(_DAILY_TASK_BY_USER.get(str(user_id).strip(), "")) |
| 2277 | return {"task": _daily_task_payload(task) if task else None} |
| 2278 | |
| 2279 | |
| 2280 | def load_latest_push(user_id: str) -> Dict[str, Any]: |
| 2281 | return {"push": _push_payload(db_ops.get_latest_push(user_id))} |
| 2282 | |
| 2283 | |
| 2284 | def _log_feedback_event( |
| 2285 | *, |
| 2286 | user_id: str, |
| 2287 | push_id: str, |
| 2288 | paper_number: int, |
| 2289 | paper: Dict[str, Any], |
| 2290 | action: str, |
| 2291 | action_type: str, |
| 2292 | category: str, |
| 2293 | ) -> int: |
| 2294 | metadata = { |
| 2295 | "paper_number": paper_number, |
| 2296 | "arxiv_id": paper.get("arxiv_id"), |
| 2297 | "push_context": "desktop_gui", |
| 2298 | "selection_state": action_type, |
| 2299 | } |
| 2300 | behavior_log_id = db_ops.log_behavior( |
| 2301 | user_id=user_id, |
| 2302 | push_id=push_id, |
| 2303 | paper_id=paper.get("id"), |
| 2304 | action=action, |
| 2305 | action_type=action, |
| 2306 | category=category, |
| 2307 | metadata=metadata, |
| 2308 | ) |
| 2309 | feedback_agent.ingest_feedback_to_wiki( |
| 2310 | user_id=user_id, |
| 2311 | push_id=push_id, |
| 2312 | paper=paper, |
no test coverage detected