nukadoko 0.5.0 → 0.7.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 +553 -3
- data/README.ja.md +22 -6
- data/README.md +13 -7
- data/docs/ci.ja.md +542 -0
- data/docs/ci.md +635 -0
- data/docs/commands.ja.md +1524 -0
- data/docs/commands.md +1281 -0
- data/docs/engines.json +19 -0
- data/docs/execution-events.ja.md +336 -0
- data/docs/execution-events.md +423 -0
- data/docs/glossary.json +1348 -0
- data/docs/guide.ja.md +733 -0
- data/docs/guide.md +815 -0
- data/docs/intent.ja.md +133 -0
- data/docs/intent.md +156 -0
- data/docs/layout.ja.md +442 -0
- data/docs/layout.md +399 -0
- data/docs/releasing.ja.md +186 -0
- data/docs/releasing.md +237 -0
- data/docs/ruby/reference.ja.md +302 -0
- data/docs/ruby/reference.md +368 -0
- data/docs/spec.ja.md +8916 -0
- data/docs/spec.md +11250 -0
- data/docs/tutorial.ja.md +451 -0
- data/docs/tutorial.md +458 -0
- data/docs/typescript/adopting.ja.md +231 -0
- data/docs/typescript/adopting.md +251 -0
- data/docs/typescript/doors.ja.md +301 -0
- data/docs/typescript/doors.md +329 -0
- data/docs/typescript/migration-playwright-test.ja.md +189 -0
- data/docs/typescript/migration-playwright-test.md +212 -0
- data/docs/typescript/migration.ja.md +391 -0
- data/docs/typescript/migration.md +505 -0
- data/docs/typescript/reference.ja.md +176 -0
- data/docs/typescript/reference.md +197 -0
- data/docs/typescript/upgrading.ja.md +1774 -0
- data/docs/typescript/upgrading.md +2224 -0
- data/docs/web-app.ja.md +627 -0
- data/docs/web-app.md +659 -0
- data/docs/writing-scenarios.ja.md +544 -0
- data/docs/writing-scenarios.md +563 -0
- data/lib/nukadoko/base.rb +12 -5
- data/lib/nukadoko/changed_files.rb +95 -0
- data/lib/nukadoko/check.rb +459 -51
- data/lib/nukadoko/claim_drops.rb +271 -0
- data/lib/nukadoko/claim_line.rb +24 -4
- data/lib/nukadoko/claim_rules.rb +143 -1
- data/lib/nukadoko/claim_sides.rb +157 -9
- data/lib/nukadoko/cli.rb +403 -50
- data/lib/nukadoko/codes.json +246 -21
- data/lib/nukadoko/codes.rb +21 -4
- data/lib/nukadoko/command.rb +120 -13
- data/lib/nukadoko/command_help.rb +128 -0
- data/lib/nukadoko/compat.rb +469 -0
- data/lib/nukadoko/criteria.rb +1 -1
- data/lib/nukadoko/definition.rb +157 -7
- data/lib/nukadoko/error_frames.rb +6 -3
- data/lib/nukadoko/events/count.rb +146 -0
- data/lib/nukadoko/events/counted.rb +114 -0
- data/lib/nukadoko/events/format.rb +257 -0
- data/lib/nukadoko/events/lists.rb +154 -0
- data/lib/nukadoko/events/path.rb +285 -0
- data/lib/nukadoko/events/read.rb +284 -0
- data/lib/nukadoko/events/reader.rb +490 -0
- data/lib/nukadoko/events/selection.rb +252 -0
- data/lib/nukadoko/events/tally.rb +438 -0
- data/lib/nukadoko/features.rb +2 -2
- data/lib/nukadoko/fixtures.rb +160 -35
- data/lib/nukadoko/http_recording.rb +6 -2
- data/lib/nukadoko/intent.rb +364 -0
- data/lib/nukadoko/intent_file.rb +81 -0
- data/lib/nukadoko/intent_view.rb +190 -0
- data/lib/nukadoko/js_json.rb +2 -1
- data/lib/nukadoko/judge.rb +2 -2
- data/lib/nukadoko/judgment_file.rb +22 -1
- data/lib/nukadoko/judgments.rb +33 -3
- data/lib/nukadoko/measure_mcp.rb +202 -0
- data/lib/nukadoko/parts.rb +8 -2
- data/lib/nukadoko/path_view.rb +252 -0
- data/lib/nukadoko/place_rows.rb +161 -0
- data/lib/nukadoko/program.rb +1265 -51
- data/lib/nukadoko/program_log.rb +122 -0
- data/lib/nukadoko/program_shape.rb +385 -0
- data/lib/nukadoko/project_fixtures.rb +43 -10
- data/lib/nukadoko/project_program.rb +5 -4
- data/lib/nukadoko/repeated_prefix.rb +310 -0
- data/lib/nukadoko/report_run.rb +3 -3
- data/lib/nukadoko/run.rb +1156 -159
- data/lib/nukadoko/run_record.rb +70 -46
- data/lib/nukadoko/scaffold.rb +24 -6
- data/lib/nukadoko/schema.rb +15 -2
- data/lib/nukadoko/secrets.rb +55 -5
- data/lib/nukadoko/states.rb +478 -0
- data/lib/nukadoko/step.rb +71 -2
- data/lib/nukadoko/step_fixtures.rb +52 -3
- data/lib/nukadoko/summary.rb +803 -30
- data/lib/nukadoko/table.rb +4 -2
- data/lib/nukadoko/text_fit.rb +20 -7
- data/lib/nukadoko/trace.rb +152 -45
- data/lib/nukadoko/tree_passes.rb +95 -33
- data/lib/nukadoko/underneath.rb +311 -0
- data/lib/nukadoko/verdict.rb +18 -1
- data/lib/nukadoko/version.rb +1 -1
- data/lib/nukadoko/vocabulary.rb +166 -23
- data/lib/nukadoko/walk.rb +2 -2
- data/lib/nukadoko/walk_step.rb +1 -1
- data/lib/nukadoko.rb +23 -0
- data/llms.txt +42 -35
- data/sig/generated/nukadoko/base.rbs +4 -4
- data/sig/generated/nukadoko/changed_files.rbs +42 -0
- data/sig/generated/nukadoko/check.rbs +147 -10
- data/sig/generated/nukadoko/claim_drops.rbs +135 -0
- data/sig/generated/nukadoko/claim_line.rbs +11 -0
- data/sig/generated/nukadoko/claim_rules.rbs +49 -4
- data/sig/generated/nukadoko/claim_sides.rbs +63 -12
- data/sig/generated/nukadoko/cli.rbs +80 -7
- data/sig/generated/nukadoko/codes.rbs +19 -4
- data/sig/generated/nukadoko/command.rbs +68 -1
- data/sig/generated/nukadoko/command_help.rbs +18 -0
- data/sig/generated/nukadoko/compat.rbs +392 -0
- data/sig/generated/nukadoko/criteria.rbs +1 -1
- data/sig/generated/nukadoko/definition.rbs +50 -0
- data/sig/generated/nukadoko/error_frames.rbs +1 -1
- data/sig/generated/nukadoko/events/count.rbs +69 -0
- data/sig/generated/nukadoko/events/counted.rbs +70 -0
- data/sig/generated/nukadoko/events/format.rbs +163 -0
- data/sig/generated/nukadoko/events/lists.rbs +47 -0
- data/sig/generated/nukadoko/events/path.rbs +161 -0
- data/sig/generated/nukadoko/events/read.rbs +109 -0
- data/sig/generated/nukadoko/events/reader.rbs +226 -0
- data/sig/generated/nukadoko/events/selection.rbs +100 -0
- data/sig/generated/nukadoko/events/tally.rbs +227 -0
- data/sig/generated/nukadoko/features.rbs +6 -4
- data/sig/generated/nukadoko/fixtures.rbs +67 -11
- data/sig/generated/nukadoko/http_recording.rbs +1 -1
- data/sig/generated/nukadoko/intent.rbs +132 -0
- data/sig/generated/nukadoko/intent_file.rbs +46 -0
- data/sig/generated/nukadoko/intent_view.rbs +69 -0
- data/sig/generated/nukadoko/judgment_file.rbs +7 -1
- data/sig/generated/nukadoko/judgments.rbs +10 -0
- data/sig/generated/nukadoko/measure_mcp.rbs +104 -0
- data/sig/generated/nukadoko/parts.rbs +2 -2
- data/sig/generated/nukadoko/path_view.rbs +105 -0
- data/sig/generated/nukadoko/place_rows.rbs +43 -0
- data/sig/generated/nukadoko/program.rbs +627 -23
- data/sig/generated/nukadoko/program_log.rbs +67 -0
- data/sig/generated/nukadoko/program_shape.rbs +147 -0
- data/sig/generated/nukadoko/project_fixtures.rbs +16 -3
- data/sig/generated/nukadoko/project_program.rbs +2 -1
- data/sig/generated/nukadoko/repeated_prefix.rbs +172 -0
- data/sig/generated/nukadoko/report_run.rbs +1 -1
- data/sig/generated/nukadoko/run.rbs +286 -41
- data/sig/generated/nukadoko/run_record.rbs +20 -12
- data/sig/generated/nukadoko/scaffold.rbs +3 -0
- data/sig/generated/nukadoko/schema.rbs +5 -0
- data/sig/generated/nukadoko/secrets.rbs +26 -3
- data/sig/generated/nukadoko/states.rbs +214 -0
- data/sig/generated/nukadoko/step.rbs +58 -1
- data/sig/generated/nukadoko/step_fixtures.rbs +39 -0
- data/sig/generated/nukadoko/summary.rbs +256 -2
- data/sig/generated/nukadoko/table.rbs +3 -2
- data/sig/generated/nukadoko/trace.rbs +108 -33
- data/sig/generated/nukadoko/tree_passes.rbs +36 -8
- data/sig/generated/nukadoko/underneath.rbs +141 -0
- data/sig/generated/nukadoko/verdict.rbs +8 -0
- data/sig/generated/nukadoko/vocabulary.rbs +45 -6
- data/skills/nukadoko/SKILL.md +18 -18
- data/skills/nukadoko/references/checking-steps.md +16 -83
- data/skills/nukadoko/references/diagnosing.md +6 -6
- data/skills/nukadoko/references/done.md +22 -0
- data/skills/nukadoko/references/evidence.md +19 -6
- data/skills/nukadoko/references/exploring.md +22 -7
- data/skills/nukadoko/references/fixtures.md +12 -32
- data/skills/nukadoko/references/judgments.md +18 -0
- data/skills/nukadoko/references/maintenance.md +1 -1
- data/skills/nukadoko/references/merge-risk.md +1 -1
- data/skills/nukadoko/references/parts.md +46 -23
- data/skills/nukadoko/references/{perturbed-worlds.md → perturbed-systems.md} +30 -12
- data/skills/nukadoko/references/program.md +168 -169
- data/skills/nukadoko/references/reviewing.md +20 -20
- data/skills/nukadoko/references/ruby/checking-steps.md +106 -0
- data/skills/nukadoko/references/ruby/examples/cli.md +212 -0
- data/skills/nukadoko/references/ruby/fixtures.md +34 -0
- data/skills/nukadoko/references/ruby/program.md +112 -0
- data/skills/nukadoko/references/ruby/step-files.md +115 -0
- data/skills/nukadoko/references/running.md +34 -34
- data/skills/nukadoko/references/scenario-rules.md +7 -6
- data/skills/nukadoko/references/states.md +7 -1
- data/skills/nukadoko/references/step-files.md +41 -120
- data/skills/nukadoko/references/typescript/checking-steps.md +129 -0
- data/skills/nukadoko/references/{examples → typescript/examples}/cli.md +1 -1
- data/skills/nukadoko/references/{examples → typescript/examples}/http-api.md +6 -6
- data/skills/nukadoko/references/{examples → typescript/examples}/workflow.md +1 -1
- data/skills/nukadoko/references/typescript/fixtures.md +56 -0
- data/skills/nukadoko/references/typescript/program.md +111 -0
- data/skills/nukadoko/references/typescript/step-files.md +104 -0
- data/skills/nukadoko/references/verdicts.md +10 -10
- data/skills/nukadoko/references/writing-steps.md +67 -67
- data/skills/nukadoko/references/writing-the-feature.md +1 -1
- data/skills/nukadoko-verification/SKILL.md +13 -8
- metadata +103 -7
- data/skills/nukadoko/references/ruby.md +0 -80
|
@@ -20,9 +20,59 @@ module Nukadoko
|
|
|
20
20
|
|
|
21
21
|
private
|
|
22
22
|
|
|
23
|
+
# : (untyped) -> String?
|
|
24
|
+
def claim_step_problem: (untyped) -> String?
|
|
25
|
+
|
|
26
|
+
# : () -> String?
|
|
27
|
+
def run_step_problem: () -> String?
|
|
28
|
+
|
|
29
|
+
EVENTS_ENTRY_KEYS: untyped
|
|
30
|
+
|
|
31
|
+
# The characters a service's name takes in a program. Whether the
|
|
32
|
+
# program has a service of that name is `nuka check`'s and the run's
|
|
33
|
+
# (`events-service-unknown`).
|
|
34
|
+
SERVICE_NAME: untyped
|
|
35
|
+
|
|
36
|
+
# Why `events` is not a hash of counts the run can read: each key one
|
|
37
|
+
# word a claim's actual can name, each entry `{ of:, count: }` with
|
|
38
|
+
# `of` a step or a list of distinct ones, and `count` a selection the
|
|
39
|
+
# format can judge, and an optional `service`, the one service of the
|
|
40
|
+
# system whose lines to count.
|
|
41
|
+
# : () -> String?
|
|
42
|
+
def events_problem: () -> String?
|
|
43
|
+
|
|
44
|
+
FILES_ENTRY_KEYS: untyped
|
|
45
|
+
|
|
46
|
+
FILE_CHANGES: untyped
|
|
47
|
+
|
|
48
|
+
UNWALKED: untyped
|
|
49
|
+
|
|
50
|
+
# Why `files` is not a hash of lists the run can read: each key one
|
|
51
|
+
# word a claim's actual can name, each entry `{ of:, change:, under: }`
|
|
52
|
+
# with `of` a step or a list of distinct ones, `change` one of the
|
|
53
|
+
# changes a record lists or a list of them, and `under` a directory
|
|
54
|
+
# relative to the working directory that a walk enters.
|
|
55
|
+
# : () -> String?
|
|
56
|
+
def files_problem: () -> String?
|
|
57
|
+
|
|
58
|
+
# A record's paths are relative and `/`-separated, so an absolute
|
|
59
|
+
# path, a backslash, or a `.` or `..` segment matches none of them,
|
|
60
|
+
# and a list under node_modules or .git is empty whatever the command did.
|
|
61
|
+
# : (untyped) -> String?
|
|
62
|
+
def under_problem: (untyped) -> String?
|
|
63
|
+
|
|
23
64
|
# : () -> ClaimRules::Shape
|
|
24
65
|
def shape: () -> ClaimRules::Shape
|
|
25
66
|
|
|
67
|
+
# Each value the step's selections take from the sentence.
|
|
68
|
+
# : () -> Array[Hash[Symbol, String]]
|
|
69
|
+
def events_sentence: () -> Array[Hash[Symbol, String]]
|
|
70
|
+
|
|
71
|
+
# A deadline the step could never keep is refused when it loads, as
|
|
72
|
+
# the TypeScript engine refuses one Node's timer would clamp.
|
|
73
|
+
# : () -> String?
|
|
74
|
+
def timeout_problem: () -> String?
|
|
75
|
+
|
|
26
76
|
# : () -> String?
|
|
27
77
|
def poll_problem: () -> String?
|
|
28
78
|
end
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# backtrace. A step record's error message says what went wrong but not
|
|
5
5
|
# where, so a reader had to call the step again outside nukadoko to find the
|
|
6
6
|
# line. The frames kept are the ones a reader can open and change: inside
|
|
7
|
-
# the project root, and outside
|
|
7
|
+
# the project root, and outside this gem and every installed gem, as the
|
|
8
8
|
# TypeScript engine leaves out node_modules.
|
|
9
9
|
module Nukadoko
|
|
10
10
|
module Engine
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/events/count.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nukadoko
|
|
4
|
+
module Engine
|
|
5
|
+
module Events
|
|
6
|
+
# Responsibility: what a count of execution events says of a claim:
|
|
7
|
+
# the range the count lies in, and whether a compare holds, breaks, or
|
|
8
|
+
# cannot be known on that range, with the words of the reason. Pure.
|
|
9
|
+
# Boundary: what the lines add up to is the tally's; where the
|
|
10
|
+
# expected value comes from is the claim's.
|
|
11
|
+
#
|
|
12
|
+
# A count is a range, never one number standing for "probably that
|
|
13
|
+
# many". Lines that match raise the lower bound. Lines that may match
|
|
14
|
+
# raise only the upper bound, and a reading that is not whole has
|
|
15
|
+
# none, since more lines may still come. A compare holds, or breaks,
|
|
16
|
+
# only when it gives that answer for every count in the range, so an
|
|
17
|
+
# absence never holds on a reading that was not whole.
|
|
18
|
+
module Count
|
|
19
|
+
COMPARES: untyped
|
|
20
|
+
|
|
21
|
+
# The gaps that say nothing was read, rather than that what was
|
|
22
|
+
# read may lack lines.
|
|
23
|
+
UNREAD_GAPS: untyped
|
|
24
|
+
|
|
25
|
+
CAUSE_WORDS: untyped
|
|
26
|
+
|
|
27
|
+
# The range a selection's count lies in: `[yes, yes + maybe]` on a
|
|
28
|
+
# whole reading, `[yes, unbounded]` on one that is not.
|
|
29
|
+
# : (Integer, Hash[String, Integer], bool) -> Hash[Symbol, Integer?]
|
|
30
|
+
def self.range_of: (Integer, Hash[String, Integer], bool) -> Hash[Symbol, Integer?]
|
|
31
|
+
|
|
32
|
+
# : (Hash[String, Integer]) -> Integer
|
|
33
|
+
def self.maybe_total: (Hash[String, Integer]) -> Integer
|
|
34
|
+
|
|
35
|
+
# What `compare` gives for every whole count in `range`.
|
|
36
|
+
# : (Hash[Symbol, Integer?], String, Numeric) -> Symbol
|
|
37
|
+
def self.judge_range: (Hash[Symbol, Integer?], String, Numeric) -> Symbol
|
|
38
|
+
|
|
39
|
+
# : (Integer) -> String
|
|
40
|
+
def self.lines: (Integer) -> String
|
|
41
|
+
|
|
42
|
+
# The words of one gap, as a reason uses them.
|
|
43
|
+
# : (Hash[Symbol, untyped]) -> String
|
|
44
|
+
def self.describe_gap: (Hash[Symbol, untyped]) -> String
|
|
45
|
+
|
|
46
|
+
# The service a gap is about, as its words name it; nothing for a
|
|
47
|
+
# gap of a record written before a system could hold several
|
|
48
|
+
# services.
|
|
49
|
+
# : (Hash[Symbol, untyped]) -> String
|
|
50
|
+
def self.service_words: (Hash[Symbol, untyped]) -> String
|
|
51
|
+
|
|
52
|
+
# The lines that may match, by cause.
|
|
53
|
+
# : (Hash[String, Integer]) -> String
|
|
54
|
+
def self.describe_maybe: (Hash[String, Integer]) -> String
|
|
55
|
+
|
|
56
|
+
# The range in words: `exactly 2`, `between 1 and 3`, `at least 1,
|
|
57
|
+
# with no upper bound`.
|
|
58
|
+
# : (Hash[Symbol, Integer?]) -> String
|
|
59
|
+
def self.describe_range: (Hash[Symbol, Integer?]) -> String
|
|
60
|
+
|
|
61
|
+
# `held` or `broken` only when every count in the range gives that
|
|
62
|
+
# answer; `unjudged` with the reason and the gap word otherwise.
|
|
63
|
+
# `of` names the step whose events were read, in the reason.
|
|
64
|
+
# : (Hash[Symbol, untyped], String, Numeric, ?String?) -> Hash[Symbol, untyped]
|
|
65
|
+
def self.judge: (Hash[Symbol, untyped], String, Numeric, ?String?) -> Hash[Symbol, untyped]
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/events/counted.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# What a count of execution events counted, grouped so a record names
|
|
4
|
+
# what the lines were and not only how many: the lines of one kind that
|
|
5
|
+
# hold the same values in the fields that tell them apart, and those
|
|
6
|
+
# groups in words. Pure. Which lines a count matches is Tally's.
|
|
7
|
+
module Nukadoko
|
|
8
|
+
module Engine
|
|
9
|
+
module Events
|
|
10
|
+
module Counted
|
|
11
|
+
# The fields a group of each kind is told apart by, in the order its
|
|
12
|
+
# record and its words name them.
|
|
13
|
+
GROUP_FIELDS: Hash[String, Array[String]]
|
|
14
|
+
|
|
15
|
+
OP_WORDS: untyped
|
|
16
|
+
|
|
17
|
+
# How many groups a line names before it says how many lines the
|
|
18
|
+
# rest hold.
|
|
19
|
+
GROUPS_NAMED: ::Integer
|
|
20
|
+
|
|
21
|
+
# The lines a count matched, grouped as they are folded.
|
|
22
|
+
class Groups
|
|
23
|
+
# : (String) -> void
|
|
24
|
+
def initialize: (String) -> void
|
|
25
|
+
|
|
26
|
+
# : (Hash[String, untyped]) -> void
|
|
27
|
+
def add: (Hash[String, untyped]) -> void
|
|
28
|
+
|
|
29
|
+
# The groups of the lines added and of `more`, most lines first,
|
|
30
|
+
# then by their values; `more` is not added.
|
|
31
|
+
# : (?Array[Hash[String, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
32
|
+
def groups: (?Array[Hash[String, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# The values a group is told apart by, as one key. JSON of the
|
|
36
|
+
# values, compared as text, as the TypeScript engine orders them.
|
|
37
|
+
# : (String, Hash[untyped, untyped]) -> String
|
|
38
|
+
def self?.key_of: (String, Hash[untyped, untyped]) -> String
|
|
39
|
+
|
|
40
|
+
# The groups `after` holds more lines of than `before`, each with
|
|
41
|
+
# how many more.
|
|
42
|
+
# : (Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
43
|
+
def self?.added: (Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
44
|
+
|
|
45
|
+
# : (untyped) -> String
|
|
46
|
+
def self?.text: (untyped) -> String
|
|
47
|
+
|
|
48
|
+
# One group in words, by kind: `db insert into events`.
|
|
49
|
+
# : (Hash[Symbol, untyped]) -> String
|
|
50
|
+
def self?.words: (Hash[Symbol, untyped]) -> String
|
|
51
|
+
|
|
52
|
+
# : (Integer, bool) -> String
|
|
53
|
+
def self?.lines_text: (Integer, bool) -> String
|
|
54
|
+
|
|
55
|
+
# The groups in words: `1 line: db insert into events`, `3 lines: 2
|
|
56
|
+
# db insert into scores, 1 db update rankings`, and past
|
|
57
|
+
# GROUPS_NAMED `..., and 4 more lines in 2 groups`.
|
|
58
|
+
# : (Array[Hash[Symbol, untyped]], ?bool) -> String
|
|
59
|
+
def self?.describe: (Array[Hash[Symbol, untyped]], ?bool) -> String
|
|
60
|
+
|
|
61
|
+
# The groups a count left out, each with what its table holds.
|
|
62
|
+
# : (Array[Hash[Symbol, untyped]]) -> String
|
|
63
|
+
def self?.describe_left_out: (Array[Hash[Symbol, untyped]]) -> String
|
|
64
|
+
|
|
65
|
+
# : (Array[Hash[Symbol, untyped]], bool) { (Hash[Symbol, untyped]) -> String } -> String
|
|
66
|
+
def self?.describe_groups: (Array[Hash[Symbol, untyped]], bool) { (Hash[Symbol, untyped]) -> String } -> String
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/events/format.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# The execution events line format, version 1 (docs/execution-events.md),
|
|
4
|
+
# as data: every kind and every field it defines, and the one function
|
|
5
|
+
# that turns a line of text into what the line is. Pure: no I/O, no
|
|
6
|
+
# secrets, no clock. Which step a line belongs to is decided from the trace
|
|
7
|
+
# id this module reads and the system's prefix the caller passes
|
|
8
|
+
# (`owner_of`); what the lines of one trace add up to is Tally's.
|
|
9
|
+
#
|
|
10
|
+
# A line is an event only when its kind's required fields hold values the
|
|
11
|
+
# format allows. A line that breaks that is unreadable, with the reason,
|
|
12
|
+
# and so is one that is not one JSON object, repeats a key in one object
|
|
13
|
+
# (a parser keeps one of the two values, so a record would show one and
|
|
14
|
+
# say nothing), holds an integer past 2^53 - 1 (the TypeScript engine's
|
|
15
|
+
# parser rounds it, so an id would change silently there), or has no valid
|
|
16
|
+
# `trace` or `kind`. An unreadable line has no owner: no trace id read
|
|
17
|
+
# from it is trusted, so no step's events take data from it.
|
|
18
|
+
module Nukadoko
|
|
19
|
+
module Engine
|
|
20
|
+
module Events
|
|
21
|
+
FORMAT_VERSION: ::Integer
|
|
22
|
+
|
|
23
|
+
DB_OPS: untyped
|
|
24
|
+
|
|
25
|
+
# The most primary keys one `ids` field holds.
|
|
26
|
+
IDS_CAP: ::Integer
|
|
27
|
+
|
|
28
|
+
SAFE: untyped
|
|
29
|
+
|
|
30
|
+
EXTENSION_PREFIX: ::String
|
|
31
|
+
|
|
32
|
+
# One field of a kind: its type, whether the format requires it,
|
|
33
|
+
# whether it may hold null, and the values a string field may hold.
|
|
34
|
+
class Field < Data
|
|
35
|
+
attr_reader type(): Symbol
|
|
36
|
+
|
|
37
|
+
attr_reader required(): bool
|
|
38
|
+
|
|
39
|
+
attr_reader nullable(): bool
|
|
40
|
+
|
|
41
|
+
attr_reader values(): Array[String]?
|
|
42
|
+
|
|
43
|
+
def self.new: (Symbol type, bool required, bool nullable, Array[String]? values) -> instance
|
|
44
|
+
| (type: Symbol, required: bool, nullable: bool, values: Array[String]?) -> instance
|
|
45
|
+
|
|
46
|
+
def self.members: () -> [ :type, :required, :nullable, :values ]
|
|
47
|
+
|
|
48
|
+
def members: () -> [ :type, :required, :nullable, :values ]
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# A Data block's methods are its own, but rbs-inline reads only a
|
|
52
|
+
# class body, so they are written in one.
|
|
53
|
+
class Field
|
|
54
|
+
# : (type: Symbol, required: bool, ?nullable: bool, ?values: Array[String]?) -> Field
|
|
55
|
+
def self.of: (type: Symbol, required: bool, ?nullable: bool, ?values: Array[String]?) -> Field
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
KINDS: Hash[String, Hash[String, Field]]
|
|
59
|
+
|
|
60
|
+
# What a line's `trace` field says: the trace id, in lowercase, and
|
|
61
|
+
# the span a whole `traceparent` names, nil for a bare trace id.
|
|
62
|
+
class TraceRef < Data
|
|
63
|
+
attr_reader trace_id(): String
|
|
64
|
+
|
|
65
|
+
attr_reader span(): String?
|
|
66
|
+
|
|
67
|
+
def self.new: (String trace_id, String? span) -> instance
|
|
68
|
+
| (trace_id: String, span: String?) -> instance
|
|
69
|
+
|
|
70
|
+
def self.members: () -> [ :trace_id, :span ]
|
|
71
|
+
|
|
72
|
+
def members: () -> [ :trace_id, :span ]
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# What one line is: an `event`; an `extension`, a kind the writer
|
|
76
|
+
# made up (`x_`), kept and read for nothing; an `undefined-kind`, a
|
|
77
|
+
# mistake or a later version's kind; an `unknown-version`, whose
|
|
78
|
+
# meaning is not known; or `unreadable`, with why.
|
|
79
|
+
class Line < Data
|
|
80
|
+
attr_reader state(): String
|
|
81
|
+
|
|
82
|
+
attr_reader trace(): TraceRef?
|
|
83
|
+
|
|
84
|
+
attr_reader kind(): String?
|
|
85
|
+
|
|
86
|
+
attr_reader object(): Hash[String, untyped]?
|
|
87
|
+
|
|
88
|
+
attr_reader why(): String?
|
|
89
|
+
|
|
90
|
+
def self.new: (String state, TraceRef? trace, String? kind, Hash[String, untyped]? object, String? why) -> instance
|
|
91
|
+
| (state: String, trace: TraceRef?, kind: String?, object: Hash[String, untyped]?, why: String?) -> instance
|
|
92
|
+
|
|
93
|
+
def self.members: () -> [ :state, :trace, :kind, :object, :why ]
|
|
94
|
+
|
|
95
|
+
def members: () -> [ :state, :trace, :kind, :object, :why ]
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# A Data block's methods are its own, but rbs-inline reads only a
|
|
99
|
+
# class body, so they are written in one.
|
|
100
|
+
class Line
|
|
101
|
+
# : (state: String, ?trace: TraceRef?, ?kind: String?, ?object: Hash[String, untyped]?, ?why: String?) -> Line
|
|
102
|
+
def self.of: (state: String, ?trace: TraceRef?, ?kind: String?, ?object: Hash[String, untyped]?, ?why: String?) -> Line
|
|
103
|
+
|
|
104
|
+
# : () -> bool
|
|
105
|
+
def readable?: () -> bool
|
|
106
|
+
|
|
107
|
+
# : () -> bool
|
|
108
|
+
def event?: () -> bool
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
TRACEPARENT: ::Regexp
|
|
112
|
+
|
|
113
|
+
BARE_TRACE_ID: ::Regexp
|
|
114
|
+
|
|
115
|
+
ALL_ZEROS: ::Regexp
|
|
116
|
+
|
|
117
|
+
# A W3C `traceparent` (any version but `ff`) or a bare 32-character
|
|
118
|
+
# trace id, in either case, with no id of all zeros; nil otherwise.
|
|
119
|
+
# : (untyped) -> TraceRef?
|
|
120
|
+
def self?.trace_ref_of: (untyped) -> TraceRef?
|
|
121
|
+
|
|
122
|
+
# The trace id of the step a line belongs to, in a system whose trace
|
|
123
|
+
# ids start with `prefix`, or nil: an unreadable line, or a trace the
|
|
124
|
+
# program made for a request nukadoko did not stamp.
|
|
125
|
+
# : (Line, String) -> String?
|
|
126
|
+
def self?.owner_of: (Line, String) -> String?
|
|
127
|
+
|
|
128
|
+
# The first key one object of `text` holds twice, or nil. `text` is
|
|
129
|
+
# JSON that parsed, so every string and bracket is whole.
|
|
130
|
+
# : (String) -> String?
|
|
131
|
+
def self?.repeated_key: (String) -> String?
|
|
132
|
+
|
|
133
|
+
# Whether `value` is one integer JavaScript holds exactly, as a whole
|
|
134
|
+
# float is in its one number type.
|
|
135
|
+
# : (untyped) -> bool
|
|
136
|
+
def self?.safe_integer?: (untyped) -> bool
|
|
137
|
+
|
|
138
|
+
# Why `value` does not fit `field`, or nil when it does.
|
|
139
|
+
# : (untyped, Field) -> String?
|
|
140
|
+
def self?.field_problem: (untyped, Field) -> String?
|
|
141
|
+
|
|
142
|
+
# An integer literal past 2^53 - 1 anywhere in the parsed value.
|
|
143
|
+
# : (untyped) -> bool
|
|
144
|
+
def self?.unsafe_integer?: (untyped) -> bool
|
|
145
|
+
|
|
146
|
+
# : (String) -> Line
|
|
147
|
+
def self?.unreadable: (String) -> Line
|
|
148
|
+
|
|
149
|
+
# Reads one line of a system's events file, without its line feed.
|
|
150
|
+
# : (String) -> Line
|
|
151
|
+
def self?.parse_line: (String) -> Line
|
|
152
|
+
|
|
153
|
+
# The flag a `flag` event reports, `{ name:, side:, gate: }` with the
|
|
154
|
+
# gate nil when the line names none as text; nil for any other line.
|
|
155
|
+
# : (Line) -> Hash[Symbol, untyped]?
|
|
156
|
+
def self?.flag_of: (Line) -> Hash[Symbol, untyped]?
|
|
157
|
+
|
|
158
|
+
# The request a `request` event reports, `{ method:, route:, status: }`.
|
|
159
|
+
# : (Line) -> Hash[Symbol, untyped]?
|
|
160
|
+
def self?.request_of: (Line) -> Hash[Symbol, untyped]?
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/events/lists.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
module Nukadoko
|
|
4
|
+
module Engine
|
|
5
|
+
module Events
|
|
6
|
+
# Every kind, in the order a system reads them.
|
|
7
|
+
LIST_KINDS: untyped
|
|
8
|
+
|
|
9
|
+
module Lists
|
|
10
|
+
TEXT: ^(untyped) -> String?
|
|
11
|
+
|
|
12
|
+
METHOD: ^(untyped) -> String?
|
|
13
|
+
|
|
14
|
+
HOLDS: ^(untyped) -> String?
|
|
15
|
+
|
|
16
|
+
SIDES: ^(untyped) -> String?
|
|
17
|
+
|
|
18
|
+
# Every kind of list and the fields its lines hold, each with
|
|
19
|
+
# whether it is required and why a value cannot be it. A key that is
|
|
20
|
+
# not one of them, and does not start with `x_`, is refused, so a
|
|
21
|
+
# misspelt optional field is not read as absent.
|
|
22
|
+
FIELDS: Hash[String, Hash[String, [ bool, ^(untyped) -> String? ]]]
|
|
23
|
+
|
|
24
|
+
# What a list command of `kind` printed, as the kind's entries
|
|
25
|
+
# (`{ entries: }`), or why it is not a list (`{ problem: }`). A line
|
|
26
|
+
# of whitespace alone holds no entry, so a blank line at the end, or
|
|
27
|
+
# a CR before each line feed, reads as nothing.
|
|
28
|
+
# : (String, String) -> Hash[Symbol, untyped]
|
|
29
|
+
def self?.parse: (String, String) -> Hash[Symbol, untyped]
|
|
30
|
+
|
|
31
|
+
# Line `number` of the output as an entry of `kind`, or why it is
|
|
32
|
+
# not one.
|
|
33
|
+
# : (String, String, Integer) -> Hash[Symbol, untyped]
|
|
34
|
+
def self?.line: (String, String, Integer) -> Hash[Symbol, untyped]
|
|
35
|
+
|
|
36
|
+
# What a kind's checked lines come to, merged per place, or why they
|
|
37
|
+
# are not one list.
|
|
38
|
+
# : (String, Array[[Hash[String, untyped], Integer]]) -> Hash[Symbol, untyped]
|
|
39
|
+
def self?.collect: (String, Array[[ Hash[String, untyped], Integer ]]) -> Hash[Symbol, untyped]
|
|
40
|
+
|
|
41
|
+
# A read tables list, as a count reads it: the tables it marks.
|
|
42
|
+
# : (Array[Hash[Symbol, untyped]]) -> Hash[Symbol, untyped]
|
|
43
|
+
def self?.tables_of: (Array[Hash[Symbol, untyped]]) -> Hash[Symbol, untyped]
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/events/path.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# A step's coarse execution path: what one trace's lines say the program
|
|
4
|
+
# did, counted by what each line did and no finer (a write by table and
|
|
5
|
+
# op, a job by name and phase, a served request by route and status), and
|
|
6
|
+
# the range a count of one entry lies in on a path, by the gaps the trace
|
|
7
|
+
# leaves open. Pure. Which lines are the trace's, and reading them, are
|
|
8
|
+
# the caller's (Reader#collect folds every line of a system's file when
|
|
9
|
+
# the system stops).
|
|
10
|
+
#
|
|
11
|
+
# PATH_KINDS is the one table of what a path keeps. Its order is the
|
|
12
|
+
# order a reader ranks a difference by: what persists outside the process
|
|
13
|
+
# first, then the route through it.
|
|
14
|
+
#
|
|
15
|
+
# Each service of the system writes its own file, and a step's trace runs
|
|
16
|
+
# across all of them, so every entry and every request names the service
|
|
17
|
+
# whose file held its lines: a write to one service's database is not the
|
|
18
|
+
# same entry as a write to another's, and a request a service passed on
|
|
19
|
+
# counts where it was served. A key with no service is one a record
|
|
20
|
+
# written before a system could hold several services holds.
|
|
21
|
+
#
|
|
22
|
+
# A path leaves out what is too fine or too noisy to compare across two
|
|
23
|
+
# runs of one criterion: a database read (a query count moves with every
|
|
24
|
+
# cache), a `tx` line, a row's ids, and an actor. A write to a table the
|
|
25
|
+
# program's tables list marks as bookkeeping or infrastructure stays in
|
|
26
|
+
# it, its entry carrying what the table holds, since another reader of
|
|
27
|
+
# that table may depend on it.
|
|
28
|
+
#
|
|
29
|
+
# A count on a path is a range, as a count claim's is. Lines that may be
|
|
30
|
+
# any line raise only its upper bound, and a trace that is not whole has
|
|
31
|
+
# none, except that the step's own requests are written inside first, so
|
|
32
|
+
# under `jobs-pending` alone a request count stays bounded, and a step
|
|
33
|
+
# that sent nothing and has no line has an exact empty path.
|
|
34
|
+
#
|
|
35
|
+
# A writer's own kind (`x_decision`) is in a path after the format's
|
|
36
|
+
# kinds, counted by its kind and by the fields the project names, each
|
|
37
|
+
# read at a dotted path, and by nothing else: a writer may put an id or a
|
|
38
|
+
# time in its own field, which would make every run differ from the last.
|
|
39
|
+
#
|
|
40
|
+
# An outgoing call's origin on loopback is kept without its port: a test
|
|
41
|
+
# run starts the services it calls on free ports, so a key with the port
|
|
42
|
+
# would make two runs differ by nothing the program decided.
|
|
43
|
+
module Nukadoko
|
|
44
|
+
module Engine
|
|
45
|
+
module Events
|
|
46
|
+
PATH_KINDS: Hash[String, Hash[Symbol, untyped]]
|
|
47
|
+
|
|
48
|
+
PATH_KIND_ORDER: untyped
|
|
49
|
+
|
|
50
|
+
NO_OWN_READING: Hash[Symbol, untyped]
|
|
51
|
+
|
|
52
|
+
LOOPBACK_HOSTS: untyped
|
|
53
|
+
|
|
54
|
+
ORIGIN: ::Regexp
|
|
55
|
+
|
|
56
|
+
# Whether a kind is a writer's own.
|
|
57
|
+
# : (untyped) -> bool
|
|
58
|
+
def self.own_kind?: (untyped) -> bool
|
|
59
|
+
|
|
60
|
+
# The value at a dotted path of a JSON object, nil where it has none.
|
|
61
|
+
# : (Hash[String, untyped], String) -> untyped
|
|
62
|
+
def self.value_at: (Hash[String, untyped], String) -> untyped
|
|
63
|
+
|
|
64
|
+
# The fields of a key: the format's kinds' in PATH_KINDS order, a
|
|
65
|
+
# writer's own in its key's order.
|
|
66
|
+
# : (Hash[String, untyped]) -> Array[String]
|
|
67
|
+
def self.key_fields: (Hash[String, untyped]) -> Array[String]
|
|
68
|
+
|
|
69
|
+
# A key as one text, the same for equal keys: what two paths are
|
|
70
|
+
# joined by. The service comes first, so one service's entries are
|
|
71
|
+
# told from another's wherever a key is compared.
|
|
72
|
+
# : (Hash[String, untyped]) -> String
|
|
73
|
+
def self.path_key_text: (Hash[String, untyped]) -> String
|
|
74
|
+
|
|
75
|
+
# Where a kind ranks: PATH_KINDS order, then every writer's own kind.
|
|
76
|
+
# : (String) -> Integer
|
|
77
|
+
def self.kind_rank: (String) -> Integer
|
|
78
|
+
|
|
79
|
+
# : (Hash[String, untyped], Hash[String, untyped]) -> Integer
|
|
80
|
+
def self.by_path_key: (Hash[String, untyped], Hash[String, untyped]) -> Integer
|
|
81
|
+
|
|
82
|
+
# The order of a flag's gates: the format's first, in its order,
|
|
83
|
+
# then a word it does not define, then nil.
|
|
84
|
+
# : (String?) -> [Integer, String]
|
|
85
|
+
def self.gate_order: (String?) -> [ Integer, String ]
|
|
86
|
+
|
|
87
|
+
# : (String?, String?) -> Integer
|
|
88
|
+
def self.by_gate: (String?, String?) -> Integer
|
|
89
|
+
|
|
90
|
+
# An `http` line's origin as a path keeps it: on a loopback host,
|
|
91
|
+
# without its port; any other origin as written.
|
|
92
|
+
# : (String) -> String
|
|
93
|
+
def self.path_origin: (String) -> String
|
|
94
|
+
|
|
95
|
+
# The entry a line of `service`'s file counts toward, or nil for a
|
|
96
|
+
# line that is not in a coarse path.
|
|
97
|
+
# : (Line, ?String?) -> Hash[String, untyped]?
|
|
98
|
+
def self.path_key_of: (Line, ?String?) -> Hash[String, untyped]?
|
|
99
|
+
|
|
100
|
+
# The key a writer's own line counts toward, by the fields `reading`
|
|
101
|
+
# names for its kind.
|
|
102
|
+
# : (String, Hash[String, untyped], Hash[Symbol, untyped], ?String?) -> Hash[String, untyped]
|
|
103
|
+
def self.own_key_of: (String, Hash[String, untyped], Hash[Symbol, untyped], ?String?) -> Hash[String, untyped]
|
|
104
|
+
|
|
105
|
+
# The key alone of an entry, without its count and gates.
|
|
106
|
+
# : (Hash[String, untyped]) -> Hash[String, untyped]
|
|
107
|
+
def self.key_only: (Hash[String, untyped]) -> Hash[String, untyped]
|
|
108
|
+
|
|
109
|
+
# The key of a served request: the service that served it, when the
|
|
110
|
+
# request names one.
|
|
111
|
+
# : (Hash[String, untyped]) -> Hash[String, untyped]
|
|
112
|
+
def self.request_key: (Hash[String, untyped]) -> Hash[String, untyped]
|
|
113
|
+
|
|
114
|
+
# One trace's lines, folded into its path in any order.
|
|
115
|
+
class PathFold
|
|
116
|
+
# : (Hash[Symbol, untyped], ?Hash[Symbol, untyped]) -> void
|
|
117
|
+
def initialize: (Hash[Symbol, untyped], ?Hash[Symbol, untyped]) -> void
|
|
118
|
+
|
|
119
|
+
# A readable line of `service`'s file whose trace is the fold's.
|
|
120
|
+
# : (Line, String) -> void
|
|
121
|
+
def owned: (Line, String) -> void
|
|
122
|
+
|
|
123
|
+
# An unreadable line of `service`'s file whose text carries the
|
|
124
|
+
# fold's trace id.
|
|
125
|
+
# : (String) -> void
|
|
126
|
+
def damaged: (String) -> void
|
|
127
|
+
|
|
128
|
+
# The path of the lines folded so far, with what each service's
|
|
129
|
+
# reader knows of its file.
|
|
130
|
+
# : (Hash[String, Hash[Symbol, bool]]) -> Hash[Symbol, untyped]
|
|
131
|
+
def path: (Hash[String, Hash[Symbol, bool]]) -> Hash[Symbol, untyped]
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# How many lines of `path` reported `key`.
|
|
135
|
+
# : (Hash[Symbol, untyped], Hash[String, untyped]) -> Integer
|
|
136
|
+
def self.count_of: (Hash[Symbol, untyped], Hash[String, untyped]) -> Integer
|
|
137
|
+
|
|
138
|
+
# Every key the paths hold, their requests' included, once each, in
|
|
139
|
+
# entry order.
|
|
140
|
+
# : (*Hash[Symbol, untyped]) -> Array[Hash[String, untyped]]
|
|
141
|
+
def self.keys_of: (*Hash[Symbol, untyped]) -> Array[Hash[String, untyped]]
|
|
142
|
+
|
|
143
|
+
# What the table of `key` holds on `path`, when its entry is marked.
|
|
144
|
+
# : (Hash[Symbol, untyped], Hash[String, untyped]) -> String?
|
|
145
|
+
def self.holds_on: (Hash[Symbol, untyped], Hash[String, untyped]) -> String?
|
|
146
|
+
|
|
147
|
+
# What PATH_KINDS says of a kind, apart from its fields.
|
|
148
|
+
# : (String) -> Hash[Symbol, untyped]
|
|
149
|
+
def self.kind_rule: (String) -> Hash[Symbol, untyped]
|
|
150
|
+
|
|
151
|
+
# The gaps that leave a count on `path` unbounded: the trace's,
|
|
152
|
+
# except that a step that sent nothing and has no line has none.
|
|
153
|
+
# : (Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
|
|
154
|
+
def self.bounding_gaps: (Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
|
|
155
|
+
|
|
156
|
+
# The range the count of `key` on `path` lies in.
|
|
157
|
+
# : (Hash[Symbol, untyped], Hash[String, untyped]) -> Hash[Symbol, Integer?]
|
|
158
|
+
def self.range_on: (Hash[Symbol, untyped], Hash[String, untyped]) -> Hash[Symbol, Integer?]
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|