Skip to content

markdown: capture relative links as dependency edges (rosetta #2587, dependency_links 0 vs median 3) #2638

Closed

Description

@squid-protocol

Split out of the rosetta[markdown] sweep (#2587). Markdown is the only wired language whose real cross-file reference idiom — the relative link [text](sibling.md) — produces no dependency edge: it has no _dependency_capture, so dependency_links reads 0 vs the 46-language median of 3 even though the corpus deliberately plants a main→a→b→c link chain.

Links to sibling files are dependencies in the same sense code imports are: a README that links docs/setup.md breaks when that file moves. Capturing them gives docs a real cross-reference DAG — popularity scoring and orphaned-docs detection for documentation, using machinery that already exists (suffix_map indexes extension-bearing path suffixes, so a.md resolves via the O(1) fast path).

Scope: capture the URL of inline [...](...) links (image form included — the bracket core matches either way), excluding scheme-prefixed targets (http:, mailto: etc. via a [a-z]+: lookahead), protocol-relative //, and pure-anchor #... targets; the capture stops before #fragment, whitespace-separated titles, and the closing paren. The bracket half reuses lit_links' vetted bounded shape.

Noted while tracing (pre-existing, engine-wide, NOT addressed here): galaxyscope.py's import_cleaner strips leading import|from|require|use|source with no word boundary, so a captured usage.md or sources.md is mangled (use/source prefix-match) before DAG resolution. Affects every language's captured names that happen to start with those keywords; will file separately if confirmed worth it.

Cross-repo: companion keyword-rosetta re-baseline (markdown expected_signals + ledger + na_baseline review + bias regen) rides the same sweep; engine PR merges first per docs/GATING.md choreography.

🤖 Generated with Claude Code

Activity

  1. added
    metrics
    core-engine
    on Sep 1, 2026
  2. added a commit that references this issue on Sep 2, 2026
    c4208a1
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

    core-enginemetrics

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions