@backbencher/brain 0.0.0-stage → 0.1.0
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 +298 -0
- package/EMBEDDINGS.md +355 -0
- package/LICENSE +21 -0
- package/README.md +415 -2
- package/bin/bb +13 -0
- package/dist/analysis-exclusions-7ZJDXOVZ.js +35 -0
- package/dist/brain-index-health-KY7K552E.js +17 -0
- package/dist/brain-relationship-enrichment-QH7OOHUF.js +558 -0
- package/dist/brain.sql-EIM4WS4D.js +29 -0
- package/dist/chunk-2BSKD7O3.js +40 -0
- package/dist/chunk-2DE27DVC.js +1314 -0
- package/dist/chunk-2RRBMNBQ.js +322 -0
- package/dist/chunk-2RTN2DFU.js +711 -0
- package/dist/chunk-2WXYNLBA.js +29 -0
- package/dist/chunk-3CTFIJJB.js +17 -0
- package/dist/chunk-3LFTSMIV.js +174 -0
- package/dist/chunk-47HKX4AJ.js +930 -0
- package/dist/chunk-4H22TLOT.js +543 -0
- package/dist/chunk-5SD45FLC.js +818 -0
- package/dist/chunk-66A5ZFYA.js +1758 -0
- package/dist/chunk-6AIRWAO2.js +247 -0
- package/dist/chunk-6WNGD3NN.js +196 -0
- package/dist/chunk-7AN7U5IZ.js +371 -0
- package/dist/chunk-BHB7BYYI.js +626 -0
- package/dist/chunk-BQ3OVQ3P.js +125 -0
- package/dist/chunk-CW4XXSNN.js +1479 -0
- package/dist/chunk-D2Q4Y47A.js +53 -0
- package/dist/chunk-DIYAGQJL.js +34 -0
- package/dist/chunk-DYM4FQEE.js +90 -0
- package/dist/chunk-EWMWK7WN.js +75 -0
- package/dist/chunk-FVVQTSIM.js +3427 -0
- package/dist/chunk-FWSL4VG6.js +1290 -0
- package/dist/chunk-GBI7V7KY.js +69 -0
- package/dist/chunk-GEFFO6O2.js +152 -0
- package/dist/chunk-HOWAQXJO.js +236 -0
- package/dist/chunk-HQSPJDHI.js +613 -0
- package/dist/chunk-IFZNR5UJ.js +2863 -0
- package/dist/chunk-J4PMBXQQ.js +336 -0
- package/dist/chunk-KAET47ZL.js +125 -0
- package/dist/chunk-KCDECRJY.js +440 -0
- package/dist/chunk-KLK3PBTO.js +1119 -0
- package/dist/chunk-L5TDYKYK.js +76 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-OWISBAOF.js +61 -0
- package/dist/chunk-PJTNGD3Z.js +6924 -0
- package/dist/chunk-QLK6ED4Q.js +235 -0
- package/dist/chunk-R2GW4F6R.js +19 -0
- package/dist/chunk-RCMTFSEF.js +87 -0
- package/dist/chunk-RH7KC5HU.js +12050 -0
- package/dist/chunk-RM3PY6TG.js +376 -0
- package/dist/chunk-ROMM6KMC.js +433 -0
- package/dist/chunk-SK6YVHFZ.js +211 -0
- package/dist/chunk-SM7RFQRO.js +214 -0
- package/dist/chunk-UFE77L67.js +782 -0
- package/dist/chunk-UGR4QIGS.js +67 -0
- package/dist/chunk-UUNHHX4M.js +13 -0
- package/dist/chunk-V44PGPA6.js +2104 -0
- package/dist/chunk-VL52PL2T.js +71 -0
- package/dist/chunk-VURYFIHW.js +201 -0
- package/dist/chunk-XJKJYIPP.js +7436 -0
- package/dist/chunk-YI6FF2ZR.js +340 -0
- package/dist/cli/index.js +37 -0
- package/dist/config-HZAAYDP3.js +10 -0
- package/dist/content-search-642F7E5V.js +593 -0
- package/dist/database-TCTZDLE5.js +9 -0
- package/dist/doctor-GXCKSJOX.js +395 -0
- package/dist/edit-engine-KM7MPFEC.js +51 -0
- package/dist/engine-42TZFNIZ.js +11 -0
- package/dist/engine-LO6L4JLQ.js +18 -0
- package/dist/fingerprint-XDXFRWO6.js +33 -0
- package/dist/framework-intelligence-DWFCKV44.js +860 -0
- package/dist/freshness-3K6VU5OT.js +174 -0
- package/dist/graph-engine-PL5YA7BA.js +21 -0
- package/dist/graph_request-MM4REP6H.js +350 -0
- package/dist/impact_request-WDE47IZ5.js +68 -0
- package/dist/index-space-IUUN5WYV.js +15 -0
- package/dist/index-status-6BD7UBHR.js +34 -0
- package/dist/index.js +159 -0
- package/dist/instance-FO6QZRLH.js +19 -0
- package/dist/language-detection-DFCAU5DZ.js +11 -0
- package/dist/lsp/server.js +4301 -0
- package/dist/mcp/server.js +132 -0
- package/dist/onboard-DIQZV2NW.js +161 -0
- package/dist/override-companion-pass-XR7MHTP7.js +117 -0
- package/dist/parallel-indexer-4PW3AFXP.js +88 -0
- package/dist/pool-worker.js +1153 -0
- package/dist/project-health-ZS5TS2Z6.js +94 -0
- package/dist/project-index-5SDPHITE.js +57 -0
- package/dist/project-registry-DGZBIZS7.js +355 -0
- package/dist/real-bash-analyzer-SXSV67E2.js +2201 -0
- package/dist/real-c-analyzer-SY7FTZ6W.js +5942 -0
- package/dist/real-clean-analyzer-IGDHHLZK.js +3470 -0
- package/dist/real-clojure-analyzer-4OH7IWLB.js +2818 -0
- package/dist/real-cpp-analyzer-7LTDRJRJ.js +4101 -0
- package/dist/real-csharp-analyzer-KICU3TLH.js +3298 -0
- package/dist/real-css-analyzer-HPU277Q6.js +15 -0
- package/dist/real-dart-analyzer-7LZ5LCMW.js +3944 -0
- package/dist/real-elixir-analyzer-BE3MEVZO.js +2192 -0
- package/dist/real-erlang-analyzer-BZMAKYBK.js +1731 -0
- package/dist/real-fsharp-analyzer-5QLTOV3E.js +2390 -0
- package/dist/real-go-analyzer-POD7MZQR.js +4126 -0
- package/dist/real-graphql-analyzer-MAQRZ6QW.js +1442 -0
- package/dist/real-groovy-analyzer-MEWSUPMJ.js +2285 -0
- package/dist/real-haskell-analyzer-I5L2GR3Y.js +2533 -0
- package/dist/real-hcl-analyzer-DBOPXSWJ.js +725 -0
- package/dist/real-html-analyzer-O63XZLZD.js +1759 -0
- package/dist/real-java-analyzer-CHCW3EKA.js +4677 -0
- package/dist/real-javascript-analyzer-QAAJQYZE.js +14 -0
- package/dist/real-json-analyzer-UGBR7YQN.js +1640 -0
- package/dist/real-julia-analyzer-35Q4GHOZ.js +2085 -0
- package/dist/real-kotlin-analyzer-GRAYCWW2.js +3956 -0
- package/dist/real-lua-analyzer-5BAPDZDF.js +1957 -0
- package/dist/real-makefile-analyzer-YJKAHNAS.js +920 -0
- package/dist/real-markdown-analyzer-UKUQZO4F.js +1215 -0
- package/dist/real-matlab-analyzer-FVIKQZKG.js +480 -0
- package/dist/real-nim-analyzer-M7FAIABG.js +3603 -0
- package/dist/real-objective-c-analyzer-XMYQIGQI.js +1518 -0
- package/dist/real-perl-analyzer-ZLY6M2DZ.js +1865 -0
- package/dist/real-php-analyzer-KI2ZAM7X.js +9368 -0
- package/dist/real-powershell-analyzer-B3T5ZP6U.js +2915 -0
- package/dist/real-protobuf-analyzer-23OZ75XV.js +867 -0
- package/dist/real-python-analyzer-I4TIUB6D.js +4880 -0
- package/dist/real-r-analyzer-FJZJXXS6.js +2596 -0
- package/dist/real-ruby-analyzer-M3UFIVTQ.js +2429 -0
- package/dist/real-rust-analyzer-LVSONPAN.js +3359 -0
- package/dist/real-scala-analyzer-CWPI33Q2.js +3293 -0
- package/dist/real-scss-analyzer-TGRJQ7TH.js +1515 -0
- package/dist/real-solidity-analyzer-4P2VBVWA.js +2608 -0
- package/dist/real-sql-analyzer-J7DYZOZR.js +3840 -0
- package/dist/real-svelte-analyzer-NHEN2SX5.js +2532 -0
- package/dist/real-swift-analyzer-2NSYULWI.js +2311 -0
- package/dist/real-toml-analyzer-L3C66L7Q.js +929 -0
- package/dist/real-typescript-analyzer-FTC6ETRQ.js +14 -0
- package/dist/real-vb-analyzer-ORY7LAQS.js +3145 -0
- package/dist/real-vba-analyzer-JH2TTUFI.js +466 -0
- package/dist/real-vue-analyzer-OO4FUGBV.js +2680 -0
- package/dist/real-xml-analyzer-6CQVR477.js +2405 -0
- package/dist/real-yaml-analyzer-J6MQG3YX.js +3528 -0
- package/dist/real-zig-analyzer-EFKCPJNU.js +2430 -0
- package/dist/regex-search-OPTLKUN5.js +239 -0
- package/dist/rules-I453JTRC.js +152 -0
- package/dist/scoped-path-MJYWJZQX.js +11 -0
- package/dist/setup-show-Y5GB5KXA.js +15 -0
- package/dist/setup-wizard-G5YYR5T6.js +24 -0
- package/dist/symbol-search-KB4MU4SI.js +16 -0
- package/dist/taint-YOTN5X55.js +202 -0
- package/dist/taint-analyzer-N7YLZU3N.js +163 -0
- package/dist/tool-handlers-G4NAGJIH.js +72 -0
- package/dist/tool-registry-BPEJNSZG.js +17 -0
- package/dist/tool-validation-RF675A3C.js +32 -0
- package/dist/type-inference-4Y7WTMFE.js +13 -0
- package/dist/vector-binary-LMY4QGAN.js +19 -0
- package/dist/version-LXGNFO37.js +9 -0
- package/dist/wasm-NMWO3WXY.js +16 -0
- package/docs/EMBEDDINGS.md +132 -0
- package/docs/README.md +178 -0
- package/docs/data/m10-baseline.json +602 -0
- package/docs/data/m10-benchmark-baseline.json +57 -0
- package/docs/data/m10-benchmark-last-run.json +127 -0
- package/docs/data/m10-final-audit.json +215 -0
- package/docs/data/m12-final-audit.json +138 -0
- package/docs/data/m12-surface-matrix.json +50 -0
- package/docs/data/public-tools.json +1902 -0
- package/docs/indexing/DEAD-ASSETS.md +88 -0
- package/docs/indexing/INDEXER-REVIEW.md +634 -0
- package/docs/indexing/PERFORMANCE-FINDINGS.md +106 -0
- package/docs/indexing/README.md +427 -0
- package/docs/indexing/discovery-matrix.md +41 -0
- package/docs/indexing/embeddings.md +325 -0
- package/docs/indexing/environment-variables.md +77 -0
- package/docs/indexing/performance.md +323 -0
- package/docs/indexing/resume.md +345 -0
- package/docs/indexing/troubleshooting.md +391 -0
- package/docs/man/bb.1 +190 -0
- package/docs/tools/bb_analyze.md +147 -0
- package/docs/tools/bb_annotate.md +110 -0
- package/docs/tools/bb_annotations.md +106 -0
- package/docs/tools/bb_ask.md +101 -0
- package/docs/tools/bb_cross_language.md +103 -0
- package/docs/tools/bb_doc.md +169 -0
- package/docs/tools/bb_edit.md +185 -0
- package/docs/tools/bb_graph.md +169 -0
- package/docs/tools/bb_health.md +156 -0
- package/docs/tools/bb_impact.md +117 -0
- package/docs/tools/bb_index.md +108 -0
- package/docs/tools/bb_migrate.md +135 -0
- package/docs/tools/bb_patterns.md +140 -0
- package/docs/tools/bb_search.md +150 -0
- package/docs/tools/bb_security.md +100 -0
- package/docs/tools/bb_visualize.md +184 -0
- package/grammars/README.md +57 -0
- package/grammars/THIRD-PARTY-NOTICES.md +50 -0
- package/grammars/tree-sitter-c/LICENSE +21 -0
- package/grammars/tree-sitter-clojure/LICENSE.md +21 -0
- package/grammars/tree-sitter-cpp/LICENSE +21 -0
- package/grammars/tree-sitter-csharp/LICENSE +21 -0
- package/grammars/tree-sitter-css/LICENSE +21 -0
- package/grammars/tree-sitter-css/README.md +21 -0
- package/grammars/tree-sitter-dart/LICENSE +20 -0
- package/grammars/tree-sitter-dart-upstream/LICENSE +20 -0
- package/grammars/tree-sitter-dart-upstream/README.md +18 -0
- package/grammars/tree-sitter-elixir/LICENSE +176 -0
- package/grammars/tree-sitter-elixir/README.md +11 -0
- package/grammars/tree-sitter-fsharp/LICENSE +21 -0
- package/grammars/tree-sitter-fsharp/README.md +45 -0
- package/grammars/tree-sitter-graphql/LICENSE +21 -0
- package/grammars/tree-sitter-graphql/README.md +106 -0
- package/grammars/tree-sitter-groovy/LICENSE +21 -0
- package/grammars/tree-sitter-groovy/README.md +4 -0
- package/grammars/tree-sitter-haskell/LICENSE +21 -0
- package/grammars/tree-sitter-haskell/README.md +394 -0
- package/grammars/tree-sitter-hcl/CHANGELOG.md +102 -0
- package/grammars/tree-sitter-hcl/LICENSE +201 -0
- package/grammars/tree-sitter-hcl/README.md +39 -0
- package/grammars/tree-sitter-html/LICENSE +21 -0
- package/grammars/tree-sitter-html/README.md +21 -0
- package/grammars/tree-sitter-julia/LICENSE +21 -0
- package/grammars/tree-sitter-julia/README.md +24 -0
- package/grammars/tree-sitter-kotlin/LICENSE +9 -0
- package/grammars/tree-sitter-lua/LICENSE.md +21 -0
- package/grammars/tree-sitter-lua/README.md +29 -0
- package/grammars/tree-sitter-make/LICENSE +21 -0
- package/grammars/tree-sitter-matlab/LICENSE +19 -0
- package/grammars/tree-sitter-matlab/README.md +99 -0
- package/grammars/tree-sitter-nim/LICENSE +373 -0
- package/grammars/tree-sitter-nim/README.md +46 -0
- package/grammars/tree-sitter-objc/LICENSE +21 -0
- package/grammars/tree-sitter-objc/README.md +20 -0
- package/grammars/tree-sitter-perl/LICENSE +7 -0
- package/grammars/tree-sitter-perl/README.md +100 -0
- package/grammars/tree-sitter-powershell/LICENSE +21 -0
- package/grammars/tree-sitter-powershell/README.md +7 -0
- package/grammars/tree-sitter-proto/LICENSE +21 -0
- package/grammars/tree-sitter-proto/README.md +105 -0
- package/grammars/tree-sitter-r/LICENSE +9 -0
- package/grammars/tree-sitter-r/README.md +66 -0
- package/grammars/tree-sitter-ruby/LICENSE +22 -0
- package/grammars/tree-sitter-scss/LICENSE +21 -0
- package/grammars/tree-sitter-scss/README.md +17 -0
- package/grammars/tree-sitter-solidity/LICENSE +7 -0
- package/grammars/tree-sitter-sql/LICENSE +21 -0
- package/grammars/tree-sitter-typescript/LICENSE +21 -0
- package/grammars/tree-sitter-vba/LICENSE +21 -0
- package/grammars/tree-sitter-vba/README.md +738 -0
- package/grammars/tree-sitter-vbnet/LICENSE +21 -0
- package/grammars/tree-sitter-vbnet/README.md +322 -0
- package/grammars/tree-sitter-xml/LICENSE +19 -0
- package/grammars/tree-sitter-yaml/LICENSE +20 -0
- package/grammars/tree-sitter-yaml/README.md +21 -0
- package/package.json +184 -4
- package/wasm/dart.wasm +0 -0
- package/wasm/tree-sitter-bash.wasm +0 -0
- package/wasm/tree-sitter-c.wasm +0 -0
- package/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/wasm/tree-sitter-clean.wasm +0 -0
- package/wasm/tree-sitter-clojure.wasm +0 -0
- package/wasm/tree-sitter-core_schema.wasm +0 -0
- package/wasm/tree-sitter-cpp.wasm +0 -0
- package/wasm/tree-sitter-css.wasm +0 -0
- package/wasm/tree-sitter-dart.wasm +0 -0
- package/wasm/tree-sitter-elisp.wasm +0 -0
- package/wasm/tree-sitter-elixir.wasm +0 -0
- package/wasm/tree-sitter-elm.wasm +0 -0
- package/wasm/tree-sitter-embedded_template.wasm +0 -0
- package/wasm/tree-sitter-erlang.wasm +0 -0
- package/wasm/tree-sitter-fsharp.wasm +0 -0
- package/wasm/tree-sitter-fsharp_signature.wasm +0 -0
- package/wasm/tree-sitter-go.wasm +0 -0
- package/wasm/tree-sitter-graphql.wasm +0 -0
- package/wasm/tree-sitter-groovy.wasm +0 -0
- package/wasm/tree-sitter-haskell.wasm +0 -0
- package/wasm/tree-sitter-hcl.wasm +0 -0
- package/wasm/tree-sitter-html.wasm +0 -0
- package/wasm/tree-sitter-java.wasm +0 -0
- package/wasm/tree-sitter-javascript.wasm +0 -0
- package/wasm/tree-sitter-json.wasm +0 -0
- package/wasm/tree-sitter-json_schema.wasm +0 -0
- package/wasm/tree-sitter-julia.wasm +0 -0
- package/wasm/tree-sitter-kotlin.wasm +0 -0
- package/wasm/tree-sitter-lua.wasm +0 -0
- package/wasm/tree-sitter-make.wasm +0 -0
- package/wasm/tree-sitter-markdown.wasm +0 -0
- package/wasm/tree-sitter-markdown_inline.wasm +0 -0
- package/wasm/tree-sitter-matlab.wasm +0 -0
- package/wasm/tree-sitter-nim.wasm +0 -0
- package/wasm/tree-sitter-objc.wasm +0 -0
- package/wasm/tree-sitter-ocaml.wasm +0 -0
- package/wasm/tree-sitter-perl.wasm +0 -0
- package/wasm/tree-sitter-php.wasm +0 -0
- package/wasm/tree-sitter-php_only.wasm +0 -0
- package/wasm/tree-sitter-powershell.wasm +0 -0
- package/wasm/tree-sitter-protobuf.wasm +0 -0
- package/wasm/tree-sitter-python.wasm +0 -0
- package/wasm/tree-sitter-ql.wasm +0 -0
- package/wasm/tree-sitter-r.wasm +0 -0
- package/wasm/tree-sitter-rescript.wasm +0 -0
- package/wasm/tree-sitter-ruby.wasm +0 -0
- package/wasm/tree-sitter-rust.wasm +0 -0
- package/wasm/tree-sitter-scala.wasm +0 -0
- package/wasm/tree-sitter-scss.wasm +0 -0
- package/wasm/tree-sitter-solidity.wasm +0 -0
- package/wasm/tree-sitter-sql.wasm +0 -0
- package/wasm/tree-sitter-svelte.wasm +0 -0
- package/wasm/tree-sitter-swift.wasm +0 -0
- package/wasm/tree-sitter-systemrdl.wasm +0 -0
- package/wasm/tree-sitter-terraform.wasm +0 -0
- package/wasm/tree-sitter-tlaplus.wasm +0 -0
- package/wasm/tree-sitter-toml.wasm +0 -0
- package/wasm/tree-sitter-tsx.wasm +0 -0
- package/wasm/tree-sitter-typescript.wasm +0 -0
- package/wasm/tree-sitter-vba.wasm +0 -0
- package/wasm/tree-sitter-vbnet.wasm +0 -0
- package/wasm/tree-sitter-vue.wasm +0 -0
- package/wasm/tree-sitter-xml.wasm +0 -0
- package/wasm/tree-sitter-yaml.wasm +0 -0
- package/wasm/tree-sitter-zig.wasm +0 -0
- package/wasm/tree-sitter.wasm +0 -0
- package/wasm/tsx.wasm +0 -0
- package/wasm/typescript.wasm +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ishaq2321 (https://github.com/ishaq2321)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,416 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Backbencher Brain (`bb`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://backbencher.cc"><img src="https://backbencher.cc/web-app-manifest-512x512.png" width="88" alt="bb logo" /></a>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@backbencher/brain"><img src="https://img.shields.io/npm/v/@backbencher%2Fbrain.svg" alt="npm version"></a>
|
|
9
|
+
<a href="https://github.com/backbencher-hq/backbencher-brain/actions/workflows/ci.yml"><img src="https://github.com/backbencher-hq/backbencher-brain/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
10
|
+
<a href="https://github.com/backbencher-hq/backbencher-brain/blob/main/LICENSE"><img src="https://img.shields.io/github/license/backbencher-hq/backbencher-brain.svg" alt="MIT license"></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
**Evidence is the answer.** `bb` is local-first, runtime-agnostic code intelligence: it indexes a repository with
|
|
14
|
+
**50 Tree-sitter language analyzers**, stores the result in a per-project SQLite database, and answers
|
|
15
|
+
questions about it from a CLI, an **MCP server** for agent hosts, or a library. Node **and** Bun are
|
|
16
|
+
supported. No telemetry, no server, no account required.
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
source ──▶ AST index (SQLite) ──▶ graph / search / evidence ──▶ bb CLI · MCP · library
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The index stores symbols, relationships (including cross-language edges), complexity, framework and
|
|
23
|
+
security-flow inputs, and optional embeddings. Every answer declares whether it is fresh or stale; a
|
|
24
|
+
missing answer is reported as missing rather than guessed. Embeddings are model-labeled per row, and
|
|
25
|
+
`bb_ask` never compares across vector spaces: rows written by a different model are not searched
|
|
26
|
+
until `bb index --force` re-embeds them, and the answer says so instead of returning a mixed index
|
|
27
|
+
as if it were one space.
|
|
28
|
+
|
|
29
|
+
- **Docs index:** [`docs/README.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/README.md)
|
|
30
|
+
- **Indexing guide:** [`docs/indexing/README.md`](docs/indexing/README.md)
|
|
31
|
+
- **Analyzers:** one canonical page per language — [`docs/analyzers/README.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/analyzers/README.md)
|
|
32
|
+
- **Tools:** [`docs/tools/`](docs/tools/) (generated from the tool registry)
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
Backbencher ships as an npm package. Node.js 18 or newer is the only requirement.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install -g @backbencher/brain
|
|
42
|
+
bb --version
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The package is the primary and version-exact path — it is what `bb upgrade` reports as the install command.
|
|
46
|
+
|
|
47
|
+
### Installer scripts (alternative)
|
|
48
|
+
|
|
49
|
+
On Linux, macOS and Windows the `install.sh` / `install.ps1` installers are also available. They **prefer
|
|
50
|
+
npm** and only fall back to a checksum-verified GitHub release binary when npm is not available.
|
|
51
|
+
|
|
52
|
+
**Linux and macOS**
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
curl -fsSL https://backbencher.cc/install.sh | bash
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Windows PowerShell**
|
|
59
|
+
|
|
60
|
+
```powershell
|
|
61
|
+
irm https://backbencher.cc/install.ps1 | iex
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
When the scripts fall back to a release binary they install it to `~/.local/bin` (`%USERPROFILE%\.local\bin`
|
|
65
|
+
on Windows); add that directory to your `PATH`.
|
|
66
|
+
|
|
67
|
+
### Pin a release
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm install -g @backbencher/brain@0.1.0
|
|
71
|
+
# or with the installer scripts:
|
|
72
|
+
VERSION=0.1.0 curl -fsSL https://backbencher.cc/install.sh | bash
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### From source (contributors)
|
|
76
|
+
|
|
77
|
+
The compiled `dist/` path runs under Node (better-sqlite3); the source path runs under Bun (`bun:sqlite`)
|
|
78
|
+
and is what the analyzer gates use:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
git clone https://github.com/backbencher-hq/backbencher-brain.git
|
|
82
|
+
cd backbencher-brain
|
|
83
|
+
npm ci
|
|
84
|
+
npm run build
|
|
85
|
+
node bin/bb --help
|
|
86
|
+
# or, without a build, under Bun:
|
|
87
|
+
bun src/cli/index.ts --help
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Requirements
|
|
91
|
+
|
|
92
|
+
| | |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| OS / arch | Linux x64 & arm64, macOS x64 & arm64, Windows x64 & arm64 (WSL: use the Linux path) |
|
|
95
|
+
| npm install | Node.js **>= 18** (better-sqlite3 native module; prebuilt binaries are used automatically) |
|
|
96
|
+
| Installer scripts | npm on `PATH`, or a published release binary whose sha256 verifies against the release's `checksums.txt` |
|
|
97
|
+
| Build from source | Node >= 18, `npm ci`, `npm run build`; Bun optional for the source/dev path |
|
|
98
|
+
| Network | none for indexing; only the embedding provider you configure and the `bb upgrade` check |
|
|
99
|
+
| Disk | one SQLite database per project under `~/.bb` (see [Linux notes](#linux-notes) and [performance](docs/indexing/performance.md)) |
|
|
100
|
+
|
|
101
|
+
`bb` is a foreground CLI and a stdio MCP server. There is no daemon, no systemd unit and no background
|
|
102
|
+
service to install.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Quick start
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# 1. Index a project (runs in parallel; safe to re-run — only changed files are parsed)
|
|
110
|
+
bb index ~/my-project
|
|
111
|
+
|
|
112
|
+
# 2. Search the index
|
|
113
|
+
bb search "calculateTotal" --dir ~/my-project
|
|
114
|
+
|
|
115
|
+
# 3. Index counts, health and freshness
|
|
116
|
+
bb stats ~/my-project
|
|
117
|
+
bb health ~/my-project
|
|
118
|
+
|
|
119
|
+
# 4. Optional: semantic retrieval over the index (local fallback works without a key)
|
|
120
|
+
bb setup
|
|
121
|
+
bb tool bb_ask --dir ~/my-project --args '{"query":"how does request authentication flow?"}'
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
`bb index` reports what it actually did — files parsed, skipped and unchanged, symbols and relationships,
|
|
125
|
+
how long each phase took, and the final index health. The first run on a large repository takes minutes;
|
|
126
|
+
later runs only parse changed files. `bb index --force` rebuilds from scratch, and `bb index --changed`
|
|
127
|
+
does an incremental pass. The complete mode/flag matrix and every failure mode are in the
|
|
128
|
+
[indexing guide](docs/indexing/README.md).
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Linux notes
|
|
133
|
+
|
|
134
|
+
Linux-specific operational details, because this is the platform most installs run on:
|
|
135
|
+
|
|
136
|
+
- **Where data lives.** `~/.bb/projects/<sha1-of-realpath>/brain.db` (one database per indexed project),
|
|
137
|
+
with the WASM parser cache under `~/.bb/wasm`. `bb projects` lists every project with its database path,
|
|
138
|
+
size, counts and last index time; `bb projects --remove <id>` deletes one (`--force` skips the
|
|
139
|
+
confirmation).
|
|
140
|
+
- **Read-only home, containers, CI.** `BB_DATA_DIR` relocates the whole data directory, which is the
|
|
141
|
+
supported way to run where `$HOME` is read-only or where you want the index next to the repo:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
BB_DATA_DIR=/abs/project/.bb-data bb index /abs/project
|
|
145
|
+
BB_DATA_DIR=/abs/project/.bb-data bb mcp --dir /abs/project
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
- **No root, no service.** Everything runs as your user. Config written by `bb setup` is `0600`; API keys
|
|
149
|
+
are never printed in full (`bb setup show` shows a truncated fingerprint). There is no daemon to start —
|
|
150
|
+
the MCP server runs over stdio for as long as the host keeps it open.
|
|
151
|
+
- **WAL needs a writable filesystem.** The database uses SQLite WAL mode; it needs a filesystem where
|
|
152
|
+
`brain.db` and its `-wal`/`-shm` files can be created and renamed. Network filesystems with broken POSIX
|
|
153
|
+
locking are not a supported data directory.
|
|
154
|
+
- **Headless and SSH.** Indexing and the CLI work without a display or TTY. Live progress is a redrawing
|
|
155
|
+
line on a TTY and rate-limited milestone lines in a pipe/log (with ETA), so `ssh host bb index … | tee`
|
|
156
|
+
stays readable.
|
|
157
|
+
- **CPU and memory.** The parse pool uses `min(cpus - 1, 12)` workers; one run per project is enough.
|
|
158
|
+
`bb index --concurrency <n>` (1–64) or `BB_INDEX_CONCURRENCY` pins the worker count for a machine where
|
|
159
|
+
you want to leave headroom. Memory scales with the worker count and file size; very large files are
|
|
160
|
+
capped by the discovery rules described in [`docs/indexing/discovery-matrix.md`](docs/indexing/discovery-matrix.md).
|
|
161
|
+
- **Updating and removing.**
|
|
162
|
+
- npm install: `npm install -g @backbencher/brain@latest`; `bb upgrade` tells you whether a newer release
|
|
163
|
+
exists and prints the exact command, but deliberately does not replace its own files;
|
|
164
|
+
- installer scripts: re-run the installer (or prefix `VERSION=…` to pin);
|
|
165
|
+
- remove the program with `npm rm -g backbencher-brain` (or delete the release binary); remove `~/.bb`
|
|
166
|
+
(or your `BB_DATA_DIR`) to delete every index and the embedding config.
|
|
167
|
+
- **WSL.** Use the Linux installer inside the WSL distribution; the index lives on the Linux filesystem, so
|
|
168
|
+
index projects from inside the distro rather than across `/mnt/c` when you care about speed.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## CLI
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
bb --help # every command
|
|
176
|
+
bb <command> --help # per-command options
|
|
177
|
+
bb help <command> # same, via the help command
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
| Command | Purpose |
|
|
181
|
+
| --- | --- |
|
|
182
|
+
| `bb index [dir]` | Build/refresh the index (modes: full, `--changed`, `--resume`, `--post`, `--skip-post-processing`, `--file`, `--exclude`, `--concurrency`, `--force`) |
|
|
183
|
+
| `bb search [query]` | Search the index: modes `symbols` (default), `content`, `symbol`, `file` |
|
|
184
|
+
| `bb stats [dir]` | Counts only (files/symbols/relationships/embeddings) and the database path |
|
|
185
|
+
| `bb status [dir]` | In-flight/last-run state and per-phase timings (discovery, parse, db flush) |
|
|
186
|
+
| `bb health [dir]` | Index health and file freshness |
|
|
187
|
+
| `bb projects` | Every indexed project: DB path, size, counts, last index (`--remove <id>`, `--force`) |
|
|
188
|
+
| `bb setup` | Interactive embedding-provider setup (key validated before saving, written `0600`) |
|
|
189
|
+
| `bb setup show` | Print effective embedding config (key as truncated fingerprint only, never the full key) |
|
|
190
|
+
| `bb doctor [--dir] [--fix]` | Read-only diagnosis of embedding setup and index consistency (`--fix` repairs config permissions only) |
|
|
191
|
+
| `bb upgrade` | Report whether a newer `bb` is published and print the install command |
|
|
192
|
+
| `bb onboard [dir]` | Write the generated bb-tools section into `<dir>/AGENTS.md` |
|
|
193
|
+
| `bb tool <name> --args '<json>'` | Run one public tool with JSON arguments (the MCP surface, scriptable) |
|
|
194
|
+
| `bb mcp [--dir]` | Start the MCP server over stdio |
|
|
195
|
+
| `bb version` | Print the version (same as `bb -v` / `bb --version`) |
|
|
196
|
+
| `bb -v` / `bb version` | Print the version (same as `bb --version`) |
|
|
197
|
+
|
|
198
|
+
Global flags: `--verbose` (debug logs, per-file worker/WASM lines), `--quiet` (warnings/errors only).
|
|
199
|
+
A mistyped command suggests the closest real one and points to `bb --help`. `bb <command> --help` is
|
|
200
|
+
authoritative for that command's options; `bb help <command>` is the same. `bb docter` suggests `doctor`).
|
|
201
|
+
The full manual ships with npm installs and is available as `man bb` after `npm install -g @backbencher/brain`.
|
|
202
|
+
|
|
203
|
+
Example outputs are honest by construction: `bb status` shows the actual per-phase timings, `bb health`
|
|
204
|
+
reports a *sample* for freshness (and says so), and a run that stored fewer files than it discovered
|
|
205
|
+
reports the index as incomplete rather than exit 0 in silence.
|
|
206
|
+
|
|
207
|
+
### Help and manual
|
|
208
|
+
|
|
209
|
+
`bb <command> --help` shows that command's options. `bb help <command>` is the same.
|
|
210
|
+
The full manual ships with npm installs and is available as `man bb` after `npm install -g @backbencher/brain`.
|
|
211
|
+
|
|
212
|
+
### Fingerprint-only and permissions-only claims (M32)
|
|
213
|
+
|
|
214
|
+
`bb setup show` prints the key as its last-4 fingerprint only, never the full key.
|
|
215
|
+
`bb doctor --fix` mutates exactly one thing: file permissions of embedding config files to `0600`.
|
|
216
|
+
|
|
217
|
+
key as last-4 fingerprint only, never the full key
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## MCP server and agent hosts
|
|
222
|
+
|
|
223
|
+
Start the server for a project:
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
bb mcp --dir /abs/path/to/project
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Claude Desktop (`claude_desktop_config.json`):
|
|
230
|
+
|
|
231
|
+
```json
|
|
232
|
+
{
|
|
233
|
+
"mcpServers": {
|
|
234
|
+
"bb-brain": {
|
|
235
|
+
"command": "bb",
|
|
236
|
+
"args": ["mcp", "--dir", "/abs/path/to/project"]
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
VS Code workspace (`<project>/.vscode/mcp.json`):
|
|
243
|
+
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"servers": {
|
|
247
|
+
"bb-brain": {
|
|
248
|
+
"type": "stdio",
|
|
249
|
+
"command": "bb",
|
|
250
|
+
"cwd": "${workspaceFolder}",
|
|
251
|
+
"args": ["mcp", "--dir", "${workspaceFolder}"],
|
|
252
|
+
"env": { "BB_DATA_DIR": "${workspaceFolder}/.bb-data" }
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
When the CLI is installed globally, `command` is just `bb`. From a source checkout, use the absolute path
|
|
259
|
+
to `bin/bb` (Node) or `bun run src/mcp/server.ts` (Bun) — see the
|
|
260
|
+
[MCP, CLI and Indexer Guide](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/MCP_CLI_INDEXER_GUIDE.md) for host setup for Claude Code, Cursor, Zed and
|
|
261
|
+
opencode, plus the stdout-safety and stdio lifecycle rules.
|
|
262
|
+
|
|
263
|
+
`bb onboard <project>` writes a generated “use the bb tools” section into that project's `AGENTS.md` so an
|
|
264
|
+
agent host discovers the tools without being told. The section is generated from the registry (it cannot
|
|
265
|
+
name a tool that does not exist) and is idempotent.
|
|
266
|
+
|
|
267
|
+
### The sixteen public tools
|
|
268
|
+
|
|
269
|
+
`bb_search`, `bb_ask`, `bb_analyze`, `bb_patterns`, `bb_security`, `bb_doc`, `bb_visualize`, `bb_migrate`,
|
|
270
|
+
`bb_edit`, `bb_health`, `bb_index`, `bb_graph`, `bb_impact`, `bb_cross_language`, `bb_annotate`,
|
|
271
|
+
`bb_annotations`.
|
|
272
|
+
|
|
273
|
+
Read tools answer from the index and declare staleness; `bb_edit` is the only advertised mutation surface
|
|
274
|
+
and confines itself to the project, validates ASTs, writes atomically and reindexes. Key
|
|
275
|
+
[`docs/data/public-tools.json`](docs/data/public-tools.json) is the machine-readable contract (schemas,
|
|
276
|
+
defaults, examples, returns, errors, limitations, performance, safety and evidence guidance); the generated
|
|
277
|
+
human reference is [`docs/tools/`](docs/tools/). `bb --help` lists exactly these sixteen; the legacy tool
|
|
278
|
+
names retired before the first public release are documented in
|
|
279
|
+
[MCP_TOOL_MIGRATION.md](https://github.com/backbencher-hq/backbencher-brain/blob/main/archive/docs-pre-consolidation/MCP_TOOL_MIGRATION.md).
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Embedding providers (optional)
|
|
284
|
+
|
|
285
|
+
`bb` indexes without any provider; embeddings only power `bb_ask` / `bb_search` semantic ranking.
|
|
286
|
+
When you want them:
|
|
287
|
+
|
|
288
|
+
- **`bb setup`** opens an interactive wizard: it validates the key against the provider, then writes
|
|
289
|
+
the config with mode `0600`. The wizard prompts only once per provider and can be re-run any time.
|
|
290
|
+
- **`bb setup show`** prints the effective configuration and where each value came from, with the key
|
|
291
|
+
reduced to its last-4
|
|
292
|
+
fingerprint only — never the full key.
|
|
293
|
+
- **`bb doctor`** is read-only diagnosis of the embedding setup and index consistency; `bb doctor --fix`
|
|
294
|
+
mutates exactly one thing: config file permissions back to `0600`.
|
|
295
|
+
|
|
296
|
+
Vectors are model-labeled and the ask path never compares across vector spaces: after adding a model,
|
|
297
|
+
run `bb index --force` to re-embed, or those rows are reported as not searchable instead of being
|
|
298
|
+
silently mixed. See EMBEDDINGS.md for the full provider list, precedence rules (env > `~/.bb/config.json`
|
|
299
|
+
> `bb.json`) and the `--force` behaviour.
|
|
300
|
+
|
|
301
|
+
## Language support
|
|
302
|
+
|
|
303
|
+
**50 languages**, all first-class in discovery, parsing, relationship extraction and the
|
|
304
|
+
cross-language graph:
|
|
305
|
+
|
|
306
|
+
Bash, C, C#, C++, Clean, Clojure, CSS, Dart, Elixir, Erlang, F#, Go, GraphQL, Groovy, Haskell, HCL, HTML,
|
|
307
|
+
Java, JavaScript, JSON, Julia, Kotlin, Lua, Make, Markdown, MATLAB, Nim, Objective-C, Perl, PHP, PowerShell,
|
|
308
|
+
Protobuf, Python, R, Ruby, Rust, Scala, SCSS, Solidity, SQL, Svelte, Swift, TOML, TypeScript, VB, VBA,
|
|
309
|
+
Vue, XML, YAML, Zig.
|
|
310
|
+
|
|
311
|
+
Each **analyzer** has exactly one canonical documentation page —
|
|
312
|
+
[`docs/analyzers/README.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/analyzers/README.md) indexes all fifty —
|
|
313
|
+
covering its symbol contract, relationship ontology, supported/unsupported constructs, regex inventory,
|
|
314
|
+
complexity envelope, differential ground truth, corpus validation, mutation evidence and declared
|
|
315
|
+
limitations. That page is measured by `script/m14/verify-analyzer-docs.ts`; the implementation for
|
|
316
|
+
`<name>` is `src/ast/real-<name>-analyzer.ts` (`make` lives in `real-makefile-analyzer.ts`).
|
|
317
|
+
|
|
318
|
+
## Editor and IDE
|
|
319
|
+
|
|
320
|
+
The same index powers an LSP 3.18 server — `dist/lsp/server.js --stdio`, shipped in the npm
|
|
321
|
+
package — and four editor integrations under [`ide/`](https://github.com/backbencher-hq/backbencher-brain/tree/main/ide):
|
|
322
|
+
|
|
323
|
+
- **VS Code family** (VS Code, Cursor, Antigravity): the `bb_lsp-vscode` extension (one VSIX)
|
|
324
|
+
provides hover with evidence tier and staleness, go-to-definition, references, document
|
|
325
|
+
symbols, workspace symbols and call hierarchy.
|
|
326
|
+
- **Zed**, **Helix** and **JetBrains** (via LSP4IJ): manifests and configuration templates that
|
|
327
|
+
point the editor at the same server.
|
|
328
|
+
|
|
329
|
+
They are complements to your editor's own language servers, by declared design: **no completion,
|
|
330
|
+
no diagnostics, no rename** — navigation, graph and evidence only
|
|
331
|
+
([honesty contract](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/IDE-HONESTY-CONTRACT.md)).
|
|
332
|
+
The editor integration serves 49 languages (the 50 minus Objective-C, excluded because `.m` is shared
|
|
333
|
+
with MATLAB); 48 carry recorded editor evidence, and a language outside the launch set gets a
|
|
334
|
+
declared not-indexed answer rather than a guess. Per-request-ID claim levels are in
|
|
335
|
+
[`docs/m24/TOOL-DOC.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/m24/TOOL-DOC.md),
|
|
336
|
+
per-editor install and verification status in
|
|
337
|
+
[`ide/README.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/ide/README.md) and on
|
|
338
|
+
[backbencher.cc/editors](https://backbencher.cc/editors). The extension's status bar shows the same
|
|
339
|
+
generated claim table the documentation ships.
|
|
340
|
+
|
|
341
|
+
Three request IDs ride an existing analyzer rather than adding a language: **TSX** is served by the
|
|
342
|
+
TypeScript analyzer, **Sass** by the CSS analyzer, and **Terraform** by the HCL analyzer. The editor integration
|
|
343
|
+
cannot exceed the analyzers — it is the same set, minus Objective-C: `bb_lsp` serves **49 languages** in
|
|
344
|
+
the editor (Objective-C is excluded because `.m` is shared with MATLAB and cannot be disambiguated by
|
|
345
|
+
extension), and **48** of those carry recorded in-editor evidence. MATLAB and Sass are sealed terminal
|
|
346
|
+
dispositions and are never counted as verified. See
|
|
347
|
+
[`docs/m24/TOOL-DOC.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/m24/TOOL-DOC.md)
|
|
348
|
+
for the per-request-ID claim levels.
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## Embeddings (optional)
|
|
353
|
+
|
|
354
|
+
The `bb_ask` tool (and semantic search) uses embeddings. Without a configured provider, `bb` falls back to local word
|
|
355
|
+
vectors — weaker by design, and labelled as such. `bb setup` offers prefilled free providers (OpenRouter,
|
|
356
|
+
NVIDIA NIM), validates the key with one `/embeddings` call before saving, and writes the config `0600`.
|
|
357
|
+
Changing the model or dimension requires `bb index --force`; vectors from different models or dimensions
|
|
358
|
+
are never compared. The full guide, precedence rules and every `BB_EMBEDDING_*` variable are in
|
|
359
|
+
[EMBEDDINGS.md](EMBEDDINGS.md) and [`docs/indexing/embeddings.md`](docs/indexing/embeddings.md).
|
|
360
|
+
|
|
361
|
+
The only network calls the product makes are the embedding provider you configure and the update check in
|
|
362
|
+
`bb upgrade`. Your source code is never uploaded, and there is no telemetry.
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## Documentation map
|
|
367
|
+
|
|
368
|
+
| Document | Read it for |
|
|
369
|
+
| --- | --- |
|
|
370
|
+
| [`docs/README.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/README.md) | the documentation index (start here if not sure) |
|
|
371
|
+
| [`docs/indexing/README.md`](docs/indexing/README.md) | the flag matrix, what each indexing mode does, how to read a run's report |
|
|
372
|
+
| [`docs/indexing/resume.md`](docs/indexing/resume.md) | interrupt/checkpoint/resume and the `skipped-unchanged` trap |
|
|
373
|
+
| [`docs/indexing/performance.md`](docs/indexing/performance.md) | measured timings, why a big repo takes time, what is **not** measured |
|
|
374
|
+
| [`docs/indexing/troubleshooting.md`](docs/indexing/troubleshooting.md) | worker-pool failures and other common errors |
|
|
375
|
+
| [`docs/indexing/environment-variables.md`](docs/indexing/environment-variables.md) | every `BB_*` variable and whether it is a user knob |
|
|
376
|
+
| [`docs/indexing/discovery-matrix.md`](docs/indexing/discovery-matrix.md) | exactly what is scanned (and what is not), case by case |
|
|
377
|
+
| [`docs/ARCHITECTURE.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/ARCHITECTURE.md) | module layout, evidence and mutation contracts |
|
|
378
|
+
| [`docs/GRAPH_ENGINE.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/GRAPH_ENGINE.md) | what each relationship edge means and how it is resolved |
|
|
379
|
+
| [`docs/tools/`](docs/tools/) | the generated per-tool reference (schemas, examples, errors, limits) |
|
|
380
|
+
| [`docs/analyzers/README.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/analyzers/README.md) | the 50 analyzer pages |
|
|
381
|
+
| [`docs/MCP_CLI_INDEXER_GUIDE.md`](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/MCP_CLI_INDEXER_GUIDE.md) | the end-to-end operational lifecycle (CLI/MCP parity, host setup, evidence semantics) |
|
|
382
|
+
| [`EMBEDDINGS.md`](EMBEDDINGS.md) | the shipped embedding setup guide |
|
|
383
|
+
| [`CHANGELOG.md`](CHANGELOG.md) | release history and removed aliases |
|
|
384
|
+
| `man bb` | the CLI manual, installed with the npm package |
|
|
385
|
+
|
|
386
|
+
---
|
|
387
|
+
|
|
388
|
+
## Architecture and verification
|
|
389
|
+
|
|
390
|
+
`src/ast/` parses languages into the evidence substrate; `src/storage/` persists canonical `brain_*` tables
|
|
391
|
+
in a per-project SQLite database; `src/intelligence/` contains the search, semantic, graph, analysis,
|
|
392
|
+
pattern, security, documentation, visualization, migration, edit and health engines; `src/mcp/` and
|
|
393
|
+
`src/cli/` are thin adapters over the same registry and handlers. Read-only tools never refresh implicitly.
|
|
394
|
+
`bb_edit` is the only advertised mutation surface. See [ARCHITECTURE.md](https://github.com/backbencher-hq/backbencher-brain/blob/main/docs/ARCHITECTURE.md).
|
|
395
|
+
|
|
396
|
+
The engine and indexer suites run under both runtimes — Node (compiled `dist/`, better-sqlite3) and Bun
|
|
397
|
+
(`src/`, `bun:sqlite`):
|
|
398
|
+
|
|
399
|
+
```bash
|
|
400
|
+
npm run build
|
|
401
|
+
npx tsx script/verify-engine.ts # parser surface
|
|
402
|
+
npx tsx script/verify-index.ts # indexer, store, resume, health
|
|
403
|
+
npx tsx script/verify-embed.ts # embeddings
|
|
404
|
+
npx tsx script/verify-cli-surface.ts # CLI surface
|
|
405
|
+
npm test # engine + schema + tool registry + public surface
|
|
406
|
+
npm run docs:verify # generated tool docs and documentation truth
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
Documentation numbers are enforced rather than remembered: the indexing pages are gated against `src/`,
|
|
410
|
+
the per-tool references are generated from the registry, each analyzer page is measured against its
|
|
411
|
+
template, and `script/m14/verify-doc-truth-emissions.ts` fails when an analyzer page contradicts the
|
|
412
|
+
analyzer's emitted relationships.
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
MIT licensed. Repository: [github.com/backbencher-hq/backbencher-brain](https://github.com/backbencher-hq/backbencher-brain).
|
package/bin/bb
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Global `bb` binary — runs the compiled CLI (plain Node, no tsx needed).
|
|
3
|
+
import { runCli } from "../dist/cli/index.js"
|
|
4
|
+
|
|
5
|
+
try {
|
|
6
|
+
await runCli(process.argv.slice(2))
|
|
7
|
+
} catch (error) {
|
|
8
|
+
// Keep CLI failures machine-readable and symmetric with MCP tool errors.
|
|
9
|
+
// Commander/handler stack traces are implementation detail, not API output.
|
|
10
|
+
const message = error instanceof Error ? error.message : String(error)
|
|
11
|
+
console.error(`error: ${message}`)
|
|
12
|
+
process.exitCode = 1
|
|
13
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NON_CODE_LANGUAGES,
|
|
3
|
+
analysisPathScopeSQL,
|
|
4
|
+
analysisScopeConditions,
|
|
5
|
+
analysisSymbolNameConditions,
|
|
6
|
+
analysisSymbolNameScopeSQL,
|
|
7
|
+
analysis_exclusions_exports,
|
|
8
|
+
isAnalysisExcluded,
|
|
9
|
+
isHardNoisePath,
|
|
10
|
+
isIndexArtifactName,
|
|
11
|
+
isIndexArtifactNameStrict,
|
|
12
|
+
isNoiseSymbolName,
|
|
13
|
+
isNonCodeLanguage,
|
|
14
|
+
isTestPath,
|
|
15
|
+
nonCodeLanguageSQL
|
|
16
|
+
} from "./chunk-SM7RFQRO.js";
|
|
17
|
+
import "./chunk-L5TDYKYK.js";
|
|
18
|
+
import "./chunk-ROMM6KMC.js";
|
|
19
|
+
import "./chunk-MLKGABMK.js";
|
|
20
|
+
export {
|
|
21
|
+
analysis_exclusions_exports as AnalysisExclusions,
|
|
22
|
+
NON_CODE_LANGUAGES,
|
|
23
|
+
analysisPathScopeSQL,
|
|
24
|
+
analysisScopeConditions,
|
|
25
|
+
analysisSymbolNameConditions,
|
|
26
|
+
analysisSymbolNameScopeSQL,
|
|
27
|
+
isAnalysisExcluded,
|
|
28
|
+
isHardNoisePath,
|
|
29
|
+
isIndexArtifactName,
|
|
30
|
+
isIndexArtifactNameStrict,
|
|
31
|
+
isNoiseSymbolName,
|
|
32
|
+
isNonCodeLanguage,
|
|
33
|
+
isTestPath,
|
|
34
|
+
nonCodeLanguageSQL
|
|
35
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
checkEmbeddingCoverage,
|
|
3
|
+
formatHealthReport,
|
|
4
|
+
preFlightCheck,
|
|
5
|
+
runIndexHealthCheck
|
|
6
|
+
} from "./chunk-2RTN2DFU.js";
|
|
7
|
+
import "./chunk-QLK6ED4Q.js";
|
|
8
|
+
import "./chunk-KLK3PBTO.js";
|
|
9
|
+
import "./chunk-2BSKD7O3.js";
|
|
10
|
+
import "./chunk-ROMM6KMC.js";
|
|
11
|
+
import "./chunk-MLKGABMK.js";
|
|
12
|
+
export {
|
|
13
|
+
checkEmbeddingCoverage,
|
|
14
|
+
formatHealthReport,
|
|
15
|
+
preFlightCheck,
|
|
16
|
+
runIndexHealthCheck
|
|
17
|
+
};
|