MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _backfill_docs_to_wiki

Function _backfill_docs_to_wiki

deployments/desktop/shared/agents.py:2419–2454  ·  view source on GitHub ↗

Best-effort Wiki ingest for reused reading reports returned by the GUI.

(user_id: str, docs: Iterable[Dict[str, Any]])

Source from the content-addressed store, hash-verified

2417 # _DAILY_TASK_LOCK immediately, so starting it here would deadlock against
2418 # the block above. payload is already a snapshot taken under the lock.
2419 thread.start()
2420 return {"task": payload, "already_running": False}
2421
2422
2423def get_daily_push_task(task_id: str = "", user_id: str = "") -> Dict[str, Any]:
2424 with _DAILY_TASK_LOCK:
2425 task = _DAILY_TASKS.get(str(task_id or "").strip())
2426 if task is None and str(user_id or "").strip():
2427 task = _DAILY_TASKS.get(_DAILY_TASK_BY_USER.get(str(user_id).strip(), ""))
2428 return {"task": _daily_task_payload(task) if task else None}
2429
2430
2431def load_latest_push(user_id: str) -> Dict[str, Any]:
2432 return {"push": _push_payload(db_ops.get_latest_push(user_id))}
2433
2434
2435def _log_feedback_event(
2436 *,
2437 user_id: str,
2438 push_id: str,
2439 paper_number: int,
2440 paper: Dict[str, Any],
2441 action: str,
2442 action_type: str,
2443 category: str,
2444) -> int:
2445 metadata = {
2446 "paper_number": paper_number,
2447 "arxiv_id": paper.get("arxiv_id"),
2448 "push_context": "desktop_gui",
2449 "selection_state": action_type,
2450 }
2451 behavior_log_id = db_ops.log_behavior(
2452 user_id=user_id,
2453 push_id=push_id,
2454 paper_id=paper.get("id"),
2455 action=action,
2456 action_type=action,
2457 category=category,

Callers 3

create_reading_reportsFunction · 0.85
read_arxivFunction · 0.85
read_local_pdfFunction · 0.85

Calls 3

_resolve_project_pathFunction · 0.85
_extract_frontmatterFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected