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,172 @@
1
+ # Generated from lib/nukadoko/claim_rules.rb with RBS::Inline
2
+
3
+ # The claims a step may declare, as the TypeScript engine's defineStep
4
+ # reads them: each refusal names a claim the run could judge only one way
5
+ # on every line, or one that lets the line or step code decide what the
6
+ # claim compares. `first_problem` gives the first refusal in the order the
7
+ # TypeScript engine meets it, in its words, so `nuka check` reports one
8
+ # step-file-import-failed per step in both engines. A Ruby args schema has
9
+ # no optional key, no default, and no rewrite, so those refusals have no
10
+ # Ruby counterpart.
11
+ module Nukadoko
12
+ module Engine
13
+ module ClaimRules
14
+ class Refused < StandardError
15
+ end
16
+
17
+ # What the rules read about the step besides its claims.
18
+ class Shape < Data
19
+ attr_reader patterns(): Array[String]
20
+
21
+ attr_reader args_keys(): Array[String]
22
+
23
+ attr_reader string_args(): Array[String]
24
+
25
+ attr_reader from_keys(): Array[String]
26
+
27
+ attr_reader capture_keys(): Array[String]
28
+
29
+ attr_reader observe(): bool
30
+
31
+ def self.new: (Array[String] patterns, Array[String] args_keys, Array[String] string_args, Array[String] from_keys, Array[String] capture_keys, bool observe) -> instance
32
+ | (patterns: Array[String], args_keys: Array[String], string_args: Array[String], from_keys: Array[String], capture_keys: Array[String], observe: bool) -> instance
33
+
34
+ def self.members: () -> [ :patterns, :args_keys, :string_args, :from_keys, :capture_keys, :observe ]
35
+
36
+ def members: () -> [ :patterns, :args_keys, :string_args, :from_keys, :capture_keys, :observe ]
37
+ end
38
+
39
+ VIEWS: untyped
40
+
41
+ COMPARISON_KEYS: untyped
42
+
43
+ EACH_CLAIM_KEYS: untyped
44
+
45
+ EACH_KEYS: untyped
46
+
47
+ PATH: ::Regexp
48
+
49
+ VIEW_MAKES: untyped
50
+
51
+ KIND_JSON_TYPES: untyped
52
+
53
+ COUNT_COMPARES: untyped
54
+
55
+ ORDER_COMPARES: untyped
56
+
57
+ ACTUAL_READS: untyped
58
+
59
+ READS_INSTEAD: untyped
60
+
61
+ WHERE_DECIDES: untyped
62
+
63
+ # The first reason the TypeScript engine's defineStep would refuse
64
+ # these claims, or nil.
65
+ # : (untyped, Shape) -> String?
66
+ def self?.first_problem: (untyped, Shape) -> String?
67
+
68
+ # : (untyped) -> String
69
+ def self?.describe: (untyped) -> String
70
+
71
+ # : (String) -> String
72
+ def self?.article: (String) -> String
73
+
74
+ # : (String) -> bot
75
+ def self?.refuse: (String) -> bot
76
+
77
+ # : (untyped) -> Array[String]?
78
+ def self?.segments: (untyped) -> Array[String]?
79
+
80
+ # : (String, untyped, bool) -> void
81
+ def self?.check_path: (String, untyped, bool) -> void
82
+
83
+ # : (String, Hash[Symbol, untyped], Array[String], String) -> void
84
+ def self?.check_keys: (String, Hash[Symbol, untyped], Array[String], String) -> void
85
+
86
+ # : (String, Hash[Symbol, untyped]) -> void
87
+ def self?.check_common: (String, Hash[Symbol, untyped]) -> void
88
+
89
+ # : (untyped) -> Hash[Symbol, untyped]?
90
+ def self?.literal_of: (untyped) -> Hash[Symbol, untyped]?
91
+
92
+ # : (untyped) -> bool
93
+ def self?.literal_value?: (untyped) -> bool
94
+
95
+ # : (String, Hash[Symbol, untyped], Shape) -> void
96
+ def self?.check_expected_view: (String, Hash[Symbol, untyped], Shape) -> void
97
+
98
+ # : (String, untyped, untyped, Shape, bool) -> void
99
+ def self?.check_expected: (String, untyped, untyped, Shape, bool) -> void
100
+
101
+ # : (String, untyped, untyped, Shape, bool) -> void
102
+ def self?.check_literal: (String, untyped, untyped, Shape, bool) -> void
103
+
104
+ # : (String, Hash[Symbol, untyped]) -> void
105
+ def self?.check_count: (String, Hash[Symbol, untyped]) -> void
106
+
107
+ # : (String, Hash[Symbol, untyped]) -> void
108
+ def self?.check_sides: (String, Hash[Symbol, untyped]) -> void
109
+
110
+ # : (String, Hash[Symbol, untyped]) -> void
111
+ def self?.check_actual_view: (String, Hash[Symbol, untyped]) -> void
112
+
113
+ # : (String, Hash[Symbol, untyped], Shape, bool, bool) -> void
114
+ def self?.check_aria_snapshot: (String, Hash[Symbol, untyped], Shape, bool, bool) -> void
115
+
116
+ # : (String, Hash[Symbol, untyped], bool) -> void
117
+ def self?.check_judged: (String, Hash[Symbol, untyped], bool) -> void
118
+
119
+ # : (String, Hash[Symbol, untyped], Shape, bool, bool) -> void
120
+ def self?.check_comparison: (String, Hash[Symbol, untyped], Shape, bool, bool) -> void
121
+
122
+ # : (Hash[Symbol, untyped]) -> Array[String]
123
+ def self?.item_path: (Hash[Symbol, untyped]) -> Array[String]
124
+
125
+ # : (Hash[Symbol, untyped]) -> Array[String]
126
+ def self?.item_read_path: (Hash[Symbol, untyped]) -> Array[String]
127
+
128
+ # : (Array[String], Array[String]) -> bool
129
+ def self?.overlap?: (Array[String], Array[String]) -> bool
130
+
131
+ # : (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> bool
132
+ def self?.one_item_value?: (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> bool
133
+
134
+ # : (Array[String]) -> String
135
+ def self?.described_item: (Array[String]) -> String
136
+
137
+ # : (untyped) -> String?
138
+ def self?.literal_json_type: (untyped) -> String?
139
+
140
+ # : (untyped, Shape) -> void
141
+ def self?.validate: (untyped, Shape) -> void
142
+
143
+ # : (String, untyped, Shape, bool) -> void
144
+ def self?.check_each: (String, untyped, Shape, bool) -> void
145
+
146
+ # The args keys observe never receives, each with the side a claim
147
+ # reads it on: a key a claim names as its expected value (a sentence
148
+ # key, or the head of a from path), and the from key a claim's actual
149
+ # starts with when that claim, or an item claim under its each, takes
150
+ # its expected value from observe. So observe cannot return what it
151
+ # will be compared with, either way.
152
+ # : (Array[Hash[Symbol, untyped]], Array[String]) -> Hash[String, String]
153
+ def self?.withheld_keys: (Array[Hash[Symbol, untyped]], Array[String]) -> Hash[String, String]
154
+
155
+ # An observe no claim reads changes no verdict; a key it returns under
156
+ # a from key's name never reaches a claim, since the from value wins.
157
+ # : (Array[Hash[Symbol, untyped]], Shape) -> void
158
+ def self?.check_observe_read: (Array[Hash[Symbol, untyped]], Shape) -> void
159
+
160
+ # A value the line states that no claim reads, in a step with no
161
+ # observe to receive it, is a value nothing checks.
162
+ # : (Array[Hash[Symbol, untyped]], Shape) -> void
163
+ def self?.check_captures_read: (Array[Hash[Symbol, untyped]], Shape) -> void
164
+
165
+ # The args keys the claims read: the head of each actual path, a
166
+ # sentence key named as an expected value, and the head of a from
167
+ # expected path, in every claim and in each each's where and claims.
168
+ # : (Array[Hash[Symbol, untyped]]) -> Array[String]
169
+ def self?.keys_read: (Array[Hash[Symbol, untyped]]) -> Array[String]
170
+ end
171
+ end
172
+ end
@@ -0,0 +1,207 @@
1
+ # Generated from lib/nukadoko/claim_sides.rb with RBS::Inline
2
+
3
+ # Responsibility: the two sides of a top-level comparison claim, read as the
4
+ # TypeScript engine reads them: where each value sits (its place, whose
5
+ # label a reason names), the plain JSON copy a claim judges, and what stops
6
+ # a claim before any compare runs (a value that is undefined, one that is
7
+ # not plain JSON, a view that cannot read it, a claim that compares a value
8
+ # with itself or with one observe could have returned). It reads; the
9
+ # compares stay in Claims.compare. A claim on each item of a list is read
10
+ # elsewhere.
11
+ module Nukadoko
12
+ module Engine
13
+ module ClaimSides
14
+ class Place < Data
15
+ attr_reader origin(): String
16
+
17
+ attr_reader segments(): Array[String]
18
+
19
+ attr_reader label(): String
20
+
21
+ attr_reader open(): bool
22
+
23
+ def self.new: (String origin, Array[String] segments, String label, bool open) -> instance
24
+ | (origin: String, segments: Array[String], label: String, open: bool) -> instance
25
+
26
+ def self.members: () -> [ :origin, :segments, :label, :open ]
27
+
28
+ def members: () -> [ :origin, :segments, :label, :open ]
29
+ end
30
+
31
+ # What one side read: a value, or why the claim breaks or is not judged.
32
+ class Side < Data
33
+ attr_reader place(): Place
34
+
35
+ attr_reader found(): Hash[Symbol, untyped]
36
+
37
+ def self.new: (Place place, Hash[Symbol, untyped] found) -> instance
38
+ | (place: Place, found: Hash[Symbol, untyped]) -> instance
39
+
40
+ def self.members: () -> [ :place, :found ]
41
+
42
+ def members: () -> [ :place, :found ]
43
+ end
44
+
45
+ OBSERVE: untyped
46
+
47
+ LITERAL: untyped
48
+
49
+ SAFE: untyped
50
+
51
+ MAX_DEPTH: ::Integer
52
+
53
+ INDEX: ::Regexp
54
+
55
+ # Where a claim reads from: what observe returned with the from values
56
+ # merged in, the args, whether the step observes, its from keys, the
57
+ # label of each args key's origin, and the args keys observe received.
58
+ class Inputs < Data
59
+ attr_reader observed(): untyped
60
+
61
+ attr_reader args(): untyped
62
+
63
+ attr_reader observes(): bool
64
+
65
+ attr_reader from_keys(): Array[String]
66
+
67
+ attr_reader labels(): ^(String) -> String
68
+
69
+ attr_reader received(): Array[String]
70
+
71
+ def self.new: (untyped observed, untyped args, bool observes, Array[String] from_keys, ^(String) -> String labels, Array[String] received) -> instance
72
+ | (observed: untyped, args: untyped, observes: bool, from_keys: Array[String], labels: ^(String) -> String, received: Array[String]) -> instance
73
+
74
+ def self.members: () -> [ :observed, :args, :observes, :from_keys, :labels, :received ]
75
+
76
+ def members: () -> [ :observed, :args, :observes, :from_keys, :labels, :received ]
77
+ end
78
+
79
+ # : (Place, String?) -> Place
80
+ def self.place_at: (Place, String?) -> Place
81
+
82
+ # : (Place, String?) -> Place
83
+ def self.place_viewed: (Place, String?) -> Place
84
+
85
+ # : (Place, bool?) -> Place
86
+ def self.place_counted: (Place, bool?) -> Place
87
+
88
+ # : (Place, Place) -> bool
89
+ def self.same_place?: (Place, Place) -> bool
90
+
91
+ # : (Place, Place) -> bool
92
+ def self.overlap?: (Place, Place) -> bool
93
+
94
+ # : (String, Inputs) -> Place
95
+ def self.arg_place: (String, Inputs) -> Place
96
+
97
+ # : (String) -> Array[String]
98
+ def self.segments: (String) -> Array[String]
99
+
100
+ # The value at `segments` inside `root`, or the index of the first
101
+ # segment that finds nothing. nil is JSON's null, which is a value.
102
+ # : (untyped, Array[String]) -> Hash[Symbol, untyped]
103
+ def self.value_at: (untyped, Array[String]) -> Hash[Symbol, untyped]
104
+
105
+ # : (untyped, Array[String]) -> Hash[Symbol, untyped]
106
+ def self.read_at: (untyped, Array[String]) -> Hash[Symbol, untyped]
107
+
108
+ # : (String) -> String
109
+ def self.article: (String) -> String
110
+
111
+ # The plain JSON copy a claim judges, as JavaScript holds it, or where
112
+ # the first part that is not plain JSON sits and what it is. A whole
113
+ # float is the integer JavaScript's one number type would hold, so
114
+ # 2500.0 is judged and shown as 2500; a symbol is its name.
115
+ # : (untyped, ?Integer) -> Hash[Symbol, untyped]
116
+ def self.snapshot: (untyped, ?Integer) -> Hash[Symbol, untyped]
117
+
118
+ # A JavaScript object lists its array-index keys first, in ascending
119
+ # order, then its other keys in the order they were added.
120
+ # : (Hash[String, untyped]) -> Hash[String, untyped]
121
+ def self.js_order: (Hash[String, untyped]) -> Hash[String, untyped]
122
+
123
+ # : (Place) -> String
124
+ def self.name_of: (Place) -> String
125
+
126
+ # : (Place, Hash[Symbol, untyped]) -> String
127
+ def self.refusal_reason: (Place, Hash[Symbol, untyped]) -> String
128
+
129
+ # : (Integer, Place, Array[String]) -> String
130
+ def self.first_missing: (Integer, Place, Array[String]) -> String
131
+
132
+ # : (Hash[Symbol, untyped], Place, Array[String], Integer, ?^(Place) -> String) -> Side
133
+ def self.side_of: (Hash[Symbol, untyped], Place, Array[String], Integer, ?^(Place) -> String) -> Side
134
+
135
+ # : (Array[String], Inputs, ?^(Place) -> String) -> Side
136
+ def self.arg_side: (Array[String], Inputs, ?^(Place) -> String) -> Side
137
+
138
+ # The side a claim's actual names, read at its path and, with no
139
+ # view, at its at too; `at_read` says the at was read here.
140
+ # : (Hash[Symbol, untyped], Inputs) -> [Side, bool]
141
+ def self.top_side: (Hash[Symbol, untyped], Inputs) -> [ Side, bool ]
142
+
143
+ # The value after a view, or why the view could not read it.
144
+ # : (String?, untyped) -> Hash[Symbol, untyped]
145
+ def self.apply_view: (String?, untyped) -> Hash[Symbol, untyped]
146
+
147
+ # : (Side, String?, String?, ?bool) -> Side
148
+ def self.shaped: (Side, String?, String?, ?bool) -> Side
149
+
150
+ # : (Side, bool?) -> Side
151
+ def self.counted: (Side, bool?) -> Side
152
+
153
+ # The expected side, and whether observe gave it.
154
+ # : (Hash[Symbol, untyped], Inputs) -> [Side, bool]
155
+ def self.expected_side: (Hash[Symbol, untyped], Inputs) -> [ Side, bool ]
156
+
157
+ # What stops a claim before any compare runs, or nil.
158
+ # : (Side, Side, bool, Inputs) -> Hash[Symbol, String]?
159
+ def self.precondition: (Side, Side, bool, Inputs) -> Hash[Symbol, String]?
160
+
161
+ # : (Place, Inputs, String) -> Hash[Symbol, String]?
162
+ def self.observe_received: (Place, Inputs, String) -> Hash[Symbol, String]?
163
+
164
+ # A top-level comparison claim, judged as Claims.judge_one reports one.
165
+ # : (Hash[Symbol, untyped], Inputs) -> Hash[Symbol, untyped]
166
+ def self.judge: (Hash[Symbol, untyped], Inputs) -> Hash[Symbol, untyped]
167
+
168
+ # One comparison on a side already read: a top-level claim's, or one
169
+ # item's under an each.
170
+ # : (Hash[Symbol, untyped], Side, Inputs, ?bool) -> Hash[Symbol, untyped]
171
+ def self.judge_comparison: (Hash[Symbol, untyped], Side, Inputs, ?bool) -> Hash[Symbol, untyped]
172
+
173
+ # : (Hash[Symbol, untyped], StandardError) -> Hash[Symbol, untyped]
174
+ def self.unjudgeable: (Hash[Symbol, untyped], StandardError) -> Hash[Symbol, untyped]
175
+
176
+ # The array an each reads, after its view and at.
177
+ # : (Hash[Symbol, untyped], Inputs) -> Side
178
+ def self.array_side: (Hash[Symbol, untyped], Inputs) -> Side
179
+
180
+ # The side an item claim reads: the item, or a path inside it. The item
181
+ # is part of a snapshot, so a read inside it finds a value or nothing.
182
+ # : (untyped, Place, Hash[Symbol, untyped]) -> Side
183
+ def self.item_side: (untyped, Place, Hash[Symbol, untyped]) -> Side
184
+
185
+ # What ends an each before any item: a declaration whose expected value
186
+ # observe received, or reads through what observe returned while observe
187
+ # received the array, does not depend on an item, and an empty array
188
+ # would hide it. Then a where clause that implies an item claim.
189
+ # : (Hash[Symbol, untyped], Place, Inputs) -> Hash[Symbol, String]?
190
+ def self.each_stop: (Hash[Symbol, untyped], Place, Inputs) -> Hash[Symbol, String]?
191
+
192
+ # The first where clause and item claim that read one value where the
193
+ # clause implies the claim whatever the value is, as the reason that
194
+ # breaks the each: the claim holds on every item where selects, so
195
+ # "every item" measures nothing.
196
+ # : (Hash[Symbol, untyped], Inputs) -> String?
197
+ def self.where_implication: (Hash[Symbol, untyped], Inputs) -> String?
198
+
199
+ # Whether every value a where clause selects holds an item claim on the
200
+ # same value: the same order direction with a bound at least as strict,
201
+ # not-equal against the same value, or an is-a whose kind is the one JSON
202
+ # type the clause can compare.
203
+ # : (String, untyped, String, untyped) -> bool
204
+ def self.where_implies?: (String, untyped, String, untyped) -> bool
205
+ end
206
+ end
207
+ end
@@ -0,0 +1,208 @@
1
+ # Generated from lib/nukadoko/claims.rb with RBS::Inline
2
+
3
+ module Nukadoko
4
+ module Engine
5
+ module Claims
6
+ COMPARES: untyped
7
+
8
+ # The ARIA snapshots nukadoko took of what observe returned, by the
9
+ # value observe returned, so a claim judges the tree taken right
10
+ # after that reading and never reads a live page.
11
+ ARIA_TAKEN: ObjectSpace::WeakKeyMap[Hash[String, untyped], Hash[String, Hash[Symbol, String]]]
12
+
13
+ ARIA_TAKES: ::String
14
+
15
+ # Takes the ARIA snapshot of the locator or page at each path a
16
+ # fits-aria-snapshot claim reads, once per reading. One path's failure
17
+ # is that path's read, so taking them never raises.
18
+ # : (Array[Hash[Symbol, untyped]], untyped) -> untyped
19
+ def self.take_aria_snapshots: (Array[Hash[Symbol, untyped]], untyped) -> untyped
20
+
21
+ # The path a judged-as claim reads: its actual and, with no view, its at.
22
+ # : (Hash[Symbol, untyped]) -> String
23
+ def self.judged_path: (Hash[Symbol, untyped]) -> String
24
+
25
+ # : (untyped, Array[String]) -> Hash[Symbol, String]
26
+ def self.aria_snapshot_at: (untyped, Array[String]) -> Hash[Symbol, String]
27
+
28
+ # Only Playwright's own locator and page: a value step code wrote with
29
+ # a method of that name would be a tree written in code.
30
+ # : (untyped) -> bool
31
+ def self.aria_snapshot_taker?: (untyped) -> bool
32
+
33
+ # The phrase for a value that is not a locator or a page, as the
34
+ # TypeScript engine names it.
35
+ # : (untyped) -> String
36
+ def self.aria_value_kind: (untyped) -> String
37
+
38
+ # : (String) -> String
39
+ def self.article_of: (String) -> String
40
+
41
+ # The side a fits-aria-snapshot claim reads: the text of the snapshot
42
+ # taken of the value at its actual path.
43
+ # : (Hash[Symbol, untyped], untyped) -> Hash[Symbol, String]
44
+ def self.aria_side: (Hash[Symbol, untyped], untyped) -> Hash[Symbol, String]
45
+
46
+ # `inputs` says where each side sits, so a top-level comparison is read
47
+ # as the TypeScript engine reads it (ClaimSides); without it, a claim
48
+ # reads `observed` as the value of each key.
49
+ # : (Array[Hash[Symbol, untyped]], untyped, untyped, ?ClaimSides::Inputs?) -> Array[Hash[Symbol, untyped]]
50
+ def self.judge: (Array[Hash[Symbol, untyped]], untyped, untyped, ?ClaimSides::Inputs?) -> Array[Hash[Symbol, untyped]]
51
+
52
+ # An each judged as its record judges it, so a poll waits on the
53
+ # outcome the record will hold.
54
+ # : (Hash[Symbol, untyped], ClaimSides::Inputs) -> Hash[Symbol, untyped]
55
+ def self.each_judged: (Hash[Symbol, untyped], ClaimSides::Inputs) -> Hash[Symbol, untyped]
56
+
57
+ # from inside an each as well. A claim on an item with no actual reads
58
+ # the item itself.
59
+ # : (Hash[Symbol, untyped], untyped, untyped, ?untyped) -> Hash[Symbol, untyped]
60
+ def self.judge_one: (Hash[Symbol, untyped], untyped, untyped, ?untyped) -> Hash[Symbol, untyped]
61
+
62
+ # : (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
63
+ def self.judge_aria: (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
64
+
65
+ # The tree nukadoko took of a judged value that is a locator or a page.
66
+ # : (Hash[Symbol, untyped], untyped) -> Hash[Symbol, String]?
67
+ def self.aria_judged: (Hash[Symbol, untyped], untyped) -> Hash[Symbol, String]?
68
+
69
+ # : (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
70
+ def self.judge_judged: (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
71
+
72
+ # : (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
73
+ def self.judge_each: (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
74
+
75
+ # : (Hash[Symbol, untyped], untyped, ?untyped) -> untyped
76
+ def self.expected_value: (Hash[Symbol, untyped], untyped, ?untyped) -> untyped
77
+
78
+ VIEWS: untyped
79
+
80
+ # A view reads a string as something else before `at` walks into it.
81
+ # : (String?, untyped) -> untyped
82
+ def self.view: (String?, untyped) -> untyped
83
+
84
+ # : (untyped, String | Symbol) -> untyped
85
+ def self.read: (untyped, String | Symbol) -> untyped
86
+
87
+ # : (untyped, untyped) -> untyped
88
+ def self.dig: (untyped, untyped) -> untyped
89
+
90
+ # : (untyped, untyped) -> bool
91
+ def self.same?: (untyped, untyped) -> bool
92
+
93
+ # : (untyped) -> untyped
94
+ def self.normal: (untyped) -> untyped
95
+
96
+ # A pattern that backtracks gets this long before the claim is left unjudged.
97
+ PATTERN_TIMEOUT: ::Float
98
+
99
+ # What `is-a` names, as the TypeScript engine lists the kinds.
100
+ VALUE_KINDS: untyped
101
+
102
+ DATE: ::Regexp
103
+
104
+ # Seconds are required and a leap second refused, as a program's clock
105
+ # never prints 60; the separator and the offset take the spellings
106
+ # RFC 3339 and ISO 8601 allow.
107
+ TIMESTAMP: ::Regexp
108
+
109
+ UUID: ::Regexp
110
+
111
+ # : (Integer, Integer, Integer) -> bool
112
+ def self.calendar_day?: (Integer, Integer, Integer) -> bool
113
+
114
+ # : (untyped) -> bool
115
+ def self.date?: (untyped) -> bool
116
+
117
+ # : (untyped) -> bool
118
+ def self.timestamp?: (untyped) -> bool
119
+
120
+ # A text a URL parser accepts can still be no URL a program wrote, so
121
+ # the scheme needs "//" and no character a reader cannot see may appear.
122
+ # The rest is what the WHATWG URL parser, which the TypeScript engine
123
+ # uses, refuses for http and https: a missing host, a port that is not
124
+ # a number up to 65535, a host with a character no domain may hold, and
125
+ # an IPv4 or IPv6 address that does not parse. A path, a query, and a
126
+ # fragment can hold anything, as a browser takes them.
127
+ # : (untyped) -> bool
128
+ def self.url?: (untyped) -> bool
129
+
130
+ # The host and the port of `host:port`, a colon inside brackets kept.
131
+ # : (String) -> [String?, String?]
132
+ def self.split_host_port: (String) -> [ String?, String? ]
133
+
134
+ # : (String) -> bool
135
+ def self.ipv6?: (String) -> bool
136
+
137
+ FORBIDDEN_DOMAIN: ::Regexp
138
+
139
+ # A host percent-decoded and mapped as UTS #46 maps it (NFKC, then
140
+ # lower case), which holds no character a domain may not, and whose
141
+ # last label, when it reads as a number, is an IPv4 address.
142
+ # : (String) -> bool
143
+ def self.domain?: (String) -> bool
144
+
145
+ # Whether a label written as `xn--` decodes, under RFC 3492, to a
146
+ # label UTS #46 keeps: one with a character outside ASCII, no control,
147
+ # joiner, or unassigned character, and already in its mapped form.
148
+ # : (String) -> bool
149
+ def self.punycode_label?: (String) -> bool
150
+
151
+ # RFC 3492's decoder, or nil for a text that does not decode.
152
+ # : (String) -> String?
153
+ def self.punycode_decode: (String) -> String?
154
+
155
+ # The WHATWG IPv4 parser: up to four parts, each decimal, octal with a
156
+ # leading 0, or hex with 0x, every part but the last below 256 and the
157
+ # last below what the parts before it leave.
158
+ # : (Array[String]) -> bool
159
+ def self.ipv4?: (Array[String]) -> bool
160
+
161
+ KIND_TESTS: untyped
162
+
163
+ # The test of the kind `name` names, read trimmed and in any case.
164
+ # : (String) -> untyped
165
+ def self.value_kind: (String) -> untyped
166
+
167
+ # : (untyped) -> String
168
+ def self.json_type: (untyped) -> String
169
+
170
+ # : (String) -> String
171
+ def self.article: (String) -> String
172
+
173
+ # JavaScript's trim, which takes Unicode spaces and a byte order mark.
174
+ # : (String) -> bool
175
+ def self.blank?: (String) -> bool
176
+
177
+ # Structural equality over JSON values: key order does not count, and
178
+ # 1 equals 1.0, as JSON writes one number.
179
+ # : (untyped, untyped) -> bool
180
+ def self.deep_equal?: (untyped, untyped) -> bool
181
+
182
+ # The same items, each as many times, in any order.
183
+ # : (Array[untyped], Array[untyped]) -> bool
184
+ def self.same_items?: (Array[untyped], Array[untyped]) -> bool
185
+
186
+ # The first place `expected` does not fit `actual` under has-fields, or
187
+ # nil: an object fits one that holds each of its fields with a value
188
+ # that fits, an array one of its length whose items fit, and anything
189
+ # else an equal value.
190
+ # : (untyped, untyped, ?Array[String | Integer]) -> Hash[Symbol, untyped]?
191
+ def self.field_misfit: (untyped, untyped, ?Array[String | Integer]) -> Hash[Symbol, untyped]?
192
+
193
+ # The path of the first object with no field, at any depth, or nil.
194
+ # : (untyped, ?Array[String | Integer]) -> Array[String | Integer]?
195
+ def self.fieldless_object: (untyped, ?Array[String | Integer]) -> Array[String | Integer]?
196
+
197
+ # { holds: } or { reason: } when the two sides cannot be compared, or
198
+ # { stopped: } when nothing judged them. A comparison across two JSON
199
+ # types never holds for the reason the claim states, so it breaks with
200
+ # both types named, and so does an expected value every actual holds.
201
+ # : (String, untyped, untyped) -> Hash[Symbol, untyped]
202
+ def self.compare: (String, untyped, untyped) -> Hash[Symbol, untyped]
203
+
204
+ # : (String, untyped, untyped) -> bool
205
+ def self.holds?: (String, untyped, untyped) -> bool
206
+ end
207
+ end
208
+ end