Skip to content

graphify update writes absolute paths into generated artifacts #433

Closed

Description

@takeItIzzy

Summary

graphify update . currently serializes absolute filesystem paths into the generated artifacts for code-only rebuilds.

The regression is specific to the update / watch rebuild path. Running the full /graphify workflow on a relative path still produces project-relative source_file values, but graphify update . does not.

Affected outputs

  • graphify-out/graph.json node and edge source_file fields
  • graphify-out/GRAPH_REPORT.md report title and any path-bearing sections
  • graphify-out/graph.html title and node metadata
  • graphify-out/cache/*.json AST cache entries

Reproduction

  1. Create a small repo with pkg/a.py.
  2. From the repo root, run graphify update ..
  3. Inspect graphify-out/graph.json or graphify-out/GRAPH_REPORT.md.

Actual behavior

Generated outputs contain absolute paths such as:

  • /Users/alice/project/pkg/a.py
  • # Graph Report - /Users/alice/project (...)

This makes committed graph artifacts machine-specific and leaks local filesystem layout into reports, HTML, and cache files.

Expected behavior

graphify update . should preserve project-relative paths, matching the rest of the pipeline:

  • pkg/a.py in source_file
  • a non-absolute report title for the project root
  • no absolute project paths in graphify-out/cache/*.json

Root cause

graphify.watch._rebuild_code() resolves the input path before running detection and report generation:

  • watch_path = watch_path.resolve()
  • detect(watch_path, ...) therefore returns absolute file paths
  • the AST extractors serialize those absolute paths directly into source_file
  • report.generate(..., str(watch_path), ...) also receives an absolute root label

Scope

This issue is about path serialization only. The large-graph HTML failure path was already handled separately in v0.4.23.

Activity

  1. takeItIzzy commented on Apr 18, 2026

    @takeItIzzy
    Author

    Opened draft PR #434 with a fix and regression coverage for this path serialization bug.

  2. added a commit that references this issue on Apr 21, 2026
    bf58d85
  3. added a commit that references this issue on Apr 23, 2026
    4738e88
  4. added a commit that references this issue on Sep 10, 2026
    c4b0400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions