nukadoko 0.1.0 → 0.3.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 (159) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +417 -0
  3. data/README.ja.md +62 -7
  4. data/README.md +19 -5
  5. data/exe/nuka +8 -0
  6. data/lib/nukadoko/aria_snapshot.rb +1008 -0
  7. data/lib/nukadoko/aria_tree.rb +150 -0
  8. data/lib/nukadoko/base.rb +294 -0
  9. data/lib/nukadoko/check.rb +669 -22
  10. data/lib/nukadoko/claim_check.rb +177 -0
  11. data/lib/nukadoko/claim_check_run.rb +293 -0
  12. data/lib/nukadoko/claim_line.rb +381 -0
  13. data/lib/nukadoko/claim_rules.rb +519 -0
  14. data/lib/nukadoko/claim_sides.rb +469 -0
  15. data/lib/nukadoko/claims.rb +576 -37
  16. data/lib/nukadoko/cli.rb +814 -22
  17. data/lib/nukadoko/codes.json +947 -0
  18. data/lib/nukadoko/codes.rb +19 -0
  19. data/lib/nukadoko/command.rb +214 -12
  20. data/lib/nukadoko/criteria.rb +172 -0
  21. data/lib/nukadoko/definition.rb +33 -41
  22. data/lib/nukadoko/env_check.rb +88 -0
  23. data/lib/nukadoko/features.rb +80 -10
  24. data/lib/nukadoko/fixtures.rb +329 -11
  25. data/lib/nukadoko/http_recording.rb +68 -0
  26. data/lib/nukadoko/init.rb +129 -0
  27. data/lib/nukadoko/js_json.rb +274 -0
  28. data/lib/nukadoko/js_pattern.rb +531 -0
  29. data/lib/nukadoko/judge.rb +221 -0
  30. data/lib/nukadoko/judgment_file.rb +78 -0
  31. data/lib/nukadoko/judgments.rb +256 -0
  32. data/lib/nukadoko/literal.rb +129 -0
  33. data/lib/nukadoko/measured.rb +105 -0
  34. data/lib/nukadoko/order.rb +84 -0
  35. data/lib/nukadoko/parts.rb +43 -22
  36. data/lib/nukadoko/pattern.rb +73 -3
  37. data/lib/nukadoko/poll.rb +21 -8
  38. data/lib/nukadoko/program.rb +105 -17
  39. data/lib/nukadoko/project_files.rb +17 -0
  40. data/lib/nukadoko/project_fixtures.rb +17 -2
  41. data/lib/nukadoko/project_program.rb +119 -0
  42. data/lib/nukadoko/report_allure.rb +751 -0
  43. data/lib/nukadoko/report_messages.rb +167 -0
  44. data/lib/nukadoko/report_run.rb +169 -0
  45. data/lib/nukadoko/run.rb +898 -91
  46. data/lib/nukadoko/run_record.rb +535 -0
  47. data/lib/nukadoko/scaffold.rb +1015 -0
  48. data/lib/nukadoko/schema.rb +120 -21
  49. data/lib/nukadoko/secrets.rb +375 -0
  50. data/lib/nukadoko/selection.rb +163 -0
  51. data/lib/nukadoko/signature.rb +4 -1
  52. data/lib/nukadoko/skill.rb +36 -0
  53. data/lib/nukadoko/spaces.rb +28 -0
  54. data/lib/nukadoko/step.rb +68 -21
  55. data/lib/nukadoko/summary.rb +662 -0
  56. data/lib/nukadoko/table.rb +34 -2
  57. data/lib/nukadoko/text_fit.rb +179 -0
  58. data/lib/nukadoko/trace.rb +244 -0
  59. data/lib/nukadoko/trace_actions.rb +116 -0
  60. data/lib/nukadoko/tree_passes.rb +122 -0
  61. data/lib/nukadoko/verdict.rb +128 -0
  62. data/lib/nukadoko/version.rb +2 -1
  63. data/lib/nukadoko/vocabulary.rb +6 -0
  64. data/lib/nukadoko/walk.rb +305 -0
  65. data/lib/nukadoko/walk_files.rb +473 -0
  66. data/lib/nukadoko/walk_step.rb +149 -0
  67. data/lib/nukadoko.rb +60 -2
  68. data/llms.txt +297 -0
  69. data/sig/generated/nukadoko/aria_snapshot.rbs +331 -0
  70. data/sig/generated/nukadoko/aria_tree.rbs +142 -0
  71. data/sig/generated/nukadoko/base.rbs +142 -0
  72. data/sig/generated/nukadoko/check.rbs +255 -0
  73. data/sig/generated/nukadoko/claim_check.rbs +118 -0
  74. data/sig/generated/nukadoko/claim_check_run.rbs +88 -0
  75. data/sig/generated/nukadoko/claim_line.rbs +158 -0
  76. data/sig/generated/nukadoko/claim_rules.rbs +172 -0
  77. data/sig/generated/nukadoko/claim_sides.rbs +207 -0
  78. data/sig/generated/nukadoko/claims.rbs +208 -0
  79. data/sig/generated/nukadoko/cli.rbs +182 -0
  80. data/sig/generated/nukadoko/codes.rbs +16 -0
  81. data/sig/generated/nukadoko/command.rbs +109 -0
  82. data/sig/generated/nukadoko/criteria.rbs +83 -0
  83. data/sig/generated/nukadoko/definition.rbs +30 -0
  84. data/sig/generated/nukadoko/env_check.rbs +34 -0
  85. data/sig/generated/nukadoko/features.rbs +101 -0
  86. data/sig/generated/nukadoko/fixtures.rbs +175 -0
  87. data/sig/generated/nukadoko/http_recording.rbs +29 -0
  88. data/sig/generated/nukadoko/init.rbs +64 -0
  89. data/sig/generated/nukadoko/js_json.rbs +109 -0
  90. data/sig/generated/nukadoko/js_pattern.rbs +194 -0
  91. data/sig/generated/nukadoko/judge.rbs +64 -0
  92. data/sig/generated/nukadoko/judgment_file.rbs +39 -0
  93. data/sig/generated/nukadoko/judgments.rbs +120 -0
  94. data/sig/generated/nukadoko/literal.rbs +71 -0
  95. data/sig/generated/nukadoko/measured.rbs +42 -0
  96. data/sig/generated/nukadoko/order.rbs +54 -0
  97. data/sig/generated/nukadoko/parts.rbs +35 -0
  98. data/sig/generated/nukadoko/pattern.rbs +62 -0
  99. data/sig/generated/nukadoko/poll.rbs +41 -0
  100. data/sig/generated/nukadoko/program.rbs +101 -0
  101. data/sig/generated/nukadoko/project_files.rbs +19 -0
  102. data/sig/generated/nukadoko/project_fixtures.rbs +57 -0
  103. data/sig/generated/nukadoko/project_program.rbs +55 -0
  104. data/sig/generated/nukadoko/report_allure.rbs +268 -0
  105. data/sig/generated/nukadoko/report_messages.rbs +68 -0
  106. data/sig/generated/nukadoko/report_run.rbs +102 -0
  107. data/sig/generated/nukadoko/run.rbs +264 -0
  108. data/sig/generated/nukadoko/run_record.rbs +175 -0
  109. data/sig/generated/nukadoko/scaffold.rbs +328 -0
  110. data/sig/generated/nukadoko/schema.rbs +155 -0
  111. data/sig/generated/nukadoko/secrets.rbs +172 -0
  112. data/sig/generated/nukadoko/selection.rbs +73 -0
  113. data/sig/generated/nukadoko/signature.rbs +17 -0
  114. data/sig/generated/nukadoko/skill.rbs +20 -0
  115. data/sig/generated/nukadoko/spaces.rbs +31 -0
  116. data/sig/generated/nukadoko/step.rbs +115 -0
  117. data/sig/generated/nukadoko/summary.rbs +204 -0
  118. data/sig/generated/nukadoko/table.rbs +43 -0
  119. data/sig/generated/nukadoko/text_fit.rbs +70 -0
  120. data/sig/generated/nukadoko/trace.rbs +127 -0
  121. data/sig/generated/nukadoko/trace_actions.rbs +40 -0
  122. data/sig/generated/nukadoko/tree_passes.rbs +48 -0
  123. data/sig/generated/nukadoko/verdict.rbs +56 -0
  124. data/sig/generated/nukadoko/version.rbs +5 -0
  125. data/sig/generated/nukadoko/vocabulary.rbs +25 -0
  126. data/sig/generated/nukadoko/walk.rbs +139 -0
  127. data/sig/generated/nukadoko/walk_files.rbs +189 -0
  128. data/sig/generated/nukadoko/walk_step.rbs +50 -0
  129. data/sig/generated/nukadoko.rbs +26 -0
  130. data/sig/nukadoko.rbs +5 -48
  131. data/skills/nukadoko/SKILL.md +120 -0
  132. data/skills/nukadoko/references/checking-steps.md +200 -0
  133. data/skills/nukadoko/references/diagnosing.md +200 -0
  134. data/skills/nukadoko/references/done.md +99 -0
  135. data/skills/nukadoko/references/evidence.md +124 -0
  136. data/skills/nukadoko/references/examples/cli.md +230 -0
  137. data/skills/nukadoko/references/examples/http-api.md +342 -0
  138. data/skills/nukadoko/references/examples/workflow.md +173 -0
  139. data/skills/nukadoko/references/exploring.md +184 -0
  140. data/skills/nukadoko/references/fixtures.md +198 -0
  141. data/skills/nukadoko/references/from-prose.md +51 -0
  142. data/skills/nukadoko/references/judgments.md +95 -0
  143. data/skills/nukadoko/references/maintenance.md +97 -0
  144. data/skills/nukadoko/references/merge-risk.md +74 -0
  145. data/skills/nukadoko/references/parts.md +152 -0
  146. data/skills/nukadoko/references/perturbed-worlds.md +109 -0
  147. data/skills/nukadoko/references/program.md +200 -0
  148. data/skills/nukadoko/references/reviewing.md +200 -0
  149. data/skills/nukadoko/references/running.md +200 -0
  150. data/skills/nukadoko/references/scenario-rules.md +188 -0
  151. data/skills/nukadoko/references/states.md +66 -0
  152. data/skills/nukadoko/references/step-files.md +200 -0
  153. data/skills/nukadoko/references/verdicts.md +200 -0
  154. data/skills/nukadoko/references/writing-steps.md +200 -0
  155. data/skills/nukadoko/references/writing-the-feature.md +165 -0
  156. data/skills/nukadoko/scripts/claude-code-verdict-hook.mjs +99 -0
  157. data/skills/nukadoko/scripts/merge-risk.jq +56 -0
  158. data/skills/nukadoko-verification/SKILL.md +263 -0
  159. metadata +133 -1
