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,73 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/selection.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# Which scenarios a run executes: the targets on the command line (feature
|
|
4
|
+
# files, `file:line` selections, directories) narrowed by `--tag`. A target
|
|
5
|
+
# that names nothing runnable is refused before anything runs, with the
|
|
6
|
+
# TypeScript engine's code for the same mistake, so a run never quietly
|
|
7
|
+
# does less than its command line asked for.
|
|
8
|
+
module Nukadoko
|
|
9
|
+
module Engine
|
|
10
|
+
class Refusal < StandardError
|
|
11
|
+
attr_reader code: String
|
|
12
|
+
|
|
13
|
+
attr_reader severity: String
|
|
14
|
+
|
|
15
|
+
# `fix` and `run` are this refusal's own way past it; without either,
|
|
16
|
+
# the code's registry fix and the command's --help stand in.
|
|
17
|
+
# : (String, String, ?severity: String, ?fix: String?, ?run: String?) -> void
|
|
18
|
+
def initialize: (String, String, ?severity: String, ?fix: String?, ?run: String?) -> void
|
|
19
|
+
|
|
20
|
+
# A refusal stops before anything runs (exit 2); a selection that kept
|
|
21
|
+
# no scenario ran and found nothing to do (exit 1).
|
|
22
|
+
# : () -> Integer
|
|
23
|
+
def exit_code: () -> Integer
|
|
24
|
+
|
|
25
|
+
# : (?String) -> Hash[Symbol, untyped]
|
|
26
|
+
def to_h: (?String) -> Hash[Symbol, untyped]
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class Selection
|
|
30
|
+
TAG: ::Regexp
|
|
31
|
+
|
|
32
|
+
# `whole_files` are the files a target named whole and --tag left
|
|
33
|
+
# whole, which a rerun line may name as a file.
|
|
34
|
+
attr_reader scenarios: Array[Scenario]
|
|
35
|
+
|
|
36
|
+
attr_reader selection: String
|
|
37
|
+
|
|
38
|
+
attr_reader tag_selection: Hash[Symbol, untyped]?
|
|
39
|
+
|
|
40
|
+
attr_reader whole_files: Array[String]
|
|
41
|
+
|
|
42
|
+
attr_reader problems: Array[FeatureProblem]
|
|
43
|
+
|
|
44
|
+
# : (String, Array[String], Array[String], ?features_dir: String) -> void
|
|
45
|
+
def initialize: (String, Array[String], Array[String], ?features_dir: String) -> void
|
|
46
|
+
|
|
47
|
+
SHELL_SAFE: ::Regexp
|
|
48
|
+
|
|
49
|
+
# A word as a POSIX shell reads it back: as it is when it holds no
|
|
50
|
+
# character the shell treats apart, otherwise in single quotes.
|
|
51
|
+
# : (String) -> String
|
|
52
|
+
def self.shell_word: (String) -> String
|
|
53
|
+
|
|
54
|
+
private
|
|
55
|
+
|
|
56
|
+
# : (String) -> [bool, String]
|
|
57
|
+
def parse_tag: (String) -> [ bool, String ]
|
|
58
|
+
|
|
59
|
+
# : (String, Array[String], Hash[String, Array[Integer]]) -> void
|
|
60
|
+
def add: (String, Array[String], Hash[String, Array[Integer]]) -> void
|
|
61
|
+
|
|
62
|
+
# Every .feature file below dir, skipping node_modules and any directory
|
|
63
|
+
# whose name starts with a dot, as step discovery skips them.
|
|
64
|
+
# : (String) -> Array[String]
|
|
65
|
+
def walk: (String) -> Array[String]
|
|
66
|
+
|
|
67
|
+
# Two spellings of one file are one file: a target is named by its real
|
|
68
|
+
# path relative to the project, so it is selected once.
|
|
69
|
+
# : (String) -> String
|
|
70
|
+
def relative: (String) -> String
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/signature.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# The RBS of each step, written from the same declarations check reads, so a
|
|
4
|
+
# project that runs Steep gets the body checked against its own contract:
|
|
5
|
+
# args it does not declare, a return value of the wrong shape, and, in a
|
|
6
|
+
# Then step, an args key the claim keeps from observe.
|
|
7
|
+
module Nukadoko
|
|
8
|
+
module Signature
|
|
9
|
+
FIXTURE_TYPES: untyped
|
|
10
|
+
|
|
11
|
+
# : (Array[singleton(Nukadoko::Step)]) -> String
|
|
12
|
+
def self.of: (Array[singleton(Nukadoko::Step)]) -> String
|
|
13
|
+
|
|
14
|
+
# : (singleton(Nukadoko::Step)) -> String
|
|
15
|
+
def self.of_step: (singleton(Nukadoko::Step)) -> String
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/skill.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# `nuka skill path`: the directory that holds every agent skill this gem
|
|
4
|
+
# ships, one absolute path, as the TypeScript engine prints its own. It is
|
|
5
|
+
# a fact about the installed nukadoko, the one route sure to match the
|
|
6
|
+
# version installed; copying a skill into an agent's own layout is what
|
|
7
|
+
# `gh skill install` and the agent's plugin marketplace already do.
|
|
8
|
+
#
|
|
9
|
+
# The gem ships the skills beside lib/ (bin/stage-shared copies them in
|
|
10
|
+
# before `gem build`). A checkout that has not staged them reads the
|
|
11
|
+
# repository root's, which are the same files.
|
|
12
|
+
module Nukadoko
|
|
13
|
+
module Skill
|
|
14
|
+
# : () -> String
|
|
15
|
+
def self?.dir: () -> String
|
|
16
|
+
|
|
17
|
+
# : (IO, IO) -> Integer
|
|
18
|
+
def self?.print_path: (IO, IO) -> Integer
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/spaces.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# Responsibility: the spaces JavaScript's trim, trimEnd, and \s take, so a
|
|
4
|
+
# text the Ruby engine trims ends where the TypeScript engine's does.
|
|
5
|
+
# Ruby's strip takes a NUL and no Unicode space, and [[:space:]] takes
|
|
6
|
+
# U+0085, which JavaScript keeps; a page's text often ends in a no-break
|
|
7
|
+
# space, so either would judge a claim the other way.
|
|
8
|
+
module Nukadoko
|
|
9
|
+
module Engine
|
|
10
|
+
module Spaces
|
|
11
|
+
CLASS: ::String
|
|
12
|
+
|
|
13
|
+
SPACE: ::Regexp
|
|
14
|
+
|
|
15
|
+
LEADING: ::Regexp
|
|
16
|
+
|
|
17
|
+
TRAILING: ::Regexp
|
|
18
|
+
|
|
19
|
+
BLANK: ::Regexp
|
|
20
|
+
|
|
21
|
+
# : (String) -> String
|
|
22
|
+
def self.trim: (String) -> String
|
|
23
|
+
|
|
24
|
+
# : (String) -> String
|
|
25
|
+
def self.trim_end: (String) -> String
|
|
26
|
+
|
|
27
|
+
# : (String) -> bool
|
|
28
|
+
def self.blank?: (String) -> bool
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/step.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# A step is a class under features/steps/, one per file, named by its file.
|
|
4
|
+
# Everything except the body is a class-level declaration, so check reads the
|
|
5
|
+
# contract without calling the body, and `Method#parameters` names the
|
|
6
|
+
# fixtures the body asks for.
|
|
7
|
+
module Nukadoko
|
|
8
|
+
class Step
|
|
9
|
+
# : () -> String
|
|
10
|
+
def self.file: () -> String
|
|
11
|
+
|
|
12
|
+
# : (singleton(Step)) -> void
|
|
13
|
+
def self.inherited: (singleton(Step)) -> void
|
|
14
|
+
|
|
15
|
+
# : () -> Array[singleton(Step)]
|
|
16
|
+
def self.registry: () -> Array[singleton(Step)]
|
|
17
|
+
|
|
18
|
+
# : (String) -> String
|
|
19
|
+
# : () -> String?
|
|
20
|
+
def self.pattern: (String) -> String
|
|
21
|
+
| () -> String?
|
|
22
|
+
|
|
23
|
+
# : (String) -> String
|
|
24
|
+
# : () -> String?
|
|
25
|
+
def self.description: (String) -> String
|
|
26
|
+
| () -> String?
|
|
27
|
+
|
|
28
|
+
# : (bool) -> bool
|
|
29
|
+
# : () -> bool?
|
|
30
|
+
def self.mutates: (bool) -> bool
|
|
31
|
+
| () -> bool?
|
|
32
|
+
|
|
33
|
+
# : (Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
34
|
+
# : () -> Array[Hash[Symbol, untyped]]?
|
|
35
|
+
def self.claims: (Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
36
|
+
| () -> Array[Hash[Symbol, untyped]]?
|
|
37
|
+
|
|
38
|
+
# : (untyped) -> untyped
|
|
39
|
+
# : () -> untyped
|
|
40
|
+
def self.poll: (untyped) -> untyped
|
|
41
|
+
| () -> untyped
|
|
42
|
+
|
|
43
|
+
# The steps this one may run through the `call` fixture. A part with no
|
|
44
|
+
# pattern exists only for calls.
|
|
45
|
+
# : (Array[singleton(Step)]) -> Array[singleton(Step)]
|
|
46
|
+
# : () -> Array[singleton(Step)]
|
|
47
|
+
def self.parts: (Array[singleton(Step)]) -> Array[singleton(Step)]
|
|
48
|
+
| () -> Array[singleton(Step)]
|
|
49
|
+
|
|
50
|
+
# : () { () [self: Schema] -> void } -> Schema
|
|
51
|
+
# : () -> Schema
|
|
52
|
+
def self.args: () { () [self: Schema] -> void } -> Schema
|
|
53
|
+
| () -> Schema
|
|
54
|
+
|
|
55
|
+
# : () { () [self: Schema] -> void } -> Schema
|
|
56
|
+
# : () -> Schema?
|
|
57
|
+
def self.returns: () { () [self: Schema] -> void } -> Schema
|
|
58
|
+
| () -> Schema?
|
|
59
|
+
|
|
60
|
+
# Args an earlier step of the scenario returned, by key: one source as
|
|
61
|
+
# `[Step, :field]`, or several as a list of them, where the nearest
|
|
62
|
+
# earlier one that ran gives the value.
|
|
63
|
+
# : (Hash[Symbol | String, untyped]) -> Hash[String, Array[untyped]]
|
|
64
|
+
# : () -> Hash[String, Array[untyped]]
|
|
65
|
+
def self.from: (Hash[Symbol | String, untyped]) -> Hash[String, Array[untyped]]
|
|
66
|
+
| () -> Hash[String, Array[untyped]]
|
|
67
|
+
|
|
68
|
+
# observe never sees the args a claim compares with, so it cannot pick
|
|
69
|
+
# what to read by the answer it will be judged against.
|
|
70
|
+
# : () -> Schema
|
|
71
|
+
def self.inputs: () -> Schema
|
|
72
|
+
|
|
73
|
+
# : () -> String
|
|
74
|
+
def self.step_name: () -> String
|
|
75
|
+
|
|
76
|
+
# A step that runs code may change the world unless it says it does
|
|
77
|
+
# not; a claim step has no action, so it never does.
|
|
78
|
+
# : () -> bool
|
|
79
|
+
def self.mutating?: () -> bool
|
|
80
|
+
|
|
81
|
+
# : () -> Symbol
|
|
82
|
+
def self.body: () -> Symbol
|
|
83
|
+
|
|
84
|
+
# : () -> Integer?
|
|
85
|
+
def self.line: () -> Integer?
|
|
86
|
+
|
|
87
|
+
# : () -> Array[Symbol]
|
|
88
|
+
def self.fixtures: () -> Array[Symbol]
|
|
89
|
+
|
|
90
|
+
# What `run` gave back, checked against `returns`, as problems to
|
|
91
|
+
# report. A Ruby method always gives back its last value, so a step
|
|
92
|
+
# with no returns that ends on a call (an Integer, a String, nil)
|
|
93
|
+
# returns nothing; a Hash with keys would lose them from the record,
|
|
94
|
+
# so that is refused, as the TypeScript engine refuses it.
|
|
95
|
+
# : (untyped) -> [untyped, Array[String]]
|
|
96
|
+
def self.returned: (untyped) -> [ untyped, Array[String] ]
|
|
97
|
+
|
|
98
|
+
# The keywords the body is called with: `args` only when it names
|
|
99
|
+
# them, as a TypeScript step that does not destructure `args` never
|
|
100
|
+
# sees them, so `def run(scratch:)` is a whole step.
|
|
101
|
+
# : (Hash[Symbol, untyped], untyped) -> Hash[Symbol, untyped]
|
|
102
|
+
def self.keywords: (Hash[Symbol, untyped], untyped) -> Hash[Symbol, untyped]
|
|
103
|
+
|
|
104
|
+
# The fixtures the engine builds before the body runs: the step's own,
|
|
105
|
+
# and those of every part it can reach, since the bag is closed before
|
|
106
|
+
# any call happens.
|
|
107
|
+
# : (?Array[singleton(Step)]) -> Array[Symbol]
|
|
108
|
+
def self.bag: (?Array[singleton(Step)]) -> Array[Symbol]
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Each step file is registered for autoload under its class name first, so a
|
|
112
|
+
# step can name another in `from` or `field` whatever order the files load in.
|
|
113
|
+
# : (String) -> Array[singleton(Step)]
|
|
114
|
+
def self.load_steps: (String) -> Array[singleton(Step)]
|
|
115
|
+
end
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/summary.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# summary.md: the run as a person reads it, rendered from run.json alone,
|
|
4
|
+
# in the TypeScript engine's words, so a summary never says something
|
|
5
|
+
# run.json does not and `nuka report` renders the same file again from a
|
|
6
|
+
# run.json copied off another machine. The sections this engine has no
|
|
7
|
+
# field for yet (removed criteria, paths, flags, routes, judgments) are
|
|
8
|
+
# left out, as the TypeScript engine leaves them out of a run without
|
|
9
|
+
# them.
|
|
10
|
+
module Nukadoko
|
|
11
|
+
module Engine
|
|
12
|
+
module Summary
|
|
13
|
+
MARKER: ::String
|
|
14
|
+
|
|
15
|
+
# A failed scenario is its cell, and a row with no required cell is
|
|
16
|
+
# its reason line, so the findings list leaves those out.
|
|
17
|
+
TABLE_CODES: untyped
|
|
18
|
+
|
|
19
|
+
RED: untyped
|
|
20
|
+
|
|
21
|
+
VALUE_TEXT_LIMIT: ::Integer
|
|
22
|
+
|
|
23
|
+
STDOUT_JSON_LIMIT: ::Integer
|
|
24
|
+
|
|
25
|
+
ANSI: ::Regexp
|
|
26
|
+
|
|
27
|
+
THROW_LOCATION: ::Regexp
|
|
28
|
+
|
|
29
|
+
CARETS: ::Regexp
|
|
30
|
+
|
|
31
|
+
CLAIMS_LEAD: ::String
|
|
32
|
+
|
|
33
|
+
CONTROL_NOTE: ::String
|
|
34
|
+
|
|
35
|
+
LIMIT_KINDS: untyped
|
|
36
|
+
|
|
37
|
+
LIMIT_HEADINGS: untyped
|
|
38
|
+
|
|
39
|
+
# : (Hash[Symbol, untyped]) -> String
|
|
40
|
+
def self?.render: (Hash[Symbol, untyped]) -> String
|
|
41
|
+
|
|
42
|
+
# Text outside a code span: `\` doubled first, so the `\` before a
|
|
43
|
+
# `|` survives both the table parser and the inline one, and `<`
|
|
44
|
+
# never opens a tag.
|
|
45
|
+
# : (untyped) -> String
|
|
46
|
+
def self?.cell_text: (untyped) -> String
|
|
47
|
+
|
|
48
|
+
# A code span longer than any backtick run inside it.
|
|
49
|
+
# : (untyped) -> String
|
|
50
|
+
def self?.code_span: (untyped) -> String
|
|
51
|
+
|
|
52
|
+
# : (untyped) -> String
|
|
53
|
+
def self?.cell_code: (untyped) -> String
|
|
54
|
+
|
|
55
|
+
# : (Integer, String, String) -> String
|
|
56
|
+
def self?.count_of: (Integer, String, String) -> String
|
|
57
|
+
|
|
58
|
+
# : (Integer) -> String
|
|
59
|
+
def self?.duration: (Integer) -> String
|
|
60
|
+
|
|
61
|
+
# : (untyped) -> String
|
|
62
|
+
def self?.value_text: (untyped) -> String
|
|
63
|
+
|
|
64
|
+
# The first line with text in it; a Node throw location with its
|
|
65
|
+
# source line and carets is skipped, and a line that ends in a colon
|
|
66
|
+
# takes the next line after it.
|
|
67
|
+
# : (untyped, ?bool) -> String?
|
|
68
|
+
def self?.first_visible_line: (untyped, ?bool) -> String?
|
|
69
|
+
|
|
70
|
+
# : (untyped) -> String
|
|
71
|
+
def self?.first_error_line: (untyped) -> String
|
|
72
|
+
|
|
73
|
+
# : (Hash[Symbol, untyped]) -> String
|
|
74
|
+
def self?.cell_word: (Hash[Symbol, untyped]) -> String
|
|
75
|
+
|
|
76
|
+
# : (Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
|
|
77
|
+
def self?.head_scenarios: (Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
|
|
78
|
+
|
|
79
|
+
# : (Hash[untyped, untyped]) -> String
|
|
80
|
+
def self?.conditions_text: (Hash[untyped, untyped]) -> String
|
|
81
|
+
|
|
82
|
+
# : (Hash[Symbol, untyped]) -> Array[String]
|
|
83
|
+
def self?.title: (Hash[Symbol, untyped]) -> Array[String]
|
|
84
|
+
|
|
85
|
+
# : (Hash[Symbol, untyped]) -> String
|
|
86
|
+
def self?.table_cell: (Hash[Symbol, untyped]) -> String
|
|
87
|
+
|
|
88
|
+
# : (Hash[Symbol, untyped]) -> Array[String]
|
|
89
|
+
def self?.table: (Hash[Symbol, untyped]) -> Array[String]
|
|
90
|
+
|
|
91
|
+
# The line above the table under `--base`: what the run compared with,
|
|
92
|
+
# how many criteria changed, and whether the mapping changed and what
|
|
93
|
+
# in it, since an unchanged criterion over a changed mapping is what
|
|
94
|
+
# the old world was run for.
|
|
95
|
+
# : (Hash[Symbol, untyped]) -> Array[String]
|
|
96
|
+
def self?.base_line: (Hash[Symbol, untyped]) -> Array[String]
|
|
97
|
+
|
|
98
|
+
# Each criterion the base holds and head does not, with its sentences
|
|
99
|
+
# at the base, so a reader approving the change sees what it drops.
|
|
100
|
+
# : (Hash[Symbol, untyped]) -> Array[String]
|
|
101
|
+
def self?.removed: (Hash[Symbol, untyped]) -> Array[String]
|
|
102
|
+
|
|
103
|
+
# A capture taken at least this long after its reading says so beside
|
|
104
|
+
# its link: a page that changes on a timer of a few hundred
|
|
105
|
+
# milliseconds can show another state by then.
|
|
106
|
+
LATE_VIEW_MS: ::Integer
|
|
107
|
+
|
|
108
|
+
# Where a Then's judged moment can be seen: each open page's view
|
|
109
|
+
# right after the reading its claims were judged on, its screenshot
|
|
110
|
+
# before its ARIA snapshot, or, for a Then that read no page, the
|
|
111
|
+
# requests its own step sent. Each link is [label, href, after_ms].
|
|
112
|
+
# : (Hash[Symbol, untyped]) -> Array[Array[untyped]]
|
|
113
|
+
def self?.seen_links: (Hash[Symbol, untyped]) -> Array[Array[untyped]]
|
|
114
|
+
|
|
115
|
+
# : (String, String) -> String
|
|
116
|
+
def self?.markdown_link: (String, String) -> String
|
|
117
|
+
|
|
118
|
+
# : (Array[Array[untyped]]) -> String
|
|
119
|
+
def self?.seen_text: (Array[Array[untyped]]) -> String
|
|
120
|
+
|
|
121
|
+
# : (Hash[Symbol, untyped]) -> (^(Hash[Symbol, untyped]) -> String)?
|
|
122
|
+
def self?.seen_column: (Hash[Symbol, untyped]) -> (^(Hash[Symbol, untyped]) -> String)?
|
|
123
|
+
|
|
124
|
+
# : (Hash[Symbol, untyped]) -> Array[String]
|
|
125
|
+
def self?.reasons: (Hash[Symbol, untyped]) -> Array[String]
|
|
126
|
+
|
|
127
|
+
# Where an execution stopped: the step, the error's first line, the
|
|
128
|
+
# producers that exited nonzero, the last command that did, the
|
|
129
|
+
# record, and where the Then can be seen.
|
|
130
|
+
# : (Hash[Symbol, untyped]) -> String?
|
|
131
|
+
def self?.describe_failure: (Hash[Symbol, untyped]) -> String?
|
|
132
|
+
|
|
133
|
+
# : (Array[Hash[Symbol, untyped]]?) -> Array[[untyped, Integer, String]]
|
|
134
|
+
def self?.exited_producers: (Array[Hash[Symbol, untyped]]?) -> Array[[ untyped, Integer, String ]]
|
|
135
|
+
|
|
136
|
+
# : (String) -> String?
|
|
137
|
+
def self?.stdout_line: (String) -> String?
|
|
138
|
+
|
|
139
|
+
# The gaps a green verdict does not cover, computed again from
|
|
140
|
+
# run.json's other fields, never read from a stored list.
|
|
141
|
+
# : (Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
|
|
142
|
+
def self?.limits: (Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
|
|
143
|
+
|
|
144
|
+
# One entry per row a judgment holds green: nukadoko checked that the
|
|
145
|
+
# value is the one judged, and nothing of the judgment itself. A value
|
|
146
|
+
# judged as an ARIA snapshot names what that leaves out: a change only
|
|
147
|
+
# to how the page looks keeps the snapshot, and so the judgment.
|
|
148
|
+
# : (Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
149
|
+
def self?.judgment_limits: (Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
150
|
+
|
|
151
|
+
# : (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]]) -> Hash[Symbol, untyped]?
|
|
152
|
+
def self?.control_limit: (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]]) -> Hash[Symbol, untyped]?
|
|
153
|
+
|
|
154
|
+
# : (Hash[Symbol, untyped]) -> String
|
|
155
|
+
def self?.closer_text: (Hash[Symbol, untyped]) -> String
|
|
156
|
+
|
|
157
|
+
# : (Hash[Symbol, untyped], bool) -> String
|
|
158
|
+
def self?.limit_place: (Hash[Symbol, untyped], bool) -> String
|
|
159
|
+
|
|
160
|
+
# : (Hash[Symbol, untyped]) -> Array[String]
|
|
161
|
+
def self?.limits_section: (Hash[Symbol, untyped]) -> Array[String]
|
|
162
|
+
|
|
163
|
+
# : (Array[String]) -> String
|
|
164
|
+
def self?.tag_flags: (Array[String]) -> String
|
|
165
|
+
|
|
166
|
+
# : (Hash[Symbol, untyped]) -> Array[String]
|
|
167
|
+
def self?.condition: (Hash[Symbol, untyped]) -> Array[String]
|
|
168
|
+
|
|
169
|
+
# The claim as ClaimLine writes it, then where its values were
|
|
170
|
+
# measured: a value no recorded channel holds is what a constant in
|
|
171
|
+
# step code looks like, so the line says `measured: none`.
|
|
172
|
+
# : (Hash[Symbol, untyped], String?) -> String
|
|
173
|
+
def self?.claim_line: (Hash[Symbol, untyped], String?) -> String
|
|
174
|
+
|
|
175
|
+
# : (Hash[Symbol, untyped], String?) -> String
|
|
176
|
+
def self?.measured_text: (Hash[Symbol, untyped], String?) -> String
|
|
177
|
+
|
|
178
|
+
# : (Hash[Symbol, untyped]?, String?) -> String
|
|
179
|
+
def self?.channel_text: (Hash[Symbol, untyped]?, String?) -> String
|
|
180
|
+
|
|
181
|
+
# : (Hash[Symbol, untyped]) -> Array[String]
|
|
182
|
+
def self?.claims: (Hash[Symbol, untyped]) -> Array[String]
|
|
183
|
+
|
|
184
|
+
# : (Hash[Symbol, untyped]) -> String
|
|
185
|
+
def self?.where_of: (Hash[Symbol, untyped]) -> String
|
|
186
|
+
|
|
187
|
+
# : (Hash[Symbol, untyped]) -> Array[String]
|
|
188
|
+
def self?.findings: (Hash[Symbol, untyped]) -> Array[String]
|
|
189
|
+
|
|
190
|
+
# The heading names what the commands under it rerun: a stopped walk
|
|
191
|
+
# did not fail, so a heading that called it failed would state
|
|
192
|
+
# something false.
|
|
193
|
+
# : (Hash[Symbol, untyped]) -> Array[String]
|
|
194
|
+
def self?.rerun: (Hash[Symbol, untyped]) -> Array[String]
|
|
195
|
+
|
|
196
|
+
# A walk is a run that paused after each step for an answer: its
|
|
197
|
+
# verdicts were measured, but between steps the world and the browser
|
|
198
|
+
# were open to anything, which no record covers. The longest pause
|
|
199
|
+
# says how long that was.
|
|
200
|
+
# : (Hash[Symbol, untyped]) -> String
|
|
201
|
+
def self?.walk_sentence: (Hash[Symbol, untyped]) -> String
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/table.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# The run's verdict table: a row per criterion (a scenario, or an Examples
|
|
4
|
+
# row), a cell per environment. A cell is `required` where its environment
|
|
5
|
+
# meets the row's condition tags and a `control` elsewhere. Only a control
|
|
6
|
+
# that fails at a Then, the same way, in every proof run proves a row.
|
|
7
|
+
module Nukadoko
|
|
8
|
+
module Engine
|
|
9
|
+
module Table
|
|
10
|
+
PROOF_RUNS: ::Integer
|
|
11
|
+
|
|
12
|
+
# : (Integer) -> Integer
|
|
13
|
+
def self.proof_runs=: (Integer) -> Integer
|
|
14
|
+
|
|
15
|
+
# : () -> Integer
|
|
16
|
+
def self.proof_runs: () -> Integer
|
|
17
|
+
|
|
18
|
+
# : (Array[String], Hash[String, untyped]) -> String
|
|
19
|
+
def self.role: (Array[String], Hash[String, untyped]) -> String
|
|
20
|
+
|
|
21
|
+
# What a cell's executions came to. An execution is `[:pass]`,
|
|
22
|
+
# `[:fail, line, claim]`, `[:broke, line]`, or `[:stopped, line]`
|
|
23
|
+
# for a walk a person stopped after that line.
|
|
24
|
+
# : (Array[Array[untyped]]) -> Hash[Symbol, untyped]
|
|
25
|
+
def self.cell: (Array[Array[untyped]]) -> Hash[Symbol, untyped]
|
|
26
|
+
|
|
27
|
+
# : (Array[Hash[Symbol, untyped]]) -> String
|
|
28
|
+
def self.verdict: (Array[Hash[Symbol, untyped]]) -> String
|
|
29
|
+
|
|
30
|
+
# : (Array[String]) -> Array[String]
|
|
31
|
+
def self.condition_tags: (Array[String]) -> Array[String]
|
|
32
|
+
|
|
33
|
+
# The tags a row lists: its condition tags and @held, as written.
|
|
34
|
+
# : (Array[String]) -> Array[String]
|
|
35
|
+
def self.row_tags: (Array[String]) -> Array[String]
|
|
36
|
+
|
|
37
|
+
# For each condition the tags name, the value the environment declares
|
|
38
|
+
# for it, or nil: what a cell's role came from.
|
|
39
|
+
# : (Array[String], Hash[String, untyped]) -> Hash[String, untyped]
|
|
40
|
+
def self.conditions_of: (Array[String], Hash[String, untyped]) -> Hash[String, untyped]
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/text_fit.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# `fits-text`, as the TypeScript engine judges it: an expected text fits an
|
|
4
|
+
# actual one line by line, where a line that is exactly `...` takes any run
|
|
5
|
+
# of actual lines, `[..]` any characters inside one line, and `[..:name]`
|
|
6
|
+
# does too, and then every stand-in of one name must have read one text and
|
|
7
|
+
# two names two texts. The judge and the claim line both read this module,
|
|
8
|
+
# so the two never disagree about where a text stopped fitting. It walks
|
|
9
|
+
# the expected lines once and keeps only the actual lines each one can end
|
|
10
|
+
# before, so a text costs time in its length rather than a power of its
|
|
11
|
+
# `...` lines.
|
|
12
|
+
module Nukadoko
|
|
13
|
+
module Engine
|
|
14
|
+
module TextFit
|
|
15
|
+
ANY_LINES: ::String
|
|
16
|
+
|
|
17
|
+
STAND_IN_NAME: ::Regexp
|
|
18
|
+
|
|
19
|
+
# An expected line split at its stand-ins: the fixed texts, and the
|
|
20
|
+
# place of each named stand-in among them.
|
|
21
|
+
class Fixed < Data
|
|
22
|
+
attr_reader parts(): untyped
|
|
23
|
+
|
|
24
|
+
attr_reader names(): untyped
|
|
25
|
+
|
|
26
|
+
def self.new: (untyped parts, untyped names) -> instance
|
|
27
|
+
| (parts: untyped, names: untyped) -> instance
|
|
28
|
+
|
|
29
|
+
def self.members: () -> [ :parts, :names ]
|
|
30
|
+
|
|
31
|
+
def members: () -> [ :parts, :names ]
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# A `[..` that `]`, or `:`, a name, and `]`, do not follow is text.
|
|
35
|
+
# : (String) -> Fixed
|
|
36
|
+
def self?.fixed_line: (String) -> Fixed
|
|
37
|
+
|
|
38
|
+
# A text's lines, at "\n" or "\r\n", with one final empty line dropped.
|
|
39
|
+
# : (String) -> Array[String]
|
|
40
|
+
def self?.lines: (String) -> Array[String]
|
|
41
|
+
|
|
42
|
+
# Each part between the first and the last is found leftmost after
|
|
43
|
+
# the one before it, which is enough when a stand-in takes anything.
|
|
44
|
+
# : (Array[String], String, ?Array[String?]?) -> bool
|
|
45
|
+
def self?.parts_fit: (Array[String], String, ?Array[String?]?) -> bool
|
|
46
|
+
|
|
47
|
+
# : (String, String) -> bool
|
|
48
|
+
def self?.line_fits: (String, String) -> bool
|
|
49
|
+
|
|
50
|
+
# { fits: true }, or where the text stopped fitting: `fitted` expected
|
|
51
|
+
# lines fit, `expected` fit nothing from actual line `at` on, which is
|
|
52
|
+
# `actual`; or `readings`, the two named stand-ins that disagree.
|
|
53
|
+
# : (String, String) -> Hash[Symbol, untyped]
|
|
54
|
+
def self?.fit: (String, String) -> Hash[Symbol, untyped]
|
|
55
|
+
|
|
56
|
+
# The actual line each expected line takes in the first way the text
|
|
57
|
+
# fits, each `...` taking as few lines as it can from the top: a walk
|
|
58
|
+
# from the end learns which lines the rest can start at.
|
|
59
|
+
# : (Array[String], Array[Fixed?]) -> Array[Integer?]
|
|
60
|
+
def self?.first_fit: (Array[String], Array[Fixed?]) -> Array[Integer?]
|
|
61
|
+
|
|
62
|
+
# : (Array[String], Array[Fixed?], Array[Integer?]) -> Hash[Symbol, untyped]
|
|
63
|
+
def self?.names_fit: (Array[String], Array[Fixed?], Array[Integer?]) -> Hash[Symbol, untyped]
|
|
64
|
+
|
|
65
|
+
# Whether an expected text states nothing beyond its stand-ins.
|
|
66
|
+
# : (String) -> bool
|
|
67
|
+
def self?.only_stand_ins?: (String) -> bool
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|