nano-brain 2026.6.2003 → 2026.6.2005

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.
Files changed (2) hide show
  1. package/README.md +55 -1
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -21,6 +21,7 @@
21
21
  - [MCP Tools](#mcp-tools)
22
22
  - [Search Pipeline](#search-pipeline)
23
23
  - [Architecture](#architecture)
24
+ - [Ruby / Rails Support](#ruby--rails-support)
24
25
  - [Migration from V1](#migration-from-v1)
25
26
  - [Tech Stack](#tech-stack)
26
27
  - [License](#license)
@@ -75,7 +76,7 @@ You work on 3 client projects in parallel. Each is a separate workspace. When yo
75
76
  ### Legacy codebase archaeology
76
77
  You inherit a 5-year-old codebase with minimal documentation and no original authors to ask. Index it into nano-brain. Your AI agent can now answer "what does this function do?", "why does this class exist?", and "if I change this file, what else breaks?" — navigating cross-file relationships without reading 200k lines manually.
77
78
 
78
- Go, TypeScript, Python, JavaScript supported today. Rust, Java, and others planned.
79
+ Go, TypeScript, Python, JavaScript, Ruby supported today. Rust, Java, and others planned.
79
80
 
80
81
  ### Pre-commit / pre-PR impact check
81
82
  Before pushing, run `memory_impact` on your changed files to discover what else in the codebase depends on them — across files, across repos in the same workspace. Catch breaking changes before they hit CI. *(Multi-file diff-aware mode in roadmap.)*
@@ -767,6 +768,59 @@ Query --> Vector (HNSW cos) ---+
767
768
  - errgroup + context for goroutine lifecycle
768
769
  - Echo v4 middleware: workspace extraction, content-type enforcement, version header
769
770
 
771
+ ## Ruby / Rails Support
772
+
773
+ nano-brain supports Ruby and Ruby on Rails code intelligence, including execution flow visualization and control-flow graph (CFG) extraction.
774
+
775
+ ### Supported file types
776
+
777
+ - `.rb`
778
+
779
+ ### What's extracted
780
+
781
+ - **Rails routes:** `resources`, `get`/`post`/`patch`/`put`/`delete`, `namespace`, `scope`, `mount`, `root`, `devise_for` — each generates an edge from the HTTP entry point (`METHOD /path`) to the corresponding controller action (`ControllerName#action`).
782
+ - **Control-flow graph:** `if`/`else`, loops, `begin`/`rescue` blocks, method definitions, and same-file method calls.
783
+ - **Flow diagrams:** Mermaid flowcharts and sequence diagrams for Rails request cycles.
784
+
785
+ ### Example: Flow diagram for a Rails controller action
786
+
787
+ Given a `UsersController` with a `create` action that creates a user and sends a welcome email, `memory_flow` produces a flowchart:
788
+
789
+ ```mermaid
790
+ flowchart LR
791
+ POST_/users["POST /users"]
792
+ POST_/users --> UsersController#create
793
+ UsersController#create --> User.create
794
+ UsersController#create --> Mailer.welcome
795
+ ```
796
+
797
+ ### Example: Sequence diagram for a Rails request
798
+
799
+ With `format: "sequence"`, the same request produces a sequence diagram:
800
+
801
+ ```mermaid
802
+ sequenceDiagram
803
+ participant Client
804
+ participant Router
805
+ participant UsersController
806
+ participant User
807
+ participant Mailer
808
+ Client->>Router: POST /users
809
+ Router->>UsersController: create
810
+ UsersController->>User: create(params)
811
+ User-->>UsersController: user
812
+ UsersController->>Mailer: welcome(user)
813
+ Mailer-->>UsersController: email
814
+ UsersController-->>Client: 201 Created
815
+ ```
816
+
817
+ ### Known limitations (v1)
818
+
819
+ - **Same-file calls only:** Only method calls within the same file are resolved; cross-file caller/callee edges are not yet extracted.
820
+ - **No `before_action` / `after_action`:** Callback chains are not followed or visualized.
821
+ - **No ActiveRecord dynamic methods:** Calls like `find_by_email` or `where_active` are treated as generic method calls, not resolved to AR query targets.
822
+ - **No metaprogramming:** Methods defined via `define_method`, `method_missing`, or `class_eval` are not captured.
823
+
770
824
  ## Migration from V1
771
825
 
772
826
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nano-brain",
3
- "version": "2026.6.2003",
3
+ "version": "2026.6.2005",
4
4
  "description": "Persistent memory and code intelligence for AI coding agents",
5
5
  "bin": {
6
6
  "nano-brain": "npm/run.js"