rails-ai-bridge 4.2.0 → 4.3.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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.aider.conf.yml +23 -0
  3. data/.graphifyignore +19 -0
  4. data/.mutant.yml +3 -0
  5. data/AGENTS.md +32 -3
  6. data/CHANGELOG.md +43 -0
  7. data/CLAUDE.md +3 -3
  8. data/CONTRIBUTING.md +1 -1
  9. data/GEMINI.md +7 -5
  10. data/README.md +42 -26
  11. data/SECURITY.md +6 -0
  12. data/docs/GUIDE.md +34 -7
  13. data/docs/devin-setup.md +1 -0
  14. data/docs/gem-general-improvements.md +12 -1
  15. data/docs/offline-mode.md +5 -0
  16. data/lib/generators/rails_ai_bridge/install/install_generator.rb +4 -0
  17. data/lib/rails_ai_bridge/config/introspection.rb +15 -1
  18. data/lib/rails_ai_bridge/config/output.rb +5 -0
  19. data/lib/rails_ai_bridge/configuration.rb +2 -0
  20. data/lib/rails_ai_bridge/exclusion_helper.rb +70 -0
  21. data/lib/rails_ai_bridge/introspector.rb +11 -5
  22. data/lib/rails_ai_bridge/introspectors/controller_introspector/filter_extractor.rb +118 -5
  23. data/lib/rails_ai_bridge/introspectors/controller_introspector.rb +10 -2
  24. data/lib/rails_ai_bridge/introspectors/model_introspector/association_extractor.rb +2 -1
  25. data/lib/rails_ai_bridge/introspectors/model_introspector.rb +35 -3
  26. data/lib/rails_ai_bridge/introspectors/model_semantic_enrichment.rb +7 -1
  27. data/lib/rails_ai_bridge/introspectors/route_introspector.rb +57 -4
  28. data/lib/rails_ai_bridge/introspectors/schema/static_schema_parser.rb +4 -3
  29. data/lib/rails_ai_bridge/introspectors/schema/static_structure_sql_parser.rb +204 -13
  30. data/lib/rails_ai_bridge/introspectors/schema_introspector.rb +3 -2
  31. data/lib/rails_ai_bridge/path_resolver.rb +67 -6
  32. data/lib/rails_ai_bridge/serializers/formatters/providers/mcp_guide_formatter.rb +1 -0
  33. data/lib/rails_ai_bridge/serializers/providers/collaborators/rules_document_builder.rb +1 -1
  34. data/lib/rails_ai_bridge/serializers/providers/copilot_serializer.rb +7 -0
  35. data/lib/rails_ai_bridge/serializers/providers/mcp_tool_reference_formatter.rb +1 -0
  36. data/lib/rails_ai_bridge/serializers/shared_assistant_guidance.rb +39 -6
  37. data/lib/rails_ai_bridge/server.rb +2 -0
  38. data/lib/rails_ai_bridge/tools/README.md +4 -0
  39. data/lib/rails_ai_bridge/tools/confidence_tag.rb +34 -0
  40. data/lib/rails_ai_bridge/tools/explain_symbol/cli_explorer.rb +70 -0
  41. data/lib/rails_ai_bridge/tools/explain_symbol.rb +124 -0
  42. data/lib/rails_ai_bridge/tools/get_context/composer.rb +213 -0
  43. data/lib/rails_ai_bridge/tools/get_context/related_tests.rb +95 -0
  44. data/lib/rails_ai_bridge/tools/get_context/resolver.rb +320 -0
  45. data/lib/rails_ai_bridge/tools/get_context.rb +110 -0
  46. data/lib/rails_ai_bridge/tools/get_controllers.rb +19 -4
  47. data/lib/rails_ai_bridge/tools/get_model_details.rb +4 -3
  48. data/lib/rails_ai_bridge/tools/get_routes.rb +52 -7
  49. data/lib/rails_ai_bridge/tools/get_schema.rb +18 -2
  50. data/lib/rails_ai_bridge/tools/model_details/full_formatter.rb +3 -1
  51. data/lib/rails_ai_bridge/tools/model_details/single_model_formatter.rb +47 -3
  52. data/lib/rails_ai_bridge/tools/schema/full_formatter.rb +4 -2
  53. data/lib/rails_ai_bridge/tools/schema/standard_formatter.rb +20 -2
  54. data/lib/rails_ai_bridge/tools/schema/summary_formatter.rb +4 -2
  55. data/lib/rails_ai_bridge/tools/schema/table_formatter.rb +24 -3
  56. data/lib/rails_ai_bridge/version.rb +1 -1
  57. data/lib/rails_ai_bridge/view_file_analyzer.rb +39 -1
  58. data/rails-ai-bridge.gemspec +2 -8
  59. data/repomix.config.json +44 -0
  60. metadata +14 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24c9dd6461240b9d6864b35c171c465635f9fdacc3c76195915f43b995a27f18
4
- data.tar.gz: e97756c625478c854f78f661393d26043ba36b07b8941bed7a2a2c09b3a62a4b
3
+ metadata.gz: d937341388cd5f16ca5c4df0bfb3e540b0aabd88f21fb7edd8a99c4109a504e2
4
+ data.tar.gz: 92b5ef03eed9e1a2a3c2f3161543e2f3143724e2af146b941a83b159ca9f7324
5
5
  SHA512:
