nukadoko 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +153 -0
  3. data/README.ja.md +6 -3
  4. data/README.md +6 -3
  5. data/lib/nukadoko/aria_snapshot.rb +4 -4
  6. data/lib/nukadoko/base.rb +49 -29
  7. data/lib/nukadoko/check.rb +62 -5
  8. data/lib/nukadoko/claim_check.rb +2 -2
  9. data/lib/nukadoko/claim_rules.rb +1 -1
  10. data/lib/nukadoko/claim_sides.rb +481 -0
  11. data/lib/nukadoko/claims.rb +182 -20
  12. data/lib/nukadoko/cli.rb +24 -7
  13. data/lib/nukadoko/codes.json +20 -15
  14. data/lib/nukadoko/criteria.rb +1 -1
  15. data/lib/nukadoko/env_check.rb +1 -3
  16. data/lib/nukadoko/fixtures.rb +53 -21
  17. data/lib/nukadoko/init.rb +0 -1
  18. data/lib/nukadoko/js_json.rb +274 -0
  19. data/lib/nukadoko/js_pattern.rb +531 -0
  20. data/lib/nukadoko/parameter_types.rb +54 -0
  21. data/lib/nukadoko/parts.rb +1 -1
  22. data/lib/nukadoko/pattern.rb +112 -2
  23. data/lib/nukadoko/poll.rb +5 -3
  24. data/lib/nukadoko/program.rb +5 -5
  25. data/lib/nukadoko/project_files.rb +17 -0
  26. data/lib/nukadoko/project_program.rb +119 -0
  27. data/lib/nukadoko/run.rb +62 -17
  28. data/lib/nukadoko/run_record.rb +25 -22
  29. data/lib/nukadoko/scaffold.rb +2 -2
  30. data/lib/nukadoko/schema.rb +60 -18
  31. data/lib/nukadoko/secrets.rb +20 -4
  32. data/lib/nukadoko/spaces.rb +28 -0
  33. data/lib/nukadoko/step.rb +7 -1
  34. data/lib/nukadoko/text_fit.rb +1 -1
  35. data/lib/nukadoko/trace_actions.rb +4 -2
  36. data/lib/nukadoko/tree_passes.rb +6 -3
  37. data/lib/nukadoko/version.rb +1 -1
  38. data/lib/nukadoko.rb +26 -2
  39. data/llms.txt +20 -18
  40. data/sig/generated/nukadoko/aria_snapshot.rbs +2 -2
  41. data/sig/generated/nukadoko/base.rbs +24 -18
  42. data/sig/generated/nukadoko/check.rbs +11 -1
  43. data/sig/generated/nukadoko/claim_sides.rbs +216 -0
  44. data/sig/generated/nukadoko/claims.rbs +46 -3
  45. data/sig/generated/nukadoko/cli.rbs +1 -1
  46. data/sig/generated/nukadoko/env_check.rbs +0 -4
  47. data/sig/generated/nukadoko/fixtures.rbs +25 -2
  48. data/sig/generated/nukadoko/init.rbs +0 -2
  49. data/sig/generated/nukadoko/js_json.rbs +109 -0
  50. data/sig/generated/nukadoko/js_pattern.rbs +194 -0
  51. data/sig/generated/nukadoko/parameter_types.rbs +27 -0
  52. data/sig/generated/nukadoko/pattern.rbs +59 -1
  53. data/sig/generated/nukadoko/poll.rbs +3 -2
  54. data/sig/generated/nukadoko/program.rbs +1 -1
  55. data/sig/generated/nukadoko/project_files.rbs +19 -0
  56. data/sig/generated/nukadoko/project_program.rbs +55 -0
  57. data/sig/generated/nukadoko/run.rbs +17 -3
  58. data/sig/generated/nukadoko/run_record.rbs +5 -4
  59. data/sig/generated/nukadoko/schema.rbs +22 -4
  60. data/sig/generated/nukadoko/secrets.rbs +17 -2
  61. data/sig/generated/nukadoko/spaces.rbs +31 -0
  62. data/sig/generated/nukadoko/trace_actions.rbs +3 -1
  63. data/sig/generated/nukadoko/tree_passes.rbs +2 -2
  64. data/sig/generated/nukadoko.rbs +11 -0
  65. data/skills/nukadoko/SKILL.md +2 -2
  66. data/skills/nukadoko/references/diagnosing.md +1 -1
  67. data/skills/nukadoko/references/examples/http-api.md +19 -16
  68. data/skills/nukadoko/references/fixtures.md +1 -1
  69. data/skills/nukadoko/references/perturbed-worlds.md +8 -6
  70. data/skills/nukadoko/references/program.md +20 -20
  71. data/skills/nukadoko/references/running.md +2 -2
  72. data/skills/nukadoko/references/scenario-rules.md +2 -2
  73. data/skills/nukadoko/references/verdicts.md +3 -3
  74. data/skills/nukadoko/references/writing-steps.md +1 -1
  75. data/skills/nukadoko-verification/SKILL.md +6 -6
  76. metadata +19 -5
