From 00692ef667ee149d6d9b3136b2e607d58179472d Mon Sep 17 00:00:00 2001 From: Research Assistant Date: Mon, 27 Apr 2026 15:15:43 +0800 Subject: [PATCH] feat(13-logging-foundation): add verbose param to worker function signatures - run_selection_sync(vault) -> run_selection_sync(vault, verbose=False) - run_index_refresh(vault) -> run_index_refresh(vault, verbose=False) - run_ocr(vault) -> run_ocr(vault, verbose=False) - run_doctor(vault) -> run_doctor(vault, verbose=False) - run_status(vault) -> run_status(vault, verbose=False) - Backward compatible: default False preserves existing call sites --- paperforge/worker/ocr.py | 2 +- paperforge/worker/status.py | 4 ++-- paperforge/worker/sync.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/paperforge/worker/ocr.py b/paperforge/worker/ocr.py index 4928edc2..aff24b54 100644 --- a/paperforge/worker/ocr.py +++ b/paperforge/worker/ocr.py @@ -1217,7 +1217,7 @@ def postprocess_ocr_result(vault: Path, key: str, all_results: list[dict]) -> tu fulltext_md_path = str(fulltext_path.resolve()) return (page_num, markdown_path, json_path, fulltext_md_path) -def run_ocr(vault: Path) -> int: +def run_ocr(vault: Path, verbose: bool = False) -> int: from paperforge.pdf_resolver import resolve_pdf_path paths = pipeline_paths(vault) cleanup_blocked_ocr_dirs(paths) diff --git a/paperforge/worker/status.py b/paperforge/worker/status.py index 0a5481d8..fce4a244 100644 --- a/paperforge/worker/status.py +++ b/paperforge/worker/status.py @@ -378,7 +378,7 @@ def check_wikilink_format(vault: Path, paths: dict, add_check) -> None: ) -def run_doctor(vault: Path) -> int: +def run_doctor(vault: Path, verbose: bool = False) -> int: """Validate PaperForge Lite setup and report by category. Returns: @@ -563,7 +563,7 @@ def _is_junction(path: Path) -> bool: return False -def run_status(vault: Path) -> int: +def run_status(vault: Path, verbose: bool = False) -> int: """Print a compact Lite install/runtime status.""" paths = pipeline_paths(vault) cfg = load_vault_config(vault) diff --git a/paperforge/worker/sync.py b/paperforge/worker/sync.py index e9dfb1cb..3b04e955 100644 --- a/paperforge/worker/sync.py +++ b/paperforge/worker/sync.py @@ -808,7 +808,7 @@ def load_control_actions(paths: dict[str, Path]) -> dict[str, dict]: actions[zotero_key] = {'analyze': row.get('analyze', False), 'do_ocr': row.get('do_ocr', False)} return actions -def run_selection_sync(vault: Path) -> int: +def run_selection_sync(vault: Path, verbose: bool = False) -> int: from paperforge.worker.base_views import ensure_base_views from paperforge.worker.ocr import validate_ocr_meta paths = pipeline_paths(vault) @@ -1355,7 +1355,7 @@ def frontmatter_note(entry: dict, existing_text: str='') -> str: def analyze_selected_keys(paths: dict[str, Path]) -> set[str]: return {key for key, row in load_control_actions(paths).items() if row.get('analyze')} -def run_index_refresh(vault: Path) -> int: +def run_index_refresh(vault: Path, verbose: bool = False) -> int: from paperforge.worker.base_views import ensure_base_views from paperforge.worker.ocr import validate_ocr_meta paths = pipeline_paths(vault)