6
- metadata.gz: f453227c44348be19356eecb728dac22328abcb20a99cf0430f441c68557346d93576527716764cae4f68f404fcab524dd44c4454b27a4f9078955632be8937f
7
- data.tar.gz: 10e975098f252c37f37108e04d0e370b03f469829f9e2520334b180e83a8844a8276b9f4ed60ae650e0f9bd47dd7361b42885dcbdf87880e37d56c04152720fa
6
+ metadata.gz: '09bdcacd48c5a46c069a90468cd772b0179d4b5464cd48438923b27e8ac8e4895afbcaecfa08136bd70e51231d70a439dfb4ddc5b3b153488fa1f16caf1ed22c'
7
+ data.tar.gz: 64715803d3c38e8827dfdd9200bbed447663d5751854193f1ae5f5a818c8eb9f2a9aabbf14fc3c84bc1a79b47f48e8bf3007cd6b1f26f10c1dab98771f300f74
data/.aider.conf.yml ADDED
@@ -0,0 +1,23 @@
1
+ read:
2
+ - AGENTS.md
3
+ - repomix.config.json
4
+
5
+ mcp_servers:
6
+ codegraph:
7
+ command: "/Users/igmarin/.local/bin/codegraph"
8
+ args:
9
+ - serve
10
+ - --mcp
11
+ - --path
12
+ - "/Volumes/minimini/Developer/Projects/rails-ai-bridge"
13
+ graphify:
14
+ command: "/Users/igmarin/.local/bin/graphify-mcp"
15
+ args:
16
+ - --graph
17
+ - "/Volumes/minimini/Developer/Projects/rails-ai-bridge/graphify-out/graph.json"
18
+ repomix:
19
+ command: "/opt/homebrew/bin/repomix"
20
+ args:
21
+ - --mcp
22
+ - --sandbox
23
+ - "/Volumes/minimini/Developer/Projects/rails-ai-bridge"
data/.graphifyignore ADDED
@@ -0,0 +1,19 @@
1
+ .git
2
+ .idea
3
+ .cursor
4
+ .claude
5
+ .grok
6
+ .zed
7
+ .codegraph
8
+ graphify-out
9
+ repomix-output.xml
10
+ repomix-output.md
11
+ coverage
12
+ review-result.txt
13
+ rs-guard-metrics.json
14
+ *.gem
15
+ .DS_Store
16
+ tmp/
17
+ doc/
18
+ vendor/bundle/
19
+ coverage/
data/.mutant.yml CHANGED
@@ -13,6 +13,9 @@
13
13
  # Subject expressions are passed on the CLI to target critical paths:
14
14
  # RailsAiBridge::Registry — registry resolution
15
15
  # RailsAiBridge::Tools — MCP tools
16
+ # RailsAiBridge::Tools::SearchCode::Validator
17
+ # RailsAiBridge::ViewFileAnalyzer
18
+ # RailsAiBridge::ExclusionHelper
16
19
  # RailsAiBridge::Serializers — output serializers
17
20
  usage: opensource
18
21
  integration: rspec
data/AGENTS.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # AGENTS.md — rails-ai-bridge development guide
2
2
 
3
- This is a Ruby gem that auto-introspects Rails applications and exposes their
4
- structure to AI assistants via the Model Context Protocol (MCP).
3
+ Ruby gem that reads a Rails app and gives assistants that map over MCP and
4
+ committed context files. It does not write to the host database.
5
5
 
6
6
  ## Architecture
7
7
 
@@ -9,7 +9,7 @@ structure to AI assistants via the Model Context Protocol (MCP).
9
9
  - `lib/rails_ai_bridge/configuration.rb` — User-facing config with presets (:standard, :full)
10
10
  - `lib/rails_ai_bridge/introspector.rb` — Orchestrates sub-introspectors
11
11
  - `lib/rails_ai_bridge/introspectors/` — Built-in introspector classes; `:standard` preset runs **9**, `:full` runs **27** (see `Configuration::PRESETS`). Registry: `Introspector::BUILTIN_INTROSPECTORS` (includes opt-in symbols such as `database_stats`, `non_ar_models` not listed in those presets).
12
- - `lib/rails_ai_bridge/tools/` — 17 built-in MCP tools using the official mcp SDK (hosts can add more via `additional_tools`)
12
+ - `lib/rails_ai_bridge/tools/` — 19 built-in MCP tools using the official mcp SDK (hosts can add more via `additional_tools`)
13
13
  - `lib/rails_ai_bridge/serializers/` — Output formatters (claude, claude_rules, codex, cursor_rules, devin, devin_rules, copilot, copilot_instructions, gemini, rules, markdown, JSON)
14
14
  - `lib/rails_ai_bridge/resources.rb` — MCP resources (static data AI clients read directly)
15
15
  - `lib/rails_ai_bridge/server.rb` — MCP server configuration (stdio + HTTP transports)
@@ -54,9 +54,38 @@ Uses combustion gem for testing Rails engine behavior in isolation.
54
54
  - `generate_context` returns `{ written: [], skipped: [] }` hash
55
55
  - Zeitwerk autoloads all files — no `require_relative` needed for new classes
56
56
 
