get_markdown_path() in src/paperscale/pipeline.py:691 builds the output filename with:
md_filename = os.path.splitext(os.path.basename(relative_path))[0] + ".md"
It drops the source extension. paperscale accepts both PDFs and images (--pdfs takes
"Local PDF/image paths, a local glob ... or a .txt file listing paths"), so two source files
in one directory that differ only by extension collide onto a single markdown file:
corpus/case.pdf -> workspace/markdown/corpus/case.md
corpus/case.tiff -> workspace/markdown/corpus/case.md # overwrites, silently
Whichever document is exported second wins. Nothing warns, and the loss is invisible unless
you count the output files against the input list.
Related precedent: evaluation/runs.py:45 already treats a duplicate Source-File inside one
run as fatal (DuplicateSourceFileError) on exactly the grounds that an ambiguous document key
is not recoverable. The export path has no equivalent guard.
Found while resolving #22. That ticket chose extension-replacement for the embed output too, so
the same collision family will exist on the .npz side and both should be fixed by the same
rule — see #22's resolution, which makes the path-hash the tiebreak.
get_markdown_path()insrc/paperscale/pipeline.py:691builds the output filename with:It drops the source extension. paperscale accepts both PDFs and images (
--pdfstakes"Local PDF/image paths, a local glob ... or a .txt file listing paths"), so two source files
in one directory that differ only by extension collide onto a single markdown file:
Whichever document is exported second wins. Nothing warns, and the loss is invisible unless
you count the output files against the input list.
Related precedent:
evaluation/runs.py:45already treats a duplicateSource-Fileinside onerun as fatal (
DuplicateSourceFileError) on exactly the grounds that an ambiguous document keyis not recoverable. The export path has no equivalent guard.
Found while resolving #22. That ticket chose extension-replacement for the embed output too, so
the same collision family will exist on the
.npzside and both should be fixed by the samerule — see #22's resolution, which makes the path-hash the tiebreak.