Skip to content

Improve Markdown document graph resolution - #239

Merged
forhappy merged 1 commit into
mainfrom
codex/markdown-document-graph-quality
Aug 13, 2026
Merged

Improve Markdown document graph resolution#239
forhappy merged 1 commit into
mainfrom
codex/markdown-document-graph-quality

Conversation

@forhappy

Copy link
Copy Markdown
Contributor

Summary

  • give every Markdown structural block a deterministic section-qualified identity
  • match duplicate automatic heading slugs in source order and decode bounded percent-encoded fragments
  • resolve exact, extensionless, repository-root, directory-index, and unique-wikilink document targets against the complete project inventory
  • connect Markdown documentation to file inventory for Python, Rust, Go, Java, TypeScript, and every other extracted language
  • keep missing fragments and ambiguous targets unresolved instead of selecting a candidate or falling back to a document root
  • retain exact document relationships at the default low inference level and advance extraction semantics to v12

Why

The per-file Markdown extractor previously guessed a .md endpoint before the full project inventory was available. Cross-file fragments stopped at the document root, extensionless and root-relative paths could not be selected accurately, and the generic endpoint-rewrite provenance correctly classified the later repair as inferred. Default-low publication therefore retained only two same-file HTTPX references and filtered the project-resolved links.

The new flow preserves source spelling and the exact link site in compass-languages, then performs unique target selection in compass-resolve. Because the resulting relationship is an exact source-backed document fact rather than heuristic endpoint repair, it survives low inference. Ambiguity remains explicit and unpublished.

Impact

  • agents can navigate directly from documentation prose to the referenced heading or source file instead of retrieving and searching a whole document
  • repeated headings and structural blocks have stable, scoped identities that improve search precision
  • .md, .markdown, .mdx, .qmd, and .skill documents share the same bounded resolution rules
  • language-specific code extractors and resolvers are unchanged; document-to-code coverage is verified across Python, Rust, Go, Java, and TypeScript file inventories
  • graph schema v1 and relationship direction are unchanged

HTTPX default-low qualification

Metric Baseline Candidate
Files indexed 102 102
Nodes 4,867 4,867
Edges 7,123 7,152
Published Markdown references 2 31
Exact project-resolved document references 0 29

All 29 added edges have real endpoints and exact link-site evidence; no nodes were added. A fresh release-mode build completed in 1.25s. The cold release-mode CompassQL lookup was 0.13s on the baseline and 0.21s on the candidate; latency is reported for context and was not an optimization criterion.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --lib --bins --locked -- -D warnings
  • cargo test --workspace --lib --bins --locked
  • full compass-languages and compass-resolve test suites
  • focused default-low end-to-end Compass Core document publication test
  • ./scripts/qualify_code_graph_v1.sh --fixtures-only
  • sh scripts/check_product_boundary.sh
  • fresh release-mode HTTPX build plus CompassQL document-link query

An additional cargo clippy -p compass-languages -p compass-resolve -p compass-core --all-targets --all-features --locked -- -D warnings run reached two pre-existing test-only violations (expect_err in framework_qualification.rs and items_after_test_module in evidence/projection/mod.rs). The documented workspace lib/bin Clippy gate passes.

@forhappy
forhappy marked this pull request as ready for review August 13, 2026 20:12
@forhappy
forhappy merged commit e77e655 into main Aug 13, 2026
14 checks passed
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