assistant 0.0.2 → 1.0.0.rc1

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 (92) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +13 -0
  3. data/.github/PULL_REQUEST_TEMPLATE.md +39 -0
  4. data/.github/dependabot.yml +4 -0
  5. data/.github/workflows/ci.yml +140 -0
  6. data/.github/workflows/docs.yml +64 -0
  7. data/.github/workflows/release.yml +46 -0
  8. data/.gitignore +5 -1
  9. data/.markdownlint.json +6 -0
  10. data/.opencode/.gitignore +4 -0
  11. data/.opencode/opencode.json +13 -0
  12. data/.opencode/skills/create-pr/SKILL.md +138 -0
  13. data/.opencode/skills/ruby-services/SKILL.md +81 -0
  14. data/.rubocop.yml +40 -148
  15. data/.ruby-version +1 -1
  16. data/.yardopts +17 -0
  17. data/CHANGELOG.md +434 -0
  18. data/CONTRIBUTING.md +131 -0
  19. data/Gemfile +10 -0
  20. data/Gemfile.lock +264 -94
  21. data/README.md +125 -16
  22. data/Rakefile +53 -3
  23. data/SECURITY.md +50 -0
  24. data/Steepfile +49 -0
  25. data/_config.yml +87 -0
  26. data/assistant.gemspec +33 -20
  27. data/docs/api-reference.md +264 -0
  28. data/docs/changelog.md +26 -0
  29. data/docs/deprecations.md +86 -0
  30. data/docs/examples/cli-handler.md +17 -0
  31. data/docs/examples/composing-services.md +17 -0
  32. data/docs/examples/execute-callbacks.md +17 -0
  33. data/docs/examples/index.md +29 -0
  34. data/docs/examples/instrumentation-notifier.md +17 -0
  35. data/docs/examples/rails-service.md +17 -0
  36. data/docs/examples/rbs-generator.md +17 -0
  37. data/docs/examples/sidekiq-worker.md +17 -0
  38. data/docs/getting-started.md +136 -0
  39. data/docs/guides/composing-services.md +222 -0
  40. data/docs/guides/index.md +25 -0
  41. data/docs/guides/inputs.md +333 -0
  42. data/docs/guides/logging-and-results.md +202 -0
  43. data/docs/guides/rbs-and-types.md +16 -0
  44. data/docs/guides/validation.md +180 -0
  45. data/docs/index.md +69 -0
  46. data/docs/roadmap.md +33 -0
  47. data/exe/assistant-rbs +7 -0
  48. data/lib/assistant/execute_callbacks.rb +103 -0
  49. data/lib/assistant/execute_callbacks.rbs +30 -0
  50. data/lib/assistant/input_builder/accessors.rb +36 -0
  51. data/lib/assistant/input_builder/accessors.rbs +10 -0
  52. data/lib/assistant/input_builder/default_option.rb +41 -0
  53. data/lib/assistant/input_builder/default_option.rbs +11 -0
  54. data/lib/assistant/input_builder/dsl.rb +37 -0
  55. data/lib/assistant/input_builder/dsl.rbs +12 -0
  56. data/lib/assistant/input_builder/optional_option.rb +45 -0
  57. data/lib/assistant/input_builder/optional_option.rbs +10 -0
  58. data/lib/assistant/input_builder/registry.rb +27 -0
  59. data/lib/assistant/input_builder/registry.rbs +13 -0
  60. data/lib/assistant/input_builder/require_validator.rb +104 -0
  61. data/lib/assistant/input_builder/require_validator.rbs +24 -0
  62. data/lib/assistant/input_builder/type_validator.rb +47 -0
  63. data/lib/assistant/input_builder/type_validator.rbs +18 -0
  64. data/lib/assistant/input_builder.rb +28 -0
  65. data/lib/assistant/input_builder.rbs +15 -0
  66. data/lib/assistant/log_item.rb +75 -17
  67. data/lib/assistant/log_item.rbs +40 -0
  68. data/lib/assistant/log_list.rb +44 -12
  69. data/lib/assistant/log_list.rbs +48 -0
  70. data/lib/assistant/rbs_generator/cli.rb +109 -0
  71. data/lib/assistant/rbs_generator/cli.rbs +24 -0
  72. data/lib/assistant/rbs_generator/renderer.rb +67 -0
  73. data/lib/assistant/rbs_generator/renderer.rbs +11 -0
  74. data/lib/assistant/rbs_generator/writer.rb +65 -0
  75. data/lib/assistant/rbs_generator/writer.rbs +24 -0
  76. data/lib/assistant/rbs_generator.rb +38 -0
  77. data/lib/assistant/rbs_generator.rbs +5 -0
  78. data/lib/assistant/refinements/string_blankness.rb +14 -0
  79. data/lib/assistant/refinements/string_blankness.rbs +6 -0
  80. data/lib/assistant/service.rb +328 -8
  81. data/lib/assistant/service.rbs +86 -0
  82. data/lib/assistant/version.rb +5 -1
  83. data/lib/assistant/version.rbs +5 -0
  84. data/lib/assistant.rb +53 -4
  85. data/lib/assistant.rbs +25 -0
  86. data/mise.toml +6 -0
  87. data/sig/examples/greeter.rbs +14 -0
  88. metadata +128 -112
  89. data/.circleci/config.yml +0 -45
  90. data/.fasterer.yml +0 -19
  91. data/.rspec +0 -3
  92. data/.rubocop_todo.yml +0 -0
