rails-ai-context 5.35.2 → 5.36.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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +177 -1
  3. data/CONTRIBUTING.md +1 -0
  4. data/docs/COMPATIBILITY.md +10 -1
  5. data/docs/SECURITY.md +11 -9
  6. data/docs/TOOLS.md +11 -10
  7. data/docs/TROUBLESHOOTING.md +1 -1
  8. data/lib/rails_ai_context/database_family/mysql_runtime.rb +17 -2
  9. data/lib/rails_ai_context/database_family/postgresql_plan.rb +6 -2
  10. data/lib/rails_ai_context/database_family/postgresql_runtime.rb +41 -6
  11. data/lib/rails_ai_context/database_family/sqlite_runtime.rb +9 -3
  12. data/lib/rails_ai_context/database_family.rb +27 -5
  13. data/lib/rails_ai_context/introspector.rb +12 -0
  14. data/lib/rails_ai_context/introspectors/eager_load.rb +12 -2
  15. data/lib/rails_ai_context/introspectors/job_introspector.rb +54 -14
  16. data/lib/rails_ai_context/introspectors/model_introspector.rb +13 -11
  17. data/lib/rails_ai_context/introspectors/schema_introspector.rb +12 -1
  18. data/lib/rails_ai_context/payload.rb +2 -3
  19. data/lib/rails_ai_context/secret_columns.rb +59 -37
  20. data/lib/rails_ai_context/sql_gate.rb +115 -24
  21. data/lib/rails_ai_context/tools/get_conventions.rb +10 -5
  22. data/lib/rails_ai_context/tools/get_schema.rb +35 -11
  23. data/lib/rails_ai_context/tools/query.rb +12 -2
  24. data/lib/rails_ai_context/tools/runtime_info.rb +15 -10
  25. data/lib/rails_ai_context/version.rb +1 -1
  26. metadata +1 -23
  27. data/.rspec +0 -3
  28. data/.rubocop.yml +0 -16
  29. data/.ruby-version +0 -1
  30. data/AGENTS.md +0 -15
  31. data/CLAUDE.md +0 -3
  32. data/CODE_OF_CONDUCT.md +0 -44
  33. data/CONTEXT.md +0 -242
  34. data/Rakefile +0 -80
  35. data/docs/RELEASING.md +0 -72
  36. data/docs/_config.yml +0 -15
  37. data/docs/_includes/head-custom.html +0 -16
  38. data/docs/adr/0001-own-listener-registration.md +0 -9
  39. data/docs/adr/0002-static-tier-declared-not-detected.md +0 -5
  40. data/docs/adr/0003-shared-tool-cache-semantics.md +0 -31
  41. data/docs/adr/0004-install-e2e-stays-example-rich.md +0 -28
  42. data/docs/adr/0008-query-runs-only-where-it-can-guard.md +0 -38
  43. data/docs/adr/0009-dbhub-shapes-in-ruby.md +0 -26
  44. data/docs/adr/0010-one-config-tool-with-sections.md +0 -32
  45. data/docs/agents/domain.md +0 -38
  46. data/docs/agents/issue-tracker.md +0 -45
  47. data/docs/agents/triage-labels.md +0 -15
  48. data/server.json +0 -21
