Skip to content

fix(cli): write GRAPH.* into the scanned project, not cwd - #8

Merged
ggrace519 merged 1 commit into
mainfrom
fix/write-output-to-scanned-dir
Aug 30, 2026
Merged

fix(cli): write GRAPH.* into the scanned project, not cwd#8
ggrace519 merged 1 commit into
mainfrom
fix/write-output-to-scanned-dir

Conversation

@ggrace519

Copy link
Copy Markdown
Owner

Summary

Without -o, the CLI wrote GRAPH.md / GRAPH.json / GRAPH.html into the process working directory. Running graphlm /path/to/project from another folder therefore dropped files next to the tool instead of next to the code being analyzed.

What changed and why

  • Default output destination is the scanned project directory.
  • -o / --output-dir still overrides.
  • Library API is unchanged: generate_graph only writes when output_dir is passed.

Verification

  • uv run pytest261 passed
  • CLI tests: default dest is the project path; -o overrides; cwd is not used

Post-merge

graphlm /path/to/project writes into /path/to/project/.

Without -o the CLI used Path.cwd(), so running graphlm from another
directory dropped output next to the tool. Default destination is now
the project being analyzed; -o still overrides.

Co-Authored-By: Grok 4.6 <grok@x.ai>
@ggrace519
ggrace519 merged commit f27733e into main Aug 30, 2026
4 checks passed
@ggrace519
ggrace519 deleted the fix/write-output-to-scanned-dir branch August 30, 2026 15:13
ggrace519 added a commit that referenced this pull request Aug 30, 2026
Delete leftover tool output that predates the GRAPH.* output rename
(#7/#8): graphs.md, graphs.json, and the untracked graph.html, plus the
committed .coverage sqlite database. None of these are inputs to the
build, tests, or docs — they were graphLM's own output committed by
accident.

Add .coverage, coverage.xml, and the GRAPH.* output files to .gitignore
so generated artifacts no longer drift back into version control.


Claude-Session: https://claude.ai/code/session_01SLftfcgzQfsWHbuA4XHv1F

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
ggrace519 added a commit that referenced this pull request Aug 30, 2026
Design-only scoping of the graph-vs-graph diff artifact (self-refreshing graph
fast-follow). Building stays gated; no code in this change.

ADR-002 settles the decisions the plan left open, grounded against the merged
code:
- The diff runs in write_outputs (the only place with both graph and output
  dir, since the CLI passes output_dir=None to generate_graph — the #8 split);
  baseline GRAPH.json is read before the overwrite; --dry-run writes no diff.
- Added/removed only, no "changed" bucket — identity keys are structural, so
  LLM-regenerated prose is intentionally invisible (a changed bucket over free
  text would drown the structural signal in nondeterminism). Named deliberate.
- Three baseline states, not two: first-run, uncomparable (corrupt / unknown
  schema_version), normal — a corrupt file must not masquerade as first-run.
- deterministic_edges None (--no-ast) vs [] distinguished, so toggling --no-ast
  never reports a mass edge deletion.
- Artifact: GRAPH_DIFF.md + .json, own diff_schema_version, SHA-range header,
  *_suffix convention, on-by-default with --no-diff, no HTML in cut one.
- write_outputs signature must stay non-breaking for its ~10 positional callers.

Also points ADR-001's fast-follow note and the plan doc at ADR-002 / #28.

Refs #28


Claude-Session: https://claude.ai/code/session_01SLftfcgzQfsWHbuA4XHv1F

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant