Skip to content

Implement Phase 2: markdown node model and graph index#3

Merged
AlexMercedCoder merged 1 commit into
mainfrom
cursor/phase-2-nodes-9de7
Jun 3, 2026
Merged

Implement Phase 2: markdown node model and graph index#3
AlexMercedCoder merged 1 commit into
mainfrom
cursor/phase-2-nodes-9de7

Conversation

@AlexMercedCoder
Copy link
Copy Markdown
Owner

Summary

Implements Phase 2 — Markdown node model & index from the implementation plan.

Node model (maggraph::node)

  • YAML frontmatter parser → typed NodeMetadata (id, type, source, links, plus extra fields via #[serde(flatten)])
  • Node struct with body content and relative path
  • Markdown round-trip serialization that preserves unknown frontmatter keys
  • Node::from_file / Node::write_to for filesystem I/O

Graph index (maggraph::index)

  • GraphIndex::open(root_path) — full scan of *.md files under the graph root
  • In-memory maps: id → NodeIndexEntry and path → id
  • Duplicate ID detection on scan
  • CRUD: create_node, read_node, update_node, delete_node, rescan

Other

  • Extended MagGraphError with node/index variants
  • Added serde_yaml and walkdir workspace dependencies
  • PRD example node at examples/lakehouse/knowledge_graph/customer_churn_q2.md
  • Updated planning/PROGRESS.md — Phase 2 marked complete

Testing

cargo test
cargo clippy --all-targets --all-features -- -D warnings

20 unit tests (12 new) covering PRD schema parsing, round-trip, scan, CRUD, duplicate detection, and the basic example fixture.

Next up

Phase 3 — wikilink parsing, adjacency, and traversal API.

Slack Thread

Open in Web Open in Cursor 

Add Node frontmatter parsing (YAML), GraphIndex with full directory scan,
filesystem CRUD, and round-trip serialization preserving extra fields.
Includes tests against PRD schema and example fixtures, plus a lakehouse
sample node.

Co-authored-by: Alex Merced <alex@alexmerced.dev>
@AlexMercedCoder AlexMercedCoder marked this pull request as ready for review June 3, 2026 20:21
@AlexMercedCoder AlexMercedCoder merged commit a191b42 into main Jun 3, 2026
1 check 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.

2 participants