From 3e8817efeff7d23ddbd3ff9237dedc359b0e4f60 Mon Sep 17 00:00:00 2001 From: Research Assistant Date: Thu, 7 May 2026 19:01:01 +0800 Subject: [PATCH] fix(46-index-path-resolution): remove unnecessary Windows backslash replace in discussion.py (PATH-06) - ai_path_str from canonical index already uses forward slashes (per PATH-01) - pathlib.Path on Windows handles forward slashes natively - os.name conditional and replace('/','\\') were unnecessary noise --- paperforge/worker/discussion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paperforge/worker/discussion.py b/paperforge/worker/discussion.py index d40a1f22..041ae66e 100644 --- a/paperforge/worker/discussion.py +++ b/paperforge/worker/discussion.py @@ -99,7 +99,7 @@ def _build_ai_dir(vault: Path, domain: str, key: str, title: str) -> Path: lit_root = paths["literature"] except Exception: # Fallback to default structure if config loading fails - lit_root = vault / "03_Resources" / "Literature" + lit_root = vault / "Resources" / "Literature" title_slug = slugify_filename(title) if title else key ai_dir = lit_root / domain / f"{key} - {title_slug}" / "ai" return ai_dir @@ -263,7 +263,7 @@ def record_session( # --- Build paths (WS-03: use ai_path from canonical index) --- ai_path_str = meta.get("ai_path", "") if ai_path_str: - ai_dir = vault_path / ai_path_str.replace("/", "\\") if os.name == "nt" else vault_path / ai_path_str + ai_dir = vault_path / ai_path_str else: # Fallback: construct from metadata ai_dir = _build_ai_dir(vault_path, domain, zotero_key, paper_title)