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: 840dab1aeabc3323d5aca5702d95e712f7a013f24d05327424674262eee46de9
4
- data.tar.gz: 2eed45a1bc5e79b9806f691c9e88ca2ced55660d53b74f56d8f354963c9ee497
3
+ metadata.gz: a00a0de19ee6f632122b0258c6bc879fdc534bbd037904305fed174d941fa067
4
+ data.tar.gz: e0863f0111e4fccd2a12a26f3b73305e8647d63bda7ba095f1823ea2aedf6641
5
5
  SHA512:
6
- metadata.gz: ac390f1d5b6b148f33fdac979d98269695fed76bceaaaab6b18c0682819a271a8dfdbaaab00f6c35eaaa2a867f652bc46c8d3d88199c5cd3bd1a87e20a0b3320
7
- data.tar.gz: 0eb688c270bf08ddb5b70fc3dfbcca19432de3c6922c8a0f784081d82c117458fc3e136a56a962ee3988a9263a1ae9d9eff48716e4321e57bbc92d533622b249
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] || []).first(3).map { |a| "#{a[:type]} :#{a[:name]}" }.join(", ")
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] || []).first(3).map { |a| "#{a[:type]} :#{a[:name]}" }.join(", ")
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 (#{controllers.size})",
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
- controllers.keys.sort.first(25).each do |name|
116
- info = controllers[name]
117
- actions = (info[:actions] || []).map { |a| a.is_a?(Hash) ? a[:name] : a }.compact.first(6)
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 << "- _...#{controllers.size - 25} more_" if controllers.size > 25
127
+ lines << "- _...#{app_controllers.size - 25} more_" if app_controllers.size > 25
124
128
 
125
129
  # List service objects
126
130
  begin
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAiContext
4
- VERSION = "0.15.0"
4
+ VERSION = "0.15.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-ai-context
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.15.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - crisnahine