Description
Summary
Output artifacts land in the corpus root / CWD even when --out <dir> (or --graph <path>) points elsewhere. Two distinct cases observed on 0.9.7:
Case 1 — extract --out still creates graphify-out/ inside the corpus
cd <repoA>
graphify extract . --out /tmp/scratch/tenant --no-clusterThe requested output is written to /tmp/scratch/tenant/graphify-out/ ✔ — but a stray graphify-out/ also appears in the corpus root (observed containing cache/ and partial content; also reproduced on a run that aborted at the no-LLM-key gate, which left <corpus>/graphify-out/ behind despite --out pointing elsewhere).
Case 2 — cluster-only --graph <elsewhere> writes results to CWD instead
cd <repoA>
graphify cluster-only . --no-label --graph /tmp/scratch/opexone/graphify-out/graph.jsonGRAPH_REPORT.md, .graphify_analysis.json, .graphify_labels.json and the clustered graph.json were all written to ./graphify-out/ (CWD); the --graph target file remained un-clustered (community count 0). I.e. the flag selects the input, but outputs ignore its location.
Environment
- graphifyy 0.9.7 (pipx), Python 3.14.5, macOS (arm64)
Expected
All outputs follow --out / live next to --graph. Impact: repo pollution and accidental commits — we had to gitignore graphify-out/ in every corpus repo as a workaround.
Activity
fix(cli): keep outputs/cache with --out / --graph, not the corpus or …
safishamsi commentedon Jul 10, 2026
Fixed on v8 in c5db9ff (0.9.12). Both cases, verified with regression tests:
Case 1 (
extract --outleaving a straygraphify-out/in the corpus): the graph itself already went to--out, butdetect()'s word-count/stat-index cache used the scan root. It now honors--outvia a threadedcache_root, so the corpus is left untouched. Confirmed:extract <corpus> --out <dir> --code-onlywrites graph and cache under<dir>/graphify-out/, with nographify-out/created in the corpus.Case 2 (
cluster-only --graph <elsewhere>/graph.jsonwriting to CWD): outputs now write beside--graphwhen that graph lives in agraphify-out/dir — GRAPH_REPORT.md, the re-clustered graph.json, labels, analysis and html all land there, and nothing is created in the CWD. To avoid regressing the archived-backup restore workflow (#934, where--graph backup/graph.jsonintentionally restores into the CWD'sgraphify-out/), the beside---graphbehavior is gated to graphs that sit in agraphify-out/dir; an arbitrary path still restores into the CWD.Thanks @bbqboogiedwonsen for the clear two-case breakdown — that made both the repro and the #934 reconciliation straightforward.
fix(cache): stat-index must follow the cache location, not the key an…
fix: derive project root in cluster-only + harden file_type guards
fix(cli): keep outputs/cache with --out / --graph, not the corpus or …
fix(cache): stat-index must follow the cache location, not the key an…