Office conversion sidecars are silently dropped when graphify-out/ is gitignored
Environment
- graphifyy 0.9.26 (pip install "graphifyy[office]" — openpyxl 3.1.5, python-docx 1.2.0)
- Python 3.12.10, Windows 11
- Project: TypeScript monorepo with two
.xlsxfiles inimport/ graphify-out/is listed in the project's.gitignore(as the docs recommend for the index artifact)
What happens
With the office extra installed, .xlsx/.docx files are converted successfully — the markdown sidecars appear in graphify-out/converted/ — but the converted content never enters the corpus. detect() reports the same document count as if the office files did not exist, with no warning: skipped_sensitive is empty (it is only populated when conversion fails), and the sidecars are not in files['document'].
Root cause
In detect.py (0.9.26, around lines 1361–1372), after a successful conversion the sidecar path is checked against the ignore patterns before being added:
if p.suffix.lower() in OFFICE_EXTENSIONS:
md_path = convert_office_file(p, converted_dir, root=root)
if md_path:
if _is_ignored(md_path, root, ignore_patterns, _cache=ignore_cache):
continue # <-- sidecar silently dropped
files[ftype].append(str(md_path))
The sidecar lives inside graphify-out/converted/, and graphify-out/ matches the gitignore patterns that detect() honors — so the sidecar is always considered ignored and dropped. Anyone who follows the standard setup (gitignore the index artifact) hits this: office conversion becomes a silent no-op.
Steps to reproduce
- Repo with
graphify-out/in.gitignoreand anybook.xlsxin the tree. pip install "graphifyy[office]"- Run detection (e.g. the
/graphify .pipeline orgraphify.detect.detect(Path('.'))). - Observe:
graphify-out/converted/book_<hash>.mdexists, but the file is absent fromfiles['document'],total_filesunchanged, no entry inskipped_sensitive.
Expected
Converted sidecars are tool-generated artifacts and should be exempt from the ignore check (the original office file already passed it). Options:
- skip
_is_ignoredfor paths undergraphify-out/converted/, or - run the ignore check against the original office file path instead of the sidecar path, or
- at minimum, append a note to
skipped_sensitiveso the drop is visible instead of silent.
Workaround we used
Feed the sidecar text to the extraction step manually and set source_file to the original .xlsx path — works, but has to be redone on every re-extraction.
Confirmed the same root cause on a different platform/extension — leaving a corroborating repro in case it's useful for prioritization.
Environment: graphifyy 0.9.50, Python 3.14, native Linux (WSL2/Ubuntu), .docx (not .xlsx)
Setup: standard create-next-app-style .gitignore with /graphify-out/ (exactly the pattern graphify's own generated .gitignore entry recommends), 3 .docx files in one directory (docs/legal/).
Traced convert_office_file directly and confirmed all 3 conversions succeed and land on disk in graphify-out/converted/, but all 3 are silently absent from detect()'s returned files['document'] — not just one, all of them, every time, deterministically. skipped_sensitive is empty, unclassified is empty, pruned_noise_dirs is empty. The docs directory itself is walked fine (confirmed via os.walk trace); it's specifically the post-conversion _ignored_for_scan(md_path) check against the sidecar's own path (now living under the gitignored graphify-out/) that drops the continue silently, exactly as diagnosed in the issue body.
Scoping detect() to the subdirectory containing the .docx files directly (e.g. detect(Path('docs')) instead of the repo root) "fixes" it as a side effect — only because the ancestor .gitignore at the true repo root (which is what actually contains the /graphify-out/ rule) is then out of the loaded ignore chain. That's a good clue for anyone else chasing this: it isn't file-count- or extension-specific, it's purely about whether an ignored-graphify-out/ rule is in scope for the scan root being used.
+1 on the fix suggestion to skip _ignored_for_scan for paths already known to be tool-generated sidecars under <out_base>/graphify-out/converted/ — checking the original source file's ignore status (already done earlier in the loop) should be sufficient, and re-checking the derived sidecar path is the actual bug.
Already fixed on current v8, via #3504.
graphify/detect.py's office-conversion branch explicitly exempts sidecars under converted_dir from the gitignore check now (the same fix also covers the analogous Google Workspace sidecar case, per the inline comment referencing this issue). A .xlsx/.docx sidecar written into graphify-out/converted/ is picked up even when graphify-out/ itself is gitignored.
This looks fixed on the v8 branch by 600e4e74 (Exempt Office/Workspace sidecars from the ignore check). Could a maintainer confirm and close?