57
+ ## Multi-Issue Workflow
58
+
59
+ When working on a milestone with 3+ issues:
60
+
61
+ - **Group** issues by independence — parallel work streams get one git worktree each
62
+ - **Stack** dependent PRs within a group using `gh stack` (each PR's base is the previous branch)
63
+ - **Merge** bottom-up: the first PR in a stack merges to `main`, then `gh stack rebase` restacks the rest
64
+ - **Clean up** worktrees after all PRs in a group are merged
65
+
66
+ ```bash
67
+ # One worktree per independent group
68
+ git worktree add ../project-worktrees/group-a -b group-a-branch
69
+
70
+ # Stack dependent PRs within a group
71
+ gh stack create "feat: description (#issue)"
72
+
73
+ # Restack after bottom PR merges
74
+ gh stack rebase
75
+ ```
76
+
57
77
  <!-- lean-ctx -->
58
78
  ## lean-ctx
59
79
 
60
80
  Prefer lean-ctx MCP tools over native equivalents for token savings.
61
81
  Full rules: @LEAN-CTX.md
62
82
  <!-- /lean-ctx -->
83
+
84
+ ## Code intelligence
85
+
86
+ Use these tools before dumping whole files or grepping the tree.
87
+
88
+ 1. If `.codegraph/` exists, run `codegraph explore "<symbol or question>"` (or the CodeGraph MCP tools).
89
+ 2. If `graphify-out/graph.json` exists, use Graphify (`graphify explain`, `graphify path`, or the Graphify MCP).
90
+ 3. For a whole-repo pack, run `repomix` using `repomix.config.json`. Do not commit `repomix-output.*`.
91
+ 4. Regenerate Graphify with `graphify extract . --backend deepseek --no-cluster` (DeepSeek is the global LLM). Rust workspaces also pass `--cargo`.
data/CHANGELOG.md CHANGED
@@ -5,6 +5,49 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [Unreleased]
9
+
10
+ ## [4.3.0] - 2026-08-16
11
+
12
+ ### Added
13
+
14
+ - **PathResolver glob/file cap** — `config.introspection.max_files_per_path` (default `2000`) truncates `PathResolver#glob_for` and `#files_for` after a stable sort. Documented alongside `snapshot_ttl` (5s section snapshot; raise for HTTP MCP only), `cache_ttl` (30s), and `parallel_introspection` (off).
15
+ - **Inherited controller filters** (#190) — `rails_get_controllers` lists `before_action` / `after_action` filters from the controller and its ancestors. Filters whose `only` / `except` do not apply to any action are omitted. `detail: summary` stays at filter names; `standard` / `full` include the defining class. ActionFilter `only`/`except` conditions are parsed on Rails 7.1+.
16
+ - **MCP exclusion parity spec** (#186) — `spec/lib/rails_ai_bridge/mcp/exclusion_parity_spec.rb` fails when `Server::TOOLS` or resource templates grow without a policy entry, and asserts `excluded_models`, `excluded_tables`, `:regulated`, and `disabled_introspection_categories` do not leak omitted names through listing tools or `rails://` resources. Composite `rails_get_context` is a listing-surface policy row, invoked only when that tool is already in `Server::TOOLS` (#181).
17
+ - **`rails_explain_symbol` MCP tool** (#192) — optional in-process explanation of a `symbol` or `query` from a **local** CodeGraph index (`.codegraph/`). Runs `codegraph explore` with a timeout and argv arrays (no shell, no network). Missing index or CLI failure returns setup instructions (`codegraph init` / `codegraph index`) instead of raising. Always registered so doc-parity stays a single tool list. Built-in MCP tools: **19**.
18
+ - **`rails_get_context` MCP tool** (#181) — in-process composite for one model, controller, or feature (table + model + routes + controller actions/filters + cheap related tests). Reuses `[VERIFIED]` / `[INFERRED]` tags from #187. No HTTP; provider fan-out stays on a different name. Built-in MCP tools: **19**.
19
+ - **Confidence tags on schema and model MCP tools** (#187) — `rails_get_schema` and `rails_get_model_details` markdown now marks facts as `[VERIFIED]` (live ActiveRecord reflection or rubydex/Prism) or `[INFERRED]` (source-regex macros and static schema parses). Missing sections are omitted rather than tagged empty.
20
+ - **Shared anti-hallucination rules in compact assistant files** (#188) — compact Claude, Cursor, Copilot, Codex, Gemini, and `AGENTS.md` output now include a short verify-before-write block from `SharedAssistantGuidance`. Disable with `config.output.anti_hallucination_rules = false` (default: on).
21
+ - **`rails_get_routes` URL helpers and required params** (#191) — named routes now include the Rails path helper (from the route set's declared name, e.g. `post_path`) and required parameter names (from Journey `required_parts`). Unnamed routes are left without a helper. Summary stays a compact per-controller overview (counts plus one sample helper); standard/full list helpers and required params (paginated).
22
+ - **Partition-child tables in `structure.sql` introspection** (#166) — `StaticStructureSqlParser` now expands PostgreSQL `CREATE TABLE … PARTITION OF …` children as table entries with `partition_of` / `partition_bound`, and marks parents with `partitioned` / `partition_by`. `rails_get_schema` surfaces the parent/child relationship at `detail: standard` and `full`.
23
+
24
+ ### Changed
25
+
26
+ - **Public docs wording** (#212) — README, GUIDE, and AGENTS/CLAUDE/GEMINI openers say what the gem does in plain language. Comparison table is four durable rows (setup, files in git, read-only, presets) instead of tool-count marketing.
27
+ - **Skunk CI gate ratcheted to 20 and made blocking** (#183) — measured 4.2/4.3 SkunkScore averages were 15.93, 15.97, 15.96, 16.18, 15.89 (mean ≈ 15.99). Threshold 20 leaves ~25% headroom above the worst sample. The skunk job still runs rspec first for coverage. Perf stays advisory (`continue-on-error`). Mutation stays advisory but now also targets `Tools::SearchCode::Validator`, `ViewFileAnalyzer`, and `ExclusionHelper`.
28
+ - **Advisory perf compare** — `rake perf:compare` takes the median of five iterations after one warmup. `introspection_time_sec` rebased to 0.028s after 4.3 schema/routes work (CI was 0.0269s on main, 0.0277s with PathResolver realpath). Context and MCP baselines stay at their 4.2 values because CI still measures well under them.
29
+ - **Documentation and gemspec humanization** (#189) — gemspec is one plain sentence (maps a Rails
30
+ app so assistants stop guessing); Windsurf dropped from the gemspec; `:full` YARD comment is 27
31
+ to match `Configuration::PRESETS[:full]`; README comparison uses four durable rows
32
+ (zero-config, committed files, read-only, presets) plus a dated checked-against line;
33
+ `docs/gem-general-improvements.md` marked done-in-4.1; `docs/offline-mode.md` labeled
34
+ 5.0 / registry. SECURITY.md outbound policy unchanged (git packs only).
35
+
36
+ ### Fixed
37
+
38
+ - **`Config::Introspection#preset=` accepts `nil`** — `preset = nil` now sets `@preset` to `nil` and leaves `introspectors` unchanged, so around-hooks can restore an unset preset. Named presets (`:standard`, `:regulated`, `:full`) are unchanged.
39
+ - **Namespaced model exclusions no longer collide on the last path segment** — `excluded_models: ['User']` still matches `User` / `Users` / `users` / `UsersController`, but not `Admin::User`, `Admin::UsersController`, `UserSession`, or `Superuser`. `excluded_models: ['Admin::User']` matches `Admin::User` and `Admin::UsersController` only. Table-only exclusions are unchanged (`patient_records` still drops `PatientRecord`).
40
+ - **MCP `fetch_section` honored disabled introspectors** (#186) — `Introspector#selected_introspectors` now intersects `only:` with `effective_introspectors`, so `:regulated` and `disabled_introspection_categories` cannot be bypassed by `rails_get_schema` / `rails://schema`.
41
+ - **Excluded association names no longer leak via model details** (#186) — associations, generated accessors, and rubydex `similar_models` that name an excluded model or table are omitted from MCP output.
42
+ - **`similar_models` honors `excluded_tables`** (#186) — rubydex sibling names such as `PatientRecord` are dropped when only `patient_records` is excluded (`ExclusionHelper.excluded_class_or_table?`).
43
+ - **Routes and controllers honor model or table exclusions** (#186) — `RouteIntrospector` and `ControllerIntrospector` omit `/users` and `UsersController` when `excluded_models` includes `User` or `excluded_tables` includes `users`. Conventions stay a non-inventory surface (`:does_not_list_models_or_tables`).
44
+
45
+ ### Security
46
+
47
+ - **HTTP MCP auth defaults documented more clearly** — README and SECURITY.md now lead with: HTTP MCP is unauthenticated unless you set a token or `require_http_auth`; bind to `127.0.0.1` unless you add auth. Default remains `require_http_auth = false`.
48
+ - **`PathResolver` symlink escape** — existing files from `existing_file_for` and `glob_for` are accepted only when `File.realpath` stays inside the realpath of the resolved directory or the application root. File and directory symlinks under a configured path that point outside the root are omitted. Missing paths still return `nil` without calling `realpath`. Allowed roots are realpathed once per resolver instance.
49
+ - **`ViewFileAnalyzer` symlink escape** (#185) — existing view files are resolved with `File.realpath` and compared against the realpath of every configured `app/views` root (including custom Rails paths). A symlink under views that points outside every root now raises `SecurityError` instead of emitting the target file contents.
50
+
8
51
  ## [4.2.0] - 2026-08-13
9
52
 
10
53
  ### Added
data/CLAUDE.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # CLAUDE.md — rails-ai-bridge development guide
2
2
 
3
- This is a Ruby gem that auto-introspects Rails applications and exposes their
4
- structure to AI assistants via the Model Context Protocol (MCP).
3
+ Ruby gem that reads a Rails app and gives assistants that map over MCP and
4
+ committed context files. It does not write to the host database.
5
5
 
6
6
  ## Architecture
7
7
 
@@ -12,7 +12,7 @@ structure to AI assistants via the Model Context Protocol (MCP).
12
12
  runs **9**, `:full` runs **27** (see `Configuration::PRESETS`). Registry:
13
13
  `Introspector::BUILTIN_INTROSPECTORS` (includes opt-in symbols such as
14
14
  `database_stats`, `non_ar_models` not listed in those presets).
15
- - `lib/rails_ai_bridge/tools/` — 17 built-in MCP tools using the official mcp SDK
15
+ - `lib/rails_ai_bridge/tools/` — 19 built-in MCP tools using the official mcp SDK
16
16
  (hosts can add more via `additional_tools`)
17
17
  - `lib/rails_ai_bridge/serializers/` — Output formatters (claude, claude_rules,
18
18
  codex, cursor_rules, devin, devin_rules, copilot, copilot_instructions,
data/CONTRIBUTING.md CHANGED
@@ -19,7 +19,7 @@ The test suite uses [Combustion](https://github.com/pat/combustion) to boot a mi
19
19
  ```
20
20
  lib/rails_ai_bridge/
21
21
  ├── introspectors/ # Built-in introspectors (schema, models, non_ar_models, routes, …)
22
- ├── tools/ # 17 built-in MCP tools (detail levels, pagination, extensible)
22
+ ├── tools/ # 19 built-in MCP tools (detail levels, pagination, extensible)
23
23
  ├── rubydex_adapter.rb # Rubydex API wrapper (singleton + query interface + stats)
24
24
  ├── rubydex_adapter/ # Extracted collaborators (one concern each)
25
25
  │ ├── serializer.rb # Hash serialization (declaration_to_hash, definition_to_hash, …)
data/GEMINI.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # GEMINI.md — rails-ai-bridge development guide
2
2
 
3
- This is a Ruby gem that auto-introspects Rails applications and exposes their
4
- structure to AI assistants via the Model Context Protocol (MCP).
3
+ Ruby gem that reads a Rails app and gives assistants that map over MCP and
4
+ committed context files. It does not write to the host database.
5
5
 
6
6
  ## Architecture
7
7
 
@@ -9,8 +9,9 @@ structure to AI assistants via the Model Context Protocol (MCP).
9
9
  - `lib/rails_ai_bridge/configuration.rb` — User-facing config with presets (:standard, :full)
10
10
  - `lib/rails_ai_bridge/introspector.rb` — Orchestrates sub-introspectors
11
11
  - `lib/rails_ai_bridge/introspectors/` — Built-in introspector classes; `:standard` preset runs **9**, `:full` runs **26** (see `Configuration::PRESETS`). Registry: `Introspector::BUILTIN_INTROSPECTORS` (includes opt-in symbols such as `database_stats`, `non_ar_models` not listed in those presets).
12
- - `lib/rails_ai_bridge/tools/` — 16 built-in MCP tools using the official mcp SDK (hosts can add more via `additional_tools`)
12
+ - `lib/rails_ai_bridge/tools/` — 19 built-in MCP tools using the official mcp SDK (hosts can add more via `additional_tools`)
13
13
  - `lib/rails_ai_bridge/serializers/` — Output formatters (claude, claude_rules, cursor_rules, windsurf, windsurf_rules, copilot, copilot_instructions, rules, markdown, JSON, gemini)
14
+ runs **9**, `:full` runs **27** (see `Configuration::PRESETS`). Registry:
14
15
  - `lib/rails_ai_bridge/resources.rb` — MCP resources (static data AI clients read directly)
15
16
  - `lib/rails_ai_bridge/server.rb` — MCP server configuration (stdio + HTTP transports)
16
17
  - `lib/rails_ai_bridge/middleware.rb` — Rack middleware for auto-mounting MCP HTTP endpoint
@@ -30,10 +31,11 @@ structure to AI assistants via the Model Context Protocol (MCP).
30
31
  6. **Diff-aware** — context regeneration skips unchanged files
31
32
  7. **Per-assistant serializers** — each AI tool gets tailored output format
32
33
  8. **Zeitwerk autoloading** — files loaded on-demand, not all upfront
33
- 9. **Introspector presets** — `:standard` (9 core) default, `:full` (26 introspectors; optional extras such as `database_stats`) for power users
34
+ 9. **Introspector presets** — `:standard` (9 core) default, `:full` (27 introspectors;
35
+ optional extras such as `database_stats`, `non_ar_models`) for power users
34
36
  10. **MCP auto-discovery** — `.mcp.json` generated by install generator
35
37
  11. **Compact by default** — context files ≤150 lines, MCP tools use `detail` parameter (summary/standard/full)
36
- 12. **Per-tool split rules** — `.claude/rules/`, `.cursor/rules/`, `.windsurf/rules/`, `.github/instructions/`
38
+ 12. **Per-tool split rules** — `.codex/`, `.cursor/rules/`, `.devin/rules/`, `.github/instructions/`
37
39
 
38
40
  ## Testing
39
41
 
data/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  ![Rails AI Bridge Logo](https://github.com/user-attachments/assets/ee7b04bd-2d67-483e-be4a-cffdefdbdc50)
4
4
 
5
- > **Turn any Rails app into an AI-ready system with real context, not guesswork.**
5
+ > Maps your Rails app so assistants stop guessing table names, routes, and conventions.
6
6
 
7
- **One command. Zero config. Structured context + live introspection for AI assistants** via compact project files and an MCP server.
7
+ The install generator writes compact context files and starts a read-only MCP server. Assistants can read the files at session start, then ask for one model, table, or controller when they need detail.
8
8
 
9
9
  [![Gem Version](https://badge.fury.io/rb/rails-ai-bridge.svg)](https://rubygems.org/gems/rails-ai-bridge)
10
10
  [![CI](https://github.com/igmarin/rails-ai-bridge/actions/workflows/ci.yml/badge.svg)](https://github.com/igmarin/rails-ai-bridge/actions)
@@ -24,7 +24,7 @@ rails-ai-bridge turns a Rails app into an AI-readable project map:
24
24
  - **A read-only MCP server** lets assistants ask for exact details only when needed, such as one model, one table, one controller, or one route group.
25
25
  - **Assistant-specific output** keeps Claude Code, Cursor, Codex, Copilot, Devin, Gemini, and JSON consumers aligned without making you hand-write context files.
26
26
 
27
- The goal is simple: help AI assistants produce code that fits your Rails app instead of generic Rails code.
27
+ The point is that generated code should match this app, not a generic Rails tutorial.
28
28
 
29
29
  ## Start here
30
30
 
@@ -52,7 +52,7 @@ This is useful when you want an AI assistant to work inside a real Rails codebas
52
52
  - A team that wants shared AI guidance committed to the repo
53
53
  - Large schemas where dumping everything into context would be noisy
54
54
 
55
- For tiny apps or one-off scripts, manual context may be enough. For team Rails apps, generated context plus MCP gives the assistant a much better starting point.
55
+ Skip this on a tiny app or a one-off script. On a team app with real models and conventions, generated files plus MCP beat a hand-written notes file.
56
56
 
57
57
  ---
58
58
 
@@ -74,14 +74,14 @@ flowchart LR
74
74
 
75
75
  1. **Introspect**: built-in scanners read your Rails app structure: schema, models, routes, controllers, gems, tests, conventions, and optional full-stack details.
76
76
  2. **Generate**: `rails ai:bridge` writes compact, assistant-specific files such as `AGENTS.md`, `CLAUDE.md`, `.cursor/rules/`, and Copilot instructions.
77
- 3. **Serve**: `rails ai:serve` exposes read-only `rails_*` MCP tools so an assistant can drill into exact details on demand.
77
+ 3. **Serve**: `rails ai:serve` exposes 19 read-only `rails_*` tools so an assistant can drill into exact details on demand.
78
78
 
79
79
  This creates two complementary layers:
80
80
 
81
81
  | Layer | What it does | Why it matters |
82
82
  |---|---|---|
83
- | Static files | Give the assistant passive project orientation at session start | Fewer cold starts and fewer generic assumptions |
84
- | MCP tools | Return exact live details when requested | Less context bloat and fewer schema/route hallucinations |
83
+ | Static files | Overview the assistant sees when the session starts | Less time spent rediscovering models and routes |
84
+ | MCP tools | Exact live details when the assistant asks | Smaller prompts; fewer invented columns and helpers |
85
85
 
86
86
  Compact files are ordered for usefulness: primary domain models, busy endpoints, recently migrated tables, and optional hot-table hints appear before less important details.
87
87
 
@@ -90,7 +90,7 @@ Compact files are ordered for usefulness: primary domain models, busy endpoints,
90
90
  - MCP tools are **read-only**. They inspect Rails structure; they do not write files or mutate the database.
91
91
  - `database_stats` is **opt-in** because it queries PostgreSQL table statistics.
92
92
  - Generated assistant context avoids credential values and suppresses secret-bearing config paths such as `.env*`, Rails credentials, `master.key`, private key material, and custom `config/secrets` or `config/private` files.
93
- - HTTP MCP should stay bound to `127.0.0.1` unless you add authentication and network controls. See [docs/mcp-security.md](docs/mcp-security.md).
93
+ - HTTP MCP is unauthenticated unless you set a token or `require_http_auth`. Bind to `127.0.0.1` unless you add auth. See [docs/mcp-security.md](docs/mcp-security.md).
94
94
 
95
95
  ---
96
96
 
@@ -152,23 +152,23 @@ Optional: `gem install rails-ai-bridge` installs the gem into your Ruby environm
152
152
 
153
153
  ---
154
154
 
155
- ## Why rails-ai-bridge over alternatives?
155
+ ## Compared with writing the files yourself, or rails-mcp-server
156
156
 
157
- | | **rails-ai-bridge** | **[rails-mcp-server](https://github.com/maquina-app/rails-mcp-server)** | **Manual context** |
157
+ | | **rails-ai-bridge** | **[rails-mcp-server](https://github.com/maquina-app/rails-mcp-server)** | **Hand-written notes** |
158
158
  | --- | --- | --- | --- |
159
- | Zero config | Yes Railtie + install generator | No — per-project `projects.yml` | No |
160
- | Token optimization | Yes compact files + `detail:"summary"` workflow | Varies | No |
161
- | Codex-oriented repo files | Yes `AGENTS.md`, `.codex/README.md` | No | DIY |
162
- | Live MCP tools | Yes 17 read-only `rails_*` tools (extensible) | Yes | No |
163
- | Auto-introspection | Yes — up to **27** domains (`:full`) | No — server points at projects you configure | DIY |
159
+ | Setup | Railtie and an install generator | Per-project `projects.yml` | You write everything |
160
+ | Files in git | Assistant files committed in the app | Configured projects only | Whatever you remember to commit |
161
+ | Read-only | Inspects structure; does not write or mutate | Yes | Yes |
162
+ | Presets | `:standard`, `:full`, and `:regulated` | No | No |
164
163
 
165
- *Comparison reflects typical documented setups; verify against each project before treating any row as absolute.*
164
+ *Checked against rails-mcp-server README and typical manual-context workflows on 2026-08-15.
165
+ This table lists durable product differences, not tool or introspector counts that change release to release.*
166
166
 
167
167
  ---
168
168
 
169
- ## What Gets Generated
169
+ ## What `rails ai:bridge` writes
170
170
 
171
- `rails ai:bridge` generates assistant-specific files tailored to each AI workflow:
171
+ It writes one set of files per assistant. Compact files stay near 150 lines. Split rules live next to the tool that reads them:
172
172
 
173
173
  ```text
174
174
  your-rails-app/
@@ -229,7 +229,7 @@ Each file respects the AI tool's format and size limits. **Commit these files**
229
229
  | **Models** | Associations, validations, scopes, enums, callbacks, concerns, macros (`has_secure_password`, `encrypts`, `normalizes`, etc.), **semantic tier** (`core_entity`, `pure_join`, `rich_join`, `supporting`) |
230
230
  | **Non-AR Models** | Ruby classes under the configured logical `app/models` path that aren't ActiveRecord, tagged as `[POJO/Service]` (included in `:full`, or opt in with `:non_ar_models`) |
231
231
  | **Routing** | Every route with HTTP verbs, paths, controller actions, API namespaces, plus compact endpoint-focus summaries for busy controllers |
232
- | **Controllers** | Actions, filters, strong params, concerns, API controllers; source metadata honors configured controller paths |
232
+ | **Controllers** | Actions, inherited filters (with `only`/`except` and source class), strong params, concerns, API controllers; source metadata honors configured controller paths |
233
233
  | **Views** | Layouts, templates, partials, helpers, template engines, view components |
234
234
  | **Frontend** | Stimulus controllers, views, Turbo Frames/Streams, and broadcasts from configured Rails paths |
235
235
  | **Background** | ActiveJob classes, mailers, Action Cable channels |
@@ -251,14 +251,15 @@ This keeps context focused and avoids unnecessary token usage while still allowi
251
251
 
252
252
  ## MCP Tools
253
253
 
254
- The gem exposes **17 built-in tools** via MCP that AI clients call on-demand (hosts can append more via `config.additional_tools`):
254
+ The gem exposes **19 built-in tools** via MCP that AI clients call on-demand (hosts can append more via `config.additional_tools`):
255
255
 
256
256
  | Tool | What it returns |
257
257
  |------|----------------|
258
- | `rails_get_schema` | Tables, columns, indexes, foreign keys |
259
- | `rails_get_model_details` | Associations, validations, scopes, enums, callbacks, semantic tier, non-AR models (when enabled) |
258
+ | `rails_get_schema` | Tables, columns, indexes, foreign keys — tagged `[VERIFIED]` (live ActiveRecord) or `[INFERRED]` (static schema.rb / structure.sql parse) |
259
+ | `rails_get_model_details` | Associations, validations, scopes, enums, callbacks, source macros, semantic tier, non-AR models (when enabled) — tagged `[VERIFIED]` (reflection / rubydex) or `[INFERRED]` (source regex) |
260
+ | `rails_get_context` | In-process composite for one model, controller, or feature: table + model + routes + controller actions + cheap related tests (no HTTP) |
260
261
  | `rails_get_routes` | HTTP verbs, paths, controller actions |
261
- | `rails_get_controllers` | Actions, filters, strong params, concerns |
262
+ | `rails_get_controllers` | Actions, inherited filters (source class at standard/full), strong params, concerns |
262
263
  | `rails_get_config` | Cache, session, timezone, middleware, initializers |
263
264
  | `rails_get_test_info` | Test framework, factories, CI config, coverage |
264
265
  | `rails_get_gems` | Notable gems categorized by function |
@@ -266,6 +267,7 @@ The gem exposes **17 built-in tools** via MCP that AI clients call on-demand (ho
266
267
  | `rails_search_code` | Ripgrep (or Ruby) search under `Rails.root` with allowlisted extensions, pattern size cap, and optional wall-clock timeout |
267
268
  | `rails_get_view` | View layouts, templates, partials; optional per-file detail under the configured `app/views` path |
268
269
  | `rails_search_semantic` | Semantic code search using rubydex — find declarations by name with types, locations, and relationships |
270
+ | `rails_explain_symbol` | Local CodeGraph explanation for a `symbol` or `query` when `.codegraph/` exists; otherwise setup instructions |
269
271
  | `rails_get_stimulus` | Stimulus controllers: targets, values, actions, outlets (requires `:stimulus` introspector) |
270
272
  | `rails_list_registry` | Skill pack catalog — list skills, agents, or active packs; requires `config/rails_ai_bridge/registry.json` |
271
273
  | `rails_resolve_skill` | Full content of a named skill or agent from the registry (priority ordering + deprecation redirects); optional `pack=` pin and `type=agent` |
@@ -394,6 +396,11 @@ Codex reads `AGENTS.md` at the repository root. MCP can be configured in `.codex
394
396
 
395
397
  ### HTTP transport (alternative for all clients)
396
398
 
399
+ HTTP MCP is unauthenticated unless you set a token (`http_mcp_token` /
400
+ `RAILS_AI_BRIDGE_MCP_TOKEN`, or a resolver/JWT decoder) or
401
+ `require_http_auth`. Bind to `127.0.0.1` unless you add auth. The default
402
+ remains `require_http_auth = false`.
403
+
397
404
  If stdio MCP fails (usually a Ruby version manager PATH issue), start the HTTP server instead:
398
405
 
399
406
  ```bash
@@ -411,7 +418,7 @@ RailsAiBridge.configure do |config|
411
418
  end
412
419
  ```
413
420
 
414
- Point your AI client to `http://localhost:3000/mcp` (or whichever port your Rails server uses) using transport type `SSE`. Keep the endpoint bound to localhost unless you add authentication. See [docs/mcp-security.md](docs/mcp-security.md) for production hardening.
421
+ Point your AI client to `http://127.0.0.1:3000/mcp` (or whichever port your Rails server uses) using transport type `SSE`. See [docs/mcp-security.md](docs/mcp-security.md) and [SECURITY.md](SECURITY.md) for production hardening.
415
422
 
416
423
  ### Claude Desktop (standalone app)
417
424
 
@@ -506,6 +513,12 @@ RailsAiBridge.configure do |config|
506
513
 
507
514
  # Cache TTL for MCP tool responses (seconds)
508
515
  config.cache_ttl = 30
516
+
517
+ # Fingerprint / section snapshot TTL (default 5s). Raise for HTTP MCP only.
518
+ # config.snapshot_ttl = 30
519
+
520
+ # Cap PathResolver glob/file listings (default 2000, sorted then taken).
521
+ # config.max_files_per_path = 2000
509
522
  end
510
523
  ```
511
524
 
@@ -538,9 +551,12 @@ end
538
551
  | `additional_resources` | `{}` | Optional MCP resources merged with the built-in `rails://...` resources |
539
552
  | `http_path` | `"/mcp"` | HTTP endpoint path |
540
553
  | `http_port` | `6029` | HTTP server port |
541
- | `cache_ttl` | `30` | Cache TTL in seconds |
554
+ | `cache_ttl` | `30` | Cache TTL in seconds for introspection results |
555
+ | `snapshot_ttl` | `5` | Fingerprint / section snapshot TTL (seconds); raise for HTTP MCP |
556
+ | `max_files_per_path` | `2000` | Max paths from `PathResolver#glob_for` / `#files_for` (sorted, then taken) |
542
557
  | `watcher_formats` | `:all` | Formats regenerated by `rails ai:watch` (e.g. `%i[claude cursor]` to limit churn) |
543
558
  | `managed_region` | `false` | Confine generated output to a marked block so hand-authored content in `CLAUDE.md` & co. survives regeneration |
559
+ | `anti_hallucination_rules` | `true` | Include the shared verify-before-write block in compact assistant files |
544
560
  | `parallel_introspection` | `false` | Run introspectors concurrently (requires `concurrent-ruby`, which is already a Rails dependency) |
545
561
  | `parallel_pool_size` | `4` | Max threads in the parallel pool; capped at the number of active introspectors so no idle threads are created |
546
562
  | `parallel_timeout_seconds` | `10` | Per-introspector future timeout (seconds); timed-out introspectors return `{ error: "timed out after Ns" }` without blocking the others |
@@ -836,7 +852,7 @@ Bug reports and pull requests: [github.com/igmarin/rails-ai-bridge/issues](https
836
852
 
837
853
  ## Acknowledgments & Origins
838
854
 
839
- This gem ships as **rails-ai-bridge** (Ruby **`RailsAiBridge`**, version **4.2.0**). Earlier iterations of the same codebase were distributed as `rails-ai-context`.
855
+ This gem ships as **rails-ai-bridge** (Ruby **`RailsAiBridge`**, version **4.3.0**). Earlier iterations of the same codebase were distributed as `rails-ai-context`.
840
856
 
841
857
  RailsMCP evolved from
842
858
  [crisnahine/rails-ai-context](https://github.com/crisnahine/rails-ai-context),
data/SECURITY.md CHANGED
@@ -29,6 +29,7 @@ please report it responsibly:
29
29
 
30
30
  - All MCP tools are **read-only** and never modify your application or database.
31
31
  - Code search (`rails_search_code`) uses `Open3.capture2` with array arguments to prevent shell injection.
32
+ - Symbol explanation (`rails_explain_symbol`) uses `Open3.capture3` with array arguments against a local `.codegraph/` index only (timeout enforced; never contacts a network service).
32
33
  - File paths are validated against path traversal attacks, and invalid regex input
33
34
  now returns a controlled tool response in the Ruby fallback path.
34
35
  - Search is limited to an **allowlisted set of file extensions** by default;
@@ -47,6 +48,11 @@ please report it responsibly:
47
48
 
48
49
  ## HTTP MCP authentication
49
50
 
51
+ HTTP MCP is unauthenticated unless you set a token (`http_mcp_token` /
52
+ `RAILS_AI_BRIDGE_MCP_TOKEN`, or a resolver/JWT decoder) or
53
+ `require_http_auth`. Bind the endpoint to `127.0.0.1` unless you add auth.
54
+ `require_http_auth` stays **`false`** by default.
55
+
50
56
  For day-to-day hardening (tokens, `require_http_auth`, proxies, stdio threat model),
51
57
  see **[docs/mcp-security.md](docs/mcp-security.md)**.
52
58
 
data/docs/GUIDE.md CHANGED
@@ -1,7 +1,6 @@
1
- # rails-ai-bridge — Complete Guide
1
+ # rails-ai-bridge guide
2
2
 
3
- > Full documentation for [rails-ai-bridge](https://github.com/igmarin/rails-ai-bridge).
4
- > For a quick overview, see the [README](../README.md).
3
+ Commands, tools, config, and setup. For the short path, use the [README](../README.md).
5
4
 
6
5
  ---
7
6
 
@@ -279,7 +278,7 @@ end
279
278
 
280
279
  ## MCP Tools — Full Reference
281
280
 
282
- All **11 built-in tools** are **read-only** and **idempotent** — they never modify your application or database. Hosts can append more via `config.additional_tools`.
281
+ All **19 built-in tools** are **read-only** and **idempotent** — they never modify your application or database. Hosts can append more via `config.additional_tools`.
283
282
 
284
283
  ### rails_get_schema
285
284
 
@@ -381,7 +380,7 @@ rails_get_routes(detail: "standard", limit: 20, offset: 100)
381
380
 
382
381
  ### rails_get_controllers
383
382
 
384
- Returns controller details: actions, filters, strong params, concerns.
383
+ Returns controller details: actions, inherited filters, strong params, concerns.
385
384
 
386
385
  **Parameters:**
387
386
 
@@ -400,7 +399,7 @@ rails_get_controllers(detail: "summary")
400
399
  → Controller names with action counts
401
400
 
402
401
  rails_get_controllers(controller: "UsersController")
403
- → Full detail: parent class, actions, filters (with only/except), strong params
402
+ → Full detail: parent class, actions, inherited filters (with only/except and source class), strong params
404
403
 
405
404
  rails_get_controllers(detail: "full")
406
405
  → All controllers with actions, filters, and strong params
@@ -505,6 +504,19 @@ rails_search_semantic(query: "Service", max_results: 30)
505
504
 
506
505
  **Notable:** Results include ancestors, descendants, and inline definitions when available, making this a richer alternative to `rails_search_code` for understanding code structure and relationships.
507
506
 
507
+ ### rails_explain_symbol
508
+
509
+ Explains a Ruby/Rails symbol from a **local** CodeGraph index (`.codegraph/` under `Rails.root`). Runs `codegraph explore` in-process with a timeout. Never contacts a network service.
510
+
511
+ **Parameters:**
512
+
513
+ | Param | Type | Description |
514
+ |-------|------|-------------|
515
+ | `query` | string | Symbol or natural-language question (e.g. `User`, `User#save`). Preferred when both are sent. |
516
+ | `symbol` | string | Alias for `query`. |
517
+
518
+ If `.codegraph/` is missing or `codegraph` fails, the tool returns setup instructions (`codegraph init` / `codegraph index`) instead of raising.
519
+
508
520
  ### Rubydex configuration reference
509
521
 
510
522
  | Option | Type | Default | Description |
@@ -744,6 +756,12 @@ RailsAiBridge.configure do |config|
744
756
  # Cache TTL for introspection results (seconds)
745
757
  config.cache_ttl = 30
746
758
 
759
+ # Fingerprint / section snapshot TTL (seconds). Default is 5 — raise for HTTP MCP.
760
+ # config.snapshot_ttl = 30
761
+
762
+ # Cap PathResolver glob/file listings (sorted, then taken). Default 2000.
763
+ # config.max_files_per_path = 2000
764
+
747
765
  # --- Exclusions ---
748
766
 
749
767
  # Models to skip during introspection
@@ -787,6 +805,13 @@ RailsAiBridge.configure do |config|
787
805
  end
788
806
  ```
789
807
 
808
+ Introspection listings and caches stay bounded by default: `cache_ttl` is **30s**
809
+ for cached introspection results, `snapshot_ttl` is **5s** for the fingerprint /
810
+ section snapshot (do not raise the default globally — set `config.snapshot_ttl = 30`
811
+ on a long-lived HTTP MCP process if consecutive tool calls should skip filesystem
812
+ walks), `max_files_per_path` is **2000** (`PathResolver#glob_for` / `#files_for`
813
+ sort then take), and `parallel_introspection` is **off**.
814
+
790
815
  ### Options reference
791
816
 
792
817
  | Option | Type | Default | Description |
@@ -797,6 +822,8 @@ end
797
822
  | `claude_max_lines` | Integer | `150` | Max lines for CLAUDE.md in compact mode |
798
823
  | `max_tool_response_chars` | Integer | `120_000` | Safety cap for MCP tool responses |
799
824
  | `cache_ttl` | Integer | `30` | Cache TTL in seconds for introspection results |
825
+ | `snapshot_ttl` | Integer | `5` | Fingerprint / section snapshot TTL in seconds; raise for HTTP MCP, keep 5s for CLI |
826
+ | `max_files_per_path` | Integer | `2000` | Max paths returned by `PathResolver#glob_for` / `#files_for` (sorted, then taken) |
800
827
  | `excluded_models` | Array | internal Rails models | Models to skip |
801
828
  | `core_models` | Array | `[]` | Model names tagged as `core_entity` in introspection output and `.claude/rules/rails-context.md`. Used by `RailsAiBridge::ModelSemanticClassifier` to mark primary domain models. |
802
829
  | `introspectors` | Array | 9 core symbols | Which introspectors to run. Add `:non_ar_models` to include non-ActiveRecord classes under `app/models`. |
@@ -837,7 +864,7 @@ These run by default. Fast and cover core Rails structure.
837
864
  | `jobs` | ActiveJob classes with queue names. Mailers with action methods. Action Cable channels. |
838
865
  | `gems` | 70+ notable gems categorized: auth, background_jobs, admin, monitoring, search, pagination, forms, file_upload, testing, linting, security, api, frontend, utilities. |
839
866
  | `conventions` | Architecture patterns (MVC, service objects, STI, polymorphism, etc.), directory structure with file counts, config files, detected patterns. |
840
- | `controllers` | Actions, filters (before/after/around with only/except), strong params methods, parent class, API controller detection, concerns. Source-derived metadata honors the configured logical `app/controllers` path. |
867
+ | `controllers` | Actions, inherited filters (before/after/around with only/except and defining class), strong params methods, parent class, API controller detection, concerns. Source-derived metadata honors the configured logical `app/controllers` path. |
841
868
  | `tests` | Test framework (rspec/minitest), factories/fixtures with locations and counts, system tests, CI config files, coverage tool, test helpers, VCR cassettes. |
842
869
  | `migrations` | Total count, schema version, pending migrations, recent migration history with detected actions (create_table, add_column, etc.), migration statistics. |
843
870
 
data/docs/devin-setup.md CHANGED
@@ -94,6 +94,7 @@ Once connected, Devin has access to these tools:
94
94
  | `rails_get_gems` | Gemfile dependencies and their versions |
95
95
  | `rails_search_code` | Full-text search across the codebase |
96
96
  | `rails_search_semantic` | Semantic code search by concept |
97
+ | `rails_explain_symbol` | Local CodeGraph explanation for a symbol or query |
97
98
  | `rails_get_conventions` | Project coding conventions and patterns |
98
99
  | `rails_get_controllers` | Controller actions and before-actions |
99
100
  | `rails_get_config` | Application configuration values |
@@ -1,7 +1,16 @@
1
1
  # Gem General Improvements — Roadmap
2
2
 
3
+ > **Status:** Done in **4.1**. Historical only — not an open backlog.
4
+ >
5
+ > Shipped in [4.1.0](../CHANGELOG.md#410---2026-08-11): manifest validation (#123),
6
+ > pack lockfile (later path defaults in 4.2 #155), rake JSON (#128), full SHA-256 cache
7
+ > keys (#122), transitive `depends_on` (#126), JWT MCP auth docs (#129), structured
8
+ > registry git logging (#131). Treat this file as an archive of that planning, not as
9
+ > work remaining for 4.3.
10
+
3
11
  Collected opportunities for improving the `rails-ai-bridge` gem beyond the issues already
4
- addressed in the current session. Ordered roughly by impact vs effort.
12
+ addressed in the current session. Ordered roughly by impact vs effort. All items below
13
+ shipped in 4.1 (or were completed as follow-ups called out in the banner).
5
14
 
6
15
  ---
7
16
 
@@ -42,6 +51,7 @@ if packs do not pin a `ref`. There is no equivalent of `Gemfile.lock` for skill
42
51
  "ruby-core-skills": { "sha": "def456...", "resolved_at": "2025-06-01T10:00:00Z" }
43
52
  }
44
53
  ```
54
+
45
55
  - When the lock file is present, `SkillSourceResolver#resolve` uses the locked SHA as the
46
56
  `ref` argument, bypassing any branch-tip divergence.
47
57
  - A `rails rails_ai:registry:update` task regenerates the lock (analogous to `bundle update`).
@@ -71,6 +81,7 @@ a different, richer format. The two diverge over time.
71
81
  "skills": [{ "name": "...", "pack": "...", "description": "..." }]
72
82
  }
73
83
  ```
84
+
74
85
  - `RakePresenter` gains a `skills_json` and `packs_json` method alongside the existing
75
86
  `skills_table` / `resolve_skill_output`.
76
87
 
data/docs/offline-mode.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Offline Mode — Design Plan
2
2
 
3
+ > **Status:** Proposed for **5.0 / registry**. Not current work.
4
+ > Skill-pack cache and vendoring only. 4.3 stays read-only and does not add an HTTP client.
5
+ > The gem still makes no outbound network requests except git clone/pull for configured skill packs
6
+ > (see [SECURITY.md](../SECURITY.md)).
7
+
3
8
  ## Problem
4
9
 
5
10
  The registry resolver currently requires network access on every fresh start to clone or pull
@@ -154,6 +154,10 @@ module RailsAiBridge
154
154
  # Never applies to .ai-context.json. Per-run override: `MERGE=1 rails ai:bridge`.
155
155
  # config.output.managed_region = true
156
156
 
157
+ # Shared verify-before-write rules in compact CLAUDE.md / AGENTS.md / GEMINI.md /
158
+ # Copilot / Cursor output. Default is on; set false to omit the block.
159
+ # config.output.anti_hallucination_rules = false
160
+
157
161
  # Model list size caps for compact output (0 = show no names, only MCP pointer):
158
162
  # Reduce these for apps with large model counts to keep files within size limits.
159
163
  # config.copilot_compact_model_list_limit = 15 # default