@@ -1,32 +0,0 @@
1
- # One config tool with sections
2
-
3
- Status: accepted
4
-
5
- Eleven tools each read one payload section and take no target: `rails_get_config`, `_autoload`, `_engines`, `_active_support`, `_conventions`, `_gems`, `_frontend_stack`, `_api`, `_env`, `_env_config` and `_i18n`. Every one costs a full definition in `tools/list` on every turn: together about 8,800 characters, or a fifth of what all 45 cost before this decision. A client reads that list whether or not the app's configuration is asked about.
6
-
7
- ## Decision
8
-
9
- - `rails_get_config` takes a `section`: `app` (the default, and what the tool answered before: database, auth, assets, cache, queue, Action Cable, initializers, middleware), `gems`, `frontend`, `api`, `engines`, `conventions`, `autoload`, `active_support`, `env`, `env_config` and `i18n`. The other ten tools leave `tools/list`.
10
- - The old names keep working wherever a name is typed:
11
- - the CLI resolves `gems`, `rails_get_gems`, `frontend_stack` and the rest to their section;
12
- - the MCP server answers a call to a retired name from its section and says which call to make instead, with the arguments that section reads.
13
- - `skip_tools` naming one of the ten retired tools turns its section off, and `rails_get_config` turns off the `app` section. A skip that hid the process environment keeps hiding it after an upgrade, and a skip that hid the overview still hides only the overview. The tool leaves `tools/list` only when every section is off.
14
- - With `app` off there is no default, so `section` is required: the published schema and the description say so, and a call with none is answered with the sections that are on.
15
- - A custom tool named `rails_get_config` takes the built-in's place when `skip_tools` lists that name, as a custom tool takes any skipped built-in's. The ten sections go with the built-in, and a retired name is then an unknown tool.
16
- - A custom tool that reuses a retired name is served as its own tool. The gem's own hints still mean the built-in section.
17
- - Each section's parameters ride on the one tool (`detail`, `category`, `offset`, `limit`, `environment`, `locale`). A parameter the asked section does not read is named in the answer as ignored.
18
- - The ten classes stay in the gem as the sections' renderers. Ruby that calls `RailsAiContext::Tools::GetGems.call` keeps working; only the MCP surface changes.
19
-
20
- ## Consequences
21
-
22
- The change ships in 5.35.1, with migration notes. That number was the maintainer's choice, made outside the rule in `docs/RELEASING.md` step 1, which rules out a patch number for a release with an Added entry or a Changed entry a consumer can observe. What makes it tenable is that every retired name still answers on the CLI and over MCP, with a line naming the new call, so a prompt or a script that names one keeps working.
23
-
24
- The removal shows wherever tool names are listed or reported. `tools/list` and `tool --list` hold 35 names. The CLI's `--json` output reports `rails_get_config` for a retired name. `Tools::BaseTool.registered_tools` no longer lists the ten classes. The session context records a section call under the new name.
25
-
26
- The section names are public interface from here on, like the tool names before them: renaming one keeps the old name as an alias.
27
-
28
- ## Alternatives not taken
29
-
30
- - **Keeping the ten tools beside the new section argument**: the definitions are the cost being removed.
31
- - **A new tool name such as `rails_get_stack`**: `rails_get_config` already answered the default section, so its callers see no change.
32
- - **Splitting into two tools (stack and configuration)**: two definitions where one carries the same sections, and a line between the two that every reader would have to learn.
@@ -1,38 +0,0 @@
1
- # Domain Docs
2
-
3
- How the engineering skills should consume this repo's domain documentation when exploring the codebase.
4
-
5
- This repo is **single-context**: one `CONTEXT.md` and one `docs/adr/` at the root.
6
-
7
- ## Before exploring, read these
8
-
9
- - **`CONTEXT.md`** at the repo root: the glossary and domain overview.
10
- - **`docs/adr/`**: read ADRs that touch the area you're about to work in.
11
-
12
- If any of these files don't exist, **proceed silently**. Don't flag their absence; don't suggest creating them upfront. The `/domain-modeling` skill (reached via `/grill-with-docs` and `/improve-codebase-architecture`) creates them lazily when terms or decisions actually get resolved.
13
-
14
- ## File structure
15
-
16
- ```text
17
- /
18
- ├── CONTEXT.md
19
- ├── docs/adr/
20
- │ ├── 0001-example-decision.md
21
- │ └── 0002-another-decision.md
22
- ├── lib/
23
- └── spec/
24
- ```
25
-
26
- If this repo ever splits into multiple bounded contexts, add a root `CONTEXT-MAP.md` pointing at one `CONTEXT.md` per context, and update this file.
27
-
28
- ## Use the glossary's vocabulary
29
-
30
- When your output names a domain concept (in an issue title, a refactor proposal, a hypothesis, a test name), use the term as defined in `CONTEXT.md`. Don't drift to synonyms the glossary explicitly avoids.
31
-
32
- If the concept you need isn't in the glossary yet, that's a signal: either you're inventing language the project doesn't use (reconsider) or there's a real gap (note it for `/domain-modeling`).
33
-
34
- ## Flag ADR conflicts
35
-
36
- If your output contradicts an existing ADR, surface it explicitly rather than silently overriding:
37
-
38
- > _Contradicts ADR-0007 (event-sourced orders), but worth reopening because..._
@@ -1,45 +0,0 @@
1
- # Issue tracker: GitHub
2
-
3
- Issues and specs for this repo live as GitHub issues. Use the `gh` CLI for all operations.
4
-
5
- ## Conventions
6
-
7
- - **Create an issue**: `gh issue create --title "..." --body "..."`. Use a heredoc for multi-line bodies.
8
- - **Read an issue**: `gh issue view <number> --comments`, filtering comments by `jq` and also fetching labels.
9
- - **List issues**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'` with appropriate `--label` and `--state` filters.
10
- - **Comment on an issue**: `gh issue comment <number> --body "..."`
11
- - **Apply / remove labels**: `gh issue edit <number> --add-label "..."` / `--remove-label "..."`
12
- - **Close**: `gh issue close <number> --comment "..."`
13
-
14
- Infer the repo from `git remote -v` — `gh` does this automatically when run inside a clone.
15
-
16
- ## Pull requests as a triage surface
17
-
18
- **PRs as a request surface: no.** _(Set to `yes` if this repo treats external PRs as feature requests; `/triage` reads this flag.)_
19
-
20
- When set to `yes`, PRs run through the same labels and states as issues, using the `gh pr` equivalents:
21
-
22
- - **Read a PR**: `gh pr view <number> --comments` and `gh pr diff <number>` for the diff.
23
- - **List external PRs for triage**: `gh pr list --state open --json number,title,body,labels,author,authorAssociation,comments` then keep only `authorAssociation` of `CONTRIBUTOR`, `FIRST_TIME_CONTRIBUTOR`, or `NONE` (drop `OWNER`/`MEMBER`/`COLLABORATOR`).
24
- - **Comment / label / close**: `gh pr comment`, `gh pr edit --add-label`/`--remove-label`, `gh pr close`.
25
-
26
- GitHub shares one number space across issues and PRs, so a bare `#42` may be either — resolve with `gh pr view 42` and fall back to `gh issue view 42`.
27
-
28
- ## When a skill says "publish to the issue tracker"
29
-
30
- Create a GitHub issue.
31
-
32
- ## When a skill says "fetch the relevant ticket"
33
-
34
- Run `gh issue view <number> --comments`.
35
-
36
- ## Wayfinding operations
37
-
38
- Used by `/wayfinder`. The **map** is a single issue with **child** issues as tickets.
39
-
40
- - **Map**: a single issue labelled `wayfinder:map`, holding the Notes / Decisions-so-far / Fog body. `gh issue create --label wayfinder:map`.
41
- - **Child ticket**: an issue linked to the map as a GitHub sub-issue (`gh api` on the sub-issues endpoint). Where sub-issues aren't enabled, add the child to a task list in the map body and put `Part of #<map>` at the top of the child body. Labels: `wayfinder:<type>` (`research`/`prototype`/`grilling`/`task`). Once claimed, the ticket is assigned to the driving dev.
42
- - **Blocking**: GitHub's **native issue dependencies** — the canonical, UI-visible representation. Add an edge with `gh api --method POST repos/<owner>/<repo>/issues/<child>/dependencies/blocked_by -F issue_id=<blocker-db-id>`, where `<blocker-db-id>` is the blocker's numeric **database id** (`gh api repos/<owner>/<repo>/issues/<n> --jq .id`, _not_ the `#number` or `node_id`). GitHub reports `issue_dependencies_summary.blocked_by` (open blockers only — the live gate). Where dependencies aren't available, fall back to a `Blocked by: #<n>, #<n>` line at the top of the child body. A ticket is unblocked when every blocker is closed.
43
- - **Frontier query**: list the map's open children (`gh issue list --state open`, scoped to the map's sub-issues / task list), drop any with an open blocker (`issue_dependencies_summary.blocked_by > 0`, or an open issue in the `Blocked by` line) or an assignee; first in map order wins.
44
- - **Claim**: `gh issue edit <n> --add-assignee @me` — the session's first write.
45
- - **Resolve**: `gh issue comment <n> --body "<answer>"`, then `gh issue close <n>`, then append a context pointer (gist + link) to the map's Decisions-so-far.
@@ -1,15 +0,0 @@
1
- # Triage Labels
2
-
3
- The skills speak in terms of five canonical triage roles. This file maps those roles to the actual label strings used in this repo's issue tracker.
4
-
5
- | Label in mattpocock/skills | Label in our tracker | Meaning |
6
- | -------------------------- | -------------------- | ---------------------------------------- |
7
- | `needs-triage` | `needs-triage` | Maintainer needs to evaluate this issue |
8
- | `needs-info` | `needs-info` | Waiting on reporter for more information |
9
- | `ready-for-agent` | `ready-for-agent` | Fully specified, ready for an AFK agent |
10
- | `ready-for-human` | `ready-for-human` | Requires human implementation |
11
- | `wontfix` | `wontfix` | Will not be actioned |
12
-
13
- When a skill mentions a role (e.g. "apply the AFK-ready triage label"), use the corresponding label string from this table.
14
-
15
- Edit the right-hand column to match whatever vocabulary you actually use.
data/server.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
- "name": "io.github.crisnahine/rails-ai-context",
4
- "title": "Rails AI Context",
5
- "description": "35 MCP tools give AI agents live Rails schema, routes, models, and conventions.",
6
- "repository": {
7
- "url": "https://github.com/crisnahine/rails-ai-context",
8
- "source": "github"
9
- },
10
- "version": "5.35.2",
11
- "packages": [
12
- {
13
- "registryType": "mcpb",
14
- "identifier": "https://github.com/crisnahine/rails-ai-context/releases/download/vX.Y.Z/rails-ai-context-mcp.mcpb",
15
- "fileSha256": "PLACEHOLDER-computed-from-the-mcpb-at-release-time",
16
- "transport": {
17
- "type": "stdio"
18
- }
19
- }
20
- ]
21
- }