Skip to content

Commit f9a0499

Browse files
Release v0.2.3 — language support, dead code, human notes, export
- Rust import resolution (crate::, super::, self::) and Go go.mod parsing - C/C++ parser: templates, typedef, #define, forward declarations - Go/Rust parsers: const_spec, var_spec, macro_definition captures - annotate_file MCP tool for human notes on wiki pages (survives re-index) - Dead code: dynamic import detection, Flask/FastAPI/Django decorator awareness - Export --full flag: decisions, dead code, hotspots, provenance in JSON - CLAUDE.md template: advisory language, indexed_commit display - get_context freshness included by default, token budget caps on tools - Decision staleness scoring computed during init - Frontend: human_notes rendered in wiki viewer - Docs and README updated for 11 MCP tools
1 parent 57200df commit f9a0499

38 files changed

Lines changed: 929 additions & 703 deletions

File tree

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<img src=".github/assets/logo.png" width="280" alt="repowise" /><br />
44
**Codebase intelligence for AI-assisted engineering teams.**
55

6-
Four intelligence layers. Ten MCP tools. One `pip install`.
6+
Four intelligence layers. Eleven MCP tools. One `pip install`.
77

88
[![PyPI version](https://img.shields.io/pypi/v/repowise?color=F59520&labelColor=0A0A0A)](https://pypi.org/project/repowise/)
99
[![License: AGPL v3](https://img.shields.io/badge/license-AGPL--v3-F59520?labelColor=0A0A0A)](https://www.gnu.org/licenses/agpl-3.0)
@@ -23,7 +23,7 @@ Four intelligence layers. Ten MCP tools. One `pip install`.
2323

2424
Your AI coding agent reads files. It does not know who owns them, which ones change together, which ones are dead, or why they were built the way they were. It has the source code and zero institutional knowledge.
2525

26-
repowise fixes that. It indexes your codebase into four intelligence layers — dependency graph, git history, auto-generated documentation, and architectural decisions — and exposes them to Claude Code (and any MCP-compatible AI agent) through ten precisely designed tools. **27× fewer tokens per query. 36% cheaper. Same answer quality.**
26+
repowise fixes that. It indexes your codebase into four intelligence layers — dependency graph, git history, auto-generated documentation, and architectural decisions — and exposes them to Claude Code (and any MCP-compatible AI agent) through eleven precisely designed tools. **27× fewer tokens per query. 36% cheaper. Same answer quality.**
2727

2828
The result: your agent answers *"why does auth work this way?"* instead of *"here is what auth.ts contains."*
2929

@@ -115,7 +115,7 @@ Add to your Claude Code config (optional, `repowise init` already initializes `.
115115
116116
---
117117

118-
## Ten MCP tools
118+
## Eleven MCP tools
119119

120120
Most tools are designed around data entities — one module, one file, one symbol — which forces AI agents into long chains of sequential calls. repowise tools are designed around **tasks**. Pass multiple targets in one call. Get complete context back.
121121

@@ -131,6 +131,7 @@ Most tools are designed around data entities — one module, one file, one symbo
131131
| `get_dependency_path(from, to)` | Connection path between two files, modules, or symbols | When tracing how two things are connected |
132132
| `get_dead_code(min_confidence?, include_internals?, include_zombie_packages?)` | Unreachable code sorted by confidence and cleanup impact | Cleanup tasks |
133133
| `get_architecture_diagram(module?)` | Mermaid diagram for the repo or a specific module | Documentation and presentation |
134+
| `annotate_file(target, notes)` | Attach human-authored notes to a wiki page — survives re-indexing | Adding rationale, known issues, or context that the LLM shouldn't overwrite |
134135

135136
### Tool call comparison — a real task
136137

@@ -274,7 +275,7 @@ repowise dead-code
274275
✗ analytics/v1/tracker.ts file 0.41 recent activity — review first
275276
```
276277

277-
Conservative by design. `safe_to_delete` requires confidence ≥ 0.70 and excludes dynamically-loaded patterns (`*Plugin`, `*Handler`, `*Adapter`, `*Middleware`). repowise surfaces candidates. Engineers decide.
278+
Conservative by design. `safe_to_delete` requires confidence ≥ 0.70 and excludes dynamically-loaded patterns (`*Plugin`, `*Handler`, `*Adapter`, `*Middleware`). Dynamic import detection (`importlib.import_module()`, `__import__()`) and framework decorator awareness (Flask/FastAPI/Django routes) further reduce false positives. repowise surfaces candidates. Engineers decide.
278279

279280
---
280281

@@ -317,7 +318,7 @@ When a senior engineer leaves, the "why" usually leaves with them. Decision inte
317318
| Git intelligence (hotspots, ownership, co-changes) ||||||
318319
| Bus factor analysis ||||||
319320
| Architectural decision records ||||||
320-
| MCP server for AI agents |10 tools || ✅ 3 tools |||
321+
| MCP server for AI agents |11 tools || ✅ 3 tools |||
321322
| Auto-generated CLAUDE.md ||||||
322323
| Doc freshness scoring |||| ⚠️ staleness only ||
323324
| Incremental updates on commit | ✅ <30s |||||
@@ -395,6 +396,7 @@ repowise generate-claude-md # regenerate CLAUDE.md
395396

396397
# Utilities
397398
repowise export [PATH] # export wiki as markdown files
399+
repowise export --full --format json # full export with decisions, dead code, hotspots
398400
repowise doctor # check setup, API keys, store drift
399401
repowise doctor --repair # check and fix detected store mismatches
400402
repowise reindex # rebuild vector store (no LLM calls)
@@ -404,13 +406,15 @@ repowise reindex # rebuild vector store (no LLM calls)
404406

405407
## Supported languages
406408

407-
**Code:** Python · TypeScript · JavaScript · Go · Rust · Java · C · C++ · Ruby · Kotlin
409+
| Tier | Languages | What works |
410+
|------|-----------|------------|
411+
| **Full** | Python · TypeScript · JavaScript · Java | AST parsing, import resolution, dependency graph edges |
412+
| **Good** | Go · Rust | AST parsing, partial import resolution (`crate::` / module paths) |
413+
| **Basic** | C · C++ | AST parsing (structs, functions, classes), `#include` resolution with `compile_commands.json` |
414+
| **Traversal** | Ruby · Kotlin · C# · Swift · Scala · PHP | Files indexed and searchable, but no AST symbol extraction yet |
415+
| **Config / data** | OpenAPI · Protobuf · GraphQL · Dockerfile · Makefile · YAML · JSON · TOML · SQL · Terraform | Included in the file tree; special handlers extract endpoints/targets where applicable |
408416

409-
**Config / contracts:** OpenAPI · Protobuf · GraphQL · Dockerfile · GitHub Actions YAML · Makefile
410-
411-
More languages coming soon — Swift, Scala, PHP, Dart, and Elixir are on the roadmap.
412-
413-
Adding a new language requires one `.scm` tree-sitter query file and one config entry. No changes to the parser. PRs welcome. See [Adding a new language](docs/CONTRIBUTING.md#adding-a-new-language).
417+
Dart and Elixir are on the roadmap. Adding a new language requires one `.scm` tree-sitter query file and one config entry. No changes to the parser core. PRs welcome. See [Adding a new language](docs/CONTRIBUTING.md#adding-a-new-language).
414418

415419
---
416420

docs/CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
---
1111

12+
## [0.2.3] — 2026-04-11
13+
14+
### Added
15+
- **`annotate_file` MCP tool** — attach human-authored notes to any wiki page. Notes survive LLM-driven re-generation and appear in `get_context` responses and the web UI. Pass an empty string to clear notes.
16+
- **`repowise export --full`** — full JSON export now includes decision records, dead code findings, git hotspots, and per-page provenance metadata (confidence, freshness, model, provider).
17+
- **Rust import resolution**`use crate::`, `super::`, and `self::` imports now resolve to local files via crate root detection (`lib.rs`/`main.rs`). External crates mapped to `external:` nodes.
18+
- **Go import resolution**`go.mod` module path parsing enables accurate local vs external package classification. Local imports resolve by suffix matching against the module path.
19+
- **C/C++ parser improvements** — added captures for `template_declaration`, `type_definition` (typedef struct/enum), `preproc_def` (#define), `preproc_function_def`, and forward declarations.
20+
- **Go parser** — added `const_spec` and `var_spec` captures for package-level constants and variables.
21+
- **Rust parser** — added `macro_definition` capture for `macro_rules!` macros.
22+
- **Dynamic import detection** — dead code analysis now scans for `importlib.import_module()` and `__import__()` calls; files in the same package receive reduced confidence (capped at 0.4).
23+
- **Framework decorator awareness** — Flask, FastAPI, and Django route/endpoint decorators added to `_FRAMEWORK_DECORATORS`. Decorated functions are never flagged as dead code.
24+
- **`human_notes` column on wiki pages** — persists across re-indexing. Alembic migration `0014_page_human_notes`.
25+
- **Decision staleness scoring during ingestion**`compute_staleness()` now runs during `repowise init`, not just `repowise update`.
26+
27+
### Changed
28+
- **CLAUDE.md template** — replaced imperative "MUST use" / "CRITICAL" language with advisory framing. Added `indexed_commit` display. Made `update_decision_records` optional ("SHOULD for architectural changes").
29+
- **`get_context` freshness** — freshness data now included by default instead of requiring explicit `include=["freshness"]`.
30+
- **`get_answer` docstring** — removed "do NOT verify by Read" instruction. High-confidence note changed to "verify cited file paths exist before acting on them".
31+
- **Token budget caps**`get_overview` caps knowledge_silos (30), module_pages (20), entry_points (15). `get_why` caps file_commits (10).
32+
- **Dead code patterns** — expanded `_DEFAULT_DYNAMIC_PATTERNS` with `*Mixin`, `*Command`, `*_view`, `*_endpoint`, `*_route`, `*_callback`, `*_signal`, `*_task`.
33+
34+
### Docs
35+
- **README** — tool count updated to 11, `annotate_file` added to MCP tools table, `--full` export flag documented, dynamic import detection noted, comparison table updated.
36+
- **Supported languages** — tiered table with accurate "What works" descriptions per language.
37+
- Updated USER_GUIDE.md, ARCHITECTURE.md, and deep-dives.md to reflect all changes.
38+
39+
---
40+
1241
## [0.2.2] — 2026-04-11
1342

1443
### Added

docs/USER_GUIDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ This is how you connect repowise to Claude Code, Cursor, Cline, Windsurf, and ot
315315
| `--transport` | Protocol: `stdio` (default, for editors) or `sse` (for web clients) |
316316
| `--port` | Port for SSE transport (default: 7338) |
317317

318-
**MCP tools exposed (10 tools):**
318+
**MCP tools exposed (11 tools):**
319319

320320
| Tool | What it does |
321321
|------|-------------|
@@ -329,6 +329,7 @@ This is how you connect repowise to Claude Code, Cursor, Cline, Windsurf, and ot
329329
| `get_dependency_path` | Find how two modules connect through the dependency graph |
330330
| `get_dead_code` | Tiered dead code report grouped by confidence |
331331
| `get_architecture_diagram` | Mermaid diagram with optional churn heat map |
332+
| `annotate_file` | Attach human-authored notes to a wiki page — survives re-indexing |
332333

333334
See [MCP Integration](#mcp-integration-with-ai-editors) for setup instructions.
334335

@@ -485,6 +486,7 @@ repowise export [PATH]
485486
|------|-------------|
486487
| `--format` | `markdown` (default), `html`, `json` |
487488
| `--output / -o` | Output directory (default: `.repowise/export`) |
489+
| `--full` | Include decisions, dead code findings, hotspots, and provenance metadata (JSON format only) |
488490

489491
**Examples:**
490492

docs/architecture/ARCHITECTURE.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ For per-package detail (installation, full API reference, all CLI flags, file ma
1616
|---------|--------|----------------|
1717
| `packages/core` | [`packages/core/README.md`](../packages/core/README.md) | Ingestion, generation, persistence, providers — all key classes with code examples |
1818
| `packages/cli` | [`packages/cli/README.md`](../packages/cli/README.md) | All 10 CLI commands with every flag documented |
19-
| `packages/server` | [`packages/server/README.md`](../packages/server/README.md) | All REST API endpoints, 10 MCP tools, webhook setup, scheduler jobs |
19+
| `packages/server` | [`packages/server/README.md`](../packages/server/README.md) | All REST API endpoints, 11 MCP tools, webhook setup, scheduler jobs |
2020
| `packages/web` | [`packages/web/README.md`](../packages/web/README.md) | Every frontend file with purpose — API client, hooks, components, pages |
2121

2222
---
@@ -959,9 +959,10 @@ affected files, modules, tags, and evidence commits. Deduplication key:
959959

960960
### Staleness Tracking
961961

962-
Decisions have a `staleness_score` (0.0 = fresh, 1.0 = very stale) recomputed on every
963-
`repowise update`. Staleness rises when affected files receive commits after the decision
964-
was recorded. Decisions with `staleness_score > 0.5` are flagged as stale.
962+
Decisions have a `staleness_score` (0.0 = fresh, 1.0 = very stale) computed during
963+
`repowise init` and recomputed on every `repowise update`. Staleness rises when affected
964+
files receive commits after the decision was recorded. Decisions with `staleness_score > 0.5`
965+
are flagged as stale.
965966

966967
### MCP Tools
967968

@@ -1008,7 +1009,7 @@ and supports two transports:
10081009
- **stdio** — for Claude Code, Cursor, Cline (add to their MCP config)
10091010
- **SSE** — for web-based MCP clients (served on port 7338)
10101011

1011-
### Tools (9 total)
1012+
### Tools (11 total)
10121013

10131014
| Tool | What it answers | When to call |
10141015
|------|----------------|-------------|
@@ -1021,6 +1022,9 @@ and supports two transports:
10211022
| `get_dependency_path(from, to)` | Connection path between two files/modules in the dependency graph. | When you need to understand how two things are connected. |
10221023
| `get_dead_code` | Dead/unused code findings sorted by confidence and cleanup impact. | Before cleanup tasks. |
10231024
| `get_architecture_diagram` | Mermaid diagram for repo or specific module. | For documentation or presentation. |
1025+
| `get_answer` | One-call RAG: confidence-gated synthesis with cited answers and question cache. | First call on any code question — collapses search → read → reason. |
1026+
| `get_symbol` | Resolve a qualified symbol id to source body, signature, and docstring. | When the question names a specific class, function, or method. |
1027+
| `annotate_file` | Attach human-authored notes to a wiki page — survives re-indexing. | Adding rationale, known issues, or context the LLM shouldn't overwrite. |
10241028

10251029
### Auto-generated Config
10261030

@@ -1112,7 +1116,7 @@ file, tokens used, estimated cost, estimated time remaining).
11121116
repowise includes an interactive chat interface that lets users ask questions about
11131117
their codebase and receive answers grounded in the wiki, dependency graph, git
11141118
history, and architectural decisions. The chat agent uses whichever LLM provider
1115-
the user has configured and has access to all 10 MCP tools.
1119+
the user has configured and has access to all 11 MCP tools.
11161120

11171121
See [`docs/CHAT.md`](CHAT.md) for the full technical reference covering the
11181122
backend agentic loop, SSE streaming protocol, provider abstraction extensions,
@@ -1123,7 +1127,7 @@ database schema, frontend component architecture, and artifact rendering system.
11231127
- **Provider-agnostic** — the chat agent goes through the same provider abstraction
11241128
as documentation generation. A `ChatProvider` protocol extends `BaseProvider` with
11251129
`stream_chat()` for streaming + tool use without breaking existing callers.
1126-
- **Tool reuse** — the 10 MCP tools are called directly as Python functions (no
1130+
- **Tool reuse** — the 11 MCP tools are called directly as Python functions (no
11271131
subprocess round-trip). Tool schemas are defined once in `chat_tools.py` and
11281132
fed to both the LLM and the executor.
11291133
- **SSE streaming**`POST /api/repos/{repo_id}/chat/messages` runs the agentic

docs/architecture/deep-dives.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ For each node in the dependency graph:
4343

4444
**Why in_degree alone isn't enough:**
4545

46-
Consider `plugin_auth.py`. Nothing imports it directly because the plugin framework loads it dynamically at runtime via `importlib.import_module()`. The graph doesn't capture dynamic imports because they don't appear in the AST as static import statements.
46+
Consider `plugin_auth.py`. Nothing imports it directly because the plugin framework loads it dynamically at runtime via `importlib.import_module()`. The graph doesn't capture dynamic imports as edges because they don't appear in the AST as static import statements.
4747

48-
Repowise handles this with multiple layers of filtering:
48+
Repowise handles this with multiple layers of filtering, including **dynamic import detection** — files in the same package as `importlib.import_module()` or `__import__()` calls automatically get reduced confidence scores:
4949

5050
**Layer 1 — Structural exclusions** (never flagged):
5151

@@ -69,13 +69,33 @@ _DEFAULT_DYNAMIC_PATTERNS = (
6969
"*Handler", # Event handler registration
7070
"*Adapter", # Adapter patterns
7171
"*Middleware", # Middleware chains
72+
"*Mixin", # Mixin classes
73+
"*Command", # CLI/management commands
7274
"register_*", # Registration functions
7375
"on_*", # Event callbacks
76+
"*_view", # Django/Flask views
77+
"*_endpoint", # API endpoints
78+
"*_route", # Route handlers
79+
"*_callback", # Callback functions
80+
"*_signal", # Signal handlers
81+
"*_task", # Background tasks
7482
)
7583
```
7684

7785
Files matching these patterns aren't marked `safe_to_delete` even if confidence is high, because they're likely loaded dynamically.
7886

87+
**Layer 2b — Framework decorator awareness:**
88+
89+
Functions decorated with framework-specific route/endpoint decorators are never flagged as dead code:
90+
91+
- Flask: `@app.route`, `@blueprint.route`, `@app.before_request`, `@app.errorhandler`, etc.
92+
- FastAPI: `@app.get`, `@app.post`, `@router.get`, `@app.on_event`, `@app.middleware`, etc.
93+
- Django: `@admin.register`, `@receiver`, `@login_required`, etc.
94+
95+
**Layer 2c — Dynamic import detection:**
96+
97+
Files in the same package as `importlib.import_module()` or `__import__()` calls automatically receive a reduced confidence score (capped at 0.4), since they may be loaded dynamically at runtime.
98+
7999
**Layer 3 — Confidence scoring with git metadata:**
80100

81101
This is where it gets interesting. A file with zero importers might be dead, or it might be actively used via dynamic loading. Git history helps distinguish:

packages/cli/src/repowise/cli/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
AI-generated documentation.
77
"""
88

9-
__version__ = "0.2.2"
9+
__version__ = "0.2.3"

0 commit comments

Comments
 (0)