Skip to content

Create references edges for unambiguous backticked Markdown file paths #5224

Open

Description

@MicheleGiuliettiDev

On graphify 0.9.109, an AST/structural library scan resolves explicit Markdown links to a code file and a Markdown file, but backtick-only file paths to those same files create no reference edges. In 0.9.96 only the Markdown-to-Markdown link resolves in this fixture.

Save as repro.py, then run GRAPHIFY_NO_AUTO_REFRESH=1 uv run --no-project --with 'graphifyy==0.9.109' python repro.py:

from pathlib import Path
from tempfile import TemporaryDirectory
from graphify.extract import collect_files, extract
from graphify.build import build_from_json

with TemporaryDirectory() as tmp:
    root = Path(tmp) / 'repo'
    files = {
        'src/app.ts': 'export function sample() { return 1; }\n',
        'docs/other.md': '# Other\n',
        'docs/spans.md': '# Spans\n\nSee `src/app.ts` and `docs/other.md`.\n',
        'docs/links.md': '# Links\n\nSee [code](../src/app.ts) and [doc](./other.md).\n',
    }
    for name, text in files.items():
        path = root / name
        path.parent.mkdir(parents=True, exist_ok=True)
        path.write_text(text)
    data = extract(collect_files(root, root=root), root=root,
                   cache_root=Path(tmp) / 'cache', parallel=False)
    graph = build_from_json(data, root=root, dedup=False)
    for a, b, e in graph.edges(data=True):
        if e.get('relation') == 'references':
            print(graph.nodes[a].get('source_file'), '->', graph.nodes[b].get('source_file'))

Observed on 0.9.109: docs/links.md references docs/other.md and src/app.ts; no edge from docs/spans.md references either file. Expected: safely recognize a uniquely resolved, existing in-scan file path in an inline code span and emit a reference edge with source location. Preserve explicit relative-path semantics and skip ambiguous, missing, outside-root, fenced, or non-file spans.

Closed #3561 covers symbol mentions, while #951 covers authored links; this request concerns bare file paths in code spans. This does not claim that the LLM semantic pipeline has identical behavior.

Activity

  1. github-actions commented on Nov 15, 2026

    @github-actions

    Thanks for opening this issue, @MicheleGiuliettiDev. A maintainer will take a look soon.

    If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.

    To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.

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