projecta-rrr 1.21.8 → 1.21.10

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/CHANGELOG.md CHANGED
@@ -4,7 +4,109 @@ All notable changes to RRR will be documented in this file.
4
4
 
5
5
  Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
- ## [1.21.8] - 2026-04-18
7
+ ## [1.21.10] - 2026-04-18
8
+
9
+ **semantic_search injection waves 2 + 3.**
10
+
11
+ Completes the token-saving rollout started in v1.21.9. Waves 2 and 3 target
12
+ commands that auditor identified as MED priority but still carry significant
13
+ token cost in practice — milestone audits, gap planning, roadmap creation,
14
+ project research, and the planner agent itself.
15
+
16
+ ### Added
17
+
18
+ - **semantic_search in `rrr-planner` agent.** Planner previously grepped
19
+ CONTEXT.md and ROADMAP sections during task breakdown — now prefers
20
+ ~500-token semantic_search for "existing implementations", "similar
21
+ patterns", "existing code shape" queries.
22
+
23
+ - **semantic_search reference in 4 more commands:** `/rrr:audit-milestone`,
24
+ `/rrr:plan-milestone-gaps`, `/rrr:create-roadmap`, `/rrr:research-project`.
25
+ These don't run every session but they dominate milestone boundaries —
26
+ typical burn 12-22K each before this change.
27
+
28
+ - **`semantic-search-preference.md` domain-query patterns (wave 3).**
29
+ 10-row table: tech stack, architecture, similar implementation, error
30
+ root-cause, requirement coverage, auth/security, data model, test
31
+ coverage, API surface, config. With suggested k per query. Purpose:
32
+ stop Claude from grepping for "middleware" when a better-phrased
33
+ semantic_search would nail it in one call.
34
+
35
+ ### Status after waves 1-3
36
+
37
+ Commands using semantic_search: **13 of 23** (was 5). The 10 remaining
38
+ untouched commands do minimal code exploration (<5K tokens each) —
39
+ diminishing returns beyond here.
40
+
41
+ Agents using semantic_search: **5 of ~15** — the five highest-burn ones
42
+ (rrr-codebase-mapper, rrr-phase-researcher, rrr-executor, rrr-debugger,
43
+ rrr-planner). These carry ~80% of agent-side exploration cost.
44
+
45
+ ### Next (v1.22.0)
46
+
47
+ Webhook-driven re-index infrastructure (GitHub App single-URL webhook +
48
+ local post-commit hook → local MCP). Closes the "stale index" gap — today
49
+ reindex only runs on cron or manual sync_repo. Needs a phase plan; not a
50
+ patch.
51
+
52
+ ## [1.21.9] - 2026-04-18
53
+
54
+ **Token-efficient RRR: semantic_search injection wave 1 + hosted worker hardening.**
55
+
56
+ After indexing 59 repos across the team, audit revealed RRR commands/agents were
57
+ doing Read/Grep/Glob chains when semantic_search could return ranked chunks at
58
+ 5-20x lower token cost. Wave 1 ships the highest-ROI injections. Also bundles
59
+ four hosted-worker patches discovered during batch indexing.
60
+
61
+ ### Added
62
+
63
+ - **semantic_search in 4 high-burn agents.** `rrr-codebase-mapper`,
64
+ `rrr-phase-researcher`, `rrr-executor`, `rrr-debugger` now have
65
+ `mcp__rrr-search-hosted__semantic_search` + `mcp__rrr-search__semantic_search`
66
+ in their tool frontmatter. These five agents carried the bulk of RRR's
67
+ code-exploration token cost (15-60K tokens per run each); semantic_search
68
+ replaces most of that with ~500-token ranked chunks.
69
+
70
+ - **semantic_search reference in 4 high-leverage commands.**
71
+ `/rrr:map-codebase`, `/rrr:research-phase`, `/rrr:brownfield-audit`,
72
+ `/rrr:debug` now `@rrr/references/semantic-search-preference.md` in their
73
+ execution_context. Previously only 5 commands had the reference
74
+ (`progress`, `plan-phase`, `execute-phase`, `discuss-phase`, `verify-work`).
75
+
76
+ - **Full audit at `/tmp/rrr-token-audit.md`** (one-shot; not committed).
77
+ Identifies 10 remaining HIGH/MED-priority injection points for waves 2-3.
78
+
79
+ ### Changed
80
+
81
+ - **Hosted worker default budget: 5M → 100M tokens per repo / 30d.**
82
+ (`rrr/hosted-mcp/src/worker/lib/token-budget.js:22`.) Real-world repos
83
+ like `superintelligence` (9M tokens) and `Internjobs` (25M tokens) were
84
+ tripping the 5M cap. 100M fits all observed repos with headroom; remains
85
+ overridable per repo via `.rrr-search.json` `budget_tokens`.
86
+
87
+ - **Voyage batch cap: 100K → 80K tokens; estimator 3.5 → 2.8 chars/token.**
88
+ (`rrr/hosted-mcp/src/worker/lib/voyage-embedder.js:96-97`.) The old
89
+ char-based estimator undercounted — batches passing the 100K cap were
90
+ arriving at Voyage at 124-130K tokens and hitting the 120K hard limit
91
+ on repos like `OpenHands` and `gooseworks-skills`. Tighter cap + matched
92
+ estimator resolves this.
93
+
94
+ - **`index_repo` owner/repo regex allows dots.**
95
+ (`rrr/hosted-mcp/src/mcp/tools/index-repo.js:101`.) The previous
96
+ `([^/.]+?)` would fail to parse repos like `PA-Ai-Team/MALA.dev.git`,
97
+ silently falling back to `slug/slug` — causing a 404 on clone. New
98
+ pattern `(.+?)(?:\.git)?$` handles dots in repo names correctly.
99
+
100
+ ### Fixed
101
+
102
+ - **Git clone fallback for non-`main` default branches.**
103
+ (`rrr/hosted-mcp/src/worker/lib/github-clone.js:158-178`.) Repos whose
104
+ default branch is `master` (or anything non-`main`) were failing clone
105
+ with `fatal: Remote branch main not found in upstream origin`. Added
106
+ a catch-and-retry: on branch-not-found, re-clone without `--branch`
107
+ flag (git uses the remote's default branch automatically).
108
+
109
+
8
110
 
9
111
  **End-to-end verified on a second repo. Multiple worker bootstrap fixes.**
10
112
 
@@ -2,7 +2,7 @@
2
2
  name: rrr-codebase-mapper
3
3
  description: Explores codebase and writes structured analysis documents. Spawned by map-codebase with a focus area (tech, arch, quality, concerns). Writes documents directly to reduce orchestrator context load.
4
4
  model: sonnet
5
- tools: Read, Bash, Grep, Glob, Write
5
+ tools: Read, Bash, Grep, Glob, Write, mcp__rrr-search-hosted__semantic_search, mcp__rrr-search__semantic_search
6
6
  color: cyan
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: rrr-debugger
3
3
  description: Investigates bugs using scientific method, manages debug sessions, handles checkpoints. Spawned by /rrr:debug orchestrator.
4
4
  model: inherit
5
- tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch
5
+ tools: Read, Write, Edit, Bash, Grep, Glob, WebSearch, mcp__rrr-search-hosted__semantic_search, mcp__rrr-search__semantic_search
6
6
  color: orange
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: rrr-executor
3
3
  description: Executes RRR plans with atomic commits, deviation handling, checkpoint protocols, and state management. Spawned by execute-phase orchestrator or execute-plan command.
4
4
  model: inherit
5
- tools: Read, Write, Edit, Bash, Grep, Glob
5
+ tools: Read, Write, Edit, Bash, Grep, Glob, mcp__rrr-search-hosted__semantic_search, mcp__rrr-search__semantic_search
6
6
  color: yellow
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: rrr-phase-researcher
3
3
  description: Researches how to implement a phase before planning. Produces RESEARCH.md consumed by rrr-planner. Spawned by /rrr:plan-phase orchestrator.
4
4
  model: sonnet
5
- tools: Read, Write, Bash, Grep, Glob, WebSearch, WebFetch, mcp__context7__*
5
+ tools: Read, Write, Bash, Grep, Glob, WebSearch, WebFetch, mcp__context7__*, mcp__rrr-search-hosted__semantic_search, mcp__rrr-search__semantic_search
6
6
  color: cyan
7
7
  ---
8
8
 
@@ -2,7 +2,7 @@
2
2
  name: rrr-planner
3
3
  description: Creates executable phase plans with task breakdown, dependency analysis, and goal-backward verification. Spawned by /rrr:plan-phase orchestrator.
4
4
  model: sonnet
5
- tools: Read, Write, Bash, Glob, Grep, WebFetch, mcp__context7__*
5
+ tools: Read, Write, Bash, Glob, Grep, WebFetch, mcp__context7__*, mcp__rrr-search-hosted__semantic_search, mcp__rrr-search__semantic_search
6
6
  color: green
7
7
  ---
8
8
 
@@ -19,6 +19,7 @@ Verify milestone achieved its definition of done. Check requirements coverage, c
19
19
 
20
20
  <execution_context>
21
21
  @~/.claude/rrr/references/principles.md
22
+ @rrr/references/semantic-search-preference.md
22
23
  </execution_context>
23
24
 
24
25
  <context>
@@ -37,6 +37,7 @@ Audit brownfield repositories to detect scattered planning documents, classify t
37
37
  @~/.claude/rrr/references/principles.md
38
38
  @~/.claude/rrr/references/scan-exclusions.md
39
39
  @~/.claude/rrr/lib/phase-paths.md
40
+ @rrr/references/semantic-search-preference.md
40
41
  </execution_context>
41
42
 
42
43
  <scan_ignored_paths>
@@ -40,6 +40,7 @@ Roadmaps define what work happens in what order. Phases map to requirements.
40
40
  @~/.claude/rrr/templates/roadmap.md
41
41
  @~/.claude/rrr/templates/state.md
42
42
  @~/.claude/rrr/references/goal-backward.md
43
+ @rrr/references/semantic-search-preference.md
43
44
  </execution_context>
44
45
 
45
46
  <context>
@@ -9,6 +9,10 @@ allowed-tools:
9
9
  - AskUserQuestion
10
10
  ---
11
11
 
12
+ <execution_context>
13
+ @rrr/references/semantic-search-preference.md
14
+ </execution_context>
15
+
12
16
  <objective>
13
17
  Debug issues using scientific method with subagent isolation.
14
18
 
@@ -21,6 +21,7 @@ Output: .planning/codebase/ folder with 7 structured documents about the codebas
21
21
 
22
22
  <execution_context>
23
23
  @~/.claude/rrr/workflows/map-codebase.md
24
+ @rrr/references/semantic-search-preference.md
24
25
  </execution_context>
25
26
 
26
27
  <context>
@@ -22,6 +22,7 @@ One command creates all fix phases — no manual `/rrr:add-phase` per gap.
22
22
  @~/.claude/rrr/references/principles.md
23
23
  @~/.claude/rrr/workflows/plan-phase.md
24
24
  @~/.claude/rrr/lib/phase-paths.md
25
+ @rrr/references/semantic-search-preference.md
25
26
  </execution_context>
26
27
 
27
28
  <context>
@@ -8,6 +8,10 @@ allowed-tools:
8
8
  - Task
9
9
  ---
10
10
 
11
+ <execution_context>
12
+ @rrr/references/semantic-search-preference.md
13
+ </execution_context>
14
+
11
15
  <objective>
12
16
  Research how to implement a phase. Spawns rrr-phase-researcher agent with phase context.
13
17
 
@@ -23,6 +23,10 @@ For new projects, use /rrr:new-project instead.
23
23
  Deprecated: 2026-01-16
24
24
  -->
25
25
 
26
+ <execution_context>
27
+ @rrr/references/semantic-search-preference.md
28
+ </execution_context>
29
+
26
30
  <objective>
27
31
  Research domain ecosystem. Spawns 4 parallel rrr-project-researcher agents for comprehensive coverage.
28
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "projecta-rrr",
3
- "version": "1.21.8",
3
+ "version": "1.21.10",
4
4
  "description": "A meta-prompting, context engineering and spec-driven development system for Claude Code by Projecta.ai",
5
5
  "bin": {
6
6
  "projecta-rrr": "bin/install.js",
@@ -23,6 +23,25 @@ When exploring the codebase to answer "what does X do?", "where is Y configured?
23
23
  - **Relevance:** semantic_search ranks by cosine similarity + RRF fusion with ripgrep; grep returns alphabetically.
24
24
  - **Cross-file synthesis:** top-K often spans multiple files — one call answers "how X works" that would otherwise need 3-5 greps.
25
25
 
26
+ ## Domain-Specific Queries
27
+
28
+ Start with the right query phrasing — semantic_search ranks by meaning, not keywords. Pick the pattern closest to your intent:
29
+
30
+ | Scenario | Query pattern | k |
31
+ |---|---|---|
32
+ | Tech stack discovery | `"technology stack" "frameworks" "dependencies" "build tools"` | 10 |
33
+ | Architecture / module layout | `"system architecture" "module organization" "data flow"` | 10 |
34
+ | Find similar implementation | `"implementation pattern for X" "existing code example"` | 5 |
35
+ | Error root-cause (logs + code) | `"error pattern" "failure signature" "root cause indicators"` | 20 |
36
+ | Requirement coverage | `"requirement implementation" "feature coverage" "missing pieces"` | 10 |
37
+ | Auth / security surfaces | `"authentication flow" "token validation" "permission check"` | 10 |
38
+ | Data model / schema | `"schema definition" "table design" "entity relationships"` | 10 |
39
+ | Test coverage gaps | `"test cases" "validation" "edge case handling"` | 10 |
40
+ | API surface | `"endpoints" "request handlers" "route definitions"` | 10 |
41
+ | Config / environment | `"configuration" "environment variables" "settings"` | 5 |
42
+
43
+ **Rule of thumb:** one semantic_search (k=5-10, ~500 tokens) before any Grep/Read chain on an unknown area. If the top hits answer the question, stop. If not, narrow with a second query — still cheaper than brute-force grep.
44
+
26
45
  ## Discovery
27
46
 
28
47
  Check availability once at workflow start: