{"record":{"id":"fabf6d8dc70bfe76","repo":"nexu-io/open-design","slug":"source-not-found-path","errorCode":null,"errorMessage":"source not found: {path}","messagePattern":"source not found: (.+?)","errorType":"exception","errorClass":"FileNotFoundError","httpStatus":null,"severity":"error","filePath":"plugins/community/humanize-ppt/scripts/humanize_ppt_v2.py","lineNumber":199,"sourceCode":"        return None\n    if force or any((out / marker).exists() for marker in HUMANIZE_OUT_MARKERS):\n        shutil.rmtree(out)\n        out.mkdir(parents=True, exist_ok=True)\n        return None\n    marker_list = \" or \".join(HUMANIZE_OUT_MARKERS)\n    return (\n        f\"--out {out} already exists, is not empty, and does not look like a \"\n        f\"previous Humanize PPT run (no {marker_list} \"\n        \"at its root). Refusing to wipe it: it may hold content you did not intend \"\n        \"to lose. Point --out at a dedicated run directory, or pass --force to wipe \"\n        \"it anyway.\\n\"\n    )\n\n\ndef read_source(source):\n    path = Path(source).expanduser()\n    if not path.exists():\n        raise FileNotFoundError(f\"source not found: {path}\")\n    if path.suffix.lower() in {\".ppt\", \".pptx\"}:\n        raise ValueError(\n            f\"brief mode reads markdown/text raw material, not rendered decks: {path}. \"\n            \"Extract the text first (see scripts/pptx_qa.py's dump/inspect output for an \"\n            \"existing .ppt/.pptx) and pass that as --source. If this is a deck Humanize \"\n            \"PPT already rendered, run the presentation checkup instead: \"\n            \"--qa-from <path-to-this-file.pptx>.\"\n        )\n    text = path.read_text(encoding=\"utf-8\", errors=\"replace\")\n    return path, text, markdown_segments(text)\n\n\ndef strip_md(line):\n    line = re.sub(r\"^#{1,6}\\s*\", \"\", line.strip())\n    line = re.sub(r\"^[-*+]\\s+\", \"\", line)\n    line = re.sub(r\"^\\d+[.)]\\s+\", \"\", line)\n    line = re.sub(r\"[`*_>\\[\\]]\", \"\", line)\n    return line.strip()","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/plugins/community/humanize-ppt/scripts/humanize_ppt_v2.py#L181-L217","documentation":"Raised by read_source in humanize_ppt_v2.py as `raise FileNotFoundError(...)` when the path passed via --source does not exist on disk after expanduser(). This is the brief-mode entry guard: before any parsing, the file must be reachable. The path in the message is the expanded Path object, so '~' shortcuts are resolved for clarity.","triggerScenarios":"Launching humanize PPT brief mode with `--source <path>` where path is missing, mistyped, relative to the wrong cwd, points to a remote/URL (not fetched), or uses a '~' that expanduser cannot resolve (e.g. wrong HOME in CI). Also fires for broken symlinks (exists() returns False).","commonSituations":"Typo in the source path; running the script from a different working directory than expected; CI/agent passing a path that was never materialized; symlink to a network mount that is offline; permissions issue masked as missing (rare — exists() also returns False on broken symlinks).","solutions":["Verify the file exists and is readable from the exact cwd the script runs in: `ls -la <path>` and `python3 -c \"from pathlib import Path; print(Path('<path>').expanduser().exists())\"`.","Use an absolute path to remove cwd ambiguity, or `cd` to the directory containing the source first.","If using '~', confirm `$HOME` is set correctly (`echo $HOME`) — common in Docker/CI where HOME is unset.","Regenerate/redownload the source file if it was supposed to be produced by an upstream step that silently failed."],"exampleFix":"// before\npython3 humanize_ppt_v2.py --source ./notes.md\n# -> FileNotFoundError: source not found: notes.md\n\n// after\npython3 humanize_ppt_v2.py --source /absolute/path/to/notes.md\n# verify first\npython3 -c \"from pathlib import Path; print(Path('/absolute/path/to/notes.md').exists())\"","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\nsource_path = Path(args.source).expanduser()\nif not source_path.exists():\n    raise SystemExit(f\"source not found: {source_path}. Check the path and cwd.\")\n# safe to pass to read_source","typeGuard":null,"tryCatchPattern":"try:\n    path, text, segments = read_source(args.source)\nexcept FileNotFoundError as exc:\n    raise SystemExit(f\"Could not open source: {exc}\") from exc","preventionTips":["Always pass absolute source paths in scripts/CI to avoid cwd-dependent failures.","Validate existence and readability before invoking the humanize pipeline.","Confirm $HOME is set when using '~' in paths (Docker/CI).","Add a preflight check that all input files exist before long-running stages begin."],"tags":["filesystem","path","validation","humanize-ppt","python"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}