Skip to content

docs: update documentation to match current codebase (2026-08) - #115

Merged
study8677 merged 3 commits into
mainfrom
cursor/update-docs-to-match-codebase-f89d
Aug 27, 2026
Merged

docs: update documentation to match current codebase (2026-08)#115
study8677 merged 3 commits into
mainfrom
cursor/update-docs-to-match-codebase-f89d

Conversation

@study8677

@study8677 study8677 commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Summary

This PR updates RepoBrain documentation to match the actual codebase structure as of August 2026, removing stale/fictional claims and aligning all docs (zh/en/es) with the real implementation.

Changes Made

📁 Project Structure (docs/*/README.md)

  • ✅ Fixed project tree to show actual layout: cli/, engine/repobrain_engine/, commands/
  • ❌ Removed fictional repobrain_engine/swarm.py and repobrain_engine/agents/ references
  • ✅ Clarified that .repobrain/ is generated in target projects, not in this repo's source tree

🔥 SWARM_PROTOCOL.md (zh/en/es) — Major Rewrite

Before (fiction):

  • Described non-existent repobrain_engine/swarm.py
  • Fictional agents: Router, Coder, Reviewer, Researcher
  • Instructions to inherit BaseAgent and register in swarm.py

After (reality):

  • Documents Refresh Swarm: ScanAnalyst → ArchitectureReviewer → ConventionWriter (3-agent handoff chain for project analysis)
  • Documents Ask Swarm: Router + dynamic ModuleAgent(s) + GitAgent (module-based Q&A routing)
  • Real implementation location: engine/repobrain_engine/hub/agents.py
  • Covers: host-runner mode, incremental refresh (--quick), fallback strategies, MCP integration

🛠 Path References (all docs)

Fixed repobrain_engine/engine/repobrain_engine/ in:

  • ZERO_CONFIG.md — tool discovery paths
  • MCP_INTEGRATION.md — server paths
  • QUICK_START.md — verification commands
  • README.md — FAQ and tool paths
  • ROADMAP.md — hub module path

📈 ROADMAP.md Updates

  • ✅ Marked Phase 9 (Enterprise Core) as complete
  • Updated Phase 7 description to reflect actual agent architecture (was: generic Router-Worker; now: Refresh/Ask Swarms)
  • Updated timeline section to August 2026 with completed features:
    • Generation storage
    • Structured evidence (JSON claims + source verification)
    • Host-runner (local CLI backend, no API key)
    • Incremental refresh (agent-group level)
    • Multi-language adapters

🧭 Navigation/FAQ Fixes (commit 2)

Removed stale "Phase 9 as in-progress work" references from README navigation:

  • DevOps section: now points to Sandbox docs instead of "Phase 9 (Enterprise Core)"
  • Contributors section: now points to current architecture instead of "Phase 9 open issues"
  • Nav taglines: "through Phase 9" → "completed phases and architectural vision"

All Phase 9/10 work is documented as complete in ROADMAP.md; README navigation now reflects this.

🐛 Path Prefix Bug Fix (commit 3)

Fixed doubled engine/ prefix introduced during path replacement:

  • engine/engine/repobrain_engineengine/repobrain_engine
  • Affected: docs/en/ZERO_CONFIG.md (2), docs/zh/ZERO_CONFIG.md (1), docs/es/ZERO_CONFIG.md (1)

📅 Version Footers

  • Updated dates: April 2026 → August 2026
  • Replaced Phase 10 (Knowledge Hub) ✅ tagline with current architecture description

Verification Checklist

Check Status Notes
swarm.py references removed grep -r "swarm\.py" docs/ → no matches
repobrain_engine/agents/ references removed grep -r "repobrain_engine/agents" docs/ → no matches
❌ Stale Phase 9 nav removed All "Phase 9 as open work" references removed from README
❌ Doubled engine/engine/ prefix rg "engine/engine" docs/ → no matches
✅ Path references fixed All repobrain_engine/engine/repobrain_engine/ (except historical context)
✅ zh/en/es in sync for structural sections Project tree, SWARM_PROTOCOL, version footers, nav sections aligned
✅ Real architecture documented Refresh/Ask swarms, agents.py, hub/ modules, host-runner
✅ Dates updated August 2026 across README and ROADMAP footers

Files Changed (20 docs, 3 commits)

Commit 1: Main documentation sync (14 files)

  • Chinese (zh): README.md, SWARM_PROTOCOL.md, ZERO_CONFIG.md, MCP_INTEGRATION.md, ROADMAP.md
  • English (en): README.md, SWARM_PROTOCOL.md, ZERO_CONFIG.md, MCP_INTEGRATION.md, ROADMAP.md
  • Spanish (es): README.md, SWARM_PROTOCOL.md, ZERO_CONFIG.md, ROADMAP.md

Commit 2: Navigation/FAQ cleanup (3 files)

  • docs/zh/README.md — DevOps nav, contributor nav, contributing section
  • docs/en/README.md — planning nav, DevOps nav, submit code section
  • docs/es/README.md — planning nav, DevOps nav, contributor nav, submit code

Commit 3: Path prefix bug fix (3 files)

  • docs/en/ZERO_CONFIG.md — 2 doubled prefixes (comment + scan path)
  • docs/zh/ZERO_CONFIG.md — 1 doubled prefix (intro path)
  • docs/es/ZERO_CONFIG.md — 1 doubled prefix (intro path)

Impact

  • No code changes — documentation only
  • No behavior changes — aligns docs with existing implementation
  • Users following docs will now find real files at documented paths
  • SWARM_PROTOCOL examples reference actual agent architecture
  • Navigation reflects that Phase 9/10 are completed, not in-progress work
  • All paths are correct without doubled prefixes

Testing

  • Verified all paths point to actual files/directories in the repo
  • Confirmed swarm.py and fictional agent classes do not exist
  • Checked zh/en/es consistency for project structure and SWARM_PROTOCOL sections
  • Verified no stale Phase 9 references remain in README navigation/FAQ
  • Verified no doubled engine/engine/ prefixes remain

Fixes the gap between documentation (fictional swarm.py + Phase 9 as open work + incorrect paths) and reality (hub/agents.py + completed phases + correct paths).

Open in Web Open in Cursor 

cursoragent and others added 3 commits August 27, 2026 07:51
Fix documentation inconsistencies with actual codebase structure:

Project Structure:
- Update all docs to reflect actual layout: cli/, engine/repobrain_engine/, commands/
- Fix all path references from repobrain_engine/ to engine/repobrain_engine/
- Remove references to non-existent swarm.py and agents/ directory

SWARM_PROTOCOL.md (zh/en/es):
- Rewrite to describe real architecture instead of fictional Router/Coder/Reviewer/Researcher
- Document actual Refresh Swarm: ScanAnalyst → ArchitectureReviewer → ConventionWriter
- Document actual Ask Swarm: Router + dynamic ModuleAgent(s) + GitAgent
- Add host-runner mode, incremental refresh, and fallback strategies
- Include real implementation locations (engine/repobrain_engine/hub/agents.py, etc.)

Path Fixes:
- ZERO_CONFIG.md: Fix tool paths to engine/repobrain_engine/tools/
- MCP_INTEGRATION.md: Fix server paths
- README.md: Update tool path references
- ROADMAP.md: Fix hub module path

ROADMAP.md Updates:
- Mark Phase 9 (Enterprise Core) as complete
- Update Phase 7 description to reflect actual agent architecture
- Update timeline to reflect August 2026 progress
- Document completed Phase 10 features: generation storage, structured evidence,
  host-runner, incremental refresh, multi-language adapters

Version Footers:
- Update dates to August 2026
- Replace Phase 10 version line with current architecture description

All changes are documentation-only; no code behavior changes.

Co-authored-by: JingWen Fan <study8677@users.noreply.github.com>
Update README navigation/FAQ sections to reflect completed status:
- Remove 'Phase 9 (Enterprise Core)' as a future/in-progress reference
- Point DevOps readers to Sandbox docs instead of an open Phase 9 workstream
- Point contributors to current architecture instead of Phase 9 open issues
- Update nav taglines to 'completed phases and vision'

Affected files:
- docs/zh/README.md: DevOps nav, contributor nav, contributing section
- docs/en/README.md: Planning nav, DevOps nav, submit code section
- docs/es/README.md: Planning nav, DevOps nav, contributor nav, submit code

All Phase 9/10 work is now documented as complete in ROADMAP.md.

Co-authored-by: JingWen Fan <study8677@users.noreply.github.com>
Fix path replacement bug that doubled the engine/ prefix:
- engine/engine/repobrain_engine → engine/repobrain_engine

Affected occurrences:
- docs/en/ZERO_CONFIG.md: 2 (example comment + discovery scan path)
- docs/zh/ZERO_CONFIG.md: 1 (auto-discovery intro path)
- docs/es/ZERO_CONFIG.md: 1 (auto-discovery intro path)

All paths now correctly reference engine/repobrain_engine/.

Co-authored-by: JingWen Fan <study8677@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bbbf1e1efb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/en/ZERO_CONFIG.md Outdated
1. **Define Your Tool**:
```python
# repobrain_engine/tools/sentiment_analyzer.py
# engine/engine/repobrain_engine/tools/sentiment_analyzer.py

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the duplicated engine path segment

The new example points users to engine/engine/repobrain_engine/tools/, which does not exist; the repository directory is engine/repobrain_engine/tools/. The same doubled prefix appears in the discovery description at line 46 and in the Spanish and Chinese zero-config guides, so users following these instructions will create tools in a directory the documentation itself otherwise does not reference.

Useful? React with 👍 / 👎.

Comment thread docs/en/SWARM_PROTOCOL.md
Comment on lines +158 to +162
2. **Host-runner (no API key):**
```bash
export RB_HOST_RUNNER=codex # or generic
# Uses logged-in IDE CLI, no API key needed
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include the required command for the generic host runner

The snippet presents generic as a drop-in alternative to codex, but build_generic_command() rejects that configuration unless RB_HOST_COMMAND is also set (engine/repobrain_engine/hub/host_runner.py:314-319). Anyone selecting the documented alternative gets an immediate HostRunnerError; add the required command template or omit generic from this minimal example. The translated guides repeat the same incomplete setup.

Useful? React with 👍 / 👎.

Comment thread docs/en/SWARM_PROTOCOL.md
Comment on lines +141 to +145
The ask pipeline implements a three-tier fallback mechanism:

```python
from repobrain_engine.agents.custom_agent import DataAnalystAgent
1. **`_ask_with_structured_facts`** — Uses structured facts (JSON claims + source verification)
2. **`_ask_with_agent_md`** — Falls back to agent.md files (plain text knowledge)
3. **`_ask_with_legacy_swarm`** — Final fallback (if both fail)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Document the actual ask fallback order

These are not three sequential tiers: _ask_with_structured_facts() first invokes _ask_with_agent_md() and then falls back to _ask_with_legacy_facts() internally (ask_pipeline.py:649-656); only after that wrapper returns None does _ask_pipeline_once() invoke _ask_with_legacy_swarm() (ask_pipeline.py:291-298). Describing structured facts and agent Markdown as separate stages omits the real legacy-facts tier and misleads troubleshooting of partially generated or old knowledge bases.

Useful? React with 👍 / 👎.

Comment thread docs/en/SWARM_PROTOCOL.md
Comment on lines +222 to +226
# Refresh with debug logging
RB_LOG_LEVEL=DEBUG rb-refresh

# Ask with verbose output
RB_LOG_LEVEL=DEBUG rb-ask "Where is the database connection?"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Replace the unsupported logging environment variable

Neither the engine nor CLI reads RB_LOG_LEVEL, so both newly added commands run with exactly the normal logging behavior rather than the promised debug or verbose output. Users following this debugging section therefore receive no additional diagnostics; document a supported verbosity mechanism or implement this environment variable before recommending it. The Spanish and Chinese guides contain the same examples.

Useful? React with 👍 / 👎.

Comment thread docs/en/SWARM_PROTOCOL.md

### Speed Up Refresh
- Use `--quick` for incremental updates (clean worktree after commit)
- Exclude unnecessary directories (configure ignore patterns in `.repobrain/config.json`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Remove the nonexistent ignore-pattern configuration

There is no reader or schema for .repobrain/config.json anywhere in the repository, and scanning exclusions are currently derived from hard-coded sets in hub/scanner.py. Consequently, creating the file suggested here cannot exclude directories or speed up refreshes; document an implemented exclusion mechanism instead, or add configuration support. This unsupported advice is repeated in all three translations.

Useful? React with 👍 / 👎.

Comment thread docs/en/ROADMAP.md
| 7️⃣ **Multi-Agent Swarm** | ✅ Complete | Router-Worker orchestration |
| 8️⃣ **MCP Integration** | ✅ Complete | Model Context Protocol support |
| 9️⃣ **Enterprise Core** | 🚀 In Progress | Safety boundaries, observability, deployment polish |
| 9️⃣ **Enterprise Core** | ✅ Complete | Safety boundaries, observability, deployment polish |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep the Phase 9 status internally consistent

This newly marks Enterprise Core complete, while the same roadmap still labels Phase 9 “In Progress” at line 102 and describes major portions such as orchestrated flows, distributed agents, observability, and integrations as proposed or planned. Readers and prospective contributors cannot determine the actual project status; either retain the in-progress status or update the remaining Phase 9 section to identify what was completed.

Useful? React with 👍 / 👎.

Comment thread docs/en/SWARM_PROTOCOL.md

```bash
python -m repobrain_engine.swarm_demo
When you run `rb-ask "question"`, the Ask Swarm routes your question to the relevant module's agent and returns an answer with file paths and line numbers.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Qualify Ask Swarm behavior in host-runner mode

When RB_HOST_RUNNER is configured as recommended later in this guide, ask_pipeline() branches directly to _ask_with_host_runner() (ask_pipeline.py:204-213), which performs one local runner call and never constructs the Router, ModuleAgents, or GitAgent shown here. Thus host-runner users do not receive the documented handoff-based routing or agent tool access; document this single-turn Ask exception alongside the existing Refresh exception.

Useful? React with 👍 / 👎.

Comment thread docs/en/SWARM_PROTOCOL.md
Comment on lines +117 to +120
Each module gets its own agent with:
- Module's structured facts (JSON claims + source evidence)
- Tools to explore code (read_file, search_code, etc.)
- Ability to hand off to other ModuleAgents for cross-module information

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Describe the knowledge actually loaded by ModuleAgents

The dynamic ModuleAgents do not receive structured JSON facts: build_ask_swarm() calls _read_module_knowledge(), which reads agents/*.md, grouped Markdown documents, or legacy modules/*.md (agents.py:516-559). Structured *.facts.json claims are consumed separately by _ask_with_legacy_facts() and never injected into these ModuleAgents, so this claim incorrectly implies that their answers inherit the structured source-verification guarantees.

Useful? React with 👍 / 👎.

@study8677
study8677 merged commit a1de58b into main Aug 27, 2026
9 checks passed
@study8677
study8677 deleted the cursor/update-docs-to-match-codebase-f89d branch August 27, 2026 08:07
study8677 added a commit that referenced this pull request Aug 27, 2026
* docs: fix documentation inaccuracies flagged by Codex in PR #115

Fix all seven documentation inaccuracies across en/zh/es docs:

1. Generic host runner: Add required RB_HOST_COMMAND example
   - Show concrete trae-cli template instead of claiming generic is drop-in
   - SWARM_PROTOCOL.md: Configuration section

2. Ask fallback order: Correct pipeline flow description
   - Document actual code behavior: host-runner bypasses swarm entirely
   - Structured facts path tries agent.md then legacy-facts internally
   - SWARM_PROTOCOL.md: Fallback Strategy section

3. Remove non-existent RB_LOG_LEVEL env var
   - No such env var exists in engine or CLI
   - SWARM_PROTOCOL.md: Example 3 debugging section

4. Remove .repobrain/config.json ignore pattern advice
   - No reader/schema exists for this file
   - Scan exclusions are hard-coded in hub/scanner.py
   - SWARM_PROTOCOL.md: Performance Tips section

5. Fix Phase 9 status conflict in ROADMAP.md
   - Mark Phase 9 as completed with productization achievements
   - Relabel future ideas (sandbox, DAG, fleet, observability) as extensions
   - ROADMAP.md: Phase 9 section (en only; zh/es already correct)

6. Qualify Ask Swarm behavior in host-runner mode
   - Document single local CLI call, no Router/ModuleAgent/GitAgent
   - SWARM_PROTOCOL.md: New Host-Runner Mode subsection

7. Correct ModuleAgent knowledge sources
   - ModuleAgents read agents/*.md, not structured facts.json
   - Structured facts consumed by separate ask path
   - SWARM_PROTOCOL.md: ModuleAgent description

All changes verified via grep for residual mentions.

Co-authored-by: JingWen Fan <study8677@users.noreply.github.com>

* docs(zh): fix Phase 9 status in table to match section heading

Table showed '进行中' (In Progress) while section heading shows ✅.
Changed to '完成' (Complete) for internal consistency.

Spanish version already correct (Completa).

Co-authored-by: JingWen Fan <study8677@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: JingWen Fan <study8677@users.noreply.github.com>
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.

2 participants