coatepec 0.6.0 → 0.8.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.
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Coatepec
4
+ module TestUnit
5
+ # Makes `file:LINE` selectors work regardless of the target app's Rails/
6
+ # Minitest pairing. Rails installs its own Rails::LineFiltering only via
7
+ # Rails::TestUnitRailtie, which an app generated with --skip-test never
8
+ # loads; and Rails 7.1's version overrides `run`, a method Minitest 6 no
9
+ # longer calls (it dispatches through `run_suite` and reads
10
+ # options[:include], not options[:filter]). So the child always extends
11
+ # ActiveSupport::TestCase with the one method the *running* Minitest
12
+ # actually calls, composing Rails::TestUnit::Runner's recorded line
13
+ # filters through Rails' public compose_filter. Stacking on top of
14
+ # Rails' own module is idempotent: CompositeFilter#derive_named_filter
15
+ # unwraps an existing composite via #named_filter.
16
+ #
17
+ # Exactly one method per module, never both: on Minitest 6 a class-level
18
+ # `run` override intercepts an unrelated 3-argument call and raises.
19
+ module LineFiltering
20
+ MT6 = Module.new do
21
+ def run_suite(reporter, options = {})
22
+ options = options.merge(include: ::Rails::TestUnit::Runner.compose_filter(self, options[:include]))
23
+ super(reporter, options)
24
+ end
25
+ end
26
+
27
+ MT5 = Module.new do
28
+ def run(reporter, options = {})
29
+ options = options.merge(filter: ::Rails::TestUnit::Runner.compose_filter(self, options[:filter]))
30
+ super(reporter, options)
31
+ end
32
+ end
33
+
34
+ def self.module_for(minitest_version)
35
+ minitest_version.start_with?("6") ? MT6 : MT5
36
+ end
37
+
38
+ # Ruby ignores a second `extend` of a module already in the singleton
39
+ # ancestors, so calling this more than once per process is harmless.
40
+ def self.install!
41
+ require "rails/test_unit/runner"
42
+ ::ActiveSupport::TestCase.extend(module_for(::Minitest::VERSION))
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coatepec
4
- VERSION = "0.6.0"
4
+ VERSION = "0.8.0"
5
5
  end
@@ -45,6 +45,7 @@ module Coatepec
45
45
  when "flaky_check" then handle_flaky_check(args)
46
46
  when "routes" then handle_routes(args)
47
47
  when "model" then handle_model(args)
48
+ when "controller" then handle_controller(args)
48
49
  else
49
50
  raise Coatepec::Error.new(:internal_error, "Unknown command #{command}")
50
51
  end
@@ -63,7 +64,12 @@ module Coatepec
63
64
  end
64
65
 
65
66
  def handle_model(args)
66
- Introspection::Model.new(args.transform_keys(&:to_sym)[:name]).call
67
+ a = args.transform_keys(&:to_sym)
68
+ Introspection::Model.new(a[:name], fields: a[:fields]).call
69
+ end
70
+
71
+ def handle_controller(args)
72
+ Introspection::Controller.new(args.transform_keys(&:to_sym)[:name]).call
67
73
  end
68
74
  end
69
75
  end
@@ -20,10 +20,12 @@ module Coatepec
20
20
  dispatch("status", {}, timeout: 30)
21
21
  end
22
22
 
23
- def run_spec(paths:, example:, seed:, fail_fast:, timeout_seconds:)
23
+ def run_spec(paths:, example:, seed:, fail_fast:, timeout_seconds:, include_passing: false,
24
+ include_stdout: "failures")
24
25
  dispatch(
25
26
  "spec_run",
26
- { paths: paths, example: example, seed: seed, fail_fast: fail_fast, timeout_seconds: timeout_seconds },
27
+ { paths: paths, example: example, seed: seed, fail_fast: fail_fast, timeout_seconds: timeout_seconds,
28
+ include_passing: include_passing, include_stdout: include_stdout },
27
29
  timeout: timeout_seconds + 10
28
30
  )
29
31
  end
@@ -40,12 +42,16 @@ module Coatepec
40
42
  )
41
43
  end
42
44
 
43
- def routes(query: nil, limit: 50, offset: 0)
44
- dispatch("routes", { query: query, limit: limit, offset: offset }, timeout: 30)
45
+ def routes(query: nil, limit: 100, offset: 0, engines: Introspection::Routes::DEFAULT_ENGINES)
46
+ dispatch("routes", { query: query, limit: limit, offset: offset, engines: engines }, timeout: 30)
45
47
  end
46
48
 
