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,83 @@
1
+ # Generated from lib/nukadoko/criteria.rb with RBS::Inline
2
+
3
+ # What one criterion is, and how `nuka run --base <ref>` finds the same
4
+ # criterion at the ref. A criterion is one pickle: a scenario, or one
5
+ # Examples row. Its identity is its feature file and its name. Its content
6
+ # is what a person approved: the steps in order (Background steps first),
7
+ # each with its effective keyword, text, docstring, and table; the
8
+ # Examples row; and the tags that decide where it must hold (condition
9
+ # tags, `@expects:` tags, and `@held`). Other tags and the name are not
10
+ # content, so a scenario renamed or tagged `@smoke` still says what it said,
11
+ # though a hook or a World could read them, so such a criterion keeps its
12
+ # change and is marked `retagged` or `renamed_from`, and runs in the old
13
+ # world as a changed mapping does.
14
+ #
15
+ # Matching follows the TypeScript engine's order: the same identity and
16
+ # content is unchanged; the same content under another identity, where it
17
+ # is the one answer (same file first, then anywhere), is unchanged and
18
+ # renamed; one left over per identity on each side is changed; the rest of
19
+ # head is new and the rest of the ref removed. Taking the first of several
20
+ # candidates would make the answer depend on reading order, so a tie is
21
+ # never paired.
22
+ module Nukadoko
23
+ module Engine
24
+ module Criteria
25
+ class Criterion < Data
26
+ attr_reader feature(): untyped
27
+
28
+ attr_reader line(): untyped
29
+
30
+ attr_reader name(): untyped
31
+
32
+ attr_reader content(): untyped
33
+
34
+ attr_reader tags(): untyped
35
+
36
+ attr_reader all_tags(): untyped
37
+
38
+ attr_reader lines(): untyped
39
+
40
+ def self.new: (untyped feature, untyped line, untyped name, untyped content, untyped tags, untyped all_tags, untyped lines) -> instance
41
+ | (feature: untyped, line: untyped, name: untyped, content: untyped, tags: untyped, all_tags: untyped, lines: untyped) -> instance
42
+
43
+ def self.members: () -> [ :feature, :line, :name, :content, :tags, :all_tags, :lines ]
44
+
45
+ def members: () -> [ :feature, :line, :name, :content, :tags, :all_tags, :lines ]
46
+ end
47
+
48
+ HELD: ::String
49
+
50
+ # : (Array[String]) -> Array[String]
51
+ def self?.content_tags: (Array[String]) -> Array[String]
52
+
53
+ # The criteria of each feature file under `root` that `paths` names,
54
+ # relative to it. A file that does not parse is returned apart, with
55
+ # why, since its criteria cannot be compared.
56
+ # : (String, Array[String]) -> [Array[Criterion], Array[Hash[Symbol, untyped]]]
57
+ def self?.of_files: (String, Array[String]) -> [ Array[Criterion], Array[Hash[Symbol, untyped]] ]
58
+
59
+ # : (String, untyped, Array[untyped]) -> Array[Criterion]
60
+ def self?.of_feature: (String, untyped, Array[untyped]) -> Array[Criterion]
61
+
62
+ # : (untyped) -> Hash[String, Hash[Symbol, untyped]]
63
+ def self?.places_of: (untyped) -> Hash[String, Hash[Symbol, untyped]]
64
+
65
+ # : (untyped) -> String
66
+ def self?.row_line: (untyped) -> String
67
+
68
+ # : (untyped) -> Array[String]
69
+ def self?.step_lines: (untyped) -> Array[String]
70
+
71
+ # : (Criterion) -> [untyped, untyped]
72
+ def self?.identity: (Criterion) -> [ untyped, untyped ]
73
+
74
+ # : (String, Integer) -> [String, Integer]
75
+ def self?.key: (String, Integer) -> [ String, Integer ]
76
+
77
+ # Each head criterion's change, by `key`, and the ref's criteria that
78
+ # head no longer has.
79
+ # : (Array[Criterion], Array[Criterion]) -> Hash[Symbol, untyped]
80
+ def self?.compare: (Array[Criterion], Array[Criterion]) -> Hash[Symbol, untyped]
81
+ end
82
+ end
83
+ end
@@ -0,0 +1,30 @@
1
+ # Generated from lib/nukadoko/definition.rb with RBS::Inline
2
+
3
+ # What the TypeScript engine's defineStep refuses when a step file loads:
4
+ # a claim or a poll that could only be judged one way, or that would let a
5
+ # line fill the value a claim measures. The Ruby engine reads the same
6
+ # declarations after loading, and check reports the first as the
7
+ # TypeScript engine does, as step-file-import-failed, so the step leaves
8
+ # the vocabulary.
9
+ module Nukadoko
10
+ module Engine
11
+ class Definition
12
+ # setTimeout's own limit, which a poll's timeout cannot pass.
13
+ MAX_TIMEOUT_MS: ::Integer
14
+
15
+ # : (singleton(Step)) -> void
16
+ def initialize: (singleton(Step)) -> void
17
+
18
+ # : () -> Array[String]
19
+ def problems: () -> Array[String]
20
+
21
+ private
22
+
23
+ # : () -> ClaimRules::Shape
24
+ def shape: () -> ClaimRules::Shape
25
+
26
+ # : () -> String?
27
+ def poll_problem: () -> String?
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,38 @@
1
+ # Generated from lib/nukadoko/env_check.rb with RBS::Inline
2
+
3
+ # What `nuka check` says about the env files the config and the program
4
+ # name, as the TypeScript engine says it. A missing file is a warning, since
5
+ # a run reads it as empty; a line that loads nothing, and a `secrets` key
6
+ # that reaches nothing, are warnings too. None of it prints a value: the
7
+ # files hold secrets. The one guess here, whether a key's name looks like a
8
+ # secret, decides only a warning and never what is redacted.
9
+ module Nukadoko
10
+ module Engine
11
+ module EnvCheck
12
+ CONFIG: ::String
13
+
14
+ PROGRAM: ::String
15
+
16
+ # `KEY` counts only as a whole underscore-delimited word, so MONKEY,
17
+ # KEYWORD, and APIKEY are not guessed to be secrets.
18
+ SECRET_LOOKING: ::Regexp
19
+
20
+ # A key in both lists is two opposite instructions, so the config is
21
+ # refused before anything reads it.
22
+ # : () -> void
23
+ def self.validate!: () -> void
24
+
25
+ # : (Symbol) -> Array[String]
26
+ def self.keys: (Symbol) -> Array[String]
27
+
28
+ # : (String) -> Array[Finding]
29
+ def self.findings: (String) -> Array[Finding]
30
+
31
+ # : (String, String, String, ?String?) -> Finding
32
+ def self.warning: (String, String, String, ?String?) -> Finding
33
+
34
+ # : (String, String) -> String?
35
+ def self.readable: (String, String) -> String?
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,101 @@
1
+ # Generated from lib/nukadoko/features.rb with RBS::Inline
2
+
3
+ # Feature files become pickles through the official gherkin gem. A pickle
4
+ # from an outline is named by its Examples row's line, and its steps by the
5
+ # outline's step lines, as the TypeScript engine names them.
6
+ module Nukadoko
7
+ module Engine
8
+ # `keyword_line` is the Scenario keyword's own line, the same for every
9
+ # row of an outline, and `outline_name` the name as written, before a
10
+ # row fills it. A step from a Background has `background` set.
11
+ class Scenario < Data
12
+ attr_reader uri(): untyped
13
+
14
+ attr_reader line(): untyped
15
+
16
+ attr_reader keyword_line(): untyped
17
+
18
+ attr_reader name(): untyped
19
+
20
+ attr_reader tags(): untyped
21
+
22
+ attr_reader steps(): untyped
23
+
24
+ attr_reader tag_lines(): untyped
25
+
26
+ attr_reader columns(): untyped
27
+
28
+ attr_reader outline_name(): untyped
29
+
30
+ attr_reader serial(): untyped
31
+
32
+ def self.new: (untyped uri, untyped line, untyped keyword_line, untyped name, untyped tags, untyped steps, untyped tag_lines, untyped columns, untyped outline_name, untyped serial) -> instance
33
+ | (uri: untyped, line: untyped, keyword_line: untyped, name: untyped, tags: untyped, steps: untyped, tag_lines: untyped, columns: untyped, outline_name: untyped, serial: untyped) -> instance
34
+
35
+ def self.members: () -> [ :uri, :line, :keyword_line, :name, :tags, :steps, :tag_lines, :columns, :outline_name, :serial ]
36
+
37
+ def members: () -> [ :uri, :line, :keyword_line, :name, :tags, :steps, :tag_lines, :columns, :outline_name, :serial ]
38
+ end
39
+
40
+ class PickleStep < Data
41
+ attr_reader text(): untyped
42
+
43
+ attr_reader line(): untyped
44
+
45
+ attr_reader kind(): untyped
46
+
47
+ attr_reader table(): untyped
48
+
49
+ attr_reader doc_string(): untyped
50
+
51
+ attr_reader background(): untyped
52
+
53
+ def self.new: (untyped text, untyped line, untyped kind, untyped table, untyped doc_string, untyped background) -> instance
54
+ | (text: untyped, line: untyped, kind: untyped, table: untyped, doc_string: untyped, background: untyped) -> instance
55
+
56
+ def self.members: () -> [ :text, :line, :kind, :table, :doc_string, :background ]
57
+
58
+ def members: () -> [ :text, :line, :kind, :table, :doc_string, :background ]
59
+ end
60
+
61
+ # What makes a file, or a part of one, run nothing: a file that does
62
+ # not parse, or an outline with no row to run. `line` is nil for a file.
63
+ class FeatureProblem < Data
64
+ attr_reader code(): untyped
65
+
66
+ attr_reader uri(): untyped
67
+
68
+ attr_reader line(): untyped
69
+
70
+ attr_reader message(): untyped
71
+
72
+ def self.new: (untyped code, untyped uri, untyped line, untyped message) -> instance
73
+ | (code: untyped, uri: untyped, line: untyped, message: untyped) -> instance
74
+
75
+ def self.members: () -> [ :code, :uri, :line, :message ]
76
+
77
+ def members: () -> [ :code, :uri, :line, :message ]
78
+ end
79
+
80
+ # A directory is every .feature file under it; a list is those files.
81
+ # What runs nothing goes into `problems`, for nuka check to report.
82
+ # : (String | Array[String], ?problems: Array[FeatureProblem]) -> Array[Scenario]
83
+ def self.load_features: (String | Array[String], ?problems: Array[FeatureProblem]) -> Array[Scenario]
84
+
85
+ # The tag on a Feature line that runs the file while no other file runs.
86
+ SERIAL_TAG: ::String
87
+
88
+ # nuka run --concurrency reads the serial tag on the Feature line only,
89
+ # so on a scenario it would read as a rule in force while doing nothing.
90
+ # : (untyped) -> Array[FeatureProblem]
91
+ def self.serial_tags_on_scenarios: (untyped) -> Array[FeatureProblem]
92
+
93
+ # An outline with no Examples runs its placeholder text as written, and
94
+ # an Examples table with no rows leaves the outline out of the run.
95
+ # : (untyped) -> Array[FeatureProblem]
96
+ def self.outlines_that_do_not_run: (untyped) -> Array[FeatureProblem]
97
+
98
+ # : (untyped, Hash[String, Integer], Hash[String, bool], Hash[String, Array[String]], Hash[String, String]) -> void
99
+ def self.collect_lines: (untyped, Hash[String, Integer], Hash[String, bool], Hash[String, Array[String]], Hash[String, String]) -> void
100
+ end
101
+ end
@@ -0,0 +1,152 @@
1
+ # Generated from lib/nukadoko/fixtures.rb with RBS::Inline
2
+
3
+ # Fixtures are built by the engine, not the step, so what they record is
4
+ # measured: every request a step sends goes through Request and lands in the
5
+ # step's http.jsonl as it was sent and answered.
6
+ module Nukadoko
7
+ module Engine
8
+ class Response < Data
9
+ attr_reader status(): Integer
10
+
11
+ attr_reader headers(): Hash[String, Array[String]]
12
+
13
+ attr_reader body(): String
14
+
15
+ def self.new: (Integer status, Hash[String, Array[String]] headers, String body) -> instance
16
+ | (status: Integer, headers: Hash[String, Array[String]], body: String) -> instance
17
+
18
+ def self.members: () -> [ :status, :headers, :body ]
19
+
20
+ def members: () -> [ :status, :headers, :body ]
21
+ end
22
+
23
+ class Response
24
+ # : () -> untyped
25
+ def json: () -> untyped
26
+
27
+ # : () -> bool
28
+ def ok?: () -> bool
29
+ end
30
+
31
+ class Request
32
+ attr_reader log: Array[Hash[Symbol, untyped]]
33
+
34
+ # : (String) -> void
35
+ def initialize: (String) -> void
36
+
37
+ BODY_TEXT: untyped
38
+
39
+ # : (Float) -> Integer
40
+ def self.since: (Float) -> Integer
41
+
42
+ # A body as http.jsonl keeps it: its text, at most 16 KiB, and its
43
+ # size; none when there was none.
44
+ # : (Symbol, String?) -> Hash[Symbol, untyped]
45
+ def self.body: (Symbol, String?) -> Hash[Symbol, untyped]
46
+ end
47
+
48
+ # Opened only for a step whose body names page or context, as in the
49
+ # TypeScript engine. Requests the page sends are recorded by the engine's
50
+ # own listener, and each step gets a trace chunk.
51
+ class Browser
52
+ # : (String?, ?Hash[Symbol, untyped]) -> void
53
+ def initialize: (String?, ?Hash[Symbol, untyped]) -> void
54
+
55
+ # : (String, Array[Hash[Symbol, untyped]]) -> [untyped, ^() -> void]
56
+ def page_for: (String, Array[Hash[Symbol, untyped]]) -> [ untyped, ^() -> void ]
57
+
58
+ STAMPED_TYPES: untyped
59
+
60
+ ORDERED_KINDS: untyped
61
+
62
+ # The step that runs now, as a page request names it: set for every
63
+ # step, a page or not, so a request a page sends during a step is
64
+ # that step's.
65
+ attr_writer step: Hash[Symbol, untyped]?
66
+
67
+ # Which requests to the world the page had finished receiving the
68
+ # response of, and which were in flight, around a claim step's
69
+ # reading: an order of the events this process received, never a
70
+ # claim that the page drew from a response. Only a document, a
71
+ # fetch, and an XMLHttpRequest count; an EventSource stays open, so
72
+ # it would be in flight on every reading.
73
+ # : (untyped) -> void
74
+ def watch_requests: (untyped) -> void
75
+
76
+ # Runs one reading of a claim step and keeps when it began and ended.
77
+ # : [T] () { () -> T } -> T
78
+ def reading: [T] () { () -> T } -> T
79
+
80
+ # : () -> nil
81
+ def begin_step: () -> nil
82
+
83
+ # A claim step's `pages`, `page_requests`, and `judged_view`, after
84
+ # the reading its claims were judged on, when a page was open.
85
+ # : (String, String, ?aria_in_claims: bool) -> Hash[Symbol, untyped]
86
+ def judged: (String, String, ?aria_in_claims: bool) -> Hash[Symbol, untyped]
87
+
88
+ # : (Hash[Symbol, untyped], String) -> Hash[Symbol, untyped]
89
+ def request_record: (Hash[Symbol, untyped], String) -> Hash[Symbol, untyped]
90
+
91
+ # What the page showed right after the judged reading: its title, a
92
+ # viewport screenshot, and its ARIA snapshot, each with how long after
93
+ # the reading it was taken. The claims judged what observe returned,
94
+ # not these files.
95
+ # In a trace group of its own, so the step's actions leave these calls out.
96
+ # : (String, Float, bool) -> Hash[Symbol, untyped]
97
+ def view: (String, Float, bool) -> Hash[Symbol, untyped]
98
+
99
+ # A step whose claims judge a tree nukadoko took keeps that tree in its
100
+ # claims, so the view takes no second one.
101
+ # : (String, Float, bool) -> Hash[Symbol, untyped]
102
+ def view_files: (String, Float, bool) -> Hash[Symbol, untyped]
103
+
104
+ # : () -> Float
105
+ def monotonic: () -> Float
106
+
107
+ # A page's documents, fetches, and XMLHttpRequests to the world get
108
+ # the running step's traceparent through the Chrome DevTools
109
+ # Protocol's Fetch domain, on a session of the page's own: a header set
110
+ # on the whole context would reach other origins too, and a route
111
+ # turns the browser's cache off. Images, scripts, and stylesheets are
112
+ # left out, since each paused request costs a round trip. A session
113
+ # that cannot be opened leaves the page's requests unstamped.
114
+ # : (untyped) -> void
115
+ def stamp: (untyped) -> void
116
+
117
+ # How long a pause waits for each capture of the page's view. A page
118
+ # whose main thread is stuck answers none of them, and without a
119
+ # deadline the pause would never reach the person.
120
+ VIEW_TIMEOUT_MS: ::Integer
121
+
122
+ # What `nuka run --step` shows at a pause, taken while the run waits:
123
+ # a viewport screenshot and an ARIA snapshot of the open page, named
124
+ # under `recorded_as` as run.json names them. From now until
125
+ # `release`, the requests the page sends go to the pause's own
126
+ # http.jsonl, never to the step's record. `[]` when no page is open.
127
+ # : (String, String) -> Array[Hash[Symbol, untyped]]
128
+ def hold: (String, String) -> Array[Hash[Symbol, untyped]]
129
+
130
+ # The pause is answered: the page's requests are the next step's again.
131
+ # : () -> void
132
+ def release: () -> void
133
+
134
+ # Each scenario gets a browser context of its own, so cookies and storage
135
+ # never carry from one scenario to the next.
136
+ # The browser the scenario opened a page in, as run.json names it, or
137
+ # nil when it opened none.
138
+ # : () -> Hash[Symbol, untyped]?
139
+ def scenario_browser: () -> Hash[Symbol, untyped]?
140
+
141
+ # Closes the scenario's context, and returns the screenshot of its
142
+ # page as the scenario ended, `final.png` in `dir`, when it opened
143
+ # one. A page a failed step left unusable has none, and that costs
144
+ # the screenshot only.
145
+ # : (?String?) -> Array[Hash[Symbol, untyped]]
146
+ def end_scenario: (?String?) -> Array[Hash[Symbol, untyped]]
147
+
148
+ # : () -> void
149
+ def close: () -> void
150
+ end
151
+ end
152
+ end
@@ -0,0 +1,29 @@
1
+ # Generated from lib/nukadoko/http_recording.rb with RBS::Inline
2
+
3
+ # Requests a step sends through Net::HTTP itself, without the `request`
4
+ # fixture, measured as the TypeScript engine measures a step's own `fetch`:
5
+ # each lands in the step's http.jsonl with `via: "net/http"`, and one to
6
+ # the world's origin carries the step's traceparent. It records only while
7
+ # a step runs, on the thread that runs it, so a fixture's setup, the
8
+ # engine's own readiness check, and the `request` fixture (which records
9
+ # its requests itself) go through Net::HTTP untouched.
10
+ module Nukadoko
11
+ module Engine
12
+ module HttpRecording
13
+ # : [T] (Array[untyped]) { () -> T } -> T
14
+ def self.collect: [T] (Array[untyped]) { () -> T } -> T
15
+
16
+ # Net::HTTP as the engine's own code calls it, recording nothing.
17
+ # : [T] () { () -> T } -> T
18
+ def self.unrecorded: [T] () { () -> T } -> T
19
+
20
+ # Prepended to Net::HTTP. `request` calls itself once more when the
21
+ # connection was not started, so only the outermost call records.
22
+ # @rbs module-self Net::HTTP
23
+ module Patch : Net::HTTP
24
+ # : (Net::HTTPGenericRequest, ?String?) ?{ (Net::HTTPResponse) -> void } -> Net::HTTPResponse
25
+ def request: (Net::HTTPGenericRequest, ?String?) ?{ (Net::HTTPResponse) -> void } -> Net::HTTPResponse
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,66 @@
1
+ # Generated from lib/nukadoko/init.rb with RBS::Inline
2
+
3
+ # `nuka init`: the config file, the steps directory, and the .gitignore
4
+ # entries, in the TypeScript engine's order and words. A config file
5
+ # already there refuses the whole command before anything is written, so a
6
+ # half-done init never looks like a finished one. It ends with a
7
+ # self-check that loads the config and the steps as `nuka steps` does; a
8
+ # failure there is reported and the files stay, so what init wrote can be
9
+ # looked at and fixed.
10
+ #
11
+ # The TypeScript engine also adds a package.json script and tsconfig
12
+ # entries. A Ruby project's one command for people and CI is a rake task,
13
+ # so a Rakefile with no `scenarios` task gets one that runs `nuka run`; a
14
+ # project with no Rakefile gets none, since a Rakefile written only for
15
+ # this would be a second place to look. The Gemfile is read too: one that
16
+ # does not name nukadoko gets a line on stderr.
17
+ module Nukadoko
18
+ module Engine
19
+ class Init
20
+ CONFIG: ::String
21
+
22
+ STEPS: untyped
23
+
24
+ # `.env` files are ignored since a committed one is configuration, not
25
+ # a secret source; `!.env.example` must follow `.env.*` to re-include it.
26
+ IGNORED: untyped
27
+
28
+ # The gem's copy is staged at release; a checkout has only the root's.
29
+ STAGED_LLMS: untyped
30
+
31
+ LLMS: untyped
32
+
33
+ # The gem ships no docs/, so the config file points at the spec online.
34
+ SPEC: ::String
35
+
36
+ TASK: ::String
37
+
38
+ # : (String, out: IO, err: IO) -> void
39
+ def initialize: (String, out: IO, err: IO) -> void
40
+
41
+ # The exit code, or a Refusal when a config file exists.
42
+ # : () -> (Integer | Refusal)
43
+ def call: () -> (Integer | Refusal)
44
+
45
+ private
46
+
47
+ # Appends each entry no line already ignores; true when it wrote.
48
+ # : () -> bool
49
+ def ignore_entries: () -> bool
50
+
51
+ # Appends the `scenarios` task to a Rakefile that has none; true when it wrote.
52
+ # : () -> bool
53
+ def scenarios_task: () -> bool
54
+
55
+ # A root directory entry is also ignored by `/name`, `name`, or `name/**`.
56
+ # : (String, String) -> bool
57
+ def covers?: (String, String) -> bool
58
+
59
+ # : () -> void
60
+ def gemfile_note: () -> void
61
+
62
+ # : () -> Integer
63
+ def self_check: () -> Integer
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,64 @@
1
+ # Generated from lib/nukadoko/judge.rb with RBS::Inline
2
+
3
+ # `nuka judge <file>:<line>`, the one way a judgment gets into a judgment
4
+ # file (docs/spec.md "Judgments"). Without a verdict flag it shows what the
5
+ # criterion asks a judge: each value its Then read, the quality the
6
+ # sentence names, and where the record keeps the value. With `--meets` or
7
+ # `--misses`, `--by`, and `--because` it records one judgment of each.
8
+ #
9
+ # It checks what a machine can, and only that: the run judged this
10
+ # criterion, its required head cells passed, each value is in a channel
11
+ # nukadoko recorded, and the value the step record holds has the digest
12
+ # run.json recorded, so a judgment can only cite a value a run wrote down.
13
+ # It never checks the judgment, nor who made it: `--by` is a name, and the
14
+ # commit that adds the file, with its review, is the record of who judged.
15
+ # It shows and records; it never runs.
16
+ module Nukadoko
17
+ class CLI
18
+ class Judge
19
+ RUNS: untyped
20
+
21
+ # : (String, Array[String], Hash[String, Array[String]], json: bool, out: IO) -> void
22
+ def initialize: (String, Array[String], Hash[String, Array[String]], json: bool, out: IO) -> void
23
+
24
+ # : () -> Integer
25
+ def call: () -> Integer
26
+
27
+ private
28
+
29
+ # : (String) -> Hash[Symbol, untyped]?
30
+ def parse_target: (String) -> Hash[Symbol, untyped]?
31
+
32
+ # The run a name names (its id or its directory), or the newest run
33
+ # that ended.
34
+ # : (String?) -> Hash[Symbol, untyped]?
35
+ def run_named: (String?) -> Hash[Symbol, untyped]?
36
+
37
+ # : (Hash[Symbol, untyped]?, String, Hash[Symbol, untyped], Array[untyped]) -> String?
38
+ def unjudgeable: (Hash[Symbol, untyped]?, String, Hash[Symbol, untyped], Array[untyped]) -> String?
39
+
40
+ # Why the value a step record holds for a read is not the one run.json
41
+ # recorded, or nil when the two agree.
42
+ # : (Hash[Symbol, untyped], untyped) -> String?
43
+ def record_disagrees: (Hash[Symbol, untyped], untyped) -> String?
44
+
45
+ # : (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> Array[String]
46
+ def seen_of: (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> Array[String]
47
+
48
+ # : (untyped) -> Array[String]
49
+ def value_block: (untyped) -> Array[String]
50
+
51
+ # : (String, Hash[Symbol, untyped], Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], Hash[Symbol, untyped]) -> Integer
52
+ def show: (String, Hash[Symbol, untyped], Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], Hash[Symbol, untyped]) -> Integer
53
+
54
+ # : (String, Hash[Symbol, untyped], Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], String, String) -> Integer
55
+ def record: (String, Hash[Symbol, untyped], Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], String, String) -> Integer
56
+
57
+ # : (Hash[Symbol, untyped]) -> Integer
58
+ def emit: (Hash[Symbol, untyped]) -> Integer
59
+
60
+ # : (String, ?fix: String?, ?run: String?) -> Integer
61
+ def refused: (String, ?fix: String?, ?run: String?) -> Integer
62
+ end
63
+ end
64
+ end
@@ -0,0 +1,39 @@
1
+ # Generated from lib/nukadoko/judgment_file.rb with RBS::Inline
2
+
3
+ # Where the judgments of a feature file live, reading and writing them,
4
+ # and, under `--base`, which of them changed since the ref (docs/spec.md
5
+ # "Judgments"). What an entry means is lib/nukadoko/judgments.rb's.
6
+ #
7
+ # The files sit in `judgments/` at the project root, one per feature file
8
+ # at the same relative path with `.json` added, outside the features
9
+ # directory on purpose: there every file is mapping, so a judgment added
10
+ # would make `--base` run each unchanged criterion again in the old world,
11
+ # when a judgment changes no step. Nor do they live in the run directory,
12
+ # which retention removes and nobody reviews: a judgment is committed, and
13
+ # the commit and its review are the record of who judged.
14
+ module Nukadoko
15
+ module Engine
16
+ module JudgmentFile
17
+ DIR: ::String
18
+
19
+ # : (String) -> String
20
+ def self?.of: (String) -> String
21
+
22
+ # What a feature's judgment file holds: its entries, none when there
23
+ # is no file, or why it could not be read.
24
+ # : (String, String) -> Hash[Symbol, untyped]
25
+ def self?.read: (String, String) -> Hash[Symbol, untyped]
26
+
27
+ # Writes a feature's judgment file whole, and returns its path
28
+ # relative to the project root.
29
+ # : (String, String, Array[Hash[Symbol, untyped]]) -> String
30
+ def self?.write: (String, String, Array[Hash[Symbol, untyped]]) -> String
31
+
32
+ # Each judgment file the working tree and `commit` hold with other
33
+ # text, or one holds and the other does not, relative to the project
34
+ # root and sorted. nil when git does not answer.
35
+ # : (String, String) -> Array[String]?
36
+ def self?.changed: (String, String) -> Array[String]?
37
+ end
38
+ end
39
+ end