@@ -79,7 +79,7 @@ Checked by: `outline-rows-share-name`.
79
79
  ## S8. A scenario starts from nothing it did not establish
80
80
 
81
81
  Bad: scenario 2 reads the item scenario 1 created. The server
82
- `nukadoko.program.ts` starts serves every scenario of the run, as a
82
+ the config's `program` starts serves every scenario of the run, as a
83
83
  fixture with `scope: "process"` does. Measured in `examples/http-api.md`:
84
84
  the read got `{"id":2,"name":"lamp"}` where the feature expected id 1.
85
85
  Good: `Given an item named "lamp" exists` in the scenario that reads it,
@@ -153,7 +153,7 @@ Checked by: review.
153
153
  for every flag; one capture per argument keeps the sentence closer to
154
154
  prose, and is the shape for an argument that holds a space. Pick one
155
155
  per project and keep it.
156
- - **An HTTP API.** `nukadoko.program.ts` starts the server and the steps
156
+ - **An HTTP API.** The config's `program` starts the server and the steps
157
157
  read its URL from `baseURL`. One request step per sentence the reviewer
158
158
  reads (`I request that item`, `I request the item list`), each returning
159
159
  `status` and `body`; a Then lists every request step in `from`. A slash in a
@@ -27,7 +27,7 @@ run.json names the conditions its role came from. nukadoko trusts
27
27
  `conditions` and does not check them against the program, so derive the
28
28
  switch from them with `{condition.<name>}` (`references/program.md`).
29
29
  `nuka run` without `--env` runs every environment that declares `conditions`, or
30
- the ones the program file's `defaultEnvironments` names. Under `--env`,
30
+ the ones the program's `defaultEnvironments` names. Under `--env`,
31
31
  a scenario no named environment meets is not run, and the summary's
32
32
  `left-out` entry counts it (`<n> criteria not run`). A control never turns the run red. Tag only what the criteria say depends
33
33
  on the switch, and write the Then so it would fail on the other side: a
@@ -51,7 +51,7 @@ evidence; turning the flag on is the person's call.
51
51
 
52
52
  ## Where no step looked
53
53
 
54
- `lists` in the program file (`references/program.md`, docs/spec.md
54
+ `lists` in the program (`references/program.md`, docs/spec.md
55
55
  "Lists") names the routes and flags the program has, so run.json can
56
56
  name the places no step reached. With a routes list, `routes` has an
57
57
  entry per method and route a list or a head step's `request` line
@@ -88,7 +88,7 @@ config's fixtures or parameter types, an environment's conditions.
88
88
  - An `unchanged` row, when the mapping changed, its tags did
89
89
  (`retagged`), or its name or file did (`renamed_from`), also runs in the `old` world, your code under the base's feature file, steps, and conditions, and has to
90
90
  pass there. A rewritten step that now checks less is what this catches.
91
- - When both program files name `{events}`, the base also runs every row
91
+ - When both programs name `{events}`, the base also runs every row
92
92
  head ran, once, for run.json's `paths` alone (`for_paths`, `(for paths)`
93
93
  on stderr; no cell, no proof runs), and `paths` pairs each environment's
94
94
  base with its head, step by step: "Changed paths" lists under
@@ -126,7 +126,7 @@ the project (a real service, a shared database, a file outside
126
126
  `scratch`), tell the user what it is about to change and get their
127
127
  go-ahead, once per step, not on every retry while fixing it, or
128
128
  trial-and-error stops being possible. A step that writes only under