47
- def model(name:)
48
- dispatch("model", { name: name }, timeout: 30)
49
+ def model(name:, fields: nil)
50
+ dispatch("model", { name: name, fields: fields }, timeout: 30)
51
+ end
52
+
53
+ def controller(name:)
54
+ dispatch("controller", { name: name }, timeout: 30)
49
55
  end
50
56
 
51
57
  def stop
data/lib/coatepec.rb CHANGED
@@ -11,8 +11,14 @@ require_relative "coatepec/worker/client"
11
11
  require_relative "coatepec/worker/rails_runtime"
12
12
  require_relative "coatepec/introspection/routes"
13
13
  require_relative "coatepec/introspection/safe_options"
14
+ require_relative "coatepec/introspection/bounded_options"
15
+ require_relative "coatepec/introspection/model_resolver"
14
16
  require_relative "coatepec/introspection/model"
17
+ require_relative "coatepec/introspection/controller"
18
+ require_relative "coatepec/spec/failure_collapser"
15
19
  require_relative "coatepec/spec/result"
20
+ require_relative "coatepec/spec/rspec_adapter"
21
+ require_relative "coatepec/test_unit/adapter"
16
22
  require_relative "coatepec/spec/process_strategy"
17
23
  require_relative "coatepec/spec/fork_strategy"
18
24
  require_relative "coatepec/spec/spawn_strategy"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coatepec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Enrique Mogollan
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-08-20 00:00:00.000000000 Z
10
+ date: 2026-09-14 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: railties
@@ -44,8 +44,9 @@ dependencies:
44
44
  - !ruby/object:Gem::Version
45
45
  version: '1.0'
46
46
  description: Coatepec is a local stdio MCP sidecar that keeps an isolated Rails test
47
- worker warm so coding agents can run targeted RSpec examples quickly, without exposing
48
- a general Rails console.
47
+ worker warm so coding agents can run targeted RSpec examples quickly, check specs
48
+ for flakiness, and read routes, models, and controllers through structured read-only
49
+ Rails APIs -- without exposing a general Rails console.
49
50
  email:
50
51
  - emogollan@gmail.com
51
52
  executables:
@@ -59,13 +60,18 @@ files:
59
60
  - CHANGELOG.md
60
61
  - LICENSE.txt
61
62
  - README.md
63
+ - ROADMAP.md
62
64
  - Rakefile
63
65
  - exe/coatepec
64
66
  - exe/coatepec-worker
65
67
  - lib/coatepec.rb
66
68
  - lib/coatepec/cli.rb
67
69
  - lib/coatepec/errors.rb
70
+ - lib/coatepec/introspection/bounded_options.rb
71
+ - lib/coatepec/introspection/controller.rb
68
72
  - lib/coatepec/introspection/model.rb
73
+ - lib/coatepec/introspection/model_resolver.rb
74
+ - lib/coatepec/introspection/route_entries.rb
69
75
  - lib/coatepec/introspection/routes.rb
70
76
  - lib/coatepec/introspection/safe_options.rb
71
77
  - lib/coatepec/mcp.rb
@@ -74,14 +80,20 @@ files:
74
80
  - lib/coatepec/project.rb
75
81
  - lib/coatepec/project_config.rb
76
82
  - lib/coatepec/protocol.rb
83
+ - lib/coatepec/spec/failure_collapser.rb
77
84
  - lib/coatepec/spec/flaky_checker.rb
78
85
  - lib/coatepec/spec/fork_strategy.rb
79
86
  - lib/coatepec/spec/guarded_fork_strategy.rb
80
87
  - lib/coatepec/spec/path_policy.rb
81
88
  - lib/coatepec/spec/process_strategy.rb
82
89
  - lib/coatepec/spec/result.rb
90
+ - lib/coatepec/spec/rspec_adapter.rb
83
91
  - lib/coatepec/spec/runner.rb
84
92
  - lib/coatepec/spec/spawn_strategy.rb
93
+ - lib/coatepec/test_unit/adapter.rb
94
+ - lib/coatepec/test_unit/child_entry.rb
95
+ - lib/coatepec/test_unit/json_reporter.rb
96
+ - lib/coatepec/test_unit/line_filtering.rb
85
97
  - lib/coatepec/version.rb
86
98
  - lib/coatepec/worker/change_detector.rb
87
99
  - lib/coatepec/worker/client.rb
@@ -113,5 +125,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
125
  requirements: []
114
126
  rubygems_version: 3.6.6
115
127
  specification_version: 4
116
- summary: Run targeted RSpec examples against a warm Rails test worker over MCP
128
+ summary: Run targeted RSpec examples and introspect Rails structure over MCP, without
129
+ a Rails console
117
130
  test_files: []