docs: fix test count 1044→1030#92
Conversation
Co-Authored-By: Claude Sonnet 4.6 <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.
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThe README documentation is updated to reflect the BrainLayer MCP ecosystem's expansion from 8 to 9 tools, introducing the new 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 unit tests (beta)
📝 Coding Plan
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: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Line 3: The PR description/title is misleading because README changes add new
features (MCP tools count change, new tool brain_tags, Core tools count change,
BrainBar daemon, Real-time Hooks, new data source Codex CLI, and updated test
counts) rather than only fixing test counts; update the PR by either (A)
expanding the title and description to enumerate the README feature additions
(mentioning MCP tools count, brain_tags, Core tools, BrainBar daemon, Real-time
Hooks, Codex CLI, and test count updates) so commit history reflects these
feature docs, or (B) split the changes into two PRs: one that contains only the
test count fixes and a separate PR with the documentation additions (references:
"brain_tags", "BrainBar daemon", "Real-time Hooks", "Codex CLI", MCP/Core tools
count statements in README) and ensure the README in each PR only contains the
relevant subset of changes.
- Line 184: The "Multi-source" cell showing "7 sources" in the comparison table
is inconsistent with the Data Sources list (which enumerates 8 items); decide
and document the counting methodology (e.g., count only batch indexers vs.
include manual/real-time hooks) and update either the table cell (the |
**Multi-source** | value) or the Data Sources list so they match; reference the
table row containing "| **Multi-source** | 7 sources |" and the Data Sources
section entries ("Claude Code", "Claude Desktop", "WhatsApp", "YouTube", "Codex
CLI", "Markdown", "Manual (via MCP tool)", "Real-time (Claude Code hooks)") when
making the change and add a short parenthetical note in the Data Sources section
clarifying which types are counted.
- Line 131: Remove the deprecated brain_get_person tool registration and
handler: delete its registration block in src/brainlayer/mcp/__init__.py (the
block that registers "brain_get_person") and remove or refactor the
corresponding handler implementation in entity_handler.py so only brain_tags
remains as the Phase B tool. Ensure the tool-registration loop still registers
brain_tags (the existing brain_tags block) and retains legacy aliases beginning
with "brainlayer_" for backward compatibility. Update the docstring/comment that
currently reads "7 consolidated tools" to reflect the correct count (8 tools)
and adjust any nearby documentation text referencing brain_get_person so it no
longer appears in the tools list.
- Around line 106-108: Update the documented Swift test count from 28 to 37:
locate the line that reads "1,002 Python + 28 Swift tests" in README.md and
change it to "1,002 Python + 37 Swift tests"; also ensure any nearby mentions or
summary lines referencing BrainBar components (BrainBarServer, BrainDatabase,
MCPRouter, MCPFraming) or the RealtimeIndexer methods (capture_prompt,
index_response, record_chapter, cleanup) remain accurate and unchanged.
🪄 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: 69092256-aff6-4656-a1a1-9394e6b3e327
📒 Files selected for processing (1)
README.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.12)
- GitHub Check: test (3.11)
- GitHub Check: test (3.13)
🧰 Additional context used
🧠 Learnings (7)
📓 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.
📚 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:
README.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:
README.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:
README.md
📚 Learning: 2026-03-12T14:22:54.809Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-12T14:22:54.809Z
Learning: Applies to src/brainlayer/**/*.py : Provide `brainlayer export-obsidian` command to export as Markdown vault with backlinks and tags
Applied to files:
README.md
📚 Learning: 2026-03-12T14:22:54.809Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-12T14:22:54.809Z
Learning: Applies to src/brainlayer/**/*.py : Provide `brainlayer brain-export` command to export brain graph as JSON for dashboard consumption
Applied to files:
README.md
📚 Learning: 2026-03-12T14:22:54.809Z
Learnt from: CR
Repo: EtanHey/brainlayer PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-03-12T14:22:54.809Z
Learning: Applies to src/brainlayer/**/*.py : Preserve verbatim content for `ai_code`, `stack_trace`, and `user_message` message types during classification and chunking; skip `noise` content entirely; summarize `build_log` content; extract structure-only for `dir_listing`
Applied to files:
README.md
🔇 Additional comments (5)
README.md (5)
124-131: LGTM - Core tools categorization is logical.Expanding Core from 3 to 4 tools by adding
brain_tagsmakes sense. The four core operations (search, store, recall, browse tags) represent foundational memory operations, while the 5 Knowledge Graph tools handle entity relationships and content processing.Total: 4 Core + 5 Knowledge Graph = 9 tools ✓
96-96: LGTM - Architecture diagram updated consistently.The architecture diagram correctly reflects the 9 MCP tools, consistent with the changes throughout the document.
180-180: LGTM - Comparison table updated consistently.The competitive comparison correctly reflects 9 MCP tools across multiple mentions, maintaining consistency throughout the marketing message.
Also applies to: 193-193
252-252: Fix Codex CLI command and path in documentation.The Codex CLI indexer is implemented, but the README table entry is incorrect. The actual command is
brainlayer ingest-codex(notbrainlayer index --source codex), and the default path is~/.codex/sessions(not~/.codex/). Update line 252 to match the actual CLI interface.
10-10: Test count documentation is accurate and consistent.The test count reduction from 1,044 to 1,030 is confirmed by git commit
be7a426and verified by scanning the test suite, which found exactly 1,030 test functions. The breakdown (1,002 Python + 28 Swift = 1,030 total) is arithmetically correct and the documentation across lines 10, 15, and 261 is consistent.
| # BrainLayer | ||
|
|
||
| > Persistent memory and knowledge graph for AI agents — 8 MCP tools to search, store, recall, digest, expand, and explore entities across every conversation. | ||
| > Persistent memory and knowledge graph for AI agents — 9 MCP tools, real-time indexing hooks, and a native macOS daemon for always-on recall across every conversation. |
There was a problem hiding this comment.
PR objectives don't match the actual scope of changes.
The PR title indicates this is just a test count fix ("docs: fix test count 1044→1030"), but the changes include:
- MCP tools count 8 → 9 (lines 3, 9, 96, 122, 180, 193)
- New tool:
brain_tags(line 131) - New Core tools count 3 → 4 (line 124)
- New components: BrainBar daemon and Real-time Hooks (lines 3, 15, 106-108, 120, 187, 255)
- New data source: Codex CLI (line 252)
- Data sources count 6 → 7 (line 184)
- Test count updates (lines 10, 15, 261)
This is misleading for git history and code archaeology. Either:
- Update the PR title/description to reflect the full scope, or
- Split the test count fixes into a separate PR from the feature documentation updates
Also applies to: 9-10, 15-15, 96-96, 106-108, 120-120, 122-122, 124-124, 131-131, 180-180, 184-184, 187-187, 193-193, 252-252, 255-255, 261-261
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` at line 3, The PR description/title is misleading because README
changes add new features (MCP tools count change, new tool brain_tags, Core
tools count change, BrainBar daemon, Real-time Hooks, new data source Codex CLI,
and updated test counts) rather than only fixing test counts; update the PR by
either (A) expanding the title and description to enumerate the README feature
additions (mentioning MCP tools count, brain_tags, Core tools, BrainBar daemon,
Real-time Hooks, Codex CLI, and test count updates) so commit history reflects
these feature docs, or (B) split the changes into two PRs: one that contains
only the test count fixes and a separate PR with the documentation additions
(references: "brain_tags", "BrainBar daemon", "Real-time Hooks", "Codex CLI",
MCP/Core tools count statements in README) and ensure the README in each PR only
contains the relevant subset of changes.
| H["Real-time Hooks"] -->|live per-message| D | ||
| I["BrainBar<br/>macOS daemon"] -->|Unix socket MCP| B | ||
| ``` |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify BrainBar implementation and Real-time Hooks exist
echo "=== Checking BrainBar Swift implementation ==="
fd -e swift . brain-bar/ --exec echo "Found: {}"
echo ""
echo "=== Checking Real-time Hooks implementation ==="
rg -l "hook" --type py -g '!test*' | head -5
echo ""
echo "=== Checking BrainBar binary size if built ==="
if [ -f "brain-bar/.build/release/BrainBar" ]; then
ls -lh brain-bar/.build/release/BrainBar | awk '{print "Binary size: " $5}'
else
echo "BrainBar binary not built yet"
fi
echo ""
echo "=== Checking for Real-time Hooks documentation ==="
rg -n "real-time|per-message" docs/ README.md -i | head -10Repository: EtanHey/brainlayer
Length of output: 3195
🏁 Script executed:
# Count total Swift tests in BrainBar
find brain-bar/Tests -name "*.swift" -type f -exec wc -l {} + | tail -1
# Check Package.swift for test target configuration
cat brain-bar/Package.swift | grep -A 20 "testTarget"
# Search for actual Real-time Hooks implementation (not just "hook" in filenames)
rg "def.*hook|class.*Hook|@.*hook" --type py src/
# Check for indexing hooks or callback registration
rg "index.*hook|hook.*index|on_index|register.*hook" --type py src/Repository: EtanHey/brainlayer
Length of output: 604
🏁 Script executed:
# Count actual test methods (test* functions) in Swift
grep -r "func test" brain-bar/Tests/ | wc -l
# Read hooks implementation
cat src/brainlayer/hooks/indexer.py | head -50
# Check hooks CLI command details
grep -A 20 '@app.command("hooks")' src/brainlayer/cli/__init__.py
# Count total test methods in both Swift and Python
echo "=== Total test count ==="
echo "Swift test methods:"
grep -r "func test" brain-bar/Tests/ | wc -l
echo "Python test files:"
find tests/ -name "*test*.py" -o -name "test_*.py" 2>/dev/null | wc -lRepository: EtanHey/brainlayer
Length of output: 2509
Correct test count in documentation: 37 Swift tests, not 28.
The BrainBar daemon and Real-time Hooks are fully implemented and production-ready:
- BrainBar: Complete Swift implementation with BrainBarServer, BrainDatabase, MCPRouter, and MCPFraming (37 Swift test methods across 3 test files)
- Real-time Hooks: Fully functional RealtimeIndexer in
src/brainlayer/hooks/indexer.pywith capture_prompt(), index_response(), record_chapter(), and cleanup methods using SQLite WAL for durability
However, line 15 claims "1,002 Python + 28 Swift tests" when there are actually 37 Swift test methods. Update to reflect the correct count.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` around lines 106 - 108, Update the documented Swift test count
from 28 to 37: locate the line that reads "1,002 Python + 28 Swift tests" in
README.md and change it to "1,002 Python + 37 Swift tests"; also ensure any
nearby mentions or summary lines referencing BrainBar components
(BrainBarServer, BrainDatabase, MCPRouter, MCPFraming) or the RealtimeIndexer
methods (capture_prompt, index_response, record_chapter, cleanup) remain
accurate and unchanged.
| | `brain_search` | Semantic search — unified search across query, file_path, chunk_id, filters. | | ||
| | `brain_store` | Persist memories — ideas, decisions, learnings, mistakes. Auto-type/auto-importance. | | ||
| | `brain_recall` | Proactive retrieval — current context, sessions, session summaries. | | ||
| | `brain_tags` | Browse and filter by tag — discover what's in memory without a search query. | |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify which tools are actually registered in the MCP server
echo "=== Checking MCP server tool registration ==="
ast-grep --pattern $'@server.list_tools()
async def list_tools() -> list[Tool]:
$$$
return [
$$$
]'
echo ""
echo "=== Searching for brain_get_person usage ==="
rg -n "brain_get_person" --type py -C 2Repository: EtanHey/brainlayer
Length of output: 44301
Remove brain_get_person tool — implementation has not been updated for Phase B spec.
The code still implements 9 tools (including both brain_get_person and brain_tags), but the Phase B spec merged in PR #72 requires only 8 tools, with brain_tags replacing brain_get_person. The implementation in src/brainlayer/mcp/__init__.py currently registers both tools (lines 512–545 and 746–787 respectively) and includes the full handler in entity_handler.py. The tool registration loop needs to remove brain_get_person and update the docstring comment at line 282 (currently says "7 consolidated tools" but should reflect the correct count). Additionally, legacy aliases (brainlayer_*) must be maintained for backward compatibility as noted in the Phase B spec.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` at line 131, Remove the deprecated brain_get_person tool
registration and handler: delete its registration block in
src/brainlayer/mcp/__init__.py (the block that registers "brain_get_person") and
remove or refactor the corresponding handler implementation in entity_handler.py
so only brain_tags remains as the Phase B tool. Ensure the tool-registration
loop still registers brain_tags (the existing brain_tags block) and retains
legacy aliases beginning with "brainlayer_" for backward compatibility. Update
the docstring/comment that currently reads "7 consolidated tools" to reflect the
correct count (8 tools) and adjust any nearby documentation text referencing
brain_get_person so it no longer appears in the tools list.
| | **Local-first** | SQLite | Cloud-first | Cloud-only | Docker+PG | Framework | | ||
| | **Zero infra** | `pip install` | API key | API key | Docker | Multiple deps | | ||
| | **Multi-source** | 6 sources | API only | API only | API only | API only | | ||
| | **Multi-source** | 7 sources | API only | API only | API only | API only | |
There was a problem hiding this comment.
Verify the data sources count.
The comparison table claims "7 sources" for BrainLayer, but the Data Sources section (lines 246-255) lists 8 rows:
- Claude Code
- Claude Desktop
- YouTube
- Codex CLI
- Markdown
- Manual (via MCP tool)
- Real-time (Claude Code hooks)
If "Manual" and "Real-time" are excluded from the count (as they're not batch indexers), that would be 6 sources, not 7. If Codex CLI is new and we're counting traditional batch sources, that might be 7 (Claude Code, Desktop, WhatsApp, YouTube, Codex, Markdown, + Manual = 7, excluding Real-time).
Please clarify the counting methodology and ensure consistency between the comparison table and the Data Sources section.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` at line 184, The "Multi-source" cell showing "7 sources" in the
comparison table is inconsistent with the Data Sources list (which enumerates 8
items); decide and document the counting methodology (e.g., count only batch
indexers vs. include manual/real-time hooks) and update either the table cell
(the | **Multi-source** | value) or the Data Sources list so they match;
reference the table row containing "| **Multi-source** | 7 sources |" and the
Data Sources section entries ("Claude Code", "Claude Desktop", "WhatsApp",
"YouTube", "Codex CLI", "Markdown", "Manual (via MCP tool)", "Real-time (Claude
Code hooks)") when making the change and add a short parenthetical note in the
Data Sources section clarifying which types are counted.
Summary
Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation