Skip to content

Commit 44f89ea

Browse files
Shahinyanmshahinyanmclaude
authored
fix: v0.45.1 — refuse multi-repo workspace parent (cross-project index bleed) (#45)
start.sh always passes an explicit project root, so startServer's git-root narrowing (the `!explicitRoot` branch) never runs. When the session starts from a non-git workspace parent nesting several project repos (e.g. /work/loom holding token-pilot, loom-host, aimux), the raw parent was used verbatim and ast-index indexed every sibling into one index — find_usages / read_symbol then bled matches across unrelated projects. isDangerousRoot only caught system/home dirs, so the parent slipped through. Add isMultiRepoParent(root) guard (core/validation.ts): a non-git dir with >=2 immediate child git repos. On match, ast-index is disabled (skipAstIndex) and a warning tells the user to set CLAUDE_PROJECT_DIR to the specific project — fail safe instead of bleeding. Wired into startServer and the server.ts MCP-roots auto-detect. Single-repo roots, monorepos, and roots that are themselves a git repo are unaffected. Tests: tests/core/multi-repo-parent.test.ts (7 cases). tsc clean. Co-authored-by: shahinyanm <mher.shahinyan@12go.asia> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2eae72d commit 44f89ea

34 files changed

Lines changed: 198 additions & 36 deletions

.claude-plugin/marketplace.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
},
77
"metadata": {
88
"description": "Token Pilot — save 60-90% tokens when AI reads code",
9-
"version": "0.45.0"
9+
"version": "0.45.1"
1010
},
1111
"plugins": [
1212
{
1313
"name": "token-pilot",
1414
"source": "./",
1515
"description": "Reduces token consumption by 60-90% via AST-aware lazy file reading, structural symbol navigation, and cross-session tool-usage analytics. 23 MCP tools + 25 subagents + budget watchdog hooks.",
16-
"version": "0.45.0",
16+
"version": "0.45.1",
1717
"author": {
1818
"name": "Digital-Threads"
1919
},

.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "token-pilot",
3-
"version": "0.45.0",
3+
"version": "0.45.1",
44
"description": "Saves 60-90% tokens on AI code reading. AST-aware lazy reads, symbol navigation, find_usages, structural git diff/log, edit-safety guard, Task-routing matcher, cross-session telemetry (errors + diagnostics), 25 tp-* subagents tiered to haiku/sonnet/opus with budget watchdog.",
55
"author": {
66
"name": "Digital-Threads",

CHANGELOG.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,28 @@ All notable changes to Token Pilot will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.45.0] - 2026-06-11
8+
## [0.45.1] - 2026-06-11
9+
10+
### Fixed — refuse a multi-repo workspace parent (cross-project index bleed)
11+
12+
`start.sh` always passes an explicit project root (`${CLAUDE_PROJECT_DIR:-$USER_CWD}`)
13+
to the server, so `startServer`'s git-root **narrowing only runs in the
14+
`!explicitRoot` branch — which is never taken**. When the session is launched
15+
from a non-git workspace parent that nests several project repos (e.g.
16+
`/work/loom` holding `token-pilot`, `loom-host`, `aimux`, …), the raw parent was
17+
used verbatim and ast-index indexed **every** sibling into one index. Symbol
18+
lookups then bled across projects — `find_usages` / `read_symbol` returning
19+
matches from the wrong repo, or `symbol not found`. `isDangerousRoot` only
20+
caught system/home dirs, so the parent slipped through.
21+
22+
New guard `isMultiRepoParent(root)` (in `core/validation.ts`) detects a non-git
23+
directory with ≥2 immediate child git repos. When the resolved root matches,
24+
ast-index is disabled (`skipAstIndex`) and a warning tells the user to set
25+
`CLAUDE_PROJECT_DIR` to the specific project — fail safe instead of bleeding.
26+
Wired into `startServer` and the `server.ts` MCP-roots auto-detect. Single-repo
27+
roots, monorepos, and roots that are themselves a git repo are unaffected.
28+
29+
930

1031
### Changed — default tool profile is now `full` (adoption fix)
1132

agents/tp-api-surface-tracker.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tools:
99
- mcp__token-pilot__read_symbol
1010
- Bash
1111
model: haiku
12-
token_pilot_version: "0.45.0"
12+
token_pilot_version: "0.45.1"
1313
token_pilot_body_hash: dd184501203fa7f3c73f419c4ffbe33c4be75400cb64a7a51733a3fe23f6e085
1414
requiredMcpServers:
1515
- "token-pilot"

agents/tp-audit-scanner.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tools:
1111
- Grep
1212
- Read
1313
model: sonnet
14-
token_pilot_version: "0.45.0"
14+
token_pilot_version: "0.45.1"
1515
token_pilot_body_hash: d172f600bf32277ea6eb4cbbee4542ddd698a986dcd96997d33930561964569b
1616
requiredMcpServers:
1717
- "token-pilot"

agents/tp-commit-writer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ tools:
88
- mcp__token-pilot__test_summary
99
- mcp__token-pilot__outline
1010
- Bash
11-
token_pilot_version: "0.45.0"
11+
token_pilot_version: "0.45.1"
1212
token_pilot_body_hash: de64a406b5176de19f7422619c7de7949b1f28865f225402c9cea9255f377428
1313
requiredMcpServers:
1414
- "token-pilot"

agents/tp-context-engineer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ tools:
1313
- Edit
1414
- Glob
1515
model: sonnet
16-
token_pilot_version: "0.45.0"
16+
token_pilot_version: "0.45.1"
1717
token_pilot_body_hash: 68b32af2dacd82ebe52c4eec93edb903d452688274c3065218270627c564d8b0
1818
requiredMcpServers:
1919
- "token-pilot"

agents/tp-dead-code-finder.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ tools:
1111
- Grep
1212
- Read
1313
model: sonnet
14-
token_pilot_version: "0.45.0"
14+
token_pilot_version: "0.45.1"
1515
token_pilot_body_hash: d9b7f5b7ae6f4ae21305c775361bcab097cc774370a6d976c093571d46d55021
1616
requiredMcpServers:
1717
- "token-pilot"

agents/tp-debugger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tools:
1212
- Read
1313
- Bash
1414
model: sonnet
15-
token_pilot_version: "0.45.0"
15+
token_pilot_version: "0.45.1"
1616
token_pilot_body_hash: 052413de8d92377edcde6ae5c823f5378db304baccfa29e8866467f42553a500
1717
requiredMcpServers:
1818
- "token-pilot"

agents/tp-dep-health.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ tools:
99
- Bash
1010
- Read
1111
model: haiku
12-
token_pilot_version: "0.45.0"
12+
token_pilot_version: "0.45.1"
1313
token_pilot_body_hash: e14dc57493d816f8c2e017963e2ef5f66bea50fd0b805a80e8a0d97c968427e7
1414
requiredMcpServers:
1515
- "token-pilot"

0 commit comments

Comments
 (0)