129
- `scratch`, or to a server a fixture or `nukadoko.program.ts` started, needs no
129
+ `scratch`, or to a server a fixture or the program in `nukadoko.config.ts` started, needs no
130
130
  go-ahead (`examples/http-api.md`), nor does a claim or `mutates: false` step.
131
131
 
132
132
  With nobody to ask mid-task, because the caller handed the task over
@@ -104,7 +104,7 @@ How a step reaches the CLI's instance depends on its handle:
104
104
  turned off) with a scenario, since they do not survive a reconnect.
105
105
 
106
106
  Either way, run whole scenarios against the CLI's instance: read `url`
107
- in `nukadoko.program.ts` from an environment variable whose name no
107
+ in the config's `program` from an environment variable whose name no
108
108
  production tool reads, and have the CLI's `scenario` command set it and
109
109
  run `nuka run --json`. A program each run may start fresh goes in `serve`
110
110
  there instead, with its state under `{dir}`.
@@ -129,7 +129,7 @@ program's log lines and execution events for them the step's.
129
129
 
130
130
  ## 4. Doctor and readiness
131
131
 
132
- `serve.ready` in `nukadoko.program.ts` treats a server as ready once one
132
+ `serve.ready` in the config's `program` treats a server as ready once one
133
133
  path answers 2xx, and nothing more. Usable is the control CLI's `doctor`: the
134
134
  port is ours, the build is the expected one, the data is seeded. For a
135
135
  command-line tool, usable is the tool's own startup check (`--version`
@@ -192,7 +192,7 @@ has run.
192
192
  nothing red (`skills/nukadoko/references/done.md`).
193
193
  5. Link the scenario from the map's sub-feature.
194
194
 
195
- When the scenario and the program file live in the product's repository,
195
+ When the scenario and the program live in the product's repository,
196
196
  `nuka run --base <the commit before the fix>` shows red before and green
197
197
  after in one run: the base world builds the base's code from its program
198
198
  file. When the scenario lives outside the product's repository, `--base`
@@ -205,7 +205,7 @@ by returning the product's `git rev-parse HEAD` from the environment's
205
205
 
206
206
  When the fix sits behind a switch the program reads (a flag, a setting),
207
207
  one run shows both sides instead: declare the switch in `conditions` on
208
- two environments of `nukadoko.program.ts` and tag the scenario
208
+ two environments of the program in `nukadoko.config.ts` and tag the scenario
209
209
  `@with:<switch>`, so the side without the fix is a control. The verdict
210
210
  table reads `proven` when the Then breaks there at the same line in each
211
211
  of `--proof-runs` runs, and `held` when it passes there, which says what
@@ -245,12 +245,12 @@ the program did differently, step by step, on the side with the fix.
245
245
  - `nuka run --base <ref>`: which criteria changed since the map was last
246
246
  checked, and, when the steps changed, whether an unchanged one still
247
247
  means what it meant (a `moved` row says it does not).
248
- - `nuka run` with `lists` in the program file: the routes the program
248
+ - `nuka run` with `lists` in the program: the routes the program
249
249
  has that no scenario requested ("Routes" in the summary, `routes` in
250
250
  run.json; `skills/nukadoko/references/verdicts.md`). A route no
251
251
  scenario requested is a place the map may be missing; a requested one
252
252
  is not yet a checked one.
253
- - `nuka run` with a `tables` list in the program file: a count of
253
+ - `nuka run` with a `tables` list in the program: a count of
254
254
  writes that names no table counts the tables that hold state, and its
255
255
  line names the bookkeeping and infrastructure writes it left out; the
256
256
  note `undeclared-write` names a step declared `mutates: false` whose
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nukadoko
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - meganemura
@@ -41,16 +41,16 @@ dependencies:
41
41
  name: playwright-ruby-client
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - '='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 1.61.0
46
+ version: 1.63.0
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 1.61.0
53
+ version: 1.63.0
54
54
  executables:
55
55
  - nuka
56
56
  extensions: []
@@ -70,6 +70,7 @@ files:
70
70
  - lib/nukadoko/claim_check_run.rb
71
71
  - lib/nukadoko/claim_line.rb
72
72
  - lib/nukadoko/claim_rules.rb
73
+ - lib/nukadoko/claim_sides.rb
73
74
  - lib/nukadoko/claims.rb
