nukadoko 0.1.0 → 0.2.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 (147) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +291 -0
  3. data/README.ja.md +58 -5
  4. data/README.md +15 -3
  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 +274 -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/claims.rb +407 -30
  15. data/lib/nukadoko/cli.rb +802 -19
  16. data/lib/nukadoko/codes.json +942 -0
  17. data/lib/nukadoko/codes.rb +19 -0
  18. data/lib/nukadoko/command.rb +214 -12
  19. data/lib/nukadoko/criteria.rb +172 -0
  20. data/lib/nukadoko/definition.rb +33 -41
  21. data/lib/nukadoko/env_check.rb +90 -0
  22. data/lib/nukadoko/features.rb +80 -10
  23. data/lib/nukadoko/fixtures.rb +296 -10
  24. data/lib/nukadoko/http_recording.rb +68 -0
  25. data/lib/nukadoko/init.rb +130 -0
  26. data/lib/nukadoko/judge.rb +221 -0
  27. data/lib/nukadoko/judgment_file.rb +78 -0
  28. data/lib/nukadoko/judgments.rb +256 -0
  29. data/lib/nukadoko/literal.rb +129 -0
  30. data/lib/nukadoko/measured.rb +105 -0
  31. data/lib/nukadoko/order.rb +84 -0
  32. data/lib/nukadoko/parts.rb +42 -21
  33. data/lib/nukadoko/pattern.rb +11 -1
  34. data/lib/nukadoko/poll.rb +17 -6
  35. data/lib/nukadoko/program.rb +105 -17
  36. data/lib/nukadoko/project_fixtures.rb +17 -2
  37. data/lib/nukadoko/report_allure.rb +751 -0
  38. data/lib/nukadoko/report_messages.rb +167 -0
  39. data/lib/nukadoko/report_run.rb +169 -0
  40. data/lib/nukadoko/run.rb +865 -88
  41. data/lib/nukadoko/run_record.rb +532 -0
  42. data/lib/nukadoko/scaffold.rb +1015 -0
  43. data/lib/nukadoko/schema.rb +61 -4
  44. data/lib/nukadoko/secrets.rb +359 -0
  45. data/lib/nukadoko/selection.rb +163 -0
  46. data/lib/nukadoko/signature.rb +4 -1
  47. data/lib/nukadoko/skill.rb +36 -0
  48. data/lib/nukadoko/step.rb +62 -21
  49. data/lib/nukadoko/summary.rb +662 -0
  50. data/lib/nukadoko/table.rb +34 -2
  51. data/lib/nukadoko/text_fit.rb +179 -0
  52. data/lib/nukadoko/trace.rb +244 -0
  53. data/lib/nukadoko/trace_actions.rb +116 -0
  54. data/lib/nukadoko/tree_passes.rb +119 -0
  55. data/lib/nukadoko/verdict.rb +128 -0
  56. data/lib/nukadoko/version.rb +2 -1
  57. data/lib/nukadoko/vocabulary.rb +6 -0
  58. data/lib/nukadoko/walk.rb +305 -0
  59. data/lib/nukadoko/walk_files.rb +473 -0
  60. data/lib/nukadoko/walk_step.rb +149 -0
  61. data/lib/nukadoko.rb +36 -0
  62. data/llms.txt +296 -0
  63. data/sig/generated/nukadoko/aria_snapshot.rbs +331 -0
  64. data/sig/generated/nukadoko/aria_tree.rbs +142 -0
  65. data/sig/generated/nukadoko/base.rbs +136 -0
  66. data/sig/generated/nukadoko/check.rbs +255 -0
  67. data/sig/generated/nukadoko/claim_check.rbs +118 -0
  68. data/sig/generated/nukadoko/claim_check_run.rbs +88 -0
  69. data/sig/generated/nukadoko/claim_line.rbs +158 -0
  70. data/sig/generated/nukadoko/claim_rules.rbs +172 -0
  71. data/sig/generated/nukadoko/claims.rbs +165 -0
  72. data/sig/generated/nukadoko/cli.rbs +182 -0
  73. data/sig/generated/nukadoko/codes.rbs +16 -0
  74. data/sig/generated/nukadoko/command.rbs +109 -0
  75. data/sig/generated/nukadoko/criteria.rbs +83 -0
  76. data/sig/generated/nukadoko/definition.rbs +30 -0
  77. data/sig/generated/nukadoko/env_check.rbs +38 -0
  78. data/sig/generated/nukadoko/features.rbs +101 -0
  79. data/sig/generated/nukadoko/fixtures.rbs +152 -0
  80. data/sig/generated/nukadoko/http_recording.rbs +29 -0
  81. data/sig/generated/nukadoko/init.rbs +66 -0
  82. data/sig/generated/nukadoko/judge.rbs +64 -0
  83. data/sig/generated/nukadoko/judgment_file.rbs +39 -0
  84. data/sig/generated/nukadoko/judgments.rbs +120 -0
  85. data/sig/generated/nukadoko/literal.rbs +71 -0
  86. data/sig/generated/nukadoko/measured.rbs +42 -0
  87. data/sig/generated/nukadoko/order.rbs +54 -0
  88. data/sig/generated/nukadoko/parts.rbs +35 -0
  89. data/sig/generated/nukadoko/pattern.rbs +28 -0
  90. data/sig/generated/nukadoko/poll.rbs +40 -0
  91. data/sig/generated/nukadoko/program.rbs +101 -0
  92. data/sig/generated/nukadoko/project_fixtures.rbs +57 -0
  93. data/sig/generated/nukadoko/report_allure.rbs +268 -0
  94. data/sig/generated/nukadoko/report_messages.rbs +68 -0
  95. data/sig/generated/nukadoko/report_run.rbs +102 -0
  96. data/sig/generated/nukadoko/run.rbs +257 -0
  97. data/sig/generated/nukadoko/run_record.rbs +174 -0
  98. data/sig/generated/nukadoko/scaffold.rbs +328 -0
  99. data/sig/generated/nukadoko/schema.rbs +137 -0
  100. data/sig/generated/nukadoko/secrets.rbs +157 -0
  101. data/sig/generated/nukadoko/selection.rbs +73 -0
  102. data/sig/generated/nukadoko/signature.rbs +17 -0
  103. data/sig/generated/nukadoko/skill.rbs +20 -0
  104. data/sig/generated/nukadoko/step.rbs +115 -0
  105. data/sig/generated/nukadoko/summary.rbs +204 -0
  106. data/sig/generated/nukadoko/table.rbs +43 -0
  107. data/sig/generated/nukadoko/text_fit.rbs +70 -0
  108. data/sig/generated/nukadoko/trace.rbs +127 -0
  109. data/sig/generated/nukadoko/trace_actions.rbs +40 -0
  110. data/sig/generated/nukadoko/tree_passes.rbs +48 -0
  111. data/sig/generated/nukadoko/verdict.rbs +56 -0
  112. data/sig/generated/nukadoko/version.rbs +5 -0
  113. data/sig/generated/nukadoko/vocabulary.rbs +25 -0
  114. data/sig/generated/nukadoko/walk.rbs +139 -0
  115. data/sig/generated/nukadoko/walk_files.rbs +189 -0
  116. data/sig/generated/nukadoko/walk_step.rbs +50 -0
  117. data/sig/generated/nukadoko.rbs +15 -0
  118. data/sig/nukadoko.rbs +5 -48
  119. data/skills/nukadoko/SKILL.md +120 -0
  120. data/skills/nukadoko/references/checking-steps.md +200 -0
  121. data/skills/nukadoko/references/diagnosing.md +200 -0
  122. data/skills/nukadoko/references/done.md +99 -0
  123. data/skills/nukadoko/references/evidence.md +124 -0
  124. data/skills/nukadoko/references/examples/cli.md +230 -0
  125. data/skills/nukadoko/references/examples/http-api.md +339 -0
  126. data/skills/nukadoko/references/examples/workflow.md +173 -0
  127. data/skills/nukadoko/references/exploring.md +184 -0
  128. data/skills/nukadoko/references/fixtures.md +198 -0
  129. data/skills/nukadoko/references/from-prose.md +51 -0
  130. data/skills/nukadoko/references/judgments.md +95 -0
  131. data/skills/nukadoko/references/maintenance.md +97 -0
  132. data/skills/nukadoko/references/merge-risk.md +74 -0
  133. data/skills/nukadoko/references/parts.md +152 -0
  134. data/skills/nukadoko/references/perturbed-worlds.md +107 -0
  135. data/skills/nukadoko/references/program.md +200 -0
  136. data/skills/nukadoko/references/reviewing.md +200 -0
  137. data/skills/nukadoko/references/running.md +200 -0
  138. data/skills/nukadoko/references/scenario-rules.md +188 -0
  139. data/skills/nukadoko/references/states.md +66 -0
  140. data/skills/nukadoko/references/step-files.md +200 -0
  141. data/skills/nukadoko/references/verdicts.md +200 -0
  142. data/skills/nukadoko/references/writing-steps.md +200 -0
  143. data/skills/nukadoko/references/writing-the-feature.md +165 -0
  144. data/skills/nukadoko/scripts/claude-code-verdict-hook.mjs +99 -0
  145. data/skills/nukadoko/scripts/merge-risk.jq +56 -0
  146. data/skills/nukadoko-verification/SKILL.md +263 -0
  147. metadata +121 -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,165 @@
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
+ # : (Array[Hash[Symbol, untyped]], untyped, untyped) -> Array[Hash[Symbol, untyped]]
47
+ def self.judge: (Array[Hash[Symbol, untyped]], untyped, untyped) -> Array[Hash[Symbol, untyped]]
48
+
49
+ # `top` is what observe returned, which an expected { observe } reads
50
+ # from inside an each as well. A claim on an item with no actual reads
51
+ # the item itself.
52
+ # : (Hash[Symbol, untyped], untyped, untyped, ?untyped) -> Hash[Symbol, untyped]
53
+ def self.judge_one: (Hash[Symbol, untyped], untyped, untyped, ?untyped) -> Hash[Symbol, untyped]
54
+
55
+ # : (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
56
+ def self.judge_aria: (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
57
+
58
+ # The tree nukadoko took of a judged value that is a locator or a page.
59
+ # : (Hash[Symbol, untyped], untyped) -> Hash[Symbol, String]?
60
+ def self.aria_judged: (Hash[Symbol, untyped], untyped) -> Hash[Symbol, String]?
61
+
62
+ # : (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
63
+ def self.judge_judged: (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
64
+
65
+ # : (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
66
+ def self.judge_each: (Hash[Symbol, untyped], untyped, untyped, untyped) -> Hash[Symbol, untyped]
67
+
68
+ # : (Hash[Symbol, untyped], untyped, ?untyped) -> untyped
69
+ def self.expected_value: (Hash[Symbol, untyped], untyped, ?untyped) -> untyped
70
+
71
+ VIEWS: untyped
72
+
73
+ # A view reads a string as something else before `at` walks into it.
74
+ # : (String?, untyped) -> untyped
75
+ def self.view: (String?, untyped) -> untyped
76
+
77
+ # : (untyped, String | Symbol) -> untyped
78
+ def self.read: (untyped, String | Symbol) -> untyped
79
+
80
+ # : (untyped, untyped) -> untyped
81
+ def self.dig: (untyped, untyped) -> untyped
82
+
83
+ # : (untyped, untyped) -> bool
84
+ def self.same?: (untyped, untyped) -> bool
85
+
86
+ # : (untyped) -> untyped
87
+ def self.normal: (untyped) -> untyped
88
+
89
+ # A pattern that backtracks gets this long before the claim is left unjudged.
90
+ PATTERN_TIMEOUT: ::Float
91
+
92
+ # What `is-a` names, as the TypeScript engine lists the kinds.
93
+ VALUE_KINDS: untyped
94
+
95
+ DATE: ::Regexp
96
+
97
+ # Seconds are required and a leap second refused, as a program's clock
98
+ # never prints 60; the separator and the offset take the spellings
99
+ # RFC 3339 and ISO 8601 allow.
100
+ TIMESTAMP: ::Regexp
101
+
102
+ UUID: ::Regexp
103
+
104
+ # : (Integer, Integer, Integer) -> bool
105
+ def self.calendar_day?: (Integer, Integer, Integer) -> bool
106
+
107
+ # : (untyped) -> bool
108
+ def self.date?: (untyped) -> bool
109
+
110
+ # : (untyped) -> bool
111
+ def self.timestamp?: (untyped) -> bool
112
+
113
+ # A text a URL parser accepts can still be no URL a program wrote, so
114
+ # the scheme needs "//" and no character a reader cannot see may appear.
115
+ # : (untyped) -> bool
116
+ def self.url?: (untyped) -> bool
117
+
118
+ KIND_TESTS: untyped
119
+
120
+ # The test of the kind `name` names, read trimmed and in any case.
121
+ # : (String) -> untyped
122
+ def self.value_kind: (String) -> untyped
123
+
124
+ # : (untyped) -> String
125
+ def self.json_type: (untyped) -> String
126
+
127
+ # : (String) -> String
128
+ def self.article: (String) -> String
129
+
130
+ # JavaScript's trim, which takes Unicode spaces and a byte order mark.
131
+ # : (String) -> bool
132
+ def self.blank?: (String) -> bool
133
+
134
+ # Structural equality over JSON values: key order does not count, and
135
+ # 1 equals 1.0, as JSON writes one number.
136
+ # : (untyped, untyped) -> bool
137
+ def self.deep_equal?: (untyped, untyped) -> bool
138
+
139
+ # The same items, each as many times, in any order.
140
+ # : (Array[untyped], Array[untyped]) -> bool
141
+ def self.same_items?: (Array[untyped], Array[untyped]) -> bool
142
+
143
+ # The first place `expected` does not fit `actual` under has-fields, or
144
+ # nil: an object fits one that holds each of its fields with a value
145
+ # that fits, an array one of its length whose items fit, and anything
146
+ # else an equal value.
147
+ # : (untyped, untyped, ?Array[String | Integer]) -> Hash[Symbol, untyped]?
148
+ def self.field_misfit: (untyped, untyped, ?Array[String | Integer]) -> Hash[Symbol, untyped]?
149
+
150
+ # The path of the first object with no field, at any depth, or nil.
151
+ # : (untyped, ?Array[String | Integer]) -> Array[String | Integer]?
152
+ def self.fieldless_object: (untyped, ?Array[String | Integer]) -> Array[String | Integer]?
153
+
154
+ # { holds: } or { reason: } when the two sides cannot be compared, or
155
+ # { stopped: } when nothing judged them. A comparison across two JSON
156
+ # types never holds for the reason the claim states, so it breaks with
157
+ # both types named, and so does an expected value every actual holds.
158
+ # : (String, untyped, untyped) -> Hash[Symbol, untyped]
159
+ def self.compare: (String, untyped, untyped) -> Hash[Symbol, untyped]
160
+
161
+ # : (String, untyped, untyped) -> bool
162
+ def self.holds?: (String, untyped, untyped) -> bool
163
+ end
164
+ end
165
+ end
@@ -0,0 +1,182 @@
1
+ # Generated from lib/nukadoko/cli.rb with RBS::Inline
2
+
3
+ # The `nuka` command. With --json it prints one envelope in the shape the
4
+ # TypeScript engine prints, so an agent reads both engines the same way.
5
+ module Nukadoko
6
+ class CLI
7
+ FLAGS: untyped
8
+
9
+ REPEATED: untyped
10
+
11
+ VALUED: untyped
12
+
13
+ # : (Array[String], ?project: String, ?out: IO) -> void
14
+ def initialize: (Array[String], ?project: String, ?out: IO) -> void
15
+
16
+ # The commands by what a user reaches them for, in the TypeScript
17
+ # engine's words, so `nuka --help` reads the same in both.
18
+ HELP: ::String
19
+
20
+ COMMANDS: untyped
21
+
22
+ # : () -> Integer
23
+ def call: () -> Integer
24
+
25
+ private
26
+
27
+ # `--name value` and `--name=value` for the repeated options, bare
28
+ # flags, and every other word a target. An unknown `--name` is kept to
29
+ # refuse, so a typo never reads as a target or is silently ignored.
30
+ # : (Array[String]) -> void
31
+ def parse: (Array[String]) -> void
32
+
33
+ # `nuka run --step`: a run of one scenario that pauses after each step
34
+ # until `nuka step` answers. The walk is recorded before anything else,
35
+ # so every way the run stops reaches a `nuka step` waiting for it: a
36
+ # refusal or nothing selected ends it as not run, with what the run
37
+ # printed; a signal, which is what ends a pause nobody answers, as
38
+ # interrupted; an exception as an error.
39
+ # : (Array[singleton(Step)]) -> Integer
40
+ def walk: (Array[singleton(Step)]) -> Integer
41
+
42
+ # Why a walk cannot walk this run, raised as step-needs-one-scenario: a
43
+ # walk is one execution of one scenario, in one environment, where its
44
+ # conditions hold, since a control would run again for its proof.
45
+ # : (Array[Engine::Scenario], Array[Engine::Environment]) -> void
46
+ def one_execution: (Array[Engine::Scenario], Array[Engine::Environment]) -> void
47
+
48
+ # A run checks the scenarios it selected, then runs them in each world
49
+ # it selected; a target or a world it cannot reach is refused first.
50
+ # : (Array[singleton(Step)]) -> Integer
51
+ def run: (Array[singleton(Step)]) -> Integer
52
+
53
+ # `--repeat`, `--concurrency`, and `--proof-runs` take a whole number of 1 or more.
54
+ # : (String) -> Integer
55
+ def count_flag: (String) -> Integer
56
+
57
+ # One pass of a `--base` tree, in the tree's own directory: the plan
58
+ # names the world, the environment, and the rows at their place in this
59
+ # tree, and the result goes to the file it names.
60
+ # : (Array[singleton(Step)]) -> Integer
61
+ def tree: (Array[singleton(Step)]) -> Integer
62
+
63
+ # `nuka do <step>`: one step alone, its args from --args and from the
64
+ # records --use names, in a world started for it. The step record goes
65
+ # to stdout and to .nukadoko/do/<id>/record.json, where a later
66
+ # `nuka do --use` reads it. A refusal goes to stderr, since stdout is
67
+ # the record's.
68
+ # Paths written go to stdout, notes and refusals to stderr.
69
+ # : () -> Integer
70
+ def init: () -> Integer
71
+
72
+ # Writes stubs; their paths go to stdout, and notes and refusals to stderr.
73
+ # : (Array[singleton(Step)], Array[Engine::Scenario]) -> Integer
74
+ def scaffold: (Array[singleton(Step)], Array[Engine::Scenario]) -> Integer
75
+
76
+ # : (Engine::Check) -> Integer
77
+ def run_one: (Engine::Check) -> Integer
78
+
79
+ # Each from key of the step, from the newest record --use names whose
80
+ # step gives it, and where it came from.
81
+ # : (singleton(Step), Array[String]) -> [Hash[untyped, untyped], Hash[untyped, String], Array[Hash[Symbol, untyped]]]
82
+ def used_args: (singleton(Step), Array[String]) -> [ Hash[untyped, untyped], Hash[untyped, String], Array[Hash[Symbol, untyped]] ]
83
+
84
+ # The record `nuka do` prints, in the TypeScript engine's shape.
85
+ # : (Hash[Symbol, untyped], String, singleton(Step), Hash[untyped, untyped], Hash[untyped, String], Array[Hash[Symbol, untyped]], Engine::Environment) -> Hash[Symbol, untyped]
86
+ def do_record: (Hash[Symbol, untyped], String, singleton(Step), Hash[untyped, untyped], Hash[untyped, String], Array[Hash[Symbol, untyped]], Engine::Environment) -> Hash[Symbol, untyped]
87
+
88
+ # : (Engine::Scenario, Array[Engine::Environment]) -> bool
89
+ def meets?: (Engine::Scenario, Array[Engine::Environment]) -> bool
90
+
91
+ # The `nuka check` that reports the same errors: the files the targets
92
+ # name, and each --env.
93
+ # : () -> String
94
+ def check_command: () -> String
95
+
96
+ # Why --env left out every selected scenario, and the run that meets
97
+ # them: the run without --env when it does, else the first environment
98
+ # of the program file that meets each, or else one that meets some.
99
+ # : (Array[Engine::Scenario], Engine::Program) -> Hash[Symbol, String]
100
+ def left_out_stop: (Array[Engine::Scenario], Engine::Program) -> Hash[Symbol, String]
101
+
102
+ # Removes what runs left in the state directory: each run directory,
103
+ # each `nuka do` record, the Allure results nukadoko wrote, and the
104
+ # directories an earlier release left. --dry-run lists them only.
105
+ # : () -> Integer
106
+ def clean: () -> Integer
107
+
108
+ # `nuka skill path`, the one verb, as the TypeScript engine has it.
109
+ # : () -> Integer
110
+ def skill: () -> Integer
111
+
112
+ # Renders a finished run again from its run.json alone: the run a
113
+ # directory names, or the newest one.
114
+ # : () -> Integer
115
+ def report: () -> Integer
116
+
117
+ # Why a report cannot go to `target`, or nil when it can.
118
+ # : (String, Symbol, String) -> String?
119
+ def out_problem: (String, Symbol, String) -> String?
120
+
121
+ # : (String) -> String
122
+ def shown_path: (String) -> String
123
+
124
+ # The files this project's own run noted in its exports manifest under
125
+ # the export directory, so a render of the same run replaces what the
126
+ # last one wrote there and retention removes them with the run. A run
127
+ # that is not one of this project's own notes nothing.
128
+ # : (String, untyped, Array[String]) -> Hash[Symbol, untyped]?
129
+ def own_exports: (String, untyped, Array[String]) -> Hash[Symbol, untyped]?
130
+
131
+ # : (Hash[Symbol, untyped]?, String, Symbol) -> void
132
+ def replace_own_exports: (Hash[Symbol, untyped]?, String, Symbol) -> void
133
+
134
+ # : (Hash[Symbol, untyped]?, Array[String]) -> void
135
+ def note_own_exports: (Hash[Symbol, untyped]?, Array[String]) -> void
136
+
137
+ # : () -> String
138
+ def report_dir: () -> String
139
+
140
+ # Reads run.json files and git only, so it loads no step.
141
+ # : () -> Integer
142
+ def verdict: () -> Integer
143
+
144
+ # What check says about the env files; a file it cannot read, or a key
145
+ # both secrets lists name, stops the command instead.
146
+ # : () -> Array[Engine::Finding]
147
+ def env_findings: () -> Array[Engine::Finding]
148
+
149
+ # : (Engine::Refusal) -> Integer
150
+ def refuse: (Engine::Refusal) -> Integer
151
+
152
+ # : (Engine::Finding) -> Engine::Finding
153
+ def relative: (Engine::Finding) -> Engine::Finding
154
+
155
+ # Every envelope opens the same way, in the TypeScript engine's order.
156
+ # : (String?, String, Array[untyped], **untyped) -> Hash[Symbol, untyped]
157
+ def head: (String?, String, Array[untyped], **untyped) -> Hash[Symbol, untyped]
158
+
159
+ # : (String?, bool, findings: Array[untyped], ?verdict: String, ?exit_code: Integer, **untyped) -> Integer
160
+ def finish: (String?, bool, findings: Array[untyped], ?verdict: String, ?exit_code: Integer, **untyped) -> Integer
161
+
162
+ # : (Hash[Symbol, untyped], Array[untyped], String?, ?io: IO) -> void
163
+ def emit: (Hash[Symbol, untyped], Array[untyped], String?, ?io: IO) -> void
164
+
165
+ # The counts after where the run wrote, as the TypeScript engine prints
166
+ # them: the scenarios, then the control runs, then the criteria when a
167
+ # control or a base makes the scenario count no verdict count, then the
168
+ # criteria left out.
169
+ # : (Hash[Symbol, untyped], IO) -> void
170
+ def run_end: (Hash[Symbol, untyped], IO) -> void
171
+
172
+ # `1h 2m 3s`, the unit a whole run reads in.
173
+ # : (String, String) -> String
174
+ def duration: (String, String) -> String
175
+
176
+ # After the failed list, under --repeat, each scenario that failed at
177
+ # least once and how many of its executions passed. No verdict is
178
+ # named: one that fails every time is not flaky.
179
+ # : (Array[Hash[Symbol, untyped]], IO) -> void
180
+ def repeat_tallies: (Array[Hash[Symbol, untyped]], IO) -> void
181
+ end
182
+ end
@@ -0,0 +1,16 @@
1
+ # Generated from lib/nukadoko/codes.rb with RBS::Inline
2
+
3
+ # Every code a finding or a refusal can carry, with its description and
4
+ # the edit that gets past it, as the TypeScript engine's registry holds
5
+ # them (`bin/sync-codes` writes codes.json from it), so one code reads the
6
+ # same in either engine. Data only.
7
+ module Nukadoko
8
+ module Engine
9
+ module Codes
10
+ ALL: untyped
11
+
12
+ # : (String) -> String?
13
+ def self.fix: (String) -> String?
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,109 @@
1
+ # Generated from lib/nukadoko/command.rb with RBS::Inline
2
+
3
+ # What a command-line scenario needs: scratch directories that live as long
4
+ # as one scenario, and a way to run the program under test that keeps every
5
+ # run for the step record. Both are engine-built, so a step never removes a
6
+ # directory it made or forgets to note a process it started.
7
+ module Nukadoko
8
+ # Runs a command and gives what it left: the exit code (nil when a signal
9
+ # ended it), the signal, stdout, and stderr. Inside a step the run is
10
+ # noted in the step record's processes, with what changed under `cwd`
11
+ # while it ran, which the result gives as `files` too; `files: true`
12
+ # measures that outside a step as well. `env` is added to the runner's
13
+ # environment. A run that `timeout` seconds stopped raises, since it has
14
+ # no exit code to read. `input` (or `stdin`) is written to the program's
15
+ # stdin. `redact` names secrets the step holds itself, which the record
16
+ # writes as `{{secret.NAME}}` while the program still gets the real value.
17
+ # : (String, ?Array[String], ?cwd: String, ?env: Hash[String | Symbol, String], ?input: String?, ?stdin: String?, ?timeout: Numeric?, ?redact: Hash[String | Symbol, String], ?files: bool) -> Hash[Symbol, untyped]
18
+ def self.run_command: (String, ?Array[String], ?cwd: String, ?env: Hash[String | Symbol, String], ?input: String?, ?stdin: String?, ?timeout: Numeric?, ?redact: Hash[String | Symbol, String], ?files: bool) -> Hash[Symbol, untyped]
19
+
20
+ module Engine
21
+ # The processes the running step started, kept per thread so a step
22
+ # that calls run_command from a helper is still measured.
23
+ module Processes
24
+ # : () -> Array[untyped]?
25
+ def self.current: () -> Array[untyped]?
26
+
27
+ # Fills `into` even when the step raises, so a failed step still names
28
+ # the processes it ran.
29
+ # : [T] (Array[untyped]) { () -> T } -> T
30
+ def self.collect: [T] (Array[untyped]) { () -> T } -> T
31
+
32
+ # : () -> bool
33
+ def self.groups?: () -> bool
34
+
35
+ # Runs the command to its close, its stdin closed after `input`.
36
+ # : (Hash[String, String], Array[String], String, String?, Numeric?, group: bool) -> [String, String, Process::Status, bool?]
37
+ def self.spawn: (Hash[String, String], Array[String], String, String?, Numeric?, group: bool) -> [ String, String, Process::Status, bool? ]
38
+
39
+ # `ended` when no process of the group still runs as the leader closed.
40
+ # : (Integer) -> String
41
+ def self.group_state: (Integer) -> String
42
+
43
+ # The child's environment against the runner's: every name the step
44
+ # set, and a value only when it cannot be a credential.
45
+ # : (Hash[untyped, untyped]) -> Hash[Symbol, untyped]
46
+ def self.env_entry: (Hash[untyped, untyped]) -> Hash[Symbol, untyped]
47
+
48
+ # : (String) -> (String | Hash[Symbol, Integer])
49
+ def self.shown_value: (String) -> (String | Hash[Symbol, Integer])
50
+ end
51
+
52
+ # A directory's files as their identities, before and after something
53
+ # wrote there, and the difference as the record names it.
54
+ module FileWalk
55
+ SKIPPED: untyped
56
+
57
+ LIMIT: ::Integer
58
+
59
+ # : (String) -> Hash[Symbol, untyped]
60
+ def self.snapshot: (String) -> Hash[Symbol, untyped]
61
+
62
+ # : (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
63
+ def self.difference: (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
64
+ end
65
+
66
+ # The `scratch` fixture: `dir` makes a fresh directory, and the engine
67
+ # removes every one of them when the scenario ends, passed or failed.
68
+ class Scratch
69
+ # `root` is what a relative `copy` source resolves against: the
70
+ # project's directory.
71
+ # : (?String) -> void
72
+ def initialize: (?String) -> void
73
+
74
+ # A directory under the system's temporary directory, named
75
+ # `<prefix>-` and six characters, as the TypeScript engine names it.
76
+ # : (?String) -> String
77
+ def dir: (?String) -> String
78
+
79
+ # A fresh scratch directory holding a copy of `source`: a directory's
80
+ # contents, or a file under its own name. The source is read before
81
+ # the directory is made, so a missing one raises without leaving an
82
+ # empty directory in the step record.
83
+ # : (String) -> String
84
+ def copy: (String) -> String
85
+
86
+ # : () -> Array[String]
87
+ def dirs: () -> Array[String]
88
+
89
+ FILE_TEXT: untyped
90
+
91
+ STEP_TEXT: untyped
92
+
93
+ # Each scratch directory's paths as identities, to compare a step's
94
+ # start with its end.
95
+ # : () -> Hash[String, Hash[Symbol, untyped]]
96
+ def snapshot: () -> Hash[String, Hash[Symbol, untyped]]
97
+
98
+ # What the step changed in the scratch directories, absolute and
99
+ # sorted, each file with its size and text after the step: a
100
+ # directory made during the step is compared with an empty one. The
101
+ # step reads at most 64 KiB of content in all, 8 KiB of each file.
102
+ # : (Hash[String, Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
103
+ def changes: (Hash[String, Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
104
+
105
+ # : () -> void
106
+ def remove_all: () -> void
107
+ end
108
+ end
109
+ end