fix: add zotero_dir to paperforge_paths() for PDF resolution; fix L3 diagnostic to skip schema check without file upload

This commit is contained in:
Research Assistant 2026-04-27 21:12:29 +08:00
parent ee260e05f5
commit 2bfbec691e
3 changed files with 12 additions and 4 deletions

View file

@ -258,6 +258,10 @@ def paperforge_paths(
bases = vault / base_dir
skill_path = vault / skill_dir
zotero_dir_val = os.environ.get("ZOTERO_DATA_DIR", "").strip()
if not zotero_dir_val:
zotero_dir_val = str(system / "Zotero")
# worker_script: paperforge worker package (pipeline/ removed in v1.3)
worker_script = Path(__file__).parent / "worker" / "__init__.py"
# ld_deep_script: look relative to skill_dir first, then repo paperforge/skills for dev
@ -278,6 +282,7 @@ def paperforge_paths(
"paperforge": paperforge,
"exports": paperforge / "exports",
"ocr": paperforge / "ocr",
"zotero_dir": Path(zotero_dir_val),
"resources": resources,
"literature": literature,
"control": control,

View file

@ -111,12 +111,14 @@ def ocr_doctor(config: dict[str, str] | None, live: bool = False) -> dict:
)
except Exception:
pass # ignore cancel failure
except requests.RequestException as e:
except requests.RequestException:
# Without a real file upload the API will reject the request (4xx/5xx).
# This is expected — L2 already confirmed connectivity + token validity.
# Run `--live` for a full upload round-trip test.
return {
"level": 3,
"passed": False,
"error": f"API submission test failed: {e}",
"fix": "Check PADDLEOCR configuration and network. Run `paperforge ocr --diagnose` again after fixes.",
"passed": True,
"message": "Skipped (requires file upload). Use `paperforge ocr --diagnose --live` for full validation.",
}
except (json.JSONDecodeError, KeyError) as e:
return {

View file

@ -310,6 +310,7 @@ def test_paperforge_paths_returns_exact_keys(tmp_path: Path):
"paperforge",
"exports",
"ocr",
"zotero_dir",
"resources",
"literature",
"control",