74
75
  - lib/nukadoko/cli.rb
75
76
  - lib/nukadoko/codes.json
@@ -82,17 +83,22 @@ files:
82
83
  - lib/nukadoko/fixtures.rb
83
84
  - lib/nukadoko/http_recording.rb
84
85
  - lib/nukadoko/init.rb
86
+ - lib/nukadoko/js_json.rb
87
+ - lib/nukadoko/js_pattern.rb
85
88
  - lib/nukadoko/judge.rb
86
89
  - lib/nukadoko/judgment_file.rb
87
90
  - lib/nukadoko/judgments.rb
88
91
  - lib/nukadoko/literal.rb
89
92
  - lib/nukadoko/measured.rb
90
93
  - lib/nukadoko/order.rb
94
+ - lib/nukadoko/parameter_types.rb
91
95
  - lib/nukadoko/parts.rb
92
96
  - lib/nukadoko/pattern.rb
93
97
  - lib/nukadoko/poll.rb
94
98
  - lib/nukadoko/program.rb
99
+ - lib/nukadoko/project_files.rb
95
100
  - lib/nukadoko/project_fixtures.rb
101
+ - lib/nukadoko/project_program.rb
96
102
  - lib/nukadoko/report_allure.rb
97
103
  - lib/nukadoko/report_messages.rb
98
104
  - lib/nukadoko/report_run.rb
@@ -104,6 +110,7 @@ files:
104
110
  - lib/nukadoko/selection.rb
105
111
  - lib/nukadoko/signature.rb
106
112
  - lib/nukadoko/skill.rb
113
+ - lib/nukadoko/spaces.rb
107
114
  - lib/nukadoko/step.rb
108
115
  - lib/nukadoko/summary.rb
109
116
  - lib/nukadoko/table.rb
@@ -127,6 +134,7 @@ files:
127
134
  - sig/generated/nukadoko/claim_check_run.rbs
128
135
  - sig/generated/nukadoko/claim_line.rbs
129
136
  - sig/generated/nukadoko/claim_rules.rbs
137
+ - sig/generated/nukadoko/claim_sides.rbs
130
138
  - sig/generated/nukadoko/claims.rbs
131
139
  - sig/generated/nukadoko/cli.rbs
132
140
  - sig/generated/nukadoko/codes.rbs
@@ -138,17 +146,22 @@ files:
138
146
  - sig/generated/nukadoko/fixtures.rbs
139
147
  - sig/generated/nukadoko/http_recording.rbs
140
148
  - sig/generated/nukadoko/init.rbs
149
+ - sig/generated/nukadoko/js_json.rbs
150
+ - sig/generated/nukadoko/js_pattern.rbs
141
151
  - sig/generated/nukadoko/judge.rbs
142
152
  - sig/generated/nukadoko/judgment_file.rbs
143
153
  - sig/generated/nukadoko/judgments.rbs
144
154
  - sig/generated/nukadoko/literal.rbs
145
155
  - sig/generated/nukadoko/measured.rbs
146
156
  - sig/generated/nukadoko/order.rbs
157
+ - sig/generated/nukadoko/parameter_types.rbs
147
158
  - sig/generated/nukadoko/parts.rbs
148
159
  - sig/generated/nukadoko/pattern.rbs
149
160
  - sig/generated/nukadoko/poll.rbs
150
161
  - sig/generated/nukadoko/program.rbs
162
+ - sig/generated/nukadoko/project_files.rbs
151
163
  - sig/generated/nukadoko/project_fixtures.rbs
164
+ - sig/generated/nukadoko/project_program.rbs
152
165
  - sig/generated/nukadoko/report_allure.rbs
153
166
  - sig/generated/nukadoko/report_messages.rbs
154
167
  - sig/generated/nukadoko/report_run.rbs
@@ -160,6 +173,7 @@ files:
160
173
  - sig/generated/nukadoko/selection.rbs
161
174
  - sig/generated/nukadoko/signature.rbs
162
175
  - sig/generated/nukadoko/skill.rbs
176
+ - sig/generated/nukadoko/spaces.rbs
163
177
  - sig/generated/nukadoko/step.rbs
164
178
  - sig/generated/nukadoko/summary.rbs
165
179
  - sig/generated/nukadoko/table.rbs