Skip to content

Implement Phase 1: maggraph.toml configuration loader#2

Merged
AlexMercedCoder merged 2 commits into
mainfrom
cursor/phase-1-config-2b1a
Jun 3, 2026
Merged

Implement Phase 1: maggraph.toml configuration loader#2
AlexMercedCoder merged 2 commits into
mainfrom
cursor/phase-1-config-2b1a

Conversation

@AlexMercedCoder
Copy link
Copy Markdown
Owner

Summary

Implements Phase 1 — Configuration & filesystem layout from the implementation plan. Also includes the minimal Rust workspace scaffolding required for the config module (partial Phase 0).

What's included

Config module (maggraph::config)

  • TOML schema matching the PRD: [storage], [lakehouse], [sync]
  • Typed enums for StorageMode (local | lakehouse) and SyncRole (leader | follower)
  • Validation with clear error messages (empty paths, lakehouse section required in lakehouse mode, sync URL checks, etc.)
  • root_path resolved relative to the config file directory
  • initialize_graph_root() to create the graph root and optional .maggraph/ metadata directory

Examples

  • examples/basic/ — local-mode config + two-node sample graph
  • examples/lakehouse/ — PRD-style lakehouse + follower config

CLI stub

  • maggraph --config <path> [--init] loads and validates config (foundation for Phase 6)

Tests & CI

  • 8 unit tests covering valid/invalid configs, path resolution, and graph root initialization
  • GitHub Actions: fmt, clippy, test

Acceptance criteria (Phase 1)

  • Unit tests load valid and invalid configs
  • Example path resolves root_path correctly
  • Example maggraph.toml + sample graph in examples/

Try it

cargo test
cargo run -p maggraph-cli -- --config examples/basic/maggraph.toml
cargo run -p maggraph-cli -- --config examples/basic/maggraph.toml --init

Progress

Updated planning/PROGRESS.md — Phase 1 marked complete; Phase 0 partially complete (workspace, CI, error types).

Slack Thread

Open in Web Open in Cursor 

cursoragent and others added 2 commits June 3, 2026 19:04
- Add Rust workspace with maggraph lib and maggraph-cli binary
- Implement TOML schema for [storage], [lakehouse], and [sync]
- Validate config fields and resolve root_path relative to config file
- Support optional graph root initialization with .maggraph metadata dir
- Add examples/basic and examples/lakehouse fixtures with sample nodes
- Add unit tests for valid/invalid configs and path resolution
- Add CI workflow (fmt, clippy, test) and update planning progress

Co-authored-by: Alex Merced <alex@alexmerced.dev>
Co-authored-by: Alex Merced <alex@alexmerced.dev>
Copy link
Copy Markdown
Owner Author

@AlexMercedCoder AlexMercedCoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTm

@AlexMercedCoder AlexMercedCoder marked this pull request as ready for review June 3, 2026 20:07
@AlexMercedCoder AlexMercedCoder merged commit 8bb5832 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