Repository navigation
Conversation
Adds regex-based extractors for two formats that have no bundled tree-sitter grammar (same approach already used for ReScript and SQL CREATE PROCEDURE): - Markdown (.md/.mdx/.qmd): each heading becomes a Section node; heading nesting produces CONTAINS edges; backtick filenames / [[wikilinks]] / [text](x.md) links produce REFERENCES edges. Fenced code blocks are skipped. - YAML (.yaml/.yml): top-level keys become Section nodes and registry-style list entries (id:/name:) become Type nodes, with CONTAINS edges. Pure regex, no PyYAML dependency. Because both reuse the existing NodeInfo/EdgeInfo schema and the shared CONTAINS/REFERENCES edge kinds, documentation and config now live in the SAME graph as code — e.g. a spec.md REFERENCES the source file it describes, and a CRON-123 registry entry is a queryable node. Tests: tests/test_knowledge_extractors.py (4 cases — headings/nesting, code fence skip, references, yaml entries). ruff clean, pytest green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Thanks for the contribution. The parser-level tests pass, but the persisted graph is not connected correctly: File nodes use full paths while the new CONTAINS/REFERENCES edges use path.name and custom bare section IDs, so those edges do not point to stored nodes. There are significant false positives. Ordinary inline code such as python or GraphStore becomes a reference, and YAML creates separate Types for both id: CRON-1 and name: alpha. Link directories are discarded, section spans stop on the heading line, and fence handling covers only simple triple-backtick toggling. Please use canonical endpoints, add a full_build/query integration test, narrow Markdown reference and YAML registry detection, preserve link paths, add negative/error cases, and provide graph-size/build-time evidence. This would automatically index 61 files in this repository. Coordinate YAML design with #577, rebase, and run full CI. |
|
Thanks for the parser work. I am closing head A future contribution should use canonical qualified endpoints, include full-build/query integration and dangling-edge assertions, preserve link paths and section spans, add conservative Markdown/YAML detection with negative and malformed-input cases, measure graph-size/build-time impact, and align with current YAML/Ansible classification before running full CI. |
|
Is markdown support on the path? |
What
Adds two regex-based extractors so the graph can index knowledge files that have no bundled tree-sitter grammar:
.md/.mdx/.qmd): headings →Sectionnodes, nesting →CONTAINSedges, links (backtick filenames,[[wikilinks]],[text](x.md)) →REFERENCESedges. Fenced code blocks are skipped..yaml/.yml): top-level keys →Sectionnodes, registry-styleid:/name:list entries →Typenodes, withCONTAINSedges. Pure regex, no PyYAML dependency.Why
Both reuse the existing
NodeInfo/EdgeInfoschema and the sharedCONTAINS/REFERENCESedge kinds, so documentation and config land in the same graph as code: aspec.mdcanREFERENCESthe source file it describes, and aCRON-123registry entry becomes a queryable node. Helpful for repos that mix code with specs, docs and config registries.Approach
Follows the existing pattern for grammar-less inputs (
_parse_rescript,_parse_sql): extension mapping inEXTENSION_TO_LANGUAGE, dispatch inparse_bytes, dedicated_parse_markdown/_parse_yamlmethods.Tests
tests/test_knowledge_extractors.py— 4 cases (headings/nesting, fenced-code skip, references, yaml entries).ruff checkpasses clean,pytestgreen locally.