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,120 @@
1
+ # Generated from lib/nukadoko/judgments.rb with RBS::Inline
2
+
3
+ # Judgments (docs/spec.md "Judgments"): the verdicts on a criterion that no
4
+ # compare can give, such as whether a text is friendly. A Then asks for one
5
+ # with a `judged-as` claim; the run reads the value and records it, and a
6
+ # reader judges it after the run and commits the judgment. nukadoko checks
7
+ # two things alone, both exactly: that a judgment cites a value this run's
8
+ # records hold (by its digest), and that the value did not change since.
9
+ # The judgment itself is never checked, and never folded into the machine
10
+ # verdict: a row keeps its verdict from the cells, and gains a `judgment`
11
+ # beside it, whose state has a gate of its own.
12
+ #
13
+ # Pure, and in the words the TypeScript engine uses. The files on disk are
14
+ # lib/nukadoko/judgment_file.rb's, and recording one is the judge command's.
15
+ #
16
+ # The digest is of the value's JSON with object keys sorted, so a program
17
+ # that writes its keys in another order does not make a judgment stale,
18
+ # and with numbers written the way JavaScript writes them, so both engines
19
+ # give one value one digest.
20
+ module Nukadoko
21
+ module Engine
22
+ module Judgments
23
+ # The order a row's state is chosen in: a judge's no first, then what
24
+ # no judgment can fix, then what a new judgment fixes.
25
+ STATE_ORDER: untyped
26
+
27
+ # The states in the order the summary's title counts them.
28
+ TITLE_ORDER: untyped
29
+
30
+ ARIA_LABEL: ::String
31
+
32
+ RECORD_FIX: ::String
33
+
34
+ UNCITABLE_FIX: ::String
35
+
36
+ ENTRY_STRINGS: untyped
37
+
38
+ # : (untyped) -> String
39
+ def self?.canonical_json: (untyped) -> String
40
+
41
+ # : (untyped) -> String
42
+ def self?.value_digest: (untyped) -> String
43
+
44
+ # Where a judged value was measured, as a read names it: the channel,
45
+ # with the step record that holds it when that is another step's,
46
+ # `aria-snapshot` for a tree nukadoko took, or nil.
47
+ # : (Hash[Symbol, untyped], String?) -> String?
48
+ def self?.measured_of: (Hash[Symbol, untyped], String?) -> String?
49
+
50
+ # Every value the passing required head executions of `row` read for a
51
+ # judgment, once per Then, claim, and value.
52
+ # : (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
53
+ def self?.judged_values: (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
54
+
55
+ # : (Hash[Symbol, untyped], ?Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
56
+ def self?.cited: (Hash[Symbol, untyped], ?Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
57
+
58
+ # Where one value stands against the judgments of its criterion: a
59
+ # value in no recorded channel is `uncitable` whatever a file says; an
60
+ # entry with its digest decides it; entries of the same claim that
61
+ # cite only values this run did not read make it `stale`, citing the
62
+ # latest of them; otherwise it is `pending`. `read_now` is every digest
63
+ # the run read for the same claim, so a value one environment reads
64
+ # beside a judged value another reads is a value of its own to judge.
65
+ # : (Hash[Symbol, untyped], String, Array[Hash[Symbol, untyped]], ?Array[String]?) -> Hash[Symbol, untyped]
66
+ def self?.read_against: (Hash[Symbol, untyped], String, Array[Hash[Symbol, untyped]], ?Array[String]?) -> Hash[Symbol, untyped]
67
+
68
+ # : (Array[Hash[Symbol, untyped]], String, Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
69
+ def self?.read_each: (Array[Hash[Symbol, untyped]], String, Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
70
+
71
+ # A value as a reason quotes it, cut at 120 characters of its JSON.
72
+ # : (untyped) -> String
73
+ def self?.value_preview: (untyped) -> String
74
+
75
+ # : (Hash[Symbol, untyped]) -> String
76
+ def self?.quality: (Hash[Symbol, untyped]) -> String
77
+
78
+ # : (Hash[Symbol, untyped], untyped) -> String
79
+ def self?.read_clause: (Hash[Symbol, untyped], untyped) -> String
80
+
81
+ # The judgment of one row, or nil for a row that read no value for a
82
+ # judgment.
83
+ # : (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]]) -> Hash[Symbol, untyped]?
84
+ def self?.row_judgment: (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]]) -> Hash[Symbol, untyped]?
85
+
86
+ # The table's rows with a `judgment` on each row whose required head
87
+ # cells all passed and read a value for a judgment. The verdict is
88
+ # never touched.
89
+ # : (Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]], ^(String) -> Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
90
+ def self?.with_judgments: (Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]], ^(String) -> Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
91
+
92
+ # : (Array[Hash[Symbol, untyped]]) -> bool
93
+ def self?.open?: (Array[Hash[Symbol, untyped]]) -> bool
94
+
95
+ # : (Hash[Symbol, untyped], String) -> String
96
+ def self?.show_command: (Hash[Symbol, untyped], String) -> String
97
+
98
+ # One finding per row whose judgment leaves the gate red.
99
+ # : (Array[Hash[Symbol, untyped]], String) -> Array[Hash[Symbol, untyped]]
100
+ def self?.findings: (Array[Hash[Symbol, untyped]], String) -> Array[Hash[Symbol, untyped]]
101
+
102
+ # `entries` with `entry` in: it replaces an entry that judged the same
103
+ # value of the same claim, and is added beside the entries of others.
104
+ # : (Array[Hash[Symbol, untyped]], Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
105
+ def self?.add: (Array[Hash[Symbol, untyped]], Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
106
+
107
+ # A judgment file's text: its entries ordered by criterion, Then,
108
+ # claim, and time, so two judges who add one each make a diff of two
109
+ # hunks. Keys keep the order the TypeScript engine writes.
110
+ # : (Array[Hash[Symbol, untyped]]) -> String
111
+ def self?.file_text: (Array[Hash[Symbol, untyped]]) -> String
112
+
113
+ # A judgment file's entries, or why its text holds none: a file a
114
+ # person edited by hand can break, and a judgment it no longer holds
115
+ # must read as unread, never as absent.
116
+ # : (String) -> Hash[Symbol, untyped]
117
+ def self?.parse_file: (String) -> Hash[Symbol, untyped]
118
+ end
119
+ end
120
+ end
@@ -0,0 +1,71 @@
1
+ # Generated from lib/nukadoko/literal.rb with RBS::Inline
2
+
3
+ # The literal rule, as the TypeScript engine reads it. A literal expected
4
+ # value is in neither the sentence's data nor an earlier step's result, so
5
+ # it would let step code carry the criterion again ("the command succeeds"
6
+ # claiming 0). It is allowed only when the sentence states it: its text is
7
+ # a run of the pattern's fixed words joined by one space, a whole number
8
+ # from zero to twelve a fixed word spells (or once and twice), or the fixed
9
+ # value of a word in WORDS. A word inside a capture, an optional group, or
10
+ # an alternation is not fixed, since the sentence a line binds may not say
11
+ # it. A value WORDS fixes is compared with equal alone, or with not-equal
12
+ # right after "not", "neither", or "nor".
13
+ module Nukadoko
14
+ module Engine
15
+ module Literal
16
+ class Statement < Data
17
+ attr_reader words(): untyped
18
+
19
+ attr_reader by_table(): untyped
20
+
21
+ attr_reader compare(): untyped
22
+
23
+ attr_reader negated_by(): untyped
24
+
25
+ def self.new: (untyped words, untyped by_table, untyped compare, untyped negated_by) -> instance
26
+ | (words: untyped, by_table: untyped, compare: untyped, negated_by: untyped) -> instance
27
+
28
+ def self.members: () -> [ :words, :by_table, :compare, :negated_by ]
29
+
30
+ def members: () -> [ :words, :by_table, :compare, :negated_by ]
31
+ end
32
+
33
+ WORDS: untyped
34
+
35
+ NUMBERS: untyped
36
+
37
+ TIMES: untyped
38
+
39
+ NEGATING: untyped
40
+
41
+ EDGE: ::Regexp
42
+
43
+ # Every word of the pattern, with whether a matching sentence always holds it.
44
+ # : (String) -> Array[[String, bool]]
45
+ def self?.words: (String) -> Array[[ String, bool ]]
46
+
47
+ # : (untyped) -> String?
48
+ def self?.text: (untyped) -> String?
49
+
50
+ # : (String) -> Integer?
51
+ def self?.number_of: (String) -> Integer?
52
+
53
+ # : (untyped, untyped) -> bool
54
+ def self?.same?: (untyped, untyped) -> bool
55
+
56
+ # : (String, untyped) -> Statement?
57
+ def self?.statement: (String, untyped) -> Statement?
58
+
59
+ # : (Array[String], String) -> bool
60
+ def self?.run_of?: (Array[String], String) -> bool
61
+
62
+ # How every pattern states `literal`, or nil when one does not: a line
63
+ # may bind any of them, and the first pattern's words name it.
64
+ # : (Array[String], untyped) -> Statement?
65
+ def self?.statement_of_all: (Array[String], untyped) -> Statement?
66
+
67
+ # : (Array[String], untyped) -> untyped
68
+ def self?.stated_by_all: (Array[String], untyped) -> untyped
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,42 @@
1
+ # Generated from lib/nukadoko/measured.rb with RBS::Inline
2
+
3
+ # The `measured` of each claim record: which recorded channel of which step
4
+ # record holds exactly the raw value the claim read, as the TypeScript
5
+ # engine names it. A claim on a `from` value looks in the record of the step
6
+ # that returned it; any other looks in the claim step's own channels. The
7
+ # channels are a process's stdout, stderr, and exit code, an HTTP
8
+ # response's status and body, and a changed file's content. A number
9
+ # channel matches only a number, and a number another channel of the record
10
+ # also holds names no channel: content alone cannot tell which one the value
11
+ # came from, and nil says less than a source that may be false. So does any
12
+ # value while a channel's content is unknown. It is information for a
13
+ # reader, never a condition of the claim.
14
+ module Nukadoko
15
+ module Engine
16
+ module Measured
17
+ # Every channel of a step record, in record order: processes, then
18
+ # HTTP responses, then files. A channel whose content is not on disk
19
+ # whole is unknown.
20
+ # : (String, Hash[Symbol, untyped], String?) -> Array[Hash[Symbol, untyped]]
21
+ def self?.channels: (String, Hash[Symbol, untyped], String?) -> Array[Hash[Symbol, untyped]]
22
+
23
+ # : (String, untyped) -> Hash[Symbol, untyped]
24
+ def self?.kept: (String, untyped) -> Hash[Symbol, untyped]
25
+
26
+ # : (String) -> String?
27
+ def self?.read: (String) -> String?
28
+
29
+ # The channel of `record_id` that holds `raw`, or nil; `skip` is a
30
+ # channel the other side already matched.
31
+ # : (String?, untyped, ^(String) -> Array[Hash[Symbol, untyped]], ?Hash[Symbol, untyped]?) -> Hash[Symbol, untyped]?
32
+ def self?.channel_for: (String?, untyped, ^(String) -> Array[Hash[Symbol, untyped]], ?Hash[Symbol, untyped]?) -> Hash[Symbol, untyped]?
33
+
34
+ # : (untyped, Hash[Symbol, untyped]) -> bool
35
+ def self?.same?: (untyped, Hash[Symbol, untyped]) -> bool
36
+
37
+ # Whether a channel holds `n` as a number of its own, not as part of another.
38
+ # : (Hash[Symbol, untyped], Numeric) -> bool
39
+ def self?.holds_number?: (Hash[Symbol, untyped], Numeric) -> bool
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,54 @@
1
+ # Generated from lib/nukadoko/order.rb with RBS::Inline
2
+
3
+ # The order `nuka run` plays its selection in, and the rerun line that plays
4
+ # it again. File order is the order the targets select. A shuffled order
5
+ # sorts the feature files, then each file's scenarios, by a key made from the
6
+ # seed and each one's path or line. A file stays whole, so one seed names one
7
+ # order at every concurrency. The key does not depend on what else was
8
+ # selected, so any part of a selection runs in the order the whole gave it,
9
+ # and a rerun line can name what ran before a failed scenario.
10
+ #
11
+ # The key is the TypeScript engine's, bit for bit: a seed names the same
12
+ # order in either engine. It works on 32-bit words, and on the UTF-16 code
13
+ # units of the text, as JavaScript's charCodeAt reads them.
14
+ module Nukadoko
15
+ module Engine
16
+ module Order
17
+ MAX_SEED: ::Integer
18
+
19
+ MASK: ::Integer
20
+
21
+ FILE: untyped
22
+
23
+ # `--order`'s value read, or nil when it is none of file, shuffled,
24
+ # and shuffled:<seed>. shuffled alone draws its seed.
25
+ # : (String?) -> Hash[Symbol, untyped]?
26
+ def self.read: (String?) -> Hash[Symbol, untyped]?
27
+
28
+ # : (Hash[Symbol, untyped]) -> String
29
+ def self.text: (Hash[Symbol, untyped]) -> String
30
+
31
+ # : (Hash[Symbol, untyped]) -> Array[String]
32
+ def self.flags: (Hash[Symbol, untyped]) -> Array[String]
33
+
34
+ # The scenarios in the run's order: by file in the order the files
35
+ # first appear, or by the shuffled keys.
36
+ # : (Array[Scenario], Hash[Symbol, untyped]) -> Array[Scenario]
37
+ def self.arrange: (Array[Scenario], Hash[Symbol, untyped]) -> Array[Scenario]
38
+
39
+ # The targets that run, in a shuffled order, what ran before `scenario`
40
+ # in its pass and then `scenario`. A file whose every scenario of the
41
+ # pass is among them is named whole when the run named it whole.
42
+ # : (Array[Scenario], Array[String], Scenario) -> Array[String]
43
+ def self.replay_targets: (Array[Scenario], Array[String], Scenario) -> Array[String]
44
+
45
+ # The seed is mixed before the text and the result after it, so two
46
+ # seeds a step apart give unrelated orders.
47
+ # : (Integer, String) -> Integer
48
+ def self.key: (Integer, String) -> Integer
49
+
50
+ # : (Integer) -> Integer
51
+ def self.mix: (Integer) -> Integer
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,35 @@
1
+ # Generated from lib/nukadoko/parts.rb with RBS::Inline
2
+
3
+ # The `call` fixture: a step runs one of the parts it declares, with args it
4
+ # supplies itself (a call never reads `from`). The part's args and returns
5
+ # are checked as a scenario line's are, and each call lands under `calls` in
6
+ # the calling step's record, nested when a part calls a part of its own.
7
+ module Nukadoko
8
+ module Engine
9
+ class Caller
10
+ # Raised for a call the declaration does not allow, so the step fails
11
+ # as broken rather than as a claim that did not hold.
12
+ class Refused < StandardError
13
+ end
14
+
15
+ attr_reader calls: untyped
16
+
17
+ # : (singleton(Nukadoko::Step), Hash[Symbol, untyped]) -> void
18
+ def initialize: (singleton(Nukadoko::Step), Hash[Symbol, untyped]) -> void
19
+
20
+ # : () -> Proc
21
+ def to_proc: () -> Proc
22
+
23
+ # A refused call starts nothing, so it records nothing. Every other
24
+ # call is recorded in the order it started, with its result or its
25
+ # error, as the TypeScript engine records it.
26
+ # : (singleton(Nukadoko::Step), ?Hash[String | Symbol, untyped], **untyped) -> untyped
27
+ def call: (singleton(Nukadoko::Step), ?Hash[String | Symbol, untyped], **untyped) -> untyped
28
+
29
+ private
30
+
31
+ # : (untyped, Hash[String, untyped], Hash[Symbol, untyped], String) -> untyped
32
+ def run: (untyped, Hash[String, untyped], Hash[Symbol, untyped], String) -> untyped
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,62 @@
1
+ # Generated from lib/nukadoko/pattern.rb with RBS::Inline
2
+
3
+ # A pattern names every capture (`{title:string}`). The names are stripped and
4
+ # the plain expression goes to the official cucumber-expressions gem, so the
5
+ # syntax owner is the same one the TypeScript engine uses.
6
+ module Nukadoko
7
+ module Engine
8
+ class Pattern
9
+ CE: untyped
10
+
11
+ # The built-in parameter types as the JavaScript package defines them.
12
+ # The gem's own differ: its \s takes no Unicode space, so {word} read
13
+ # "a<no-break space>b" as one word, and its float takes no "1." prefix
14
+ # or the lookahead JavaScript's does, so a line bound to one step in
15
+ # one engine and to none in the other. A value is what the JavaScript
16
+ # transformer gives: Number for an integer (a double past 2**53),
17
+ # parseFloat for a float, and the matched text for a bigdecimal.
18
+ class Registry < Cucumber::CucumberExpressions::ParameterTypeRegistry
19
+ INTEGER: untyped
20
+
21
+ FLOAT: ::Regexp
22
+
23
+ WORD: ::Regexp
24
+
25
+ STRING: untyped
26
+
27
+ ANONYMOUS: ::Regexp
28
+
29
+ DECIMAL: ::Regexp
30
+
31
+ # JavaScript's Number of a text of digits.
32
+ # : (String?) -> Numeric?
33
+ def self.number: (String?) -> Numeric?
34
+
35
+ # JavaScript's parseFloat: the longest number at the start, or NaN.
36
+ # : (String?) -> Float?
37
+ def self.parse_float: (String?) -> Float?
38
+
39
+ # : () -> void
40
+ def initialize: () -> void
41
+ end
42
+
43
+ NAMED: ::Regexp
44
+
45
+ REGISTRY: untyped
46
+
47
+ attr_reader source: untyped
48
+
49
+ attr_reader keys: untyped
50
+
51
+ # : (String) -> void
52
+ def initialize: (String) -> void
53
+
54
+ # : (String) -> Hash[String, untyped]?
55
+ def match: (String) -> Hash[String, untyped]?
56
+
57
+ # Each capture's text as the line wrote it, quotes included.
58
+ # : (String) -> Hash[String, String]?
59
+ def texts: (String) -> Hash[String, String]?
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,41 @@
1
+ # Generated from lib/nukadoko/poll.rb with RBS::Inline
2
+
3
+ # `poll timeout_ms: 3000` reads `observe` again, 100 ms apart, until every
4
+ # claim holds on two consecutive readings or the timeout passes. One holding
5
+ # reading is never enough: a page between two renders can show the expected
6
+ # state for one frame. `settled:` names a state that cannot change once
7
+ # reached, so two consecutive settled readings stop the wait for a claim
8
+ # that broke on it. The last reading is what the step judges, and every
9
+ # reading lands in the step record, because an observe that counts its
10
+ # calls could walk toward the expected value.
11
+ module Nukadoko
12
+ module Engine
13
+ class Poll
14
+ INTERVAL: ::Float
15
+
16
+ # `sides` gives the claim inputs of one reading (Claims.judge).
17
+ # : (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], Hash[Symbol, untyped], ?(^(untyped) -> ClaimSides::Inputs)?) -> void
18
+ def initialize: (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], Hash[Symbol, untyped], ?(^(untyped) -> ClaimSides::Inputs)?) -> void
19
+
20
+ # A reading whose observe raised is kept with the first line of the
21
+ # error, and the poll reads again; only a last reading that raised
22
+ # fails the step with that error.
23
+ # : (Hash[Symbol, untyped]) { () -> untyped } -> untyped
24
+ def call: (Hash[Symbol, untyped]) { () -> untyped } -> untyped
25
+
26
+ private
27
+
28
+ # : (Integer) { () -> untyped } -> Hash[Symbol, untyped]
29
+ def read: (Integer) { () -> untyped } -> Hash[Symbol, untyped]
30
+
31
+ # : (untyped, Integer) -> Hash[Symbol, untyped]
32
+ def judge: (untyped, Integer) -> Hash[Symbol, untyped]
33
+
34
+ # : (Array[Hash[Symbol, untyped]]) -> String?
35
+ def stop_for: (Array[Hash[Symbol, untyped]]) -> String?
36
+
37
+ # : () -> Float
38
+ def monotonic: () -> Float
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,101 @@
1
+ # Generated from lib/nukadoko/program.rb with RBS::Inline
2
+
3
+ # How the program under test starts, once per environment: an environment
4
+ # is a world of its own, with its own port, directory, and process, so one
5
+ # environment's state never reaches another's scenarios.
6
+ module Nukadoko
7
+ module Engine
8
+ class Environment < Data
9
+ attr_reader name(): String
10
+
11
+ attr_reader conditions(): Hash[String, untyped]
12
+
13
+ attr_reader env(): Hash[untyped, untyped]
14
+
15
+ attr_reader env_files(): Array[String]
16
+
17
+ def self.new: (String name, Hash[String, untyped] conditions, Hash[untyped, untyped] env, Array[String] env_files) -> instance
18
+ | (name: String, conditions: Hash[String, untyped], env: Hash[untyped, untyped], env_files: Array[String]) -> instance
19
+
20
+ def self.members: () -> [ :name, :conditions, :env, :env_files ]
21
+
22
+ def members: () -> [ :name, :conditions, :env, :env_files ]
23
+ end
24
+
25
+ class Program
26
+ # : (Hash[Symbol, untyped]) -> void
27
+ def initialize: (Hash[Symbol, untyped]) -> void
28
+
29
+ # The worlds a run starts: each --env in the order given; without one,
30
+ # defaultEnvironments in its order, else every environment that
31
+ # declares conditions, else the top level under the name default.
32
+ # default is always a name, whether or not the file defines it.
33
+ # : (?Array[String]) -> Array[Environment]
34
+ def environments: (?Array[String]) -> Array[Environment]
35
+
36
+ # Whether the config gave a program, so each step names its world.
37
+ # : () -> bool
38
+ def file?: () -> bool
39
+
40
+ # : () -> Hash[String, untyped]
41
+ def declared: () -> Hash[String, untyped]
42
+
43
+ # : (String) -> Environment
44
+ def environment: (String) -> Environment
45
+
46
+ # The config's envFiles, then the environment's own: later files win.
47
+ # : (Hash[Symbol, untyped]) -> Array[String]
48
+ def self.env_files: (Hash[Symbol, untyped]) -> Array[String]
49
+
50
+ # : () -> Array[String]
51
+ def default_names: () -> Array[String]
52
+
53
+ # Why a run without --env starts the environments it starts.
54
+ # : () -> String
55
+ def chosen_by: () -> String
56
+
57
+ # : (Environment, String, String) -> World
58
+ def start: (Environment, String, String) -> World
59
+
60
+ private
61
+
62
+ # : (String, Integer?, String, Environment) -> String
63
+ def placeholders: (String, Integer?, String, Environment) -> String
64
+ end
65
+
66
+ # A started program: where it answers, its env, the prefix of every
67
+ # trace id its steps carry, and its log. `timings` gains stop_ms at its stop.
68
+ class World < Data
69
+ attr_reader base_url(): String
70
+
71
+ attr_reader pid(): Integer?
72
+
73
+ attr_reader log(): File?
74
+
75
+ attr_reader env(): Hash[String, String]
76
+
77
+ attr_reader trace_prefix(): String
78
+
79
+ attr_reader log_path(): String?
80
+
81
+ attr_reader commands(): Array[Hash[Symbol, untyped]]
82
+
83
+ attr_reader timings(): Hash[Symbol, Integer]
84
+
85
+ def self.new: (String base_url, Integer? pid, File? log, Hash[String, String] env, String trace_prefix, String? log_path, Array[Hash[Symbol, untyped]] commands, Hash[Symbol, Integer] timings) -> instance
86
+ | (base_url: String, pid: Integer?, log: File?, env: Hash[String, String], trace_prefix: String, log_path: String?, commands: Array[Hash[Symbol, untyped]], timings: Hash[Symbol, Integer]) -> instance
87
+
88
+ def self.members: () -> [ :base_url, :pid, :log, :env, :trace_prefix, :log_path, :commands, :timings ]
89
+
90
+ def members: () -> [ :base_url, :pid, :log, :env, :trace_prefix, :log_path, :commands, :timings ]
91
+ end
92
+
93
+ class World
94
+ # : (String) -> void
95
+ def wait_ready: (String) -> void
96
+
97
+ # : () -> void
98
+ def stop: () -> void
99
+ end
100
+ end
101
+ end
@@ -0,0 +1,19 @@
1
+ # Generated from lib/nukadoko/project_files.rb with RBS::Inline
2
+
3
+ # The names of the files a project keeps nukadoko's settings in, one place
4
+ # for every part of the engine that reads, writes, or names them.
5
+ module Nukadoko
6
+ module Engine
7
+ CONFIG: ::String
8
+
9
+ # The program file of releases before the program moved into the
10
+ # config. A project may no longer hold one; a `--base` ref may.
11
+ LEGACY_PROGRAM: ::String
12
+
13
+ # What a `--base` run writes into a tree for the program it runs:
14
+ # another config whose program the tree runs, or a ref's legacy file.
15
+ TREE_PROGRAM: ::String
16
+
17
+ TREE_LEGACY_PROGRAM: ::String
18
+ end
19
+ end
@@ -0,0 +1,57 @@
1
+ # Generated from lib/nukadoko/project_fixtures.rb with RBS::Inline
2
+
3
+ # Fixtures a project declares in nukadoko.config.rb. A fixture block gets
4
+ # `use` and calls it with the value; whatever follows that call is the
5
+ # teardown, as with Playwright's `use()`. The block runs in a Fiber, so the
6
+ # teardown waits until the scope ends, and runs whether the steps passed.
7
+ #
8
+ # Nukadoko.fixture(:store) { |use| use.(Signup::Store.new) }
9
+ # Nukadoko.fixture(:db, scope: :process) { |use, env:| db = connect(env); use.(db); db.close }
10
+ module Nukadoko
11
+ class Fixture < Data
12
+ attr_reader name(): Symbol
13
+
14
+ attr_reader scope(): Symbol
15
+
16
+ attr_reader block(): Proc
17
+
18
+ def self.new: (Symbol name, Symbol scope, Proc block) -> instance
19
+ | (name: Symbol, scope: Symbol, block: Proc) -> instance
20
+
21
+ def self.members: () -> [ :name, :scope, :block ]
22
+
23
+ def members: () -> [ :name, :scope, :block ]
24
+ end
25
+
26
+ class Fixture
27
+ # : () -> Array[Symbol]
28
+ def dependencies: () -> Array[Symbol]
29
+ end
30
+
31
+ # : (Symbol | String, ?scope: :scenario | :process) { (^(untyped) -> void, **untyped) -> void } -> Fixture
32
+ def self.fixture: (Symbol | String, ?scope: :scenario | :process) { (^(untyped) -> void, **untyped) -> void } -> Fixture
33
+
34
+ # : () -> Hash[Symbol, Fixture]
35
+ def self.project_fixtures: () -> Hash[Symbol, Fixture]
36
+
37
+ module Engine
38
+ # One scope's built fixtures, torn down in reverse build order.
39
+ class FixtureCache
40
+ # : () -> void
41
+ def initialize: () -> void
42
+
43
+ # : (Symbol) -> bool
44
+ def key?: (Symbol) -> bool
45
+
46
+ # : (Symbol) -> untyped
47
+ def []: (Symbol) -> untyped
48
+
49
+ # : (Fixture, Hash[Symbol, untyped]) -> untyped
50
+ def build: (Fixture, Hash[Symbol, untyped]) -> untyped
51
+
52
+ # Every teardown runs; the first failure is raised after the rest.
53
+ # : () -> void
54
+ def teardown: () -> void
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,55 @@
1
+ # Generated from lib/nukadoko/project_program.rb with RBS::Inline
2
+
3
+ # A tree's program under test: the `program` lambda of its
4
+ # nukadoko.config.rb, called once. A config with no program has none, and a
5
+ # run starts no world for it.
6
+ #
7
+ # The program goes with the code and the criteria with the config, so a
8
+ # `nuka run --base` tree can hold one side's config and the other side's
9
+ # program. The run writes that program beside the tree's config: the other
10
+ # side's config as nukadoko.tree-program.rb, or a ref's program file from
11
+ # before the program moved into the config as
12
+ # nukadoko.tree-legacy-program.rb. A project's own program file is refused,
13
+ # with the move to make. Boundary: reading the program; starting it is
14
+ # Program's.
15
+ module Nukadoko
16
+ module Engine
17
+ module ProjectProgram
18
+ LIB: untyped
19
+
20
+ UPGRADING: ::String
21
+
22
+ # The program of the tree at `root`, whose config is already loaded.
23
+ # : (String) -> Hash[Symbol, untyped]
24
+ def self.read: (String) -> Hash[Symbol, untyped]
25
+
26
+ # Nukadoko.program called from the config would describe a program
27
+ # nothing reads, so it is refused rather than left unstarted.
28
+ # : () -> Refusal
29
+ def self.called_in_config: () -> Refusal
30
+
31
+ # : () -> Refusal
32
+ def self.moved: () -> Refusal
33
+
34
+ # What a config's `program` returns, or nil when it has none.
35
+ # : (untyped, String) -> Hash[Symbol, untyped]?
36
+ def self.called: (untyped, String) -> Hash[Symbol, untyped]?
37
+
38
+ # The program `file` gives, read in a process of its own, since
39
+ # loading it here would replace this tree's config and fixtures: a
40
+ # config's program, or the options a legacy file passes to
41
+ # Nukadoko.program. Raises a Refusal naming the file when it does not
42
+ # load.
43
+ # : (String, legacy: bool) -> Hash[Symbol, untyped]?
44
+ def self.elsewhere: (String, legacy: bool) -> Hash[Symbol, untyped]?
45
+
46
+ # The text of a config with its program lambda cut out, so a change to
47
+ # the program alone leaves the config's mapping as it was: the
48
+ # program goes with the code, and a `--base` run compares only what
49
+ # decides how the criteria are read. A config with no program, or
50
+ # with more than one `program:` key, is read whole.
51
+ # : (String) -> String
52
+ def self.mapping_text: (String) -> String
53
+ end
54
+ end
55
+ end