data/.rubocop.yml CHANGED
@@ -1,49 +1,36 @@
1
- # This is the configuration used to check the rubocop source code.
2
-
3
- inherit_from: .rubocop_todo.yml
4
- require:
5
- - rubocop/cop/internal_affairs
1
+ plugins:
6
2
  - rubocop-performance
7
- - rubocop-rspec
3
+ - rubocop-minitest
8
4
  - rubocop-rake
5
+ - rubocop-style-compact_nesting
9
6
 
10
7
  AllCops:
11
8
  NewCops: enable
9
+ TargetRubyVersion: 3.4
10
+ SuggestExtensions: false
12
11
  Exclude:
13
12
  - 'vendor/**/*'
14
- - 'spec/fixtures/**/*'
15
13
  - 'tmp/**/*'
16
14
  - '.git/**/*'
17
15
  - 'bin/*'
18
- TargetRubyVersion: 2.7
19
- SuggestExtensions: false
16
+ - 'Gemfile.lock'
20
17
 
21
18
  Gemspec/DevelopmentDependencies:
22
- EnforcedStyle: gemspec
19
+ EnforcedStyle: gemspec
20
+
21
+ Gemspec/DependencyVersion:
22
+ Enabled: true
23
23
 
24
- Naming/PredicateName:
25
- # Method define macros for dynamically generated method.
24
+ Naming/PredicatePrefix:
26
25
  MethodDefinitionMacros:
27
26
  - define_method
28
27
  - define_singleton_method
29
- - def_node_matcher
30
- - def_node_search
31
28
 
32
- Style/AccessorGrouping:
29
+ # Tests use simple `def execute = true` to fabricate services; the boolean
30
+ # return doesn't make these predicate methods.
31
+ Naming/PredicateMethod:
33
32
  Exclude:
34
- - lib/rubocop/formatter/base_formatter.rb
35
- - lib/rubocop/cop/offense.rb
36
-
37
- Style/FormatStringToken:
38
- # Because we parse a lot of source codes from strings. Percent arrays
39
- # look like unannotated format string tokens to this cop.
40
- Exclude:
41
- - spec/**/*
42
-
43
- Style/IpAddresses:
44
- # The test for this cop includes strings that would cause offenses
45
- Exclude:
46
- - spec/rubocop/cop/style/ip_addresses_spec.rb
33
+ - 'test/**/*.rb'
47
34
 
48
35
  Layout/EndOfLine:
49
36
  EnforcedStyle: lf
@@ -54,13 +41,6 @@ Layout/ClassStructure:
54
41
  Layout/RedundantLineBreak:
55
42
  Enabled: true
56
43
 
57
- Layout/TrailingWhitespace:
58
- AllowInHeredoc: false
59
-
60
- Lint/AmbiguousBlockAssociation:
61
- Exclude:
62
- - 'spec/**/*.rb'
63
-
64
44
  Layout/HashAlignment:
65
45
  EnforcedHashRocketStyle:
66
46
  - key
@@ -71,133 +51,45 @@ Layout/HashAlignment:
71
51
 
72
52
  Layout/LineLength:
73
53
  Max: 120
