Repository navigation
feat(markdown): capture relative links as dependency edges (closes #2638) - #2639
Merged
Merged
Conversation
Three coupled changes, found working the rosetta[markdown] sweep (#2587): 1. markdown gains _dependency_capture: the target of every inline link (image form included) whose target is repo-relative -- scheme-prefixed, protocol-relative and pure-anchor targets excluded; capture stops before fragments/titles so the census suffix map resolves it O(1). The bracket half reuses lit_links' vetted bounded shape; ReDoS-detonated in strict tests. 2. galaxyscope Phase 6: an is_inert language that explicitly DECLARES _dependency_capture now opts back into dependency extraction (the other inert skips -- security lens, named tokens, popularity census -- stay skipped). This also wakes yaml's deliberately-authored but silently dead uses:/image: capture (#813/#843): GitHub Actions/container refs now produce real DAG edges. 3. detector.py: the four early-return paths (prose deflection, low-confidence bypass, empty code_stream, catastrophic-failure fallback) no longer emit a placeholder "raw_imports": [] -- data_payload.update(logic_data) was clobbering the worker's already-extracted dependencies for every file hitting those paths. Regression-pinned in test_detector.py. Corpus effect: keyword-rosetta markdown main->a->b->c resolves (import_count main/a/b=1 c=0, popularity a/b/c=1, dependency_links 3 = median; api stays 0, orphan->api conversion needs functions). New docs/language_status/markdown.md carries the full rosetta capstone. Co-Authored-By: Claude Fable 5 <[email protected]>
…ket link targets The re-bless diff itself caught a capture flaw: CommonMark angle-bracket destinations ([x](<https://.../Collision_(computer_science)>), the escape hatch for URLs with spaces/parens) start with '<', slipping past the scheme lookahead and capturing a junk fragment. The lookahead now rejects '<' outright -- angle-wrapped targets are overwhelmingly external URLs. Found live in wtfpython's README; pinned as strict negative cases. Fixture diff shape (verified twice via scope_check against origin/main): only .md files gain Extracted Dependencies / Dependency Network fields, their link targets gain downstream popularity (e.g. springboot LICENSE.txt), plus the graph rollups new edges imply (imports_unknown +12, modularity/assortativity 4th decimal). Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Sep 1, 2026
Closed
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rosetta[markdown] sweep (#2587), the engine half. Three coupled changes:
1. markdown
_dependency_captureCaptures the target of every inline link (image form included) whose target is repo-relative. Excluded by lookahead: scheme-prefixed (
https:,mailto:), protocol-relative (//…), pure-anchor (#…), and angle-bracket-wrapped (<…>, CommonMark's escape hatch for URLs with parens — found live in wtfpython's README during the re-bless) targets. Capture stops before#fragment/titles so the census suffix map resolves the bare path in O(1). Bracket half reuseslit_links' vetted bounded shape; 4 ReDoS detonations in the strict suite.2. galaxyscope Phase 6: inert opt-in
An
is_inertlanguage that explicitly declares_dependency_capturenow opts back into dependency extraction; the other inert skips (security lens, named tokens, popularity census) stay skipped. This also wakes yaml's deliberately-authored but silently deaduses:/image:capture (#813/#843) — GitHub Actions and container refs now produce real DAG edges (supply-chain relevant; moves #2606's numbers as a free improvement).3. detector.py: early-return
raw_importsplaceholder removalThe four early-return paths (prose deflection #691, low-confidence bypass, empty
code_stream, catastrophic-failure fallback) emitted a placeholder"raw_imports": []thatdata_payload.update(logic_data)merged over the worker's already-extracted dependencies — silently erasing them for every file hitting those paths. Removed; regression-pinned intest_detector.py.Why the golden masters changed
Only
.mdfiles gainExtracted Dependencies/Dependency Networkfields, their link targets gain downstream popularity (e.g. springboot'sLICENSE.txt), plus the rollups new DAG edges imply (imports_unknown+12, modularity/assortativity in the 4th decimal). Verified twice withscope_check.pyagainstorigin/main— nothing outside that moved.Validation
audit_check.py(ruff/mypy/dead-key/ast + format): cleantree_sitter_accuracy_audit.py --ci --all: 30 languages OKtri_comparison_chart.py --all --ci: OKmain→a→b→cresolves (import_count main/a/b=1 c=0, popularity a/b/c=1, dependency_links 3 = the cross-language median;apistays 0 — orphan→api conversion needs functions). markdown & yaml both leavedependency_linksred: consistency 78%→83%, repo-wide 17→18 metrics ≥80% green band.docs/language_status/markdown.mdwith the full rosetta capstone (§8).Noted, NOT addressed here (pre-existing, engine-wide):
import_cleanerstrips leadinguse/source/etc. without a word boundary, mangling captured names likeusage.md— see #2638.Cross-repo
Companion keyword-rosetta PR (ledger
markdown-lit-plane-morphology, na_baseline 34→16, bias regen) follows withENGINE_REF: pull/<this>/head; this PR merges first, then corpus PR restoresENGINE_REF: mainand merges, thenKEYWORD_ROSETTA_REFbumps here.rosetta-auditon this PR fails until then — expected, the gate catching drift at the source.Closes #2638. Part of #2587 (epic #2560).
🤖 Generated with Claude Code