nukadoko 0.6.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 +541 -3
- data/README.ja.md +20 -5
- data/README.md +12 -6
- 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 +395 -48
- 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 +1 -1
- data/lib/nukadoko/judgments.rb +4 -4
- 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 +1148 -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 +799 -29
- 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/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 +41 -34
- 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 +1 -1
- data/sig/generated/nukadoko/judgments.rbs +1 -1
- 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/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/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 +12 -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
|
@@ -48,14 +48,16 @@ module Nukadoko
|
|
|
48
48
|
|
|
49
49
|
attr_reader doc_string(): untyped
|
|
50
50
|
|
|
51
|
+
attr_reader doc_string_media_type(): untyped
|
|
52
|
+
|
|
51
53
|
attr_reader background(): untyped
|
|
52
54
|
|
|
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
|
+
def self.new: (untyped text, untyped line, untyped kind, untyped table, untyped doc_string, untyped doc_string_media_type, untyped background) -> instance
|
|
56
|
+
| (text: untyped, line: untyped, kind: untyped, table: untyped, doc_string: untyped, doc_string_media_type: untyped, background: untyped) -> instance
|
|
55
57
|
|
|
56
|
-
def self.members: () -> [ :text, :line, :kind, :table, :doc_string, :background ]
|
|
58
|
+
def self.members: () -> [ :text, :line, :kind, :table, :doc_string, :doc_string_media_type, :background ]
|
|
57
59
|
|
|
58
|
-
def members: () -> [ :text, :line, :kind, :table, :doc_string, :background ]
|
|
60
|
+
def members: () -> [ :text, :line, :kind, :table, :doc_string, :doc_string_media_type, :background ]
|
|
59
61
|
end
|
|
60
62
|
|
|
61
63
|
# What makes a file, or a part of one, run nothing: a file that does
|
|
@@ -31,7 +31,7 @@ module Nukadoko
|
|
|
31
31
|
class Request
|
|
32
32
|
attr_reader log: Array[Hash[Symbol, untyped]]
|
|
33
33
|
|
|
34
|
-
# `base_url` is the
|
|
34
|
+
# `base_url` is the system's URL, which a path joins onto; a project with
|
|
35
35
|
# no program has none. An absolute URL, http or https, goes where it
|
|
36
36
|
# names, so a step can call a third-party API and still have its
|
|
37
37
|
# requests recorded.
|
|
@@ -58,8 +58,11 @@ module Nukadoko
|
|
|
58
58
|
class Browser
|
|
59
59
|
# `secrets` gives the run's loaded secrets when a screenshot is taken,
|
|
60
60
|
# since an environment's env files are read after the browser is made.
|
|
61
|
-
#
|
|
62
|
-
|
|
61
|
+
# `stamped` are the URLs of the system's services a page's request to
|
|
62
|
+
# gets the step's traceparent (System#trace_origins); the primary's by
|
|
63
|
+
# default.
|
|
64
|
+
# : (String?, ?Hash[Symbol, untyped], ?secrets: ^() -> Secrets, ?stamped: Array[String]?) -> void
|
|
65
|
+
def initialize: (String?, ?Hash[Symbol, untyped], ?secrets: ^() -> Secrets, ?stamped: Array[String]?) -> void
|
|
63
66
|
|
|
64
67
|
# Opaque, so a masked secret leaves no trace of its glyphs.
|
|
65
68
|
MASK_COLOR: ::String
|
|
@@ -97,7 +100,7 @@ module Nukadoko
|
|
|
97
100
|
# that step's.
|
|
98
101
|
attr_writer step: Hash[Symbol, untyped]?
|
|
99
102
|
|
|
100
|
-
# Which requests to the
|
|
103
|
+
# Which requests to the system the page had finished receiving the
|
|
101
104
|
# response of, and which were in flight, around a claim step's
|
|
102
105
|
# reading: an order of the events this process received, never a
|
|
103
106
|
# claim that the page drew from a response. Only a document, a
|
|
@@ -110,8 +113,49 @@ module Nukadoko
|
|
|
110
113
|
# : [T] () { () -> T } -> T
|
|
111
114
|
def reading: [T] () { () -> T } -> T
|
|
112
115
|
|
|
113
|
-
#
|
|
114
|
-
|
|
116
|
+
# A step's page events start empty, and so does its tally of the
|
|
117
|
+
# page's requests left out of http.jsonl.
|
|
118
|
+
# : () -> void
|
|
119
|
+
def begin_step: () -> void
|
|
120
|
+
|
|
121
|
+
PAGE_EVENT_KINDS: untyped
|
|
122
|
+
|
|
123
|
+
# A redirect loop or a chatty page can emit thousands of these in one
|
|
124
|
+
# step, so each kind keeps 100 entries and counts the rest under
|
|
125
|
+
# `truncated`, never by changing the kind's own shape.
|
|
126
|
+
PAGE_EVENTS_CAP: ::Integer
|
|
127
|
+
|
|
128
|
+
# The page's requests that land in http.jsonl, with their status; a
|
|
129
|
+
# script, a stylesheet, or an image is only counted, by its type.
|
|
130
|
+
PAGE_LOGGED_TYPES: untyped
|
|
131
|
+
|
|
132
|
+
# What the page of `context` did that no step asked about: each
|
|
133
|
+
# console.error call, each error it threw that nothing caught (the
|
|
134
|
+
# name an @expects:page-error= tag accepts), and each request that
|
|
135
|
+
# failed at the network level, each with `as` for a named context.
|
|
136
|
+
# : (untyped, String?) -> void
|
|
137
|
+
def watch_page: (untyped, String?) -> void
|
|
138
|
+
|
|
139
|
+
# : (Symbol, Hash[Symbol, untyped]) -> void
|
|
140
|
+
def note_page_event: (Symbol, Hash[Symbol, untyped]) -> void
|
|
141
|
+
|
|
142
|
+
# The step's page events as its record holds them, nil when there
|
|
143
|
+
# were none: each kind a bare array, and `truncated` naming each kind
|
|
144
|
+
# that hit the cap with its true total.
|
|
145
|
+
# : () -> Hash[Symbol, untyped]?
|
|
146
|
+
def page_events: () -> Hash[Symbol, untyped]?
|
|
147
|
+
|
|
148
|
+
# The page's requests the step's http.jsonl left out, by type, nil
|
|
149
|
+
# when there were none.
|
|
150
|
+
# : () -> Hash[String, Integer]?
|
|
151
|
+
def http_omitted: () -> Hash[String, Integer]?
|
|
152
|
+
|
|
153
|
+
# A listener that writes each response the page received to `log`:
|
|
154
|
+
# a document, a fetch, or an XMLHttpRequest with its status, so a
|
|
155
|
+
# failure underneath a step is the server's own answer; any other
|
|
156
|
+
# request is counted by its type.
|
|
157
|
+
# : (Array[Hash[Symbol, untyped]], String?) -> ^(untyped) -> void
|
|
158
|
+
def page_logger: (Array[Hash[Symbol, untyped]], String?) -> ^(untyped) -> void
|
|
115
159
|
|
|
116
160
|
# A claim step's `pages`, `page_requests`, and `judged_view`, after
|
|
117
161
|
# the reading its claims were judged on, when a page was open.
|
|
@@ -137,15 +181,17 @@ module Nukadoko
|
|
|
137
181
|
# : () -> Float
|
|
138
182
|
def monotonic: () -> Float
|
|
139
183
|
|
|
140
|
-
# A page's documents, fetches, and XMLHttpRequests to
|
|
184
|
+
# A page's documents, fetches, and XMLHttpRequests to a stamped
|
|
185
|
+
# service of the system get
|
|
141
186
|
# the running step's traceparent through the Chrome DevTools
|
|
142
187
|
# Protocol's Fetch domain, on a session of the page's own: a header set
|
|
143
188
|
# on the whole context would reach other origins too, and a route
|
|
144
189
|
# turns the browser's cache off. Images, scripts, and stylesheets are
|
|
145
190
|
# left out, since each paused request costs a round trip. A session
|
|
146
|
-
# that cannot be opened leaves the page's requests unstamped
|
|
147
|
-
#
|
|
148
|
-
|
|
191
|
+
# that cannot be opened leaves the page's requests unstamped, and so
|
|
192
|
+
# does a system with no service to stamp.
|
|
193
|
+
# : (untyped, untyped) -> void
|
|
194
|
+
def stamp: (untyped, untyped) -> void
|
|
149
195
|
|
|
150
196
|
# How long a pause waits for each capture of the page's view. A page
|
|
151
197
|
# whose main thread is stuck answers none of them, and without a
|
|
@@ -183,7 +229,7 @@ module Nukadoko
|
|
|
183
229
|
# The page of a browser context of its own, named `name`, so a second
|
|
184
230
|
# person in the scenario has cookies and storage of their own. The
|
|
185
231
|
# context opens on the first call for the name in the scenario, with
|
|
186
|
-
# `options` over the
|
|
232
|
+
# `options` over the system's base URL, and a later call gets the same
|
|
187
233
|
# page. Each step that calls it gets a trace chunk, trace.<name>.zip,
|
|
188
234
|
# and the page's requests go to the step's log with `as`.
|
|
189
235
|
# : (String, Hash[untyped, untyped]?, String, Array[Hash[Symbol, untyped]]) -> untyped
|
|
@@ -202,6 +248,16 @@ module Nukadoko
|
|
|
202
248
|
# : () -> Hash[String, [String, untyped]]
|
|
203
249
|
def step_named: () -> Hash[String, [ String, untyped ]]
|
|
204
250
|
|
|
251
|
+
# When each page request started, by the request itself, for its
|
|
252
|
+
# http.jsonl line's duration.
|
|
253
|
+
# : () -> Hash[untyped, Float]
|
|
254
|
+
def page_started: () -> Hash[untyped, Float]
|
|
255
|
+
|
|
256
|
+
# The traceparents page requests went out with, by method and URL,
|
|
257
|
+
# oldest first.
|
|
258
|
+
# : () -> Hash[[String, String], Array[String]]
|
|
259
|
+
def page_stamps: () -> Hash[[ String, String ], Array[String]]
|
|
260
|
+
|
|
205
261
|
public
|
|
206
262
|
|
|
207
263
|
# : () -> void
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
# Requests a step sends through Net::HTTP itself, without the `request`
|
|
4
4
|
# fixture, measured as the TypeScript engine measures a step's own `fetch`:
|
|
5
5
|
# each lands in the step's http.jsonl with `via: "net/http"`, and one to
|
|
6
|
-
# the
|
|
6
|
+
# the system's origin carries the step's traceparent. It records only while
|
|
7
7
|
# a step runs, on the thread that runs it, so a fixture's setup, the
|
|
8
8
|
# engine's own readiness check, and the `request` fixture (which records
|
|
9
9
|
# its requests itself) go through Net::HTTP untouched.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/intent.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# Responsibility: the intent file's format (docs/intent.md): what a change
|
|
4
|
+
# declares it means to do differently, as one Markdown table whose rows
|
|
5
|
+
# are target x observation x before -> after, each cell in the execution
|
|
6
|
+
# events vocabulary. Reading it, writing it back, and the two questions a
|
|
7
|
+
# row answers about one entry of a path: does the row aim at it, and does
|
|
8
|
+
# a difference on it go the way the row says. Pure. Boundary: where the
|
|
9
|
+
# file is and what git says of it are IntentFile's; which criteria a row
|
|
10
|
+
# reached, and what each came to, are IntentView's.
|
|
11
|
+
#
|
|
12
|
+
# Only the table whose header is exactly
|
|
13
|
+
# `| Target | Observation | Before | After |` is read; prose around it is
|
|
14
|
+
# for people. A cell's terms are the events vocabulary: a kind, and
|
|
15
|
+
# `field<op>value` over a line's fields, so a row names what the program
|
|
16
|
+
# reports and never a step, a criterion's text, or an id.
|
|
17
|
+
#
|
|
18
|
+
# A value is JSON when it parses as JSON and is otherwise the bare text:
|
|
19
|
+
# `plan:team` and `"plan:team"` are one value, and `10` is a number. A
|
|
20
|
+
# term ends at a space outside a JSON string or brackets, so a value with
|
|
21
|
+
# spaces is written as JSON, and a `|` in a cell is written `\|`, as
|
|
22
|
+
# Markdown has it.
|
|
23
|
+
#
|
|
24
|
+
# Before and after say how many lines a step's path counts for an
|
|
25
|
+
# observation with no bare field (`0` -> `1`), or which value the bare
|
|
26
|
+
# field had. Both left empty says the observation is not meant to change
|
|
27
|
+
# at all, which is how a refactor declares that decisions stay as they
|
|
28
|
+
# were. A row that cannot be read is a problem named by its line, never
|
|
29
|
+
# left out in silence.
|
|
30
|
+
module Nukadoko
|
|
31
|
+
module Engine
|
|
32
|
+
module Intent
|
|
33
|
+
FILE: ::String
|
|
34
|
+
|
|
35
|
+
HEADER: untyped
|
|
36
|
+
|
|
37
|
+
OPS: untyped
|
|
38
|
+
|
|
39
|
+
FIELD: ::Regexp
|
|
40
|
+
|
|
41
|
+
# The cells of a Markdown table line: between its outer pipes, split
|
|
42
|
+
# at each `|` that `\` does not escape, each trimmed, `\|` read as `|`.
|
|
43
|
+
# : (String) -> Array[String]?
|
|
44
|
+
def self?.table_cells: (String) -> Array[String]?
|
|
45
|
+
|
|
46
|
+
# A cell as a table line holds it: `|` escaped.
|
|
47
|
+
# : (String) -> String
|
|
48
|
+
def self?.cell_text: (String) -> String
|
|
49
|
+
|
|
50
|
+
# The terms of a cell, split at each run of spaces outside a JSON
|
|
51
|
+
# string and outside brackets.
|
|
52
|
+
# : (String) -> Array[String]
|
|
53
|
+
def self?.split_terms: (String) -> Array[String]
|
|
54
|
+
|
|
55
|
+
# A value as written: JSON when it parses, the bare text otherwise.
|
|
56
|
+
# : (String) -> untyped
|
|
57
|
+
def self?.value_of: (String) -> untyped
|
|
58
|
+
|
|
59
|
+
# A value as a cell writes it: bare when that reads back as the same
|
|
60
|
+
# value and holds no space, pipe, quote, or bracket, and JSON
|
|
61
|
+
# otherwise.
|
|
62
|
+
# : (untyped) -> String
|
|
63
|
+
def self?.value_text: (untyped) -> String
|
|
64
|
+
|
|
65
|
+
# : (String) -> Hash[Symbol, untyped]
|
|
66
|
+
def self?.term_of: (String) -> Hash[Symbol, untyped]
|
|
67
|
+
|
|
68
|
+
# Why a field cannot be read on a kind's lines, or nil.
|
|
69
|
+
# : (String, String) -> String?
|
|
70
|
+
def self?.field_problem: (String, String) -> String?
|
|
71
|
+
|
|
72
|
+
# A term as a path's key reads it: an `http` origin on loopback
|
|
73
|
+
# without its port, as a path keeps it.
|
|
74
|
+
# : (String, Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
|
|
75
|
+
def self?.key_term: (String, Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
|
|
76
|
+
|
|
77
|
+
# : (String) -> Integer?
|
|
78
|
+
def self?.count_of: (String) -> Integer?
|
|
79
|
+
|
|
80
|
+
# : (Integer, Integer, Hash[Symbol, String]) -> Hash[Symbol, untyped]
|
|
81
|
+
def self?.row_of: (Integer, Integer, Hash[Symbol, String]) -> Hash[Symbol, untyped]
|
|
82
|
+
|
|
83
|
+
# Reads the intent file's text: `{ rows:, problems: }`. Pure.
|
|
84
|
+
# : (String) -> Hash[Symbol, Array[Hash[Symbol, untyped]]]
|
|
85
|
+
def self?.parse: (String) -> Hash[Symbol, Array[Hash[Symbol, untyped]]]
|
|
86
|
+
|
|
87
|
+
# The table a list of rows' cells makes, header first: what `parse`
|
|
88
|
+
# reads back to the same cells.
|
|
89
|
+
# : (Array[Hash[Symbol, String]]) -> String
|
|
90
|
+
def self?.table: (Array[Hash[Symbol, String]]) -> String
|
|
91
|
+
|
|
92
|
+
# For each writer's own kind a row observes, every field a row reads
|
|
93
|
+
# on it, so a path counts the kind by them.
|
|
94
|
+
# : (Hash[Symbol, untyped]) -> Hash[String, Array[String]]
|
|
95
|
+
def self?.own_fields: (Hash[Symbol, untyped]) -> Hash[String, Array[String]]
|
|
96
|
+
|
|
97
|
+
# Two values are one when their JSON is, objects' keys in any order.
|
|
98
|
+
# : (untyped, untyped) -> bool
|
|
99
|
+
def self?.same_value?: (untyped, untyped) -> bool
|
|
100
|
+
|
|
101
|
+
# : (untyped) -> String
|
|
102
|
+
def self?.canonical: (untyped) -> String
|
|
103
|
+
|
|
104
|
+
# The value a key or a line holds at a field: a path's own key holds
|
|
105
|
+
# a dotted field as one name, a line as nested objects. `nil` with
|
|
106
|
+
# `found: false` when it holds none.
|
|
107
|
+
# : (Hash[String, untyped], String) -> [bool, untyped]
|
|
108
|
+
def self?.field_value: (Hash[String, untyped], String) -> [ bool, untyped ]
|
|
109
|
+
|
|
110
|
+
# Whether a term holds on a record. A field the record lacks meets no
|
|
111
|
+
# term, and an order compares two numbers or two strings alone.
|
|
112
|
+
# : (Hash[Symbol, untyped], Hash[String, untyped]) -> bool
|
|
113
|
+
def self?.term_holds?: (Hash[Symbol, untyped], Hash[String, untyped]) -> bool
|
|
114
|
+
|
|
115
|
+
# Whether a row aims at an entry of a path: its kind, and every
|
|
116
|
+
# condition and filter holds on it.
|
|
117
|
+
# : (Hash[Symbol, untyped], Hash[String, untyped]) -> bool
|
|
118
|
+
def self?.observes?: (Hash[Symbol, untyped], Hash[String, untyped]) -> bool
|
|
119
|
+
|
|
120
|
+
# : (Hash[Symbol, untyped], Integer) -> bool
|
|
121
|
+
def self?.within?: (Hash[Symbol, untyped], Integer) -> bool
|
|
122
|
+
|
|
123
|
+
# Whether a difference on an entry the row observes goes the way the
|
|
124
|
+
# row says. For a count: the base side can hold `before` and head
|
|
125
|
+
# `after`. For a value: the entry holds `before` and fewer lines at
|
|
126
|
+
# head, or `after` and more; the caller pairs the two. A row meant not
|
|
127
|
+
# to change declares no difference.
|
|
128
|
+
# : (Hash[Symbol, untyped], Hash[String, untyped], Hash[Symbol, untyped], Hash[Symbol, untyped]) -> Symbol?
|
|
129
|
+
def self?.declares: (Hash[Symbol, untyped], Hash[String, untyped], Hash[Symbol, untyped], Hash[Symbol, untyped]) -> Symbol?
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/intent_file.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# Responsibility: the intent a change declares (docs/intent.md), read
|
|
4
|
+
# under `nuka run --base`: the file at the repository's top as head's
|
|
5
|
+
# working tree holds it, and what git says of it since the base. Boundary:
|
|
6
|
+
# git and the disk only; the format is Intent's, what each row came to
|
|
7
|
+
# IntentView's.
|
|
8
|
+
#
|
|
9
|
+
# The file is the change's when the change wrote it: a file the base
|
|
10
|
+
# already holds unchanged is an earlier change's intent, merged with it,
|
|
11
|
+
# and says nothing about this one. So a run reads it only when head's
|
|
12
|
+
# text differs from the base's, and a change that removes it declares
|
|
13
|
+
# nothing.
|
|
14
|
+
#
|
|
15
|
+
# The reviewer reads when it was declared: in the change's first commit,
|
|
16
|
+
# before anything it judges was written, or later, and each commit since
|
|
17
|
+
# that changed it again. A change of intent is itself a difference the
|
|
18
|
+
# reviewer approves, so it is named, never folded into the rows.
|
|
19
|
+
module Nukadoko
|
|
20
|
+
module Engine
|
|
21
|
+
module IntentFile
|
|
22
|
+
# git did not answer.
|
|
23
|
+
class GitFailed < StandardError
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# The intent the change at `project` declares against `base_commit`:
|
|
27
|
+
# `{ intent:, record: }`, the record run.json's `intent` before its
|
|
28
|
+
# rows are judged, or nil when it declares none. Raises GitFailed
|
|
29
|
+
# when git does not answer.
|
|
30
|
+
# : (String, String) -> Hash[Symbol, untyped]?
|
|
31
|
+
def self?.read: (String, String) -> Hash[Symbol, untyped]?
|
|
32
|
+
|
|
33
|
+
# : (String, *String) -> String
|
|
34
|
+
def self?.git: (String, *String) -> String
|
|
35
|
+
|
|
36
|
+
# The file at a commit, or nil when the commit holds none.
|
|
37
|
+
# : (String, String) -> String?
|
|
38
|
+
def self?.at_commit: (String, String) -> String?
|
|
39
|
+
|
|
40
|
+
# The commits after `base` up to HEAD, oldest first, each with its
|
|
41
|
+
# subject: all of them, or with `file`, those that changed it.
|
|
42
|
+
# : (String, String, ?String?) -> Array[Hash[Symbol, String]]
|
|
43
|
+
def self?.commits_since: (String, String, ?String?) -> Array[Hash[Symbol, String]]
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/intent_view.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# Responsibility: what each row of a change's intent came to against the
|
|
4
|
+
# base pairs of run.json's `paths` (docs/intent.md), and which row declares
|
|
5
|
+
# each difference there. Pure: it reads the comparisons, the scenarios
|
|
6
|
+
# they name, and each criterion's tags. Boundary: reading the intent is
|
|
7
|
+
# Intent's, comparing two paths PathView's; this module adds the account
|
|
8
|
+
# and changes no count.
|
|
9
|
+
#
|
|
10
|
+
# A row aims at a criterion that carries every tag of its target, and,
|
|
11
|
+
# when its target or a bare field reads a line's values, whose steps on
|
|
12
|
+
# either side hold an entry those values meet. A row that counts lines
|
|
13
|
+
# with no such term aims at every criterion its tags name, since `0 -> 1`
|
|
14
|
+
# must be told apart from nothing happening where nothing was there to
|
|
15
|
+
# see. Each criterion it aims at either did what it says or did not: a
|
|
16
|
+
# row meant to change declares a difference there, and one meant not to
|
|
17
|
+
# change finds no difference on what it observes that no other row
|
|
18
|
+
# declares. A row that aimed at no compared criterion was not reached.
|
|
19
|
+
#
|
|
20
|
+
# A value row declares a difference only in pairs, within one step: the
|
|
21
|
+
# lines that held the old value go, and as many that hold the new one
|
|
22
|
+
# come. A value that went somewhere else is no such pair, so neither half
|
|
23
|
+
# is declared.
|
|
24
|
+
#
|
|
25
|
+
# Only a decided difference (`changed`) is declared or not: an `open` one
|
|
26
|
+
# could still read the same. A changed criterion of a base pair whose
|
|
27
|
+
# every difference a row declares, with no step that ran on one side
|
|
28
|
+
# alone, is explained by the intent; a new or changed criterion keeps its
|
|
29
|
+
# own sentences as the account for the rest; anything else is a
|
|
30
|
+
# difference nothing the change declares asked for.
|
|
31
|
+
module Nukadoko
|
|
32
|
+
module Engine
|
|
33
|
+
module IntentView
|
|
34
|
+
# : (Hash[Symbol, untyped]) -> String
|
|
35
|
+
def self?.place_text: (Hash[Symbol, untyped]) -> String
|
|
36
|
+
|
|
37
|
+
# A difference's key, as a row reads it.
|
|
38
|
+
# : (Hash[Symbol, untyped]) -> Hash[String, untyped]
|
|
39
|
+
def self?.key_of: (Hash[Symbol, untyped]) -> Hash[String, untyped]
|
|
40
|
+
|
|
41
|
+
# : (Hash[Symbol, untyped]?) -> Array[Hash[String, untyped]]
|
|
42
|
+
def self?.keys_of_path: (Hash[Symbol, untyped]?) -> Array[Hash[String, untyped]]
|
|
43
|
+
|
|
44
|
+
# Whether a row aims at a criterion, from its tags and every entry its
|
|
45
|
+
# two sides' steps hold.
|
|
46
|
+
# : (Hash[Symbol, untyped], Array[String], Array[Hash[String, untyped]]) -> bool
|
|
47
|
+
def self?.aims?: (Hash[Symbol, untyped], Array[String], Array[Hash[String, untyped]]) -> bool
|
|
48
|
+
|
|
49
|
+
# The first row that declares each difference of one step, by its
|
|
50
|
+
# index among `changed`, in the rows' order: a count at once, a value
|
|
51
|
+
# in pairs.
|
|
52
|
+
# : (Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]]) -> Hash[Integer, Integer]
|
|
53
|
+
def self?.declared: (Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]]) -> Hash[Integer, Integer]
|
|
54
|
+
|
|
55
|
+
# Judges each row against the base pairs of `paths`: `{ paths:, rows: }`.
|
|
56
|
+
# `tags_of` gives a criterion's tags, as head's feature file has them.
|
|
57
|
+
# : (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]], ^(Hash[Symbol, untyped]) -> Array[String]) -> Hash[Symbol, untyped]
|
|
58
|
+
def self?.judge: (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]], Array[Hash[Symbol, untyped]], ^(Hash[Symbol, untyped]) -> Array[String]) -> Hash[Symbol, untyped]
|
|
59
|
+
|
|
60
|
+
# The findings that gate a run whose change declares an intent: each
|
|
61
|
+
# problem reading it, each criterion with a difference nothing the
|
|
62
|
+
# change declares, and each row that did not happen where it aimed. A
|
|
63
|
+
# row not reached gates nothing. `rerun` gives the command that runs
|
|
64
|
+
# one criterion against the same base.
|
|
65
|
+
# : (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], ^(Hash[Symbol, untyped]) -> String) -> Array[Hash[Symbol, untyped]]
|
|
66
|
+
def self?.findings: (Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], ^(Hash[Symbol, untyped]) -> String) -> Array[Hash[Symbol, untyped]]
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
# The files sit in `judgments/` at the project root, one per feature file
|
|
8
8
|
# at the same relative path with `.json` added, outside the features
|
|
9
9
|
# directory on purpose: there every file is mapping, so a judgment added
|
|
10
|
-
# would make `--base` run each unchanged criterion again in the old
|
|
10
|
+
# would make `--base` run each unchanged criterion again in the old system,
|
|
11
11
|
# when a judgment changes no step. Nor do they live in the run directory,
|
|
12
12
|
# which retention removes and nobody reviews: a judgment is committed, and
|
|
13
13
|
# the commit and its review are the record of who judged.
|
|
@@ -93,7 +93,7 @@ module Nukadoko
|
|
|
93
93
|
# the base's file already held that very judgment (the same claim,
|
|
94
94
|
# value, verdict, judge, reason, and time), false when the change
|
|
95
95
|
# brought it. A change cannot be trusted to judge its own output any
|
|
96
|
-
# more than to rewrite its own Thens, and the old
|
|
96
|
+
# more than to rewrite its own Thens, and the old system covers only
|
|
97
97
|
# the Thens. `base_entries_of` answers nil for a feature whose base
|
|
98
98
|
# file could not be read, and its reads stay unmarked.
|
|
99
99
|
# : (Array[Hash[Symbol, untyped]], ^(String) -> Array[Hash[Symbol, untyped]]?) -> Array[Hash[Symbol, untyped]]
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/measure_mcp.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# `Nukadoko.measure_mcp`, which makes the MCP calls a step sends through a
|
|
4
|
+
# client's transport part of the step record (docs/spec.md "MCP calls"):
|
|
5
|
+
# each request and notification becomes a line of the step's mcp.jsonl
|
|
6
|
+
# with the answer it got, and carries the step's trace context in
|
|
7
|
+
# `params._meta.traceparent`, so the server's log lines and execution
|
|
8
|
+
# events for the call are the step's. It decides no verdict: an `isError`
|
|
9
|
+
# result or a JSON-RPC error is an answer the step reads.
|
|
10
|
+
#
|
|
11
|
+
# It wraps the transport, not the client. The mcp gem's client calls only
|
|
12
|
+
# `send_request(request:)`, which returns the answer, and
|
|
13
|
+
# `send_notification(notification:)` on its transport, so the wrapper
|
|
14
|
+
# measures those two and hands every other method to the transport as it
|
|
15
|
+
# is: a project keeps the official client, and nukadoko requires no MCP
|
|
16
|
+
# gem.
|
|
17
|
+
#
|
|
18
|
+
# It finds the step at each send, on the thread that sends, as the
|
|
19
|
+
# requests a step sends through Net::HTTP are found. A client is usually
|
|
20
|
+
# made in a scenario fixture, outside every step, and called from several
|
|
21
|
+
# steps, so a step bound when the transport was wrapped would be the wrong
|
|
22
|
+
# one. A message sent outside every step (the client's `initialize`, or a
|
|
23
|
+
# request the client sends from a thread of its own) goes as it was given
|
|
24
|
+
# and is recorded nowhere.
|
|
25
|
+
#
|
|
26
|
+
# Over HTTP to the system, the request the transport sends for a call goes
|
|
27
|
+
# out with the call's traceparent as its header, and counts as a stamped
|
|
28
|
+
# request with the call's span, so the program's `request` line for it
|
|
29
|
+
# closes the call. Over stdio no line can close a call: that is the
|
|
30
|
+
# `mcp-unbounded` gap.
|
|
31
|
+
module Nukadoko
|
|
32
|
+
# `transport`, measured: give it to the MCP client in its place.
|
|
33
|
+
# : [T] (T) -> T
|
|
34
|
+
def self.measure_mcp: [T] (T) -> T
|
|
35
|
+
|
|
36
|
+
module Engine
|
|
37
|
+
module McpCalls
|
|
38
|
+
FILE: ::String
|
|
39
|
+
|
|
40
|
+
# The params member that names each method's target, by the line
|
|
41
|
+
# field that keeps it. A method MCP adds later is one more row.
|
|
42
|
+
TARGETS: Hash[String, [ Symbol, String ]]
|
|
43
|
+
|
|
44
|
+
# : [T] (Array[Hash[Symbol, untyped]]) { () -> T } -> T
|
|
45
|
+
def self.collect: [T] (Array[Hash[Symbol, untyped]]) { () -> T } -> T
|
|
46
|
+
|
|
47
|
+
# The call whose transport is sending now: the traceparent its HTTP
|
|
48
|
+
# request takes, and the origins that got it.
|
|
49
|
+
# : () -> Hash[Symbol, untyped]?
|
|
50
|
+
def self.sending: () -> Hash[Symbol, untyped]?
|
|
51
|
+
|
|
52
|
+
# : [T] (Hash[Symbol, untyped]) { () -> T } -> T
|
|
53
|
+
def self.sending_as: [T] (Hash[Symbol, untyped]) { () -> T } -> T
|
|
54
|
+
|
|
55
|
+
# The header an MCP call's own HTTP request to a service of the system
|
|
56
|
+
# takes: the call's traceparent, so the header and `params._meta`
|
|
57
|
+
# carry one value. Nil outside a call, or to another origin.
|
|
58
|
+
# : (String) -> String?
|
|
59
|
+
def self.traceparent_for: (String) -> String?
|
|
60
|
+
|
|
61
|
+
# A member of a message, whichever kind of key it was written with.
|
|
62
|
+
# : (untyped, String) -> untyped
|
|
63
|
+
def self.member: (untyped, String) -> untyped
|
|
64
|
+
|
|
65
|
+
# : (untyped) -> String?
|
|
66
|
+
def self.traceparent_in: (untyped) -> String?
|
|
67
|
+
|
|
68
|
+
# `message` with `traceparent` in `params._meta`, as a new Hash with
|
|
69
|
+
# keys of the kind the message has. A message that already carries a
|
|
70
|
+
# traceparent keeps it, as a request that sets its own header does,
|
|
71
|
+
# and one whose `params` is not a Hash goes as it was: JSON-RPC allows
|
|
72
|
+
# positional params, and an Array has no place for the key.
|
|
73
|
+
# : (Hash[untyped, untyped], String) -> Hash[untyped, untyped]
|
|
74
|
+
def self.stamp: (Hash[untyped, untyped], String) -> Hash[untyped, untyped]
|
|
75
|
+
|
|
76
|
+
# A call as it starts: the message as it goes out, and the
|
|
77
|
+
# traceparent nukadoko gave it, nil when it kept the step's own or
|
|
78
|
+
# the run has no system.
|
|
79
|
+
# : (Hash[untyped, untyped]) -> Hash[Symbol, untyped]
|
|
80
|
+
def self.start: (Hash[untyped, untyped]) -> Hash[Symbol, untyped]
|
|
81
|
+
|
|
82
|
+
# The mcp.jsonl line of a call and how it ended. The params and the
|
|
83
|
+
# result are their JSON text, kept as a body is; a JSON-RPC error
|
|
84
|
+
# keeps its code and the first line of its message, which can carry
|
|
85
|
+
# a stack. The record redacts the line as it writes it.
|
|
86
|
+
# : (Hash[Symbol, untyped], **untyped) -> Hash[Symbol, untyped]
|
|
87
|
+
def self.line: (Hash[Symbol, untyped], **untyped) -> Hash[Symbol, untyped]
|
|
88
|
+
|
|
89
|
+
# : (untyped) -> Hash[Symbol, untyped]
|
|
90
|
+
def self.kept: (untyped) -> Hash[Symbol, untyped]
|
|
91
|
+
|
|
92
|
+
# The transport, measured. Recording never breaks the call: the
|
|
93
|
+
# transport's own error goes on to the client unchanged.
|
|
94
|
+
class Measured < SimpleDelegator
|
|
95
|
+
# : (request: Hash[untyped, untyped]) ?{ () -> void } -> untyped
|
|
96
|
+
def send_request: (request: Hash[untyped, untyped]) ?{ () -> void } -> untyped
|
|
97
|
+
|
|
98
|
+
# A notification has no answer, so its line is written as it goes.
|
|
99
|
+
# : (notification: Hash[untyped, untyped]) -> untyped
|
|
100
|
+
def send_notification: (notification: Hash[untyped, untyped]) -> untyped
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
@@ -14,8 +14,8 @@ module Nukadoko
|
|
|
14
14
|
|
|
15
15
|
attr_reader calls: untyped
|
|
16
16
|
|
|
17
|
-
# : (singleton(Nukadoko::Step), Hash[Symbol, untyped]) -> void
|
|
18
|
-
def initialize: (singleton(Nukadoko::Step), Hash[Symbol, untyped]) -> void
|
|
17
|
+
# : (singleton(Nukadoko::Step), Hash[Symbol, untyped], ?refuse: ^(untyped) -> String?) -> void
|
|
18
|
+
def initialize: (singleton(Nukadoko::Step), Hash[Symbol, untyped], ?refuse: ^(untyped) -> String?) -> void
|
|
19
19
|
|
|
20
20
|
# : () -> Proc
|
|
21
21
|
def to_proc: () -> Proc
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Generated from lib/nukadoko/path_view.rb with RBS::Inline
|
|
2
|
+
|
|
3
|
+
# Responsibility: run.json's `paths` (docs/spec.md "Execution events"):
|
|
4
|
+
# for each pair of sides the run can compare, what each criterion's steps
|
|
5
|
+
# did differently on one side than on the other, as their paths say
|
|
6
|
+
# (events/path.rb), so a person about to turn a change on for everyone
|
|
7
|
+
# reads what changed in what the program did. Pure: it reads run.json's
|
|
8
|
+
# own fields and nothing else. Boundary: a path, and the range a count on
|
|
9
|
+
# it lies in, are events/path.rb's; the cells and their outcomes are the
|
|
10
|
+
# table's; this module adds no verdict.
|
|
11
|
+
#
|
|
12
|
+
# A pair is two sides of one criterion. Under `nuka run --base`, each
|
|
13
|
+
# environment's base system is paired with its head system, for the rows
|
|
14
|
+
# whose head cell there is required and ran. Otherwise it is two head
|
|
15
|
+
# environments whose declared `conditions` differ in exactly one
|
|
16
|
+
# condition. Steps align by their line in head's feature file, and a
|
|
17
|
+
# criterion whose two step lists differ is not compared. A side is read
|
|
18
|
+
# from its cell's first execution, since repeats and proof runs add more.
|
|
19
|
+
#
|
|
20
|
+
# Two counts are the same when both are exact and equal, changed when
|
|
21
|
+
# their ranges cannot meet, and open otherwise: a count a side's missing
|
|
22
|
+
# lines could still reach never reads as a change. A criterion whose every
|
|
23
|
+
# open count reads the same on both sides, under the same gap words, is
|
|
24
|
+
# `same_so_far`. In a pair of environments, a flag's side differing is the
|
|
25
|
+
# switch the pair was made to compare, so a kind PATH_KINDS marks as the
|
|
26
|
+
# premise is never among what changed. Against the base, it is compared as
|
|
27
|
+
# any kind is.
|
|
28
|
+
#
|
|
29
|
+
# A write to a table the tables list marks is compared too, and its
|
|
30
|
+
# difference carries what the table holds. A criterion's `result` reads
|
|
31
|
+
# the other differences alone, and one whose only differences are on
|
|
32
|
+
# marked tables is `marked_only`, never `same`: something did differ.
|
|
33
|
+
#
|
|
34
|
+
# Against the base, a changed criterion says what accounts for it: on a
|
|
35
|
+
# new or changed criterion, the new sentences a person approves; on an
|
|
36
|
+
# unchanged one, nothing in the feature files, which is the one a reader
|
|
37
|
+
# is sent to first.
|
|
38
|
+
module Nukadoko
|
|
39
|
+
module Engine
|
|
40
|
+
module PathView
|
|
41
|
+
RESULTS: untyped
|
|
42
|
+
|
|
43
|
+
# One comparison per pair of sides the run can compare: each base
|
|
44
|
+
# pair, then each pair of environments, in the run's order of
|
|
45
|
+
# environments; [] when there is none.
|
|
46
|
+
# : (Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
|
|
47
|
+
def self?.compare: (Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
|
|
48
|
+
|
|
49
|
+
# : (Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
|
|
50
|
+
def self?.base_pairs: (Hash[Symbol, untyped]) -> Array[Hash[Symbol, untyped]]
|
|
51
|
+
|
|
52
|
+
# Every two environments whose declared conditions differ in exactly
|
|
53
|
+
# one: side `a` holds false or no value where `b` holds true, and
|
|
54
|
+
# otherwise the earlier environment.
|
|
55
|
+
# : (Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
56
|
+
def self?.condition_pairs: (Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
57
|
+
|
|
58
|
+
# Whether a side's system read its events: "read", "none" when no
|
|
59
|
+
# base system started in the environment, or why it gave no paths.
|
|
60
|
+
# : (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> (String | Hash[Symbol, String])
|
|
61
|
+
def self?.reading_of: (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> (String | Hash[Symbol, String])
|
|
62
|
+
|
|
63
|
+
# : (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> String
|
|
64
|
+
def self?.side_where: (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> String
|
|
65
|
+
|
|
66
|
+
# A side's first execution of a row, with what its cell came to, or
|
|
67
|
+
# what it came to itself when the base ran it for paths alone.
|
|
68
|
+
# : (Hash[Symbol, untyped], Hash[Symbol, untyped], Hash[Symbol, untyped]) -> Hash[Symbol, untyped]?
|
|
69
|
+
def self?.side_of: (Hash[Symbol, untyped], Hash[Symbol, untyped], Hash[Symbol, untyped]) -> Hash[Symbol, untyped]?
|
|
70
|
+
|
|
71
|
+
# : (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> bool
|
|
72
|
+
def self?.pair_compares?: (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> bool
|
|
73
|
+
|
|
74
|
+
# : (Hash[Symbol, untyped]) -> bool
|
|
75
|
+
def self?.exact?: (Hash[Symbol, untyped]) -> bool
|
|
76
|
+
|
|
77
|
+
# : (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> bool
|
|
78
|
+
def self?.apart?: (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> bool
|
|
79
|
+
|
|
80
|
+
# : (Array[Hash[Symbol, untyped]]) -> Array[String]
|
|
81
|
+
def self?.gap_words: (Array[Hash[Symbol, untyped]]) -> Array[String]
|
|
82
|
+
|
|
83
|
+
# : (Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
84
|
+
def self?.unmarked: (Array[Hash[Symbol, untyped]]) -> Array[Hash[Symbol, untyped]]
|
|
85
|
+
|
|
86
|
+
# : (Hash[Symbol, untyped]) -> bool
|
|
87
|
+
def self?.same_so_far?: (Hash[Symbol, untyped]) -> bool
|
|
88
|
+
|
|
89
|
+
# A path as events/path.rb reads it, from run.json's own shape or
|
|
90
|
+
# from one read back with symbol keys: entries and requests keyed by
|
|
91
|
+
# strings, gaps by symbols.
|
|
92
|
+
# : (Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
|
|
93
|
+
def self?.path_of: (Hash[Symbol, untyped]) -> Hash[Symbol, untyped]
|
|
94
|
+
|
|
95
|
+
# : (Hash[Symbol, untyped], Hash[Symbol, untyped], ^(String) -> bool) -> Hash[Symbol, untyped]
|
|
96
|
+
def self?.step_difference: (Hash[Symbol, untyped], Hash[Symbol, untyped], ^(String) -> bool) -> Hash[Symbol, untyped]
|
|
97
|
+
|
|
98
|
+
# : (Hash[Symbol, untyped], Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], ^(String) -> bool) -> Hash[Symbol, untyped]
|
|
99
|
+
def self?.compare_criterion: (Hash[Symbol, untyped], Hash[Symbol, untyped], Array[Hash[Symbol, untyped]], ^(String) -> bool) -> Hash[Symbol, untyped]
|
|
100
|
+
|
|
101
|
+
# : (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> Hash[Symbol, untyped]?
|
|
102
|
+
def self?.compare_pair: (Hash[Symbol, untyped], Hash[Symbol, untyped]) -> Hash[Symbol, untyped]?
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|