74
- AllowedPatterns:
75
- - !ruby/regexp /\A +(it|describe|context|shared_examples|include_examples|it_behaves_like) ["']/
76
54
 
77
- Lint/InterpolationCheck:
78
- Exclude:
79
- - 'spec/**/*.rb'
80
-
81
- Lint/UselessAccessModifier:
82
- MethodCreatingMethods:
83
- - 'def_matcher'
84
- - 'def_node_matcher'
55
+ Style/RequireOrder:
56
+ Enabled: true
85
57
 
86
- Lint/EmptyFile:
87
- Exclude:
88
- # This file is intentionally empty to catch rubocop cops failing on empty files.
89
- - spec/rubocop/intentionally_empty_file.rb
58
+ # Project convention: hybrid compact nesting enforced by
59
+ # rubocop-style-compact_nesting's Style/CompactModuleNesting. Namespace
60
+ # chains collapse to a single `module A::B::C` line; when the innermost
61
+ # definition is a class, it's nested separately inside the compact wrapper.
62
+ # That plugin disables Style/ClassAndModuleChildren by default.
90
63
 
64
+ # Test files use anonymous Class.new(...) blocks and dynamic define_method,
65
+ # which inflates length/metrics counts that don't reflect real complexity.
91
66
  Metrics/BlockLength:
92
67
  Exclude:
93
68
  - 'Rakefile'
94
69
  - '**/*.rake'
95
- - 'spec/**/*.rb'
70
+ - 'test/**/*.rb'
96
71
  - '**/*.gemspec'
97
72
 
98
73
  Metrics/ClassLength:
99
74
  Exclude:
100
- - lib/rubocop/config_obsoletion.rb
101
- - lib/rubocop/options.rb
102
-
103
- Metrics/ModuleLength:
104
- Exclude:
105
- - 'spec/**/*.rb'
106
-
107
- Naming/InclusiveLanguage:
108
- Enabled: true
109
- CheckStrings: true
110
- FlaggedTerms:
111
- ' a offense':
112
- Suggestions:
113
- - an offense
114
- auto-correct:
115
- Suggestions:
116
- - autocorrect
117
- auto_correct:
118
- Suggestions:
119
- - autocorrect
120
- behaviour:
121
- Suggestions:
122
- - behavior
123
- offence:
124
- Suggestions:
125
- - offense
126
- 'does not registers':
127
- Suggestions:
128
- - does not register
129
- Exclude:
130
- - lib/rubocop/cop/naming/inclusive_language.rb
131
- - lib/rubocop/cop/mixin/auto_corrector.rb
132
- - spec/rubocop/cop/naming/inclusive_language_spec.rb
133
-
134
- RSpec:
135
- Language:
136
- Expectations:
137
- - expect_autocorrect_options_for_autocorrect
138
- - expect_autocorrect_options_for_autocorrect_all
139
- - expect_autocorrect_options_for_fix_layout
140
- - expect_correction
141
- - expect_feature_loader
142
- - expect_no_offenses
143
- - expect_offense
144
-
145
- RSpec/FilePath:
146
- Exclude:
147
- - spec/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new_spec.rb
148
- - spec/rubocop/formatter/junit_formatter_spec.rb
149
-
150
- RSpec/PredicateMatcher:
151
- EnforcedStyle: explicit
152
-
153
- RSpec/MessageSpies:
154
- EnforcedStyle: receive
155
-
156
- RSpec/NestedGroups:
157
- Max: 7
75
+ - 'test/**/*.rb'
158
76
 
159
- RSpec/MultipleMemoizedHelpers:
160
- Enabled: false
161
-
162
- Performance/CollectionLiteralInLoop:
77
+ Metrics/MethodLength:
163
78
  Exclude:
164
- - 'Rakefile'
165
- - 'spec/**/*.rb'
166
-
167
- Performance/EndWith:
168
- SafeMultiline: false
169
-
170
- Performance/StartWith:
171
- SafeMultiline: false
172
-
173
- RSpec/StubbedMock:
174
- Enabled: false
79
+ - 'test/**/*.rb'
175
80
 
176
- InternalAffairs/ExampleDescription:
177
- Include:
178
- - 'spec/rubocop/cop/**/*.rb'
179
-
180
- InternalAffairs/ExampleHeredocDelimiter:
181
- Include:
182
- - 'spec/rubocop/cop/**/*.rb'
183
-
184
- InternalAffairs/UndefinedConfig:
185
- Include:
186
- - 'lib/rubocop/cop/**/*.rb'
187
- Exclude:
188
- - 'lib/rubocop/cop/correctors/**/*.rb'
189
- - 'lib/rubocop/cop/mixin/**/*.rb'
190
-
191
- InternalAffairs/StyleDetectedApiUse:
192
- Exclude:
193
- - 'lib/rubocop/cop/mixin/percent_array.rb'
194
-
195
- InternalAffairs/NumblockHandler:
81
+ # Test files use anonymous Class.new blocks with multiple assertions
82
+ # that inflate ABC counts beyond the cop's heuristic without reflecting
83
+ # real branching complexity.
84
+ Metrics/AbcSize:
196
85
  Exclude:
197
- - 'lib/rubocop/cop/internal_affairs/*.rb'
86
+ - 'test/**/*.rb'
198
87
 
199
- Gemspec/DependencyVersion:
200
- Enabled: true
88
+ Naming/MethodParameterName:
89
+ AllowedNames:
90
+ - a
91
+ - b
92
+ - c
201
93
 
202
- Style/RequireOrder:
203
- Enabled: true
94
+ Minitest/MultipleAssertions:
95
+ Max: 8
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.6
1
+ 3.4.1
data/.yardopts ADDED
@@ -0,0 +1,17 @@
1
+ --output-dir doc
2
+ --markup markdown
3
+ --readme README.md
4
+ --no-private
5
+ --protected
6
+ lib/**/*.rb
7
+ -
8
+ docs/getting-started.md
9
+ docs/api-reference.md
10
+ docs/guides/inputs.md
11
+ docs/guides/validation.md
12
+ docs/guides/logging-and-results.md
13
+ docs/guides/composing-services.md
14
+ CHANGELOG.md
15
+ CONTRIBUTING.md
16
+ SECURITY.md
17
+ CODE_OF_CONDUCT.md