@@ -0,0 +1,255 @@
1
+ # Generated from lib/nukadoko/check.rb with RBS::Inline
2
+
3
+ # What `check` can say without running anything: every finding follows from
4
+ # the step classes, their patterns and schemas, `Method#parameters`, and the
5
+ # feature files. The codes are the TypeScript engine's codes, so one set of
6
+ # conformance cases judges both engines.
7
+ module Nukadoko
8
+ module Engine
9
+ class Finding < Data
10
+ attr_reader severity(): String
11
+
12
+ attr_reader code(): String
13
+
14
+ attr_reader file(): String?
15
+
16
+ attr_reader line(): Integer?
17
+
18
+ attr_reader step(): String?
19
+
20
+ attr_reader message(): String
21
+
22
+ attr_reader fix(): String?
23
+
24
+ attr_reader run(): String?
25
+
26
+ def self.new: (String severity, String code, String? file, Integer? line, String? step, String message, String? fix, String? run) -> instance
27
+ | (severity: String, code: String, file: String?, line: Integer?, step: String?, message: String, fix: String?, run: String?) -> instance
28
+
29
+ def self.members: () -> [ :severity, :code, :file, :line, :step, :message, :fix, :run ]
30
+
31
+ def members: () -> [ :severity, :code, :file, :line, :step, :message, :fix, :run ]
32
+ end
33
+
34
+ # A Data block's methods are its own, but rbs-inline reads only a class
35
+ # body, so they are written in one.
36
+ class Finding
37
+ # : (String, String, singleton(Step), String, String?) -> Finding
38
+ def self.about_step: (String, String, singleton(Step), String, String?) -> Finding
39
+
40
+ # : () -> Hash[Symbol, untyped]
41
+ def to_h: () -> Hash[Symbol, untyped]
42
+ end
43
+
44
+ FIXTURES: untyped
45
+
46
+ class Check
47
+ attr_reader findings: Array[Finding]
48
+
49
+ attr_reader usable: Array[singleton(Step)]
50
+
51
+ # `environments` is the selection a run without --env starts, for
52
+ # condition-unmet; nil when --env named the selection. `problems` are
53
+ # what the feature loader found that runs nothing.
54
+ # `config` holds what was found in the config and its program before
55
+ # any step loaded, such as an env file that is missing.
56
+ # : (Array[singleton(Step)], Array[Scenario], ?features: bool, ?full: bool, ?conditions: Array[String]?, ?environments: Array[Environment]?, ?problems: Array[FeatureProblem], ?config: Array[Finding]) -> void
57
+ def initialize: (Array[singleton(Step)], Array[Scenario], ?features: bool, ?full: bool, ?conditions: Array[String]?, ?environments: Array[Environment]?, ?problems: Array[FeatureProblem], ?config: Array[Finding]) -> void
58
+
59
+ # : () -> bool
60
+ def passed?: () -> bool
61
+
62
+ private
63
+
64
+ # A step whose definition cannot stand (an unknown claim compare) is left
65
+ # out of the vocabulary, as the TypeScript engine leaves out a step file
66
+ # that fails to import, so it can never match a line.
67
+ # : (singleton(Step)) -> bool
68
+ def definition_broken?: (singleton(Step)) -> bool
69
+
70
+ KEY: ::Regexp
71
+
72
+ # Why the step's pattern cannot be read, as the TypeScript engine says
73
+ # it: the first broken capture, then what cucumber-expressions refuses.
74
+ # : (singleton(Step)) -> [String, String]?
75
+ def pattern_problem: (singleton(Step)) -> [ String, String ]?
76
+
77
+ NUMBER_TYPES: untyped
78
+
79
+ STRING_TYPES: untyped
80
+
81
+ # A capture hands the step a number or a string, and an args field of
82
+ # the other kind can never hold it.
83
+ # : (singleton(Step)) -> Array[Array[untyped]]
84
+ def capture_mismatches: (singleton(Step)) -> Array[Array[untyped]]
85
+
86
+ # : (singleton(Step)) -> void
87
+ def check_contract: (singleton(Step)) -> void
88
+
89
+ # Two patterns that read the same once their names go would match the
90
+ # same lines; the later file is named, with every step that shares it.
91
+ # : () -> void
92
+ def check_duplicate_patterns: () -> void
93
+
94
+ # A pattern no line binds alone has no place in a scenario; a placeholder
95
+ # description is what a person picking a step would read.
96
+ # : () -> void
97
+ def check_unbound: () -> void
98
+
99
+ # A from key every line fills with a capture never takes its value
100
+ # from the producer it names.
101
+ # : () -> void
102
+ def check_from_unused: () -> void
103
+
104
+ # A from key whose producer has not run before the line fails args
105
+ # validation with certainty, and two producers that both ran leave
106
+ # the feature file unable to say which one counts. A line before it
107
+ # that matches no step may be the producer misspelled, so those
108
+ # findings wait behind one warning.
109
+ # : (Scenario) -> void
110
+ def check_from_order: (Scenario) -> void
111
+
112
+ # What a claim step's claims read, from the producers of its from
113
+ # values on the earlier lines of the scenario (ClaimCheck).
114
+ # : (Scenario) -> void
115
+ def check_claim_sources: (Scenario) -> void
116
+
117
+ # : (String, String, Array[String], Array[untyped]) -> String
118
+ def from_missing_message: (String, String, Array[String], Array[untyped]) -> String
119
+
120
+ # : (Hash[Symbol, untyped]) -> String
121
+ def from_order_fix: (Hash[Symbol, untyped]) -> String
122
+
123
+ # : (Scenario, Array[Hash[Symbol, untyped]]) -> void
124
+ def hold_from_order: (Scenario, Array[Hash[Symbol, untyped]]) -> void
125
+
126
+ SCENARIO_ONLY: untyped
127
+
128
+ # Fixture definitions that can never resolve, and (in a whole-project
129
+ # check) one no step reaches.
130
+ # : (bool) -> void
131
+ def check_fixtures: (bool) -> void
132
+
133
+ # A scenario whose condition tags no environment of the selection meets
134
+ # has no required cell, so nothing in the run shows that it holds.
135
+ # : (Array[Environment]) -> void
136
+ def check_conditions_met: (Array[Environment]) -> void
137
+
138
+ # : (Hash[String, untyped]) -> String
139
+ def describe_conditions: (Hash[String, untyped]) -> String
140
+
141
+ CONDITION_NAME: ::Regexp
142
+
143
+ CONDITION_VALUE: ::Regexp
144
+
145
+ # The condition a tag names, nil for one that does not read.
146
+ # : (String) -> String?
147
+ def self.condition_of: (String) -> String?
148
+
149
+ EXPECTED: untyped
150
+
151
+ EXPECTS_FORMS: ::String
152
+
153
+ # Why an @expects: tag accepts nothing, nil for one that reads.
154
+ # : (String) -> String?
155
+ def self.expects_problem: (String) -> String?
156
+
157
+ # : (Array[String]?) -> void
158
+ def check_tags: (Array[String]?) -> void
159
+
160
+ # A cycle never closes into a fixture bag, and a read-only step cannot
161
+ # reach a part that writes: both can only end one way, so both are errors.
162
+ # : () -> void
163
+ def check_parts: () -> void
164
+
165
+ # Each cycle once, named from the step whose walk first closed it.
166
+ # : () -> Array[Array[singleton(Step)]]
167
+ def part_cycles: () -> Array[Array[singleton(Step)]]
168
+
169
+ # A scenario with steps of its own and no Then can never be judged on
170
+ # an outcome. The Background's steps count toward the Then.
171
+ # : () -> void
172
+ def check_shapes: () -> void
173
+
174
+ # : () -> void
175
+ def check_lines: () -> void
176
+
177
+ # A scenario whose Then lines each bind one step, none of them a claim
178
+ # step, passes whenever its steps run.
179
+ # : (Scenario) -> void
180
+ def judging_nothing: (Scenario) -> void
181
+
182
+ # The steps with a pattern that no line binds alone. A step whose file
183
+ # failed to load is out of the vocabulary, so it is not unbound either.
184
+ # : () -> Array[singleton(Step)]
185
+ def unbound_steps: () -> Array[singleton(Step)]
186
+
187
+ # A renamed sentence or pattern leaves one line undefined and one step
188
+ # unbound at once, so an undefined line names the unbound steps, at
189
+ # most three, beside the scaffold command that would write a duplicate.
190
+ # : () -> String
191
+ def unbound_suffix: () -> String
192
+
193
+ # While a step definition is broken, a line it would have matched looks
194
+ # undefined. Saying so would send the reader after the wrong fix, so the
195
+ # judgment waits for the broken definition, with one warning.
196
+ # : (Array[untyped]) -> void
197
+ def suppress_undefined: (Array[untyped]) -> void
198
+
199
+ KEYWORD: untyped
200
+
201
+ # Only a Then judges, so a claim step elsewhere and a step that runs in
202
+ # Then position are both mistakes.
203
+ # : (Scenario, PickleStep, singleton(Step)) -> void
204
+ def check_position: (Scenario, PickleStep, singleton(Step)) -> void
205
+
206
+ # A page between two renders can show any state for one frame, so a
207
+ # claim step whose observe reaches a page, directly or through a
208
+ # project fixture, has to say whether it reads once or until its
209
+ # claims hold. Reported once for each step.
210
+ # : (singleton(Step)) -> void
211
+ def check_poll: (singleton(Step)) -> void
212
+
213
+ # : (Array[Symbol]) -> bool
214
+ def reaches_browser?: (Array[Symbol]) -> bool
215
+
216
+ # The key a table or docstring fills is what the line states; a claim
217
+ # step that neither compares a claim with it nor observes checks
218
+ # nothing the line said.
219
+ # : (untyped, untyped, singleton(Step), String) -> void
220
+ def check_unread: (untyped, untyped, singleton(Step), String) -> void
221
+
222
+ # The args keys a step's claims read: the head of each actual path, a
223
+ # sentence key named as an expected value, and the head of a from
224
+ # expected path, in every claim and in each each's where and claims.
225
+ # : (Array[Hash[Symbol, untyped]]) -> Array[String]
226
+ def claim_keys_read: (Array[Hash[Symbol, untyped]]) -> Array[String]
227
+
228
+ # The table or docstring fills the one required key no capture and no
229
+ # from speaks for, so zero or two such keys, or a key of a type the
230
+ # attachment can never be, fail binding with certainty.
231
+ # : (Scenario, PickleStep, singleton(Step), Hash[String, untyped]) -> void
232
+ def check_fill: (Scenario, PickleStep, singleton(Step), Hash[String, untyped]) -> void
233
+
234
+ # An is-a claim whose expected sentence key this line fills, through a
235
+ # capture, with a name that is no kind breaks on this line for certain.
236
+ # Only a plain string key read as it is or as text counts, so the value
237
+ # the claim reads is the captured text.
238
+ # : (Scenario, PickleStep, singleton(Step), Hash[String, untyped]) -> void
239
+ def check_kinds: (Scenario, PickleStep, singleton(Step), Hash[String, untyped]) -> void
240
+
241
+ # A fits-aria-snapshot claim whose expected sentence key this line
242
+ # fills, through a capture or the docstring, with a tree the run breaks
243
+ # the claim on whatever the page shows: one that does not read, or one
244
+ # that names no node.
245
+ # : (Scenario, PickleStep, singleton(Step), Hash[String, untyped]) -> void
246
+ def check_unfit_trees: (Scenario, PickleStep, singleton(Step), Hash[String, untyped]) -> void
247
+
248
+ # : (singleton(Step), String, PickleStep) -> String?
249
+ def attachment_mismatch: (singleton(Step), String, PickleStep) -> String?
250
+ end
251
+
252
+ # : (Array[singleton(Step)], String) -> Array[[singleton(Step), Hash[String, untyped]]]
253
+ def self.matches: (Array[singleton(Step)], String) -> Array[[ singleton(Step), Hash[String, untyped] ]]
254
+ end
255
+ end
@@ -0,0 +1,118 @@
1
+ # Generated from lib/nukadoko/claim_check.rb with RBS::Inline
2
+
3
+ # What `nuka check` can tell about a claim step's claims from the line it
4
+ # is bound on and the earlier lines of its scenario, in the TypeScript
5
+ # engine's words and order. A `from` value comes from the nearest earlier
6
+ # line that runs its one producer bound before this line, as a run fills
7
+ # it, so the producer's `returns` says what the value can hold: a path
8
+ # into it that is not there (`claim-path-unknown`), a path the step's own
9
+ # args drops (`claim-args-dropped`), a lacks-field on a field its object
10
+ # never keeps (`claim-field-stripped`), a count or an each on a value that
11
+ # is never an array (`claim-not-an-array`), and two sides that read one
12
+ # place, or an observe that receives the value it is compared with
13
+ # (`claim-compares-itself`). A line whose producer is missing or
14
+ # ambiguous is left to `from-order-violation`, and a type this module
15
+ # cannot read (`unknown`) is taken to have every path, so each finding can
16
+ # only end one way. A view reads text the step returned at run time, so no
17
+ # path after it is checked.
18
+ module Nukadoko
19
+ module Engine
20
+ module ClaimCheck
21
+ class Producer < Data
22
+ attr_reader line(): Integer
23
+
24
+ attr_reader step(): singleton(Step)
25
+
26
+ attr_reader key(): String
27
+
28
+ def self.new: (Integer line, singleton(Step) step, String key) -> instance
29
+ | (line: Integer, step: singleton(Step), key: String) -> instance
30
+
31
+ def self.members: () -> [ :line, :step, :key ]
32
+
33
+ def members: () -> [ :line, :step, :key ]
34
+ end
35
+
36
+ # A place a side reads: the line of its producer, or observe, and the
37
+ # path from there, a view or a count as one segment of its own and an
38
+ # item of each as ANY.
39
+ class Place < Data
40
+ attr_reader origin(): String
41
+
42
+ attr_reader segments(): Array[String]
43
+
44
+ attr_reader text(): String
45
+
46
+ def self.new: (String origin, Array[String] segments, String text) -> instance
47
+ | (origin: String, segments: Array[String], text: String) -> instance
48
+
49
+ def self.members: () -> [ :origin, :segments, :text ]
50
+
51
+ def members: () -> [ :origin, :segments, :text ]
52
+ end
53
+
54
+ INDEX: ::Regexp
55
+
56
+ ANY: ::String
57
+
58
+ # : (String?) -> Array[String]?
59
+ def self?.segments_of: (String?) -> Array[String]?
60
+
61
+ # Every finding about the claim step bound on `index` of `resolved`,
62
+ # the [step, captures] of each line, as [code, message].
63
+ # : (Array[[singleton(Step), Hash[String, untyped]]?], Array[Integer], Integer) -> Array[[String, String]]
64
+ def self?.issues: (Array[[ singleton(Step), Hash[String, untyped] ]?], Array[Integer], Integer) -> Array[[ String, String ]]
65
+
66
+ # The nearest earlier line that runs the one candidate producer bound
67
+ # before this line, or nil when none or several are.
68
+ # : (singleton(Step), String, Integer, Array[[singleton(Step), Hash[String, untyped]]?], Array[Integer]) -> Producer?
69
+ def self?.producer: (singleton(Step), String, Integer, Array[[ singleton(Step), Hash[String, untyped] ]?], Array[Integer]) -> Producer?
70
+
71
+ # Follows `segments` through a schema as the run reads a value:
72
+ # { schema: type } at the end, { open: true } past a type this module
73
+ # cannot read, or { missing: index, keys: } at the first segment the
74
+ # type does not have.
75
+ # : (untyped, Array[String]) -> Hash[Symbol, untyped]
76
+ def self?.walk: (untyped, Array[String]) -> Hash[Symbol, untyped]
77
+
78
+ NOUNS: untyped
79
+
80
+ # What a value of `type` can be, as nouns, when none of them is an
81
+ # array; nil when one may be.
82
+ # : (untyped) -> Array[String]?
83
+ def self?.non_array_nouns: (untyped) -> Array[String]?
84
+
85
+ # The keys of the object at `segments`, which keeps no key it does not
86
+ # declare, as every object a Ruby schema declares does; nil for any
87
+ # other type.
88
+ # : (Schema?, Array[String]) -> Array[String]?
89
+ def self?.object_keys_at: (Schema?, Array[String]) -> Array[String]?
90
+
91
+ # The field a lacks-field claim names on this line: a literal, or a
92
+ # plain string key a capture fills with its own text.
93
+ # : (Hash[Symbol, untyped], Hash[String, untyped], singleton(Step)) -> String?
94
+ def self?.lacked_field: (Hash[Symbol, untyped], Hash[String, untyped], singleton(Step)) -> String?
95
+
96
+ # The segments a claim reads before its view, as the run reads them:
97
+ # its path, then its at when no view comes first; nil for a path that
98
+ # is not one.
99
+ # : (String?, String?, String?) -> Array[String]?
100
+ def self?.read_segments: (String?, String?, String?) -> Array[String]?
101
+
102
+ # : (String, String?, String?) -> String
103
+ def self?.read_text: (String, String?, String?) -> String
104
+
105
+ # : (Hash[Symbol, untyped]) -> Array[String]?
106
+ def self?.item_segments: (Hash[Symbol, untyped]) -> Array[String]?
107
+
108
+ # : (Place, String?, String?, bool?) -> Place
109
+ def self?.shaped: (Place, String?, String?, bool?) -> Place
110
+
111
+ # : (Place, Place) -> bool
112
+ def self?.same_place?: (Place, Place) -> bool
113
+
114
+ # : (Place, Place) -> bool
115
+ def self?.overlap?: (Place, Place) -> bool
116
+ end
117
+ end
118
+ end
@@ -0,0 +1,88 @@
1
+ # Generated from lib/nukadoko/claim_check_run.rb with RBS::Inline
2
+
3
+ # The claim checks of one claim step on one scenario line, kept apart from
4
+ # ClaimCheck's own module functions, which rbs-inline would otherwise read
5
+ # into this class.
6
+ module Nukadoko
7
+ module Engine
8
+ # One claim step on one line.
9
+ class ClaimCheck::Run
10
+ # : (singleton(Step), Array[Hash[Symbol, untyped]], Hash[String, untyped], Array[[singleton(Step), Hash[String, untyped]]?], Array[Integer], Integer) -> void
11
+ def initialize: (singleton(Step), Array[Hash[Symbol, untyped]], Hash[String, untyped], Array[[ singleton(Step), Hash[String, untyped] ]?], Array[Integer], Integer) -> void
12
+
13
+ # : () -> Array[[String, String]]
14
+ def issues: () -> Array[[ String, String ]]
15
+
16
+ private
17
+
18
+ # : (String, String) -> void
19
+ def report: (String, String) -> void
20
+
21
+ # : (String) -> ClaimCheck::Producer?
22
+ def producer_of: (String) -> ClaimCheck::Producer?
23
+
24
+ # : (String?) -> ClaimCheck::Producer?
25
+ def from_producer: (String?) -> ClaimCheck::Producer?
26
+
27
+ # The type a from path ends in, reporting a path the producer does
28
+ # not return; nil when the path is not a from path, is unresolved,
29
+ # or ends in a type this module cannot read.
30
+ # : (String, String) -> untyped
31
+ def from_path: (String, String) -> untyped
32
+
33
+ # : (String, String, ClaimCheck::Producer, Hash[Symbol, untyped], Array[String]) -> String
34
+ def missing: (String, String, ClaimCheck::Producer, Hash[Symbol, untyped], Array[String]) -> String
35
+
36
+ # A from path the step's own args takes out of the value before a
37
+ # claim reads it: the first key an object of args does not declare,
38
+ # where the producer may return one.
39
+ # : (String, String, Array[String]?) -> void
40
+ def args_drop: (String, String, Array[String]?) -> void
41
+
42
+ # : (String, untyped) -> void
43
+ def expected_args_drop: (String, untyped) -> void
44
+
45
+ # : (String, String, String, Array[String], String) -> void
46
+ def not_an_array: (String, String, String, Array[String], String) -> void
47
+
48
+ # : (String, Hash[Symbol, untyped], String, Array[String], String, bool) -> void
49
+ def stripped: (String, Hash[Symbol, untyped], String, Array[String], String, bool) -> void
50
+
51
+ # : (String, String) -> ClaimCheck::Place?
52
+ def place: (String, String) -> ClaimCheck::Place?
53
+
54
+ # : (untyped) -> ClaimCheck::Place?
55
+ def expected_place: (untyped) -> ClaimCheck::Place?
56
+
57
+ # : (String, ClaimCheck::Place?, ClaimCheck::Place?) -> void
58
+ def compares_itself: (String, ClaimCheck::Place?, ClaimCheck::Place?) -> void
59
+
60
+ # : (String, untyped) -> void
61
+ def note_expected_from: (String, untyped) -> void
62
+
63
+ # : (String, untyped, ClaimCheck::Place?, String) -> void
64
+ def note_actual_from: (String, untyped, ClaimCheck::Place?, String) -> void
65
+
66
+ # Each where clause and item claim of an each, with its label and
67
+ # whether it is a where clause.
68
+ # : (String, Hash[Symbol, untyped]) -> Array[[String, Hash[Symbol, untyped], bool]]
69
+ def each_entries: (String, Hash[Symbol, untyped]) -> Array[[ String, Hash[Symbol, untyped], bool ]]
70
+
71
+ # : (Hash[Symbol, untyped], String) -> void
72
+ def claim_issues: (Hash[Symbol, untyped], String) -> void
73
+
74
+ # : (Hash[Symbol, untyped], String, String, Array[String]?, untyped, String, ClaimCheck::Place?) -> void
75
+ def each_issues: (Hash[Symbol, untyped], String, String, Array[String]?, untyped, String, ClaimCheck::Place?) -> void
76
+
77
+ # Item paths of an each against the array's item type.
78
+ # : (String, Hash[Symbol, untyped], untyped) -> void
79
+ def item_paths: (String, Hash[Symbol, untyped], untyped) -> void
80
+
81
+ # An observe that receives a value an expected from reads, or the
82
+ # value an actual from reads when the claim takes its expected
83
+ # value from observe, could return the value it is compared with.
84
+ # : () -> void
85
+ def observe_receives: () -> void
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,158 @@
1
+ # Generated from lib/nukadoko/claim_line.rb with RBS::Inline
2
+
3
+ # One claim record as one line of plain text, in the words the TypeScript
4
+ # engine uses: the step's failure message and the run summary read it, so
5
+ # the two never describe one claim differently. It reads a record already
6
+ # written and judges nothing. Where two values part under `equal` or
7
+ # `has-same-items`, it names the place or the items they do not share.
8
+ module Nukadoko
9
+ module Engine
10
+ module ClaimLine
11
+ # A value longer than this is cut in a line; the record keeps it whole.
12
+ VALUE_TEXT_LIMIT: ::Integer
13
+
14
+ DIFFERENCE_CONTEXT: ::Integer
15
+
16
+ ITEM_PAIRS_LIMIT: ::Integer
17
+
18
+ LISTED_ITEMS: ::Integer
19
+
20
+ # : (untyped) -> String
21
+ def self?.value_text: (untyped) -> String
22
+
23
+ # : (Hash[Symbol, untyped]) -> String
24
+ def self?.expected_text: (Hash[Symbol, untyped]) -> String
25
+
26
+ # : (Hash[Symbol, untyped]) -> String
27
+ def self?.comparison_text: (Hash[Symbol, untyped]) -> String
28
+
29
+ # The actual side of a broken fits-aria-snapshot claim as the lines
30
+ # the misfit points at, with their numbers, since a page's snapshot is
31
+ # longer than the line shows and its first lines are seldom where the
32
+ # two part.
33
+ # : (Hash[Symbol, untyped]) -> String?
34
+ def self?.snapshot_excerpt_text: (Hash[Symbol, untyped]) -> String?
35
+
36
+ # : (untyped, untyped) -> String?
37
+ def self?.aria_snapshot_difference: (untyped, untyped) -> String?
38
+
39
+ # : (Hash[Symbol, untyped]) -> String
40
+ def self?.item_declaration_text: (Hash[Symbol, untyped]) -> String
41
+
42
+ # : (Integer) -> String
43
+ def self?.item_count: (Integer) -> String
44
+
45
+ # : (Hash[Symbol, untyped]) -> String
46
+ def self?.each_text: (Hash[Symbol, untyped]) -> String
47
+
48
+ # : (Hash[Symbol, untyped]) -> bool
49
+ def self?.each?: (Hash[Symbol, untyped]) -> bool
50
+
51
+ # : (Hash[Symbol, untyped]) -> String
52
+ def self?.claim_text: (Hash[Symbol, untyped]) -> String
53
+
54
+ # : (untyped) -> bool
55
+ def self?.plain_object?: (untyped) -> bool
56
+
57
+ # : (untyped, untyped) -> bool
58
+ def self?.same_json?: (untyped, untyped) -> bool
59
+
60
+ # The first place two JSON values differ: a path of keys and indexes,
61
+ # and what each side holds there, :none for a side with nothing.
62
+ # : (untyped, untyped, Array[String]) -> [Array[String], untyped, untyped]?
63
+ def self?.difference_in: (untyped, untyped, Array[String]) -> [ Array[String], untyped, untyped ]?
64
+
65
+ # : (untyped) -> String
66
+ def self?.side_text: (untyped) -> String
67
+
68
+ # : (String, String) -> String
69
+ def self?.text_difference: (String, String) -> String
70
+
71
+ # : (untyped, untyped) -> String?
72
+ def self?.equal_difference: (untyped, untyped) -> String?
73
+
74
+ # : (Array[untyped], untyped, untyped) -> String
75
+ def self?.difference_at: (Array[untyped], untyped, untyped) -> String
76
+
77
+ # : (untyped, untyped) -> bool
78
+ def self?.same?: (untyped, untyped) -> bool
79
+
80
+ # : (Array[untyped], Array[untyped]) -> [Integer, Integer]
81
+ def self?.shared_ends: (Array[untyped], Array[untyped]) -> [ Integer, Integer ]
82
+
83
+ # : (Array[untyped], Array[untyped]) -> Hash[Symbol, Array[Integer]]?
84
+ def self?.unpaired_items: (Array[untyped], Array[untyped]) -> Hash[Symbol, Array[Integer]]?
85
+
86
+ # The items a longest run of equal items, in order, leaves out, so an
87
+ # inserted item is one extra item and not a change to every one after it.
88
+ # : (Array[untyped], Array[untyped]) -> Hash[Symbol, untyped]?
89
+ def self?.aligned_items: (Array[untyped], Array[untyped]) -> Hash[Symbol, untyped]?
90
+
91
+ # : (Array[Integer], Array[untyped]) -> String
92
+ def self?.listed_items: (Array[Integer], Array[untyped]) -> String
93
+
94
+ # : (Hash[Symbol, untyped], Array[untyped], Array[untyped]) -> String?
95
+ def self?.unshared_text: (Hash[Symbol, untyped], Array[untyped], Array[untyped]) -> String?
96
+
97
+ # : (Array[Hash[Symbol, Integer]], Array[untyped], Array[untyped]) -> String?
98
+ def self?.changed_text: (Array[Hash[Symbol, Integer]], Array[untyped], Array[untyped]) -> String?
99
+
100
+ # : (Array[untyped], Array[untyped], String) -> String
101
+ def self?.list_difference: (Array[untyped], Array[untyped], String) -> String
102
+
103
+ # : (untyped, untyped) -> String?
104
+ def self?.same_items_difference: (untyped, untyped) -> String?
105
+
106
+ # The first expected field a broken has-fields claim's object lacks or
107
+ # holds another value at, found by the matcher that judged it.
108
+ # : (untyped, untyped) -> String?
109
+ def self?.fields_difference: (untyped, untyped) -> String?
110
+
111
+ # How far a broken fits-text claim's text fit, and the line where it
112
+ # stopped, or the two named stand-ins that broke it.
113
+ # : (untyped, untyped) -> String?
114
+ def self?.fits_difference: (untyped, untyped) -> String?
115
+
116
+ # : (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> String
117
+ def self?.readings_difference: (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> String
118
+
119
+ # The field a broken lacks-field claim's object holds, with its value,
120
+ # since a long object may not show it and a null reads as absent.
121
+ # : (untyped, untyped) -> String?
122
+ def self?.present_field_difference: (untyped, untyped) -> String?
123
+
124
+ DIFFERENCES: untyped
125
+
126
+ # : (Hash[Symbol, untyped]) -> String
127
+ def self?.difference_text: (Hash[Symbol, untyped]) -> String
128
+
129
+ # : (Hash[Symbol, untyped]) -> String
130
+ def self?.reason_text: (Hash[Symbol, untyped]) -> String
131
+
132
+ # : (Hash[Symbol, untyped]) -> String
133
+ def self?.named_outcome: (Hash[Symbol, untyped]) -> String
134
+
135
+ # : (Hash[Symbol, untyped]) -> Hash[Symbol, untyped]?
136
+ def self?.named_item: (Hash[Symbol, untyped]) -> Hash[Symbol, untyped]?
137
+
138
+ # : (Hash[Symbol, untyped]) -> String
139
+ def self?.item_claim_text: (Hash[Symbol, untyped]) -> String
140
+
141
+ # : (Hash[Symbol, untyped]) -> String
142
+ def self?.item_name: (Hash[Symbol, untyped]) -> String
143
+
144
+ # The claim and its outcome on one line. A broken each names its
145
+ # first broken item and that item's first broken comparison.
146
+ # : (Hash[Symbol, untyped]) -> String
147
+ def self?.line: (Hash[Symbol, untyped]) -> String
148
+
149
+ # : (Hash[Symbol, untyped]) -> Array[String]
150
+ def self?.named_item_lines: (Hash[Symbol, untyped]) -> Array[String]
151
+
152
+ # A claim step's failure: one line per claim that broke or was not
153
+ # judged, the first line naming the first one.
154
+ # : (Array[Hash[Symbol, untyped]]) -> String
155
+ def self?.broken_claims_message: (Array[Hash[Symbol, untyped]]) -> String
156
+ end
157
+ end
158
+ end