Skip to content

Commit 92646dc

Browse files
userFRMclaude
andauthored
feat: rpg-build crate + design_rpg MCP tool (v0.9.0) (#85)
New crate `rpg-build` produces an RPGraph from a natural-language project specification, inverse of rpg-encoder which extracts a graph from existing source code. Inspired by the ZeroRepo paper (Luo et al., 2026, arXiv:2509.16198), limited to the design phases — code generation is left to the connected coding agent. Architecture: - `rpg-build::design_rpg(spec, config)` returns `(RPGraph, DesignReport)` - Reuses rpg-lift's LlmProvider abstraction (Anthropic / OpenAI / OpenRouter / Gemini) - LLM produces a strict JSON schema (3-level hierarchy, entities with features, calls, imports) - Parser extracts the JSON from fenced code blocks or balanced braces, validates types, drops dangling dependency references silently - Output graph has full hierarchy + edges + features but no source code, no line ranges (line_start/end = 0) New MCP tool `design_rpg`: - Same provider/api_key/api_key_env pattern as auto_lift - Returns the design rendered as a semantic_snapshot - Optional `save=true` writes to .rpg/graph.json (clears auto-sync markers because the new graph has no committed correspondence yet) - Feature-gated behind `rpg-build` (default ON, --no-default-features builds without it) 8 unit tests for the design parser + graph builder. All 660 workspace tests pass. Bumps to v0.9.0 (minor: new public crate added to the workspace). Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e1423ad commit 92646dc

14 files changed

Lines changed: 921 additions & 17 deletions

File tree

.gemini/extensions/rpg/gemini-extension.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rpg-encoder",
3-
"version": "0.8.1",
3+
"version": "0.9.0",
44
"description": "Build and query semantic code graphs (Repository Planning Graphs) for AI-assisted code understanding. Provides entity search, dependency exploration, and autonomous LLM-driven semantic lifting.",
55
"mcpServers": {
66
"rpg-encoder": {

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/),
66
and this project adheres to [Semantic Versioning](https://semver.org/).
77

8+
## [0.9.0] - 2026-04-14
9+
10+
### Added
11+
12+
- **`rpg-build` crate** — designs an `RPGraph` from a natural-language project
13+
specification. Inverse of `rpg-encoder`: where the encoder extracts a graph
14+
from existing source code, `rpg-build` produces a graph for code that doesn't
15+
exist yet (hierarchy, entities, dependencies, verb-object features — but no
16+
source code). Inspired by the ZeroRepo paper (Luo et al., 2026,
17+
arXiv:2509.16198), limited to the design phases.
18+
- **`design_rpg` MCP tool** — exposes `rpg-build` over MCP. Takes a spec, returns
19+
a proposed graph rendered as a `semantic_snapshot`. Pass `save=true` to write
20+
the design to `.rpg/graph.json` (overwrites any existing graph). Same provider
21+
surface as `auto_lift`: Anthropic, OpenAI, OpenRouter, Gemini, with
22+
`api_key_env` for safe key handling.
23+
- MCP tool count: 27 → 28.
24+
825
## [0.8.1] - 2026-04-14
926

1027
### Fixed

Cargo.lock

Lines changed: 21 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ members = [
88
"crates/rpg-cli",
99
"crates/rpg-mcp",
1010
"crates/rpg-lift",
11+
"crates/rpg-build",
1112
]
1213

1314
[workspace.package]
14-
version = "0.8.1"
15+
version = "0.9.0"
1516
edition = "2024"
1617
license = "MIT"
1718
authors = ["userFRM"]
@@ -161,3 +162,4 @@ rpg-parser = { path = "crates/rpg-parser" }
161162
rpg-encoder = { path = "crates/rpg-encoder" }
162163
rpg-nav = { path = "crates/rpg-nav" }
163164
rpg-lift = { path = "crates/rpg-lift" }
165+
rpg-build = { path = "crates/rpg-build" }

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Whenever your working tree changes — committed, staged, or unstaged — the MC
9696
<img src="diagrams/architecture.webp" alt="Your codebase (15 languages) → RPG Engine (5 Rust crates: parser, encoder, nav, lift, mcp) → Clients (Claude Code, Cursor, opencode) via MCP Protocol" width="95%" />
9797
</p>
9898

99-
Seven Rust crates, one MCP server binary, one CLI binary:
99+
Eight Rust crates, one MCP server binary, one CLI binary:
100100

101101
| Crate | Role |
102102
|-------|------|
@@ -105,19 +105,21 @@ Seven Rust crates, one MCP server binary, one CLI binary:
105105
| `rpg-encoder` | Encoding pipeline, lifting utilities, incremental evolution |
106106
| `rpg-nav` | Search, fetch, explore, snapshot, TOON serialization |
107107
| `rpg-lift` | Autonomous LLM lifting (Anthropic, OpenAI, OpenRouter, Gemini) |
108+
| `rpg-build` | Design RPG blueprints from natural-language specs (inverse of encoder) |
108109
| `rpg-cli` | CLI binary (`rpg-encoder`) |
109-
| `rpg-mcp` | MCP server binary (`rpg-mcp-server`) with 27 tools |
110+
| `rpg-mcp` | MCP server binary (`rpg-mcp-server`) with 28 tools |
110111

111112
---
112113

113-
## MCP Tools (27)
114+
## MCP Tools (28)
114115

115116
<details>
116117
<summary><strong>Build & Maintain</strong> (4 tools)</summary>
117118

118119
| Tool | Description |
119120
|------|-------------|
120121
| `build_rpg` | Index the codebase (run once, instant) |
122+
| `design_rpg` | Design an RPG blueprint from a natural-language spec (inverse of build) |
121123
| `update_rpg` | Incremental update from git changes |
122124
| `reload_rpg` | Reload graph from disk after external changes |
123125
| `rpg_info` | Graph statistics, hierarchy overview, per-area lifting coverage |

crates/rpg-build/Cargo.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[package]
2+
name = "rpg-build"
3+
version.workspace = true
4+
edition.workspace = true
5+
license.workspace = true
6+
authors.workspace = true
7+
repository.workspace = true
8+
description = "Design Repository Planning Graphs from natural-language specifications (inverse of rpg-encoder)"
9+
10+
[dependencies]
11+
rpg-core = { workspace = true }
12+
rpg-lift = { workspace = true }
13+
serde = { workspace = true }
14+
serde_json = { workspace = true }
15+
thiserror = { workspace = true }
16+
chrono = { workspace = true }
17+
18+
[dev-dependencies]
19+
tempfile = { workspace = true }
20+
21+
[lints]
22+
workspace = true

0 commit comments

Comments
 (0)