docs: fix stale test counts, tool counts, remove private refs#101
Conversation
README.md: - Test badge: 1030 -> 1137 (1,083 Python + 54 Swift) - Highlight line: 1,002 Python + 28 Swift -> 1,083 Python + 54 Swift - Testing section: 1,002 -> 1,083 - BrainBar Swift tests: 28 -> 54 - brain_digest: document digest and enrich modes (added in PR #100) CLAUDE.md: - Remove orchestrator path reference (private) - Remove orchestrator-specific compact instructions (not relevant to this repo) - BrainBar stubs: 4 -> 3 (brain_digest fixed in PR #100) - MCP tools: 8 -> 9 (was missing brain_tags) - Add brain_tags to tool list - Remove private repo path (golems/scripts/enrichment-lazy.sh) CONTRIBUTING.md: - MCP server comment: 14 tools -> 9 (legacy aliases consolidated) - Test count: 268 -> 1,083 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
📝 WalkthroughWalkthroughDocumentation updates across multiple files to reflect revised MCP tool counts, updated test suite statistics (1,030 to 1,137 tests), and modified tool descriptions. BrainBar stub status revised with tool state changes, and Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CLAUDE.md`:
- Line 62: The MCP tools list in CLAUDE.md incorrectly lists 9 tools and still
treats brain_get_person as a required tool; update the documentation line (the
MCP tools list) to show the Phase B required 8 tools: brain_search, brain_store,
brain_recall, brain_entity, brain_expand, brain_update, brain_digest,
brain_tags, and note that brain_get_person is a legacy alias only for backward
compatibility; also audit the tool registration code that registers tools (look
for registrations of brain_tags and brain_get_person) and ensure
brain_get_person remains registered only as an alias/deprecated wrapper around
brain_tags (not counted as a required tool) so runtime behavior matches the
updated CLAUDE.md.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: c25174ff-9cbd-4f0c-bbd8-b67e9f7415e4
📒 Files selected for processing (3)
CLAUDE.mdCONTRIBUTING.mdREADME.md
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: test (3.11)
- GitHub Check: test (3.13)
- GitHub Check: test (3.12)
🧰 Additional context used
🧠 Learnings (15)
📓 Common learnings
Learnt from: EtanHey
Repo: EtanHey/brainlayer PR: 0
File: :0-0
Timestamp: 2026-03-17T01:04:22.497Z
Learning: Applies to src/brainlayer/mcp/**/*.py and brain-bar/Sources/BrainBar/MCPRouter.swift: The 8 required MCP tools are `brain_search`, `brain_store`, `brain_recall`, `brain_entity`, `brain_expand`, `brain_update`, `brain_digest`, `brain_tags`. `brain_tags` is the 8th tool, replacing `brain_get_person`, as defined in the Phase B spec merged in PR `#72`. The Python MCP server already implements `brain_tags`. Legacy `brainlayer_*` aliases must be maintained for backward compatibility.
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T23:35:42.084Z
Learning: Applies to src/brainlayer/mcp/**/*.py : Implement MCP (Model Context Protocol) server with 8 tools: `brain_search`, `brain_store`, `brain_recall`, `brain_entity`, `brain_expand`, `brain_update`, `brain_digest`, `brain_get_person` (legacy `brainlayer_*` aliases must still work); entrypoint `brainlayer-mcp`
📚 Learning: 2026-03-17T01:04:22.497Z
Learnt from: EtanHey
Repo: EtanHey/brainlayer PR: 0
File: :0-0
Timestamp: 2026-03-17T01:04:22.497Z
Learning: Applies to src/brainlayer/mcp/**/*.py and brain-bar/Sources/BrainBar/MCPRouter.swift: The 8 required MCP tools are `brain_search`, `brain_store`, `brain_recall`, `brain_entity`, `brain_expand`, `brain_update`, `brain_digest`, `brain_tags`. `brain_tags` is the 8th tool, replacing `brain_get_person`, as defined in the Phase B spec merged in PR `#72`. The Python MCP server already implements `brain_tags`. Legacy `brainlayer_*` aliases must be maintained for backward compatibility.
Applied to files:
CONTRIBUTING.mdCLAUDE.mdREADME.md
📚 Learning: 2026-03-20T23:35:42.084Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T23:35:42.084Z
Learning: Applies to src/brainlayer/mcp/**/*.py : Implement MCP (Model Context Protocol) server with 8 tools: `brain_search`, `brain_store`, `brain_recall`, `brain_entity`, `brain_expand`, `brain_update`, `brain_digest`, `brain_get_person` (legacy `brainlayer_*` aliases must still work); entrypoint `brainlayer-mcp`
Applied to files:
CONTRIBUTING.mdCLAUDE.mdREADME.md
📚 Learning: 2026-03-17T01:04:11.749Z
Learnt from: EtanHey
Repo: EtanHey/brainlayer PR: 0
File: :0-0
Timestamp: 2026-03-17T01:04:11.749Z
Learning: The socket path `/tmp/brainbar.sock` is intentional for the BrainBar Swift daemon (brain-bar/) and must NOT be changed to `/tmp/brainlayer.sock`. BrainBar is a new daemon that coexists with the existing Python `brainlayer-mcp` (which uses `/tmp/brainlayer.sock`) during the migration period. The different paths avoid conflicts and allow A/B testing. Once BrainBar is proven stable, the Python server will be retired and `.mcp.json` will point to `/tmp/brainbar.sock` via socat.
Applied to files:
CONTRIBUTING.mdCLAUDE.md
📚 Learning: 2026-03-17T01:04:22.497Z
Learnt from: EtanHey
Repo: EtanHey/brainlayer PR: 0
File: :0-0
Timestamp: 2026-03-17T01:04:22.497Z
Learning: In BrainLayer, the BrainBar daemon uses the socket path `/tmp/brainbar.sock` (NOT `/tmp/brainlayer.sock`). BrainBar is a new native Swift daemon designed to coexist with the existing Python `brainlayer-mcp` server during the migration period. Different socket paths avoid conflicts and enable A/B testing. Once BrainBar is proven stable, the Python server will be retired.
Applied to files:
CONTRIBUTING.mdCLAUDE.md
📚 Learning: 2026-03-14T02:20:54.656Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-14T02:20:54.656Z
Learning: Applies to **/*.py : Run pytest before claiming behavior changed safely; current test suite has 929 tests
Applied to files:
CONTRIBUTING.mdREADME.md
📚 Learning: 2026-03-20T23:35:42.084Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T23:35:42.084Z
Learning: Applies to tests/**/*.py : Use pytest for testing with commands: `pytest` and `ruff check src/ && ruff format src/` for linting and formatting
Applied to files:
CONTRIBUTING.mdREADME.md
📚 Learning: 2026-03-20T23:35:42.084Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T23:35:42.084Z
Learning: When compacting sessions, NEVER preserve /loop, QUEUE-OPERATION, cron polling (3+ identical system/cron messages = keep ZERO), BrainLayer search injections, or full file contents re-readable from disk (keep path + one-line summary of decision made)
Applied to files:
CLAUDE.md
📚 Learning: 2026-03-20T23:35:42.084Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T23:35:42.084Z
Learning: When compacting sessions, ALWAYS preserve verbatim: user vision/goal/decision statements (if stated 3x+, note '[USER STATED Nx]'), user repetitions in DIFFERENT places as importance signals (keep ONE with annotation), short user messages (approvals, frustration signals), sprint plan with priority ratings, and all decisions with rationale (WHY not just WHAT) with modified file paths and one-line change summary
Applied to files:
CLAUDE.md
📚 Learning: 2026-03-18T00:12:36.931Z
Learnt from: EtanHey
Repo: EtanHey/brainlayer PR: 87
File: brain-bar/Sources/BrainBar/MCPRouter.swift:0-0
Timestamp: 2026-03-18T00:12:36.931Z
Learning: In `brain-bar/Sources/BrainBar/MCPRouter.swift` (Swift, BrainBar MCP daemon), the notification guard `let isNotification = (rawID == nil || rawID is NSNull)` is the single and only point where a no-response decision is made. Any message that passes this guard has a non-nil, non-NSNull id and MUST return a proper JSON-RPC response. Returning `[:]` (empty dict = no response) anywhere after the notification guard is always a bug — it creates a silent client hang. Flag any `return [:]` that appears after the guard in future reviews.
Applied to files:
CLAUDE.md
📚 Learning: 2026-03-18T00:12:15.607Z
Learnt from: EtanHey
Repo: EtanHey/brainlayer PR: 87
File: brain-bar/Sources/BrainBar/BrainBarServer.swift:118-129
Timestamp: 2026-03-18T00:12:15.607Z
Learning: In `brain-bar/Sources/BrainBar/MCPRouter.swift` (Swift, BrainBar daemon), the socket-before-DB startup pattern means the Unix socket binds immediately (~1ms) while the database may take several seconds to open on cold start (8GB file). Any tool handler that accesses `database` MUST throw an explicit error (e.g., `ToolError.noDatabase`) when `database` is nil — never return empty or default results (e.g., `guard let db else { return "[]" }` is forbidden). The false-success pattern hides startup timing issues from MCP clients. Flag any `guard let db = database else { return ... }` patterns that silently return defaults instead of throwing.
Applied to files:
CLAUDE.md
📚 Learning: 2026-03-20T23:35:42.084Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T23:35:42.084Z
Learning: Applies to src/brainlayer/enrichment*.py : For enrichment backend configuration: use primary backend MLX (`Qwen2.5-Coder-14B-Instruct-4bit`) on Apple Silicon (port 8080), fallback to Ollama (`glm-4.7-flash`) on port 11434 after 3 consecutive MLX failures, or override with `BRAINLAYER_ENRICH_BACKEND=ollama|mlx|groq` environment variable
Applied to files:
CLAUDE.md
📚 Learning: 2026-03-20T23:35:42.084Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T23:35:42.084Z
Learning: Applies to src/brainlayer/daemon.py : Implement FastAPI daemon in `daemon.py` with endpoints: `/health`, `/stats`, `/search`, `/context/{chunk_id}`, `/session/{session_id}`, `/brain/graph`, `/brain/node/{node_id}`, `/backlog/items` (GET/POST/PATCH/DELETE)
Applied to files:
CLAUDE.md
📚 Learning: 2026-03-14T02:20:54.656Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-03-14T02:20:54.656Z
Learning: Be aware of known BrainLayer issues: DB locking during enrichment and WAL growth up to 4.7GB
Applied to files:
CLAUDE.md
📚 Learning: 2026-03-20T23:35:42.084Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-20T23:35:42.084Z
Learning: Applies to src/brainlayer/**/*.py : Use ruff for all linting and formatting of Python source code in `src/` directory
Applied to files:
README.md
🔇 Additional comments (8)
CONTRIBUTING.md (2)
42-42: LGTM: Test count update aligns with README metrics.The updated test count (1,083) matches the Python test breakdown documented in README.md (1,083 Python + 54 Swift = 1,137 total).
18-18:⚠️ Potential issue | 🟠 MajorRemove
brain_get_personfrom the MCP server; update CONTRIBUTING.md to reflect 8 tools.According to the Phase B spec (PR
#72), the 8 required MCP tools arebrain_search,brain_store,brain_recall,brain_entity,brain_expand,brain_update,brain_digest, andbrain_tags. The toolbrain_tagswas designed to replacebrain_get_person. The current implementation incorrectly includes both, and CONTRIBUTING.md should reflect 8 tools, not 9.⛔ Skipped due to learnings
Learnt from: EtanHey Repo: EtanHey/brainlayer PR: 0 File: :0-0 Timestamp: 2026-03-17T01:04:22.497Z Learning: Applies to src/brainlayer/mcp/**/*.py and brain-bar/Sources/BrainBar/MCPRouter.swift: The 8 required MCP tools are `brain_search`, `brain_store`, `brain_recall`, `brain_entity`, `brain_expand`, `brain_update`, `brain_digest`, `brain_tags`. `brain_tags` is the 8th tool, replacing `brain_get_person`, as defined in the Phase B spec merged in PR `#72`. The Python MCP server already implements `brain_tags`. Legacy `brainlayer_*` aliases must be maintained for backward compatibility.Learnt from: CR Repo: EtanHey/brainlayer PR: 0 File: CLAUDE.md:0-0 Timestamp: 2026-03-20T23:35:42.084Z Learning: Applies to src/brainlayer/mcp/**/*.py : Implement MCP (Model Context Protocol) server with 8 tools: `brain_search`, `brain_store`, `brain_recall`, `brain_entity`, `brain_expand`, `brain_update`, `brain_digest`, `brain_get_person` (legacy `brainlayer_*` aliases must still work); entrypoint `brainlayer-mcp`Learnt from: CR Repo: EtanHey/brainlayer PR: 0 File: AGENTS.md:0-0 Timestamp: 2026-03-14T02:20:54.656Z Learning: Request codex review, cursor review, and bugbot review for BrainLayer PRsLearnt from: CR Repo: EtanHey/brainlayer PR: 0 File: AGENTS.md:0-0 Timestamp: 2026-03-14T02:20:54.656Z Learning: Treat retrieval correctness, write safety, and MCP stability as critical-path concerns in BrainLayer reviewsREADME.md (5)
10-10: LGTM: Badge count matches Python + Swift test totals.The badge update (1,137 passing) correctly reflects the sum of 1,083 Python tests and 54 Swift tests documented on line 15.
137-137: LGTM: brain_digest modes documentation matches implementation.The updated description accurately documents the two modes based on the implementation in
src/brainlayer/mcp/store_handler.py:
digestmode: extracts entities, relations, and action items from new content viadigest_content()enrichmode: applies realtime LLM enrichment to existing chunks viaenrich_realtime()
262-262: LGTM: Python test count consistent with badge total.The documented count (1,083 Python tests) matches the breakdown on line 15 and contributes to the badge total of 1,137.
265-265: LGTM: Swift test count consistent with badge total.The documented count (54 Swift tests) matches the breakdown on line 15 and contributes to the badge total of 1,137.
15-15: Update README test counts to reflect actual test numbers.The Python test count in README.md line 15 is incorrect. Verification shows 254 Python tests collected (not 1,083), and 54 Swift tests. Update the claim to reflect the actual counts: 254 Python + 54 Swift tests. Note: pytest reported 50 collection errors, which may need investigation.
> Likely an incorrect or invalid review comment.CLAUDE.md (1)
13-15: Update CLAUDE.md to reflect the actual implementation status: brain_digest is still not implemented.The code shows
handleBrainDigest()throwsToolError.notImplemented("brain_digest"), but CLAUDE.md incorrectly lists it in the "Working" section. Brain_digest should remain in the broken/stub tools list along with brain_update and brain_expand.> Likely an incorrect or invalid review comment.
| - Brain graph API: `/brain/graph`, `/brain/node/{node_id}` | ||
| - Backlog API: `/backlog/items` (GET/POST/PATCH/DELETE) | ||
| - MCP tools (8): `brain_search`, `brain_store`, `brain_recall`, `brain_entity`, `brain_expand`, `brain_update`, `brain_digest`, `brain_get_person` (legacy `brainlayer_*` aliases still work) | ||
| - MCP tools (9): `brain_search`, `brain_store`, `brain_recall`, `brain_entity`, `brain_expand`, `brain_update`, `brain_digest`, `brain_get_person`, `brain_tags` (legacy `brainlayer_*` aliases still work) |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify both brain_get_person and brain_tags are present
# Check for both tool definitions
echo "=== brain_get_person ==="
ast-grep --pattern 'Tool(
name="brain_get_person",
$$$
)'
echo -e "\n=== brain_tags ==="
ast-grep --pattern 'Tool(
name="brain_tags",
$$$
)'
echo -e "\n=== Total tool count ==="
ast-grep --pattern 'Tool(
name=$_,
$$$
)' | grep -c 'name='Repository: EtanHey/brainlayer
Length of output: 6425
Update MCP tools list to reflect Phase B spec: 8 required tools with brain_tags replacing brain_get_person.
The code currently implements 9 tools (both brain_get_person and brain_tags), but per the Phase B spec (PR #72), the 8 required MCP tools are: brain_search, brain_store, brain_recall, brain_entity, brain_expand, brain_update, brain_digest, brain_tags. The brain_get_person tool should be retained only as a legacy alias for backward compatibility, not counted as one of the 8 required tools. Update the documentation (CLAUDE.md line 62) and verify tool registration to align with the spec.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CLAUDE.md` at line 62, The MCP tools list in CLAUDE.md incorrectly lists 9
tools and still treats brain_get_person as a required tool; update the
documentation line (the MCP tools list) to show the Phase B required 8 tools:
brain_search, brain_store, brain_recall, brain_entity, brain_expand,
brain_update, brain_digest, brain_tags, and note that brain_get_person is a
legacy alias only for backward compatibility; also audit the tool registration
code that registers tools (look for registrations of brain_tags and
brain_get_person) and ensure brain_get_person remains registered only as an
alias/deprecated wrapper around brain_tags (not counted as a required tool) so
runtime behavior matches the updated CLAUDE.md.
Previous badge said "1,137 passing" but pytest shows 1,070 passed + 9 skipped + 3 xfailed + 1 xpassed = 1,083 items. Breaking down by language is more accurate than inflating the "passing" count. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
pytest --coand Swift test file counts. Document brain_digest's two modes (digest, enrich) added in PR feat: unified enrichment controller + 3-mode brain_digest #100.Test plan
python3 -m pytest --co -q 2>/dev/null | tail -3should show 1083grep -c 'func test' brain-bar/Tests/BrainBarTests/*.swiftshould total 54grep -r 'orchestrator\|golems/' CLAUDE.md README.md CONTRIBUTING.md🤖 Generated with Claude Code
Note
Fix stale test counts and tool counts in docs
Updates documentation to reflect current state of the codebase across three files:
Macroscope summarized 68ce970.
Summary by CodeRabbit
New Features
brain_digesttool now supports two modes: digest mode for entity extraction/relations/action items, and enrich mode for real-time LLM enrichment on existing chunks.Documentation