rails-ai-context 0.15.0 → 0.15.1
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.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a00a0de19ee6f632122b0258c6bc879fdc534bbd037904305fed174d941fa067
|
|
4
|
+
data.tar.gz: e0863f0111e4fccd2a12a26f3b73305e8647d63bda7ba095f1823ea2aedf6641
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2187c702565f4e6342bdf3d363b010d36e7ccc1f570d093a2b1521b5ceda764c2dbe441544c4228d6dc532f71a50f7adf188012809fe8fd20e21b582f7a7a441
|
|
7
|
+
data.tar.gz: fd9a8f33981d17923300ee7eb06a2b02f48047c305597e144689fe304bda0d4dcb4d534d9165200359ca6df82fc8f114fb21f5b0823e0b5cfb7d30073fb0822a
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ 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
|
+
## [0.15.1] - 2026-03-22
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Copilot serializer** — Show all model associations (not capped at 3), use human-readable architecture/pattern labels.
|
|
13
|
+
- **OpenCode rules serializer** — Filter framework controllers (Devise) from AGENTS.md output, show all associations, match `before_action` with `!`/`?` suffixes.
|
|
14
|
+
|
|
8
15
|
## [0.15.0] - 2026-03-22
|
|
9
16
|
|
|
10
17
|
### Security
|
|
@@ -58,7 +58,7 @@ module RailsAiContext
|
|
|
58
58
|
lines << "## Models (#{models.size})"
|
|
59
59
|
models.keys.sort.first(25).each do |name|
|
|
60
60
|
data = models[name]
|
|
61
|
-
assocs = (data[:associations] || []).
|
|
61
|
+
assocs = (data[:associations] || []).map { |a| "#{a[:type]} :#{a[:name]}" }.join(", ")
|
|
62
62
|
line = "- **#{name}**"
|
|
63
63
|
line += " — #{assocs}" unless assocs.empty?
|
|
64
64
|
lines << line
|
|
@@ -73,9 +73,11 @@ module RailsAiContext
|
|
|
73
73
|
arch = conv[:architecture] || []
|
|
74
74
|
patterns = conv[:patterns] || []
|
|
75
75
|
if arch.any? || patterns.any?
|
|
76
|
+
arch_labels = RailsAiContext::Tools::GetConventions::ARCH_LABELS rescue {}
|
|
77
|
+
pattern_labels = RailsAiContext::Tools::GetConventions::PATTERN_LABELS rescue {}
|
|
76
78
|
lines << "## Architecture"
|
|
77
|
-
arch.each { |p| lines << "- #{p}" }
|
|
78
|
-
patterns.first(10).each { |p| lines << "- #{p}" }
|
|
79
|
+
arch.each { |p| lines << "- #{arch_labels[p] || p}" }
|
|
80
|
+
patterns.first(10).each { |p| lines << "- #{pattern_labels[p] || p}" }
|
|
79
81
|
lines << ""
|
|
80
82
|
end
|
|
81
83
|
end
|
|
@@ -61,7 +61,7 @@ module RailsAiContext
|
|
|
61
61
|
|
|
62
62
|
models.keys.sort.first(30).each do |name|
|
|
63
63
|
data = models[name]
|
|
64
|
-
assocs = (data[:associations] || []).
|
|
64
|
+
assocs = (data[:associations] || []).map { |a| "#{a[:type]} :#{a[:name]}" }.join(", ")
|
|
65
65
|
vals = (data[:validations] || []).size
|
|
66
66
|
line = "- **#{name}**"
|
|
67
67
|
line += " (table: #{data[:table_name]})" if data[:table_name]
|
|
@@ -93,8 +93,12 @@ module RailsAiContext
|
|
|
93
93
|
controllers = data[:controllers] || {}
|
|
94
94
|
return nil if controllers.empty?
|
|
95
95
|
|
|
96
|
+
# Filter out framework-internal controllers
|
|
97
|
+
framework = %w[DeviseController Devise::OmniauthCallbacksController]
|
|
98
|
+
app_controllers = controllers.reject { |name, _| framework.include?(name) }
|
|
99
|
+
|
|
96
100
|
lines = [
|
|
97
|
-
"# Controllers (#{
|
|
101
|
+
"# Controllers (#{app_controllers.size})",
|
|
98
102
|
"",
|
|
99
103
|
"> Auto-generated by rails-ai-context. Do not edit manually.",
|
|
100
104
|
"> Read controller files directly when editing. Use MCP tools for reference only.",
|
|
@@ -107,20 +111,20 @@ module RailsAiContext
|
|
|
107
111
|
app_ctrl = File.join(root, "app", "controllers", "application_controller.rb")
|
|
108
112
|
if File.exist?(app_ctrl)
|
|
109
113
|
source = File.read(app_ctrl)
|
|
110
|
-
before_actions = source.scan(/before_action\s+:(\w+)/).flatten
|
|
114
|
+
before_actions = source.scan(/before_action\s+:([\w!?]+)/).flatten
|
|
111
115
|
lines << "**Global before_actions:** #{before_actions.join(', ')}" << "" if before_actions.any?
|
|
112
116
|
end
|
|
113
117
|
rescue; end
|
|
114
118
|
|
|
115
|
-
|
|
116
|
-
info =
|
|
117
|
-
actions = (info[:actions] || []).map { |a| a.is_a?(Hash) ? a[:name] : a }.compact
|
|
119
|
+
app_controllers.keys.sort.first(25).each do |name|
|
|
120
|
+
info = app_controllers[name]
|
|
121
|
+
actions = (info[:actions] || []).map { |a| a.is_a?(Hash) ? a[:name] : a }.compact
|
|
118
122
|
line = "- **#{name}**"
|
|
119
123
|
line += " — #{actions.join(", ")}" unless actions.empty?
|
|
120
124
|
lines << line
|
|
121
125
|
end
|
|
122
126
|
|
|
123
|
-
lines << "- _...#{
|
|
127
|
+
lines << "- _...#{app_controllers.size - 25} more_" if app_controllers.size > 25
|
|
124
128
|
|
|
125
129
|
# List service objects
|
|
126
130
|
begin
|