project-brain 0.33.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/package.json +6 -6
- package/templates/project.claude.md +1 -5
- package/templates/rules.claude.md +1 -5
package/README.md
CHANGED
|
@@ -253,10 +253,26 @@ The CLI commands exit 0 for any executed query — including legitimate empty re
|
|
|
253
253
|
| `manage_adr` | Create or list Architecture Decision Records. Append-only: supersede by creating a new ADR with `supersedes:<slug>`. |
|
|
254
254
|
| `get_architecture` | One-call project summary: detected tech stack, indexed modules, chunk count, and symbol count. |
|
|
255
255
|
| `sync_project` | Re-index changed files now (incremental, hash-gated). Streams progress via MCP notifications when the client supplies a `progressToken`. Use when results look stale. |
|
|
256
|
+
| `okf_candidates` | Mines `fix:` commits for OKF write candidates: scores each against the symbol graph and existing bundle coverage, so the agent gets ranked suggestions instead of hunting through history by hand. |
|
|
257
|
+
| `okf_write` | Writes a new OKF concept file from structured fields (type, title, anchor, body). Refuses to write when any declared anchor (`resource` or `sources[]`) doesn't resolve against the repo and its symbol graph — an unverifiable claim never reaches the bundle. |
|
|
256
258
|
|
|
257
259
|
Curated knowledge (the *why* behind the code) lives in an OKF bundle rather than in these tools — see [`okf`](#okf--knowledge-bundles-the-why-not-the-what).
|
|
258
260
|
|
|
259
|
-
Routing: exact symbol → `find_symbol`; who-calls → `find_callers`; what-it-calls → `find_callees`; "what breaks if I change X" → `impact`; "how does A end up calling B" → `trace_path`; fuzzy/conceptual → `search_context` then `expand_context`; exact string/identifier you can type verbatim → `search_code`. The canonical tool list lives in `src/constants.ts` (`TOOL_CATALOG`) and is rendered into
|
|
261
|
+
Routing: exact symbol → `find_symbol`; who-calls → `find_callers`; what-it-calls → `find_callees`; "what breaks if I change X" → `impact`; "how does A end up calling B" → `trace_path`; fuzzy/conceptual → `search_context` then `expand_context`; exact string/identifier you can type verbatim → `search_code`. The canonical tool list lives in `src/constants.ts` (`TOOL_CATALOG`) and is rendered into the MCP server instructions plus the global rules files for hosts not proven to surface those instructions to the model. Claude Code IS proven to surface them (they land in context on every MCP connection), so its global and per-project `CLAUDE.md` point at that live copy instead of re-embedding the catalog.
|
|
262
|
+
|
|
263
|
+
## Reranking (optional)
|
|
264
|
+
|
|
265
|
+
`search_context` can rerank its retrieved pool with [TypeSafe](https://typesafe.ai)'s Jev model before the usual threshold/MMR/budget steps run, scoring every candidate's relevance to the query with a single call. Measured on a bench of 332 mined queries (30 candidates each): recall@1 goes from 66.0% to 84.3%, and MRR from 0.761 to 0.894, at p50 0.60s and $0.15 for the whole bench.
|
|
266
|
+
|
|
267
|
+
It is opt-in and sends data off-machine: **the query text and every candidate's code/doc snippet are sent to `api.typesafe.ai`.** Enable it only if that is acceptable for your codebase.
|
|
268
|
+
|
|
269
|
+
To enable it:
|
|
270
|
+
|
|
271
|
+
- Run `project-brain setup` and select the reranker unit when prompted (you'll be asked for a token), or
|
|
272
|
+
- Pass `--reranker-token <token>` to `project-brain setup` for a non-interactive install, or
|
|
273
|
+
- Set the `TYPESAFE_API_KEY` environment variable (checked before the file either way).
|
|
274
|
+
|
|
275
|
+
With no token configured, nothing changes — zero network calls, identical result order. Any failure (timeout, non-2xx, a malformed response) falls back silently to the normal, unreranked order rather than surfacing an error. `project-brain health` reports `reranker: configured` once a token resolves.
|
|
260
276
|
|
|
261
277
|
## Recipes — get the most out of it
|
|
262
278
|
|
|
@@ -429,6 +445,8 @@ Check system health: Ollama availability, LanceDB status, and staleness of the i
|
|
|
429
445
|
project-brain health
|
|
430
446
|
```
|
|
431
447
|
|
|
448
|
+
Also reports the outcome of the last background sync (`.project-brain/sync-status.json`) as a `Last sync:` line — `ok`, `aborted` (the watchdog gave up on a wedged job), `failed`, or `crashed` (the process died mid-run without ever writing a terminal outcome). Anything short of a clean `ok` points at `.project-brain/sync.log`, where the post-commit hook's `sync`/`conceptualize` output actually lands (overwritten on each run, so it always reflects the last one). The `check_health` MCP tool surfaces the same data as a `lastSync` field.
|
|
449
|
+
|
|
432
450
|
### `bench` — measure retrieval quality
|
|
433
451
|
|
|
434
452
|
Published embedding leaderboards score a different corpus and a different task. A percent-or-two delta on someone else's benchmark says nothing about whether YOUR queries still surface the right file after changing model, dimension or chunking — so `bench` measures against ground truth from *this* repository instead.
|
|
@@ -545,6 +563,7 @@ BRAIN_HTTP_TOKEN=your-secret project-brain serve --http [--port 3000]
|
|
|
545
563
|
| `BRAIN_EMBED_MODEL` | `qwen3-embedding:0.6b` | Ollama embedding model (registry keys: `qwen3-embedding`, `nomic-text`; or any raw Ollama model name; `none` disables embeddings — lexical/keyword search only, no Ollama needed) |
|
|
546
564
|
| `OLLAMA_HOST` | `http://127.0.0.1:11434` | Ollama server URL |
|
|
547
565
|
| `BRAIN_NO_UPDATE_CHECK` | — | Set to `1` to disable the update-available notice |
|
|
566
|
+
| `TYPESAFE_API_KEY` | — | Opt-in Jev reranker token — see [Reranking (optional)](#reranking-optional). Checked before `~/.project-brain/reranker.json`. |
|
|
548
567
|
|
|
549
568
|
## Tuning (environment variables)
|
|
550
569
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "project-brain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Local-first MCP server that gives AI tools semantic memory of your codebase.",
|
|
6
6
|
"author": "jcsoftdev",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"zod": "^4.4.3"
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"project-brain-darwin-arm64": "0.
|
|
53
|
-
"project-brain-linux-x64": "0.
|
|
54
|
-
"project-brain-linux-arm64": "0.
|
|
55
|
-
"project-brain-windows-x64": "0.
|
|
56
|
-
"project-brain-windows-arm64": "0.
|
|
52
|
+
"project-brain-darwin-arm64": "0.35.0",
|
|
53
|
+
"project-brain-linux-x64": "0.35.0",
|
|
54
|
+
"project-brain-linux-arm64": "0.35.0",
|
|
55
|
+
"project-brain-windows-x64": "0.35.0",
|
|
56
|
+
"project-brain-windows-arm64": "0.35.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/bun": "latest",
|
|
@@ -4,11 +4,7 @@ This project is indexed with [project-brain](https://github.com/jcsoftdev/projec
|
|
|
4
4
|
|
|
5
5
|
## project-brain MCP
|
|
6
6
|
|
|
7
|
-
You have access to the `project-brain` MCP server for codebase knowledge retrieval.
|
|
8
|
-
|
|
9
|
-
{{tools}}
|
|
10
|
-
|
|
11
|
-
When answering questions about this codebase, run `search_context` first to find semantically relevant context before reading files directly — and reach for the structural tools when you know the exact symbol, caller, or want the impact of a change.
|
|
7
|
+
You have access to the `project-brain` MCP server for codebase knowledge retrieval. Once connected, the server's own instructions describe the full tool catalog, routing (`search_context` for fuzzy/conceptual questions vs. the structural tools for exact symbols, callers, and change impact), and workflow — that copy always matches the tools actually registered, so it is not repeated here.
|
|
12
8
|
|
|
13
9
|
### Project Context
|
|
14
10
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
1
|
## project-brain MCP
|
|
2
2
|
|
|
3
|
-
You have access to the `project-brain` MCP server for codebase knowledge retrieval.
|
|
4
|
-
|
|
5
|
-
{{tools}}
|
|
6
|
-
|
|
7
|
-
When answering questions about the codebase, run `search_context` first for fuzzy/conceptual questions, and use the structural tools (`find_symbol`/`find_callers`/`find_callees`/`impact`) for exact symbols, callers, and change impact — before reading files directly.
|
|
3
|
+
You have access to the `project-brain` MCP server for codebase knowledge retrieval. Once connected, the server's own instructions describe the full tool catalog, routing (`search_context` for fuzzy/conceptual questions vs. the structural tools — `find_symbol`/`find_callers`/`find_callees`/`impact` — for exact symbols, callers, and change impact), and workflow. That copy is generated from the same source as this file and always matches the tools actually registered, so it is not repeated here. Not seeing it? Reconnect or run `project-brain setup` again.
|