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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +417 -0
- data/README.ja.md +62 -7
- data/README.md +19 -5
- data/exe/nuka +8 -0
- data/lib/nukadoko/aria_snapshot.rb +1008 -0
- data/lib/nukadoko/aria_tree.rb +150 -0
- data/lib/nukadoko/base.rb +294 -0
- data/lib/nukadoko/check.rb +669 -22
- data/lib/nukadoko/claim_check.rb +177 -0
- data/lib/nukadoko/claim_check_run.rb +293 -0
- data/lib/nukadoko/claim_line.rb +381 -0
- data/lib/nukadoko/claim_rules.rb +519 -0
- data/lib/nukadoko/claim_sides.rb +469 -0
- data/lib/nukadoko/claims.rb +576 -37
- data/lib/nukadoko/cli.rb +814 -22
- data/lib/nukadoko/codes.json +947 -0
- data/lib/nukadoko/codes.rb +19 -0
- data/lib/nukadoko/command.rb +214 -12
- data/lib/nukadoko/criteria.rb +172 -0
- data/lib/nukadoko/definition.rb +33 -41
- data/lib/nukadoko/env_check.rb +88 -0
- data/lib/nukadoko/features.rb +80 -10
- data/lib/nukadoko/fixtures.rb +329 -11
- data/lib/nukadoko/http_recording.rb +68 -0
- data/lib/nukadoko/init.rb +129 -0
- data/lib/nukadoko/js_json.rb +274 -0
- data/lib/nukadoko/js_pattern.rb +531 -0
- data/lib/nukadoko/judge.rb +221 -0
- data/lib/nukadoko/judgment_file.rb +78 -0
- data/lib/nukadoko/judgments.rb +256 -0
- data/lib/nukadoko/literal.rb +129 -0
- data/lib/nukadoko/measured.rb +105 -0
- data/lib/nukadoko/order.rb +84 -0
- data/lib/nukadoko/parts.rb +43 -22
- data/lib/nukadoko/pattern.rb +73 -3
- data/lib/nukadoko/poll.rb +21 -8
- data/lib/nukadoko/program.rb +105 -17
- data/lib/nukadoko/project_files.rb +17 -0
- data/lib/nukadoko/project_fixtures.rb +17 -2
- data/lib/nukadoko/project_program.rb +119 -0
- data/lib/nukadoko/report_allure.rb +751 -0
- data/lib/nukadoko/report_messages.rb +167 -0
- data/lib/nukadoko/report_run.rb +169 -0
- data/lib/nukadoko/run.rb +898 -91
- data/lib/nukadoko/run_record.rb +535 -0
- data/lib/nukadoko/scaffold.rb +1015 -0
- data/lib/nukadoko/schema.rb +120 -21
- data/lib/nukadoko/secrets.rb +375 -0
- data/lib/nukadoko/selection.rb +163 -0
- data/lib/nukadoko/signature.rb +4 -1
- data/lib/nukadoko/skill.rb +36 -0
- data/lib/nukadoko/spaces.rb +28 -0
- data/lib/nukadoko/step.rb +68 -21
- data/lib/nukadoko/summary.rb +662 -0
- data/lib/nukadoko/table.rb +34 -2
- data/lib/nukadoko/text_fit.rb +179 -0
- data/lib/nukadoko/trace.rb +244 -0
- data/lib/nukadoko/trace_actions.rb +116 -0
- data/lib/nukadoko/tree_passes.rb +122 -0
- data/lib/nukadoko/verdict.rb +128 -0
- data/lib/nukadoko/version.rb +2 -1
- data/lib/nukadoko/vocabulary.rb +6 -0
- data/lib/nukadoko/walk.rb +305 -0
- data/lib/nukadoko/walk_files.rb +473 -0
- data/lib/nukadoko/walk_step.rb +149 -0
- data/lib/nukadoko.rb +60 -2
- data/llms.txt +297 -0
- data/sig/generated/nukadoko/aria_snapshot.rbs +331 -0
- data/sig/generated/nukadoko/aria_tree.rbs +142 -0
- data/sig/generated/nukadoko/base.rbs +142 -0
- data/sig/generated/nukadoko/check.rbs +255 -0
- data/sig/generated/nukadoko/claim_check.rbs +118 -0
- data/sig/generated/nukadoko/claim_check_run.rbs +88 -0
- data/sig/generated/nukadoko/claim_line.rbs +158 -0
- data/sig/generated/nukadoko/claim_rules.rbs +172 -0
- data/sig/generated/nukadoko/claim_sides.rbs +207 -0
- data/sig/generated/nukadoko/claims.rbs +208 -0
- data/sig/generated/nukadoko/cli.rbs +182 -0
- data/sig/generated/nukadoko/codes.rbs +16 -0
- data/sig/generated/nukadoko/command.rbs +109 -0
- data/sig/generated/nukadoko/criteria.rbs +83 -0
- data/sig/generated/nukadoko/definition.rbs +30 -0
- data/sig/generated/nukadoko/env_check.rbs +34 -0
- data/sig/generated/nukadoko/features.rbs +101 -0
- data/sig/generated/nukadoko/fixtures.rbs +175 -0
- data/sig/generated/nukadoko/http_recording.rbs +29 -0
- data/sig/generated/nukadoko/init.rbs +64 -0
- data/sig/generated/nukadoko/js_json.rbs +109 -0
- data/sig/generated/nukadoko/js_pattern.rbs +194 -0
- data/sig/generated/nukadoko/judge.rbs +64 -0
- data/sig/generated/nukadoko/judgment_file.rbs +39 -0
- data/sig/generated/nukadoko/judgments.rbs +120 -0
- data/sig/generated/nukadoko/literal.rbs +71 -0
- data/sig/generated/nukadoko/measured.rbs +42 -0
- data/sig/generated/nukadoko/order.rbs +54 -0
- data/sig/generated/nukadoko/parts.rbs +35 -0
- data/sig/generated/nukadoko/pattern.rbs +62 -0
- data/sig/generated/nukadoko/poll.rbs +41 -0
- data/sig/generated/nukadoko/program.rbs +101 -0
- data/sig/generated/nukadoko/project_files.rbs +19 -0
- data/sig/generated/nukadoko/project_fixtures.rbs +57 -0
- data/sig/generated/nukadoko/project_program.rbs +55 -0
- data/sig/generated/nukadoko/report_allure.rbs +268 -0
- data/sig/generated/nukadoko/report_messages.rbs +68 -0
- data/sig/generated/nukadoko/report_run.rbs +102 -0
- data/sig/generated/nukadoko/run.rbs +264 -0
- data/sig/generated/nukadoko/run_record.rbs +175 -0
- data/sig/generated/nukadoko/scaffold.rbs +328 -0
- data/sig/generated/nukadoko/schema.rbs +155 -0
- data/sig/generated/nukadoko/secrets.rbs +172 -0
- data/sig/generated/nukadoko/selection.rbs +73 -0
- data/sig/generated/nukadoko/signature.rbs +17 -0
- data/sig/generated/nukadoko/skill.rbs +20 -0
- data/sig/generated/nukadoko/spaces.rbs +31 -0
- data/sig/generated/nukadoko/step.rbs +115 -0
- data/sig/generated/nukadoko/summary.rbs +204 -0
- data/sig/generated/nukadoko/table.rbs +43 -0
- data/sig/generated/nukadoko/text_fit.rbs +70 -0
- data/sig/generated/nukadoko/trace.rbs +127 -0
- data/sig/generated/nukadoko/trace_actions.rbs +40 -0
- data/sig/generated/nukadoko/tree_passes.rbs +48 -0
- data/sig/generated/nukadoko/verdict.rbs +56 -0
- data/sig/generated/nukadoko/version.rbs +5 -0
- data/sig/generated/nukadoko/vocabulary.rbs +25 -0
- data/sig/generated/nukadoko/walk.rbs +139 -0
- data/sig/generated/nukadoko/walk_files.rbs +189 -0
- data/sig/generated/nukadoko/walk_step.rbs +50 -0
- data/sig/generated/nukadoko.rbs +26 -0
- data/sig/nukadoko.rbs +5 -48
- data/skills/nukadoko/SKILL.md +120 -0
- data/skills/nukadoko/references/checking-steps.md +200 -0
- data/skills/nukadoko/references/diagnosing.md +200 -0
- data/skills/nukadoko/references/done.md +99 -0
- data/skills/nukadoko/references/evidence.md +124 -0
- data/skills/nukadoko/references/examples/cli.md +230 -0
- data/skills/nukadoko/references/examples/http-api.md +342 -0
- data/skills/nukadoko/references/examples/workflow.md +173 -0
- data/skills/nukadoko/references/exploring.md +184 -0
- data/skills/nukadoko/references/fixtures.md +198 -0
- data/skills/nukadoko/references/from-prose.md +51 -0
- data/skills/nukadoko/references/judgments.md +95 -0
- data/skills/nukadoko/references/maintenance.md +97 -0
- data/skills/nukadoko/references/merge-risk.md +74 -0
- data/skills/nukadoko/references/parts.md +152 -0
- data/skills/nukadoko/references/perturbed-worlds.md +109 -0
- data/skills/nukadoko/references/program.md +200 -0
- data/skills/nukadoko/references/reviewing.md +200 -0
- data/skills/nukadoko/references/running.md +200 -0
- data/skills/nukadoko/references/scenario-rules.md +188 -0
- data/skills/nukadoko/references/states.md +66 -0
- data/skills/nukadoko/references/step-files.md +200 -0
- data/skills/nukadoko/references/verdicts.md +200 -0
- data/skills/nukadoko/references/writing-steps.md +200 -0
- data/skills/nukadoko/references/writing-the-feature.md +165 -0
- data/skills/nukadoko/scripts/claude-code-verdict-hook.mjs +99 -0
- data/skills/nukadoko/scripts/merge-risk.jq +56 -0
- data/skills/nukadoko-verification/SKILL.md +263 -0
- metadata +133 -1
|
@@ -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 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
|
|
@@ -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,34 @@
|
|
|
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
|
+
# `KEY` counts only as a whole underscore-delimited word, so MONKEY,
|
|
13
|
+
# KEYWORD, and APIKEY are not guessed to be secrets.
|
|
14
|
+
SECRET_LOOKING: ::Regexp
|
|
15
|
+
|
|
16
|
+
# A key in both lists is two opposite instructions, so the config is
|
|
17
|
+
# refused before anything reads it.
|
|
18
|
+
# : () -> void
|
|
19
|
+
def self.validate!: () -> void
|
|
20
|
+
|
|
21
|
+
# : (Symbol) -> Array[String]
|
|
22
|
+
def self.keys: (Symbol) -> Array[String]
|
|
23
|
+
|
|
24
|
+
# : (String) -> Array[Finding]
|
|
25
|
+
def self.findings: (String) -> Array[Finding]
|
|
26
|
+
|
|
27
|
+
# : (String, String, String, ?String?) -> Finding
|
|
28
|
+
def self.warning: (String, String, String, ?String?) -> Finding
|
|
29
|
+
|
|
30
|
+
# : (String, String) -> String?
|
|
31
|
+
def self.readable: (String, String) -> String?
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
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
|