Skip to content

docs: fix test count 1044→1030#92

Merged
EtanHey merged 2 commits into
mainfrom
fix/readme-stats-march18
Mar 18, 2026
Merged

docs: fix test count 1044→1030#92
EtanHey merged 2 commits into
mainfrom
fix/readme-stats-march18

Conversation

@EtanHey
Copy link
Copy Markdown
Owner

@EtanHey EtanHey commented Mar 18, 2026

Summary

  • Update test badge from 1044 to 1030 passing
  • Update summary stat line (1,016 Python + 28 Swift → 1,002 Python + 28 Swift = 1030)
  • Update Testing section inline count to match

Test plan

  • Verify badge renders correctly on GitHub
  • Confirm 1030 total (1002 Python + 28 Swift) matches actual test suite output

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added brain_tags tool for tag-based organization and retrieval.
    • Introduced BrainBar, a native macOS daemon for system-level integration.
    • Enabled Real-time Hooks to support live per-message indexing.
    • Added Codex CLI as a new indexing data source.
  • Documentation

    • Updated architecture and data-flow diagrams to reflect new capabilities.
    • Expanded Data Sources and Testing sections with additional details and increased test coverage counts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 18, 2026

Warning

Rate limit exceeded

@EtanHey has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 40 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 51a0b281-5ca5-445c-962f-e925823f734d

📥 Commits

Reviewing files that changed from the base of the PR and between be7a426 and 1c4a1b8.

📒 Files selected for processing (1)
  • README.md
📝 Walkthrough

Walkthrough

The README documentation is updated to reflect the BrainLayer MCP ecosystem's expansion from 8 to 9 tools, introducing the new brain_tags tool, BrainBar macOS daemon, Real-time Hooks capability, and Codex CLI data source. Various counts, section headers, and architecture diagrams are revised accordingly.

Changes

Cohort / File(s) Summary
Documentation Updates
README.md
Increased MCP tool count from 8 to 9 with addition of brain_tags tool. Added BrainBar macOS daemon and Real-time Hooks features. Extended data sources to include Codex CLI. Updated section headers (Core: 3→4, MCP Tools: 8→9) and related statistics. Modified architecture and data-flow diagrams to reflect new capabilities.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Poem

🐰 Nine tools now hop in our warren,
Real-time hooks make indexing darren,
BrainBar and brain_tags take flight,
Codex joins the feast—what a sight!
Thump thump goes the drum of delight! 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the primary change: updating test count statistics in documentation from 1044 to 1030.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/readme-stats-march18
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 82bd073 and be7a426.

📒 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_tags makes 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 (not brainlayer 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 be7a426 and 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.

Comment thread README.md
# 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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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:

  1. Update the PR title/description to reflect the full scope, or
  2. 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.

Comment thread README.md
Comment on lines +106 to 108
H["Real-time Hooks"] -->|live per-message| D
I["BrainBar<br/>macOS daemon"] -->|Unix socket MCP| B
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 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 -10

Repository: 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 -l

Repository: 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.py with 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.

Comment thread README.md
| `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. |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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 2

Repository: 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.

Comment thread README.md
| **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 |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Verify the data sources count.

The comparison table claims "7 sources" for BrainLayer, but the Data Sources section (lines 246-255) lists 8 rows:

  1. Claude Code
  2. Claude Desktop
  3. WhatsApp
  4. YouTube
  5. Codex CLI
  6. Markdown
  7. Manual (via MCP tool)
  8. 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.

@EtanHey EtanHey merged commit 67134f5 into main Mar 18, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant