@kurvball/rehearse 0.0.0-stage → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +107 -2
- package/dist/affected/affected.d.ts +22 -0
- package/dist/affected/affected.js +162 -0
- package/dist/affected/index.d.ts +1 -0
- package/dist/affected/index.js +1 -0
- package/dist/args.d.ts +12 -0
- package/dist/args.js +42 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +100 -0
- package/dist/commands/check.d.ts +2 -0
- package/dist/commands/check.js +42 -0
- package/dist/commands/clean.d.ts +2 -0
- package/dist/commands/clean.js +37 -0
- package/dist/commands/command.d.ts +30 -0
- package/dist/commands/command.js +38 -0
- package/dist/commands/compare.d.ts +4 -0
- package/dist/commands/compare.js +89 -0
- package/dist/commands/drive.d.ts +2 -0
- package/dist/commands/drive.js +244 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.js +32 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.js +19 -0
- package/dist/commands/list.d.ts +2 -0
- package/dist/commands/list.js +69 -0
- package/dist/commands/open.d.ts +2 -0
- package/dist/commands/open.js +60 -0
- package/dist/commands/people.d.ts +2 -0
- package/dist/commands/people.js +49 -0
- package/dist/commands/run.d.ts +4 -0
- package/dist/commands/run.js +84 -0
- package/dist/commands/services.d.ts +28 -0
- package/dist/commands/services.js +51 -0
- package/dist/commands/stage.d.ts +7 -0
- package/dist/commands/stage.js +53 -0
- package/dist/commands/up.d.ts +3 -0
- package/dist/commands/up.js +77 -0
- package/dist/commands/validate.d.ts +2 -0
- package/dist/commands/validate.js +35 -0
- package/dist/commands/worlds.d.ts +2 -0
- package/dist/commands/worlds.js +15 -0
- package/dist/compare/announce.d.ts +6 -0
- package/dist/compare/announce.js +27 -0
- package/dist/compare/compare.d.ts +83 -0
- package/dist/compare/compare.js +335 -0
- package/dist/compare/diff.d.ts +15 -0
- package/dist/compare/diff.js +105 -0
- package/dist/compare/index.d.ts +5 -0
- package/dist/compare/index.js +5 -0
- package/dist/compare/setaside.d.ts +29 -0
- package/dist/compare/setaside.js +121 -0
- package/dist/compare/verdict.d.ts +21 -0
- package/dist/compare/verdict.js +30 -0
- package/dist/drive/aria.d.ts +8 -0
- package/dist/drive/aria.js +12 -0
- package/dist/drive/browser.d.ts +34 -0
- package/dist/drive/browser.js +216 -0
- package/dist/drive/daemon.d.ts +1 -0
- package/dist/drive/daemon.js +171 -0
- package/dist/drive/grammar.d.ts +93 -0
- package/dist/drive/grammar.js +303 -0
- package/dist/drive/index.d.ts +4 -0
- package/dist/drive/index.js +4 -0
- package/dist/drive/names.d.ts +24 -0
- package/dist/drive/names.js +97 -0
- package/dist/drive/state.d.ts +13 -0
- package/dist/drive/state.js +28 -0
- package/dist/errors.d.ts +26 -0
- package/dist/errors.js +32 -0
- package/dist/exec.d.ts +16 -0
- package/dist/exec.js +43 -0
- package/dist/git/checkout.d.ts +11 -0
- package/dist/git/checkout.js +90 -0
- package/dist/git/git.d.ts +7 -0
- package/dist/git/git.js +27 -0
- package/dist/git/index.d.ts +2 -0
- package/dist/git/index.js +2 -0
- package/dist/git/seed.d.ts +3 -0
- package/dist/git/seed.js +115 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +15 -0
- package/dist/kinds/all.d.ts +4 -0
- package/dist/kinds/all.js +4 -0
- package/dist/kinds/call/check.d.ts +29 -0
- package/dist/kinds/call/check.js +187 -0
- package/dist/kinds/call/definition.d.ts +16 -0
- package/dist/kinds/call/definition.js +33 -0
- package/dist/kinds/call/hurl.d.ts +65 -0
- package/dist/kinds/call/hurl.js +333 -0
- package/dist/kinds/call/kind.d.ts +8 -0
- package/dist/kinds/call/kind.js +122 -0
- package/dist/kinds/call/send.d.ts +32 -0
- package/dist/kinds/call/send.js +152 -0
- package/dist/kinds/call/words.d.ts +22 -0
- package/dist/kinds/call/words.js +24 -0
- package/dist/kinds/file/kind.d.ts +44 -0
- package/dist/kinds/file/kind.js +331 -0
- package/dist/kinds/file/layouts.d.ts +14 -0
- package/dist/kinds/file/layouts.js +103 -0
- package/dist/kinds/flow/kind.d.ts +21 -0
- package/dist/kinds/flow/kind.js +412 -0
- package/dist/kinds/flow/literal.d.ts +8 -0
- package/dist/kinds/flow/literal.js +148 -0
- package/dist/kinds/index.d.ts +10 -0
- package/dist/kinds/index.js +8 -0
- package/dist/kinds/kind.d.ts +63 -0
- package/dist/kinds/kind.js +21 -0
- package/dist/kinds/piece/canvas.d.ts +18 -0
- package/dist/kinds/piece/canvas.js +165 -0
- package/dist/kinds/piece/conventions.d.ts +12 -0
- package/dist/kinds/piece/conventions.js +101 -0
- package/dist/kinds/piece/csf.d.ts +10 -0
- package/dist/kinds/piece/csf.js +304 -0
- package/dist/kinds/piece/kind.d.ts +12 -0
- package/dist/kinds/piece/kind.js +297 -0
- package/dist/kinds/piece/server.d.ts +23 -0
- package/dist/kinds/piece/server.js +236 -0
- package/dist/manifest/fill.d.ts +4 -0
- package/dist/manifest/fill.js +7 -0
- package/dist/manifest/index.d.ts +5 -0
- package/dist/manifest/index.js +5 -0
- package/dist/manifest/init.d.ts +1 -0
- package/dist/manifest/init.js +47 -0
- package/dist/manifest/load.d.ts +7 -0
- package/dist/manifest/load.js +245 -0
- package/dist/manifest/types.d.ts +255 -0
- package/dist/manifest/types.js +7 -0
- package/dist/manifest/yaml.d.ts +5 -0
- package/dist/manifest/yaml.js +47 -0
- package/dist/people/index.d.ts +1 -0
- package/dist/people/index.js +1 -0
- package/dist/people/people.d.ts +39 -0
- package/dist/people/people.js +139 -0
- package/dist/run/cache.d.ts +20 -0
- package/dist/run/cache.js +98 -0
- package/dist/run/index.d.ts +5 -0
- package/dist/run/index.js +4 -0
- package/dist/run/observation.d.ts +27 -0
- package/dist/run/observation.js +1 -0
- package/dist/run/parallel.d.ts +28 -0
- package/dist/run/parallel.js +140 -0
- package/dist/run/session.d.ts +35 -0
- package/dist/run/session.js +399 -0
- package/dist/run/vars.d.ts +3 -0
- package/dist/run/vars.js +13 -0
- package/dist/scenarios/area.d.ts +6 -0
- package/dist/scenarios/area.js +37 -0
- package/dist/scenarios/files.d.ts +9 -0
- package/dist/scenarios/files.js +26 -0
- package/dist/scenarios/glob.d.ts +6 -0
- package/dist/scenarios/glob.js +106 -0
- package/dist/scenarios/index.d.ts +4 -0
- package/dist/scenarios/index.js +4 -0
- package/dist/scenarios/read.d.ts +18 -0
- package/dist/scenarios/read.js +54 -0
- package/dist/scenarios/scenario.d.ts +34 -0
- package/dist/scenarios/scenario.js +10 -0
- package/dist/schema.d.ts +14 -0
- package/dist/schema.js +122 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +2 -0
- package/dist/services/registry.d.ts +23 -0
- package/dist/services/registry.js +49 -0
- package/dist/services/service.d.ts +23 -0
- package/dist/services/service.js +313 -0
- package/dist/stage/api.d.ts +30 -0
- package/dist/stage/api.js +206 -0
- package/dist/stage/client/client/api.js +11 -0
- package/dist/stage/client/client/index.js +1 -0
- package/dist/stage/client/features/canvas/call.js +65 -0
- package/dist/stage/client/features/canvas/context.js +1 -0
- package/dist/stage/client/features/canvas/file.js +36 -0
- package/dist/stage/client/features/canvas/flow.js +59 -0
- package/dist/stage/client/features/canvas/index.js +1 -0
- package/dist/stage/client/features/canvas/observed.js +8 -0
- package/dist/stage/client/features/canvas/parts.js +24 -0
- package/dist/stage/client/features/canvas/piece.js +31 -0
- package/dist/stage/client/features/canvas/reach.js +6 -0
- package/dist/stage/client/features/canvas/views.js +16 -0
- package/dist/stage/client/features/list/index.js +1 -0
- package/dist/stage/client/features/list/list.js +53 -0
- package/dist/stage/client/features/list/reach.js +10 -0
- package/dist/stage/client/features/scenario/heading.js +14 -0
- package/dist/stage/client/features/scenario/index.js +1 -0
- package/dist/stage/client/features/scenario/reach.js +9 -0
- package/dist/stage/client/features/scenario/scenario.js +145 -0
- package/dist/stage/client/features/try/index.js +1 -0
- package/dist/stage/client/features/try/reach.js +12 -0
- package/dist/stage/client/features/try/try.js +65 -0
- package/dist/stage/client/index.html +16 -0
- package/dist/stage/client/main.js +24 -0
- package/dist/stage/client/primitives/busy.js +6 -0
- package/dist/stage/client/primitives/focus.js +21 -0
- package/dist/stage/client/primitives/h.js +25 -0
- package/dist/stage/client/primitives/index.js +6 -0
- package/dist/stage/client/primitives/keyed.js +16 -0
- package/dist/stage/client/primitives/say.js +6 -0
- package/dist/stage/client/primitives/state.js +21 -0
- package/dist/stage/client/primitives/types.js +1 -0
- package/dist/stage/client/primitives/verdicts.js +8 -0
- package/dist/stage/client/stage.css +652 -0
- package/dist/stage/compared.d.ts +20 -0
- package/dist/stage/compared.js +58 -0
- package/dist/stage/files.d.ts +4 -0
- package/dist/stage/files.js +59 -0
- package/dist/stage/guard.d.ts +3 -0
- package/dist/stage/guard.js +20 -0
- package/dist/stage/http.d.ts +12 -0
- package/dist/stage/http.js +34 -0
- package/dist/stage/index.d.ts +1 -0
- package/dist/stage/index.js +1 -0
- package/dist/stage/sending.d.ts +18 -0
- package/dist/stage/sending.js +66 -0
- package/dist/stage/server.d.ts +33 -0
- package/dist/stage/server.js +253 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +5 -0
- package/dist/worlds/define.d.ts +16 -0
- package/dist/worlds/define.js +45 -0
- package/dist/worlds/index.d.ts +2 -0
- package/dist/worlds/index.js +2 -0
- package/dist/worlds/worlds.d.ts +15 -0
- package/dist/worlds/worlds.js +46 -0
- package/llms.txt +46 -0
- package/package.json +84 -3
- package/schema/v1/announce.schema.json +28 -0
- package/schema/v1/check.schema.json +67 -0
- package/schema/v1/clean.schema.json +19 -0
- package/schema/v1/common.schema.json +210 -0
- package/schema/v1/comparison.schema.json +298 -0
- package/schema/v1/dependents.schema.json +30 -0
- package/schema/v1/drive.schema.json +112 -0
- package/schema/v1/error.schema.json +26 -0
- package/schema/v1/file-scenario.schema.json +175 -0
- package/schema/v1/flow.schema.json +216 -0
- package/schema/v1/init.schema.json +20 -0
- package/schema/v1/list.schema.json +70 -0
- package/schema/v1/manifest.schema.json +434 -0
- package/schema/v1/observation.schema.json +388 -0
- package/schema/v1/open.schema.json +14 -0
- package/schema/v1/people.schema.json +88 -0
- package/schema/v1/samples/announce.yaml +5 -0
- package/schema/v1/samples/check.json +13 -0
- package/schema/v1/samples/clean.json +1 -0
- package/schema/v1/samples/comparison.json +83 -0
- package/schema/v1/samples/dependents.json +7 -0
- package/schema/v1/samples/drive.json +10 -0
- package/schema/v1/samples/error.json +10 -0
- package/schema/v1/samples/file-scenario.yaml +13 -0
- package/schema/v1/samples/flow.yaml +13 -0
- package/schema/v1/samples/init.json +1 -0
- package/schema/v1/samples/list.json +24 -0
- package/schema/v1/samples/manifest.yaml +55 -0
- package/schema/v1/samples/observation.json +49 -0
- package/schema/v1/samples/open.json +6 -0
- package/schema/v1/samples/people.json +11 -0
- package/schema/v1/samples/services.json +27 -0
- package/schema/v1/samples/stage.json +6 -0
- package/schema/v1/samples/try.json +13 -0
- package/schema/v1/samples/up.json +16 -0
- package/schema/v1/samples/validate.json +7 -0
- package/schema/v1/samples/worlds.json +21 -0
- package/schema/v1/services.schema.json +72 -0
- package/schema/v1/stage.schema.json +14 -0
- package/schema/v1/try.schema.json +56 -0
- package/schema/v1/up.schema.json +55 -0
- package/schema/v1/validate.schema.json +40 -0
- package/schema/v1/worlds.schema.json +33 -0
- package/skill/rehearse/SKILL.md +148 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# A sample rehearse.yaml with every block, for the schema's tests and the docs.
|
|
2
|
+
version: 1
|
|
3
|
+
base: main
|
|
4
|
+
prepare: pnpm install --frozen-lockfile --offline
|
|
5
|
+
services:
|
|
6
|
+
api:
|
|
7
|
+
describe: The API, on its in-memory runtime
|
|
8
|
+
up: pnpm --filter @acme/api exec tsx test/serve.ts --port {{port}}
|
|
9
|
+
port: auto
|
|
10
|
+
ready: http://127.0.0.1:{{port}}/health
|
|
11
|
+
env: { NODE_ENV: test }
|
|
12
|
+
isolate: { env: ACME_STATE_DIR }
|
|
13
|
+
app:
|
|
14
|
+
up: pnpm drive start --scenario {{world}}
|
|
15
|
+
ready: { command: pnpm drive snapshot --json }
|
|
16
|
+
down: pnpm drive stop
|
|
17
|
+
drive: pnpm drive
|
|
18
|
+
signIn:
|
|
19
|
+
command: node scripts/people.mjs --api {{api_url}}
|
|
20
|
+
service: api
|
|
21
|
+
people:
|
|
22
|
+
owner: { describe: The organisation's owner, default: true }
|
|
23
|
+
member: { describe: A member without administration, real: local }
|
|
24
|
+
nobody-in-particular:
|
|
25
|
+
real: stand-in
|
|
26
|
+
browser: { headers: { Authorization: 'Bearer {{token}}' } }
|
|
27
|
+
worlds:
|
|
28
|
+
empty: { describe: Nothing but the schema }
|
|
29
|
+
one-org:
|
|
30
|
+
extends: empty
|
|
31
|
+
add: node scripts/seed.mjs one-org --api {{api_url}}
|
|
32
|
+
default: true
|
|
33
|
+
standins:
|
|
34
|
+
ai:
|
|
35
|
+
replaces: The model provider
|
|
36
|
+
by: test/fixtures/ai-fake.ts
|
|
37
|
+
fidelity: fake
|
|
38
|
+
services: [api]
|
|
39
|
+
env: { AI_PROVIDER: fixture }
|
|
40
|
+
real: { env: { AI_PROVIDER: anthropic } }
|
|
41
|
+
scenarios:
|
|
42
|
+
pieces:
|
|
43
|
+
paths: ['packages/ui/src/**/*.stories.tsx']
|
|
44
|
+
preview: .storybook/preview.ts
|
|
45
|
+
schemes: [light, dark]
|
|
46
|
+
flows: ['apps/web/features/*/reach.ts', '**/*.flow.yaml']
|
|
47
|
+
calls:
|
|
48
|
+
paths: ['apps/api/src/**/*.hurl', { path: ./calls/*.hurl, covers: ['apps/api/src/routes/**'] }]
|
|
49
|
+
service: api
|
|
50
|
+
files: ['**/*.rehearse.yaml']
|
|
51
|
+
defaults: { world: one-org, person: owner }
|
|
52
|
+
setAside:
|
|
53
|
+
keys: ['^requestId$']
|
|
54
|
+
keep: ['$.expiresAt']
|
|
55
|
+
budget: { services: 1, checkouts: 3 }
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"v": 1,
|
|
3
|
+
"ok": false,
|
|
4
|
+
"scenario": {
|
|
5
|
+
"id": "apps/api/src/routes/members.hurl#A member isn't told the directory exists",
|
|
6
|
+
"kind": "call",
|
|
7
|
+
"name": "A member isn't told the directory exists",
|
|
8
|
+
"file": "apps/api/src/routes/members.hurl",
|
|
9
|
+
"line": 48,
|
|
10
|
+
"area": "@acme/api",
|
|
11
|
+
"from": "checkout",
|
|
12
|
+
"definition": "3f2a9c0d1e2b4a5c"
|
|
13
|
+
},
|
|
14
|
+
"checkout": {
|
|
15
|
+
"path": "/work/acme",
|
|
16
|
+
"ref": null,
|
|
17
|
+
"commit": "b4a57d57d0000000000000000000000000000000",
|
|
18
|
+
"dirty": false
|
|
19
|
+
},
|
|
20
|
+
"world": "one-org",
|
|
21
|
+
"person": "member",
|
|
22
|
+
"standins": [
|
|
23
|
+
{
|
|
24
|
+
"name": "ai",
|
|
25
|
+
"replaces": "The model provider",
|
|
26
|
+
"by": "test/fixtures/ai-fake.ts",
|
|
27
|
+
"fidelity": "fake",
|
|
28
|
+
"real": false
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"failures": [{ "line": 52, "text": "HTTP 404", "expected": "404", "got": "403" }],
|
|
32
|
+
"broke": null,
|
|
33
|
+
"observed": {
|
|
34
|
+
"kind": "call",
|
|
35
|
+
"request": "GET /v1/organizations/{{organization}}/members",
|
|
36
|
+
"who": "member",
|
|
37
|
+
"status": 403,
|
|
38
|
+
"contentType": "application/json",
|
|
39
|
+
"body": { "error": { "code": "forbidden", "correlationId": "9b2f6a1e-1c1d-4c4e-9a52-0f6b1d2c3e4f" } },
|
|
40
|
+
"tries": []
|
|
41
|
+
},
|
|
42
|
+
"artifacts": [],
|
|
43
|
+
"ms": 12,
|
|
44
|
+
"at": "2026-12-03T14:00:00.000Z",
|
|
45
|
+
"rehearse": "0.1.0",
|
|
46
|
+
"cached": false,
|
|
47
|
+
"runner": "call/1",
|
|
48
|
+
"cacheKey": null
|
|
49
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"v": 1,
|
|
3
|
+
"people": { "owner": { "token": "eyJ.sample.token", "membershipId": "m-1" } },
|
|
4
|
+
"variables": { "organization": "org-1", "owner_membershipId": "m-1" },
|
|
5
|
+
"about": {
|
|
6
|
+
"owner": { "real": "local", "default": true, "describe": "The organisation's owner", "signedIn": true },
|
|
7
|
+
"member": { "real": "local", "default": false, "describe": null, "signedIn": false }
|
|
8
|
+
},
|
|
9
|
+
"signedIn": true,
|
|
10
|
+
"said": null
|
|
11
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"v": 1,
|
|
3
|
+
"services": [
|
|
4
|
+
{
|
|
5
|
+
"name": "api",
|
|
6
|
+
"describe": "The API",
|
|
7
|
+
"up": "pnpm serve --port {{port}}",
|
|
8
|
+
"cwd": null,
|
|
9
|
+
"url": "http://127.0.0.1:{{port}}",
|
|
10
|
+
"port": "auto",
|
|
11
|
+
"ready": { "http": "http://127.0.0.1:{{port}}/health" },
|
|
12
|
+
"down": null,
|
|
13
|
+
"isolate": null,
|
|
14
|
+
"drive": null,
|
|
15
|
+
"standins": ["ai"],
|
|
16
|
+
"running": [
|
|
17
|
+
{
|
|
18
|
+
"checkout": "/work/acme",
|
|
19
|
+
"url": "http://127.0.0.1:41234",
|
|
20
|
+
"port": 41234,
|
|
21
|
+
"pid": 4242,
|
|
22
|
+
"since": "2026-12-03T14:00:00.000Z"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"v": 1,
|
|
3
|
+
"scenario": "packages/ui/src/Badge.stories.tsx#Primary",
|
|
4
|
+
"works": true,
|
|
5
|
+
"note": "Reads well in dark too.",
|
|
6
|
+
"world": null,
|
|
7
|
+
"person": null,
|
|
8
|
+
"mode": "diff",
|
|
9
|
+
"verdict": "said",
|
|
10
|
+
"base": "2d24f5e1aaaa0000000000000000000000000000",
|
|
11
|
+
"head": null,
|
|
12
|
+
"at": "2026-12-03T14:05:00.000Z"
|
|
13
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"v": 1,
|
|
3
|
+
"checkout": "/work/acme",
|
|
4
|
+
"world": "one-org",
|
|
5
|
+
"services": [
|
|
6
|
+
{
|
|
7
|
+
"name": "api",
|
|
8
|
+
"checkout": "/work/acme",
|
|
9
|
+
"url": "http://127.0.0.1:41234",
|
|
10
|
+
"port": 41234,
|
|
11
|
+
"pid": 4242,
|
|
12
|
+
"since": "2026-12-03T14:00:00.000Z",
|
|
13
|
+
"standins": ["ai"]
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"v": 1,
|
|
3
|
+
"worlds": [
|
|
4
|
+
{
|
|
5
|
+
"name": "empty",
|
|
6
|
+
"describe": "Nothing but the schema",
|
|
7
|
+
"extends": null,
|
|
8
|
+
"chain": ["empty"],
|
|
9
|
+
"add": null,
|
|
10
|
+
"default": false
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "one-org",
|
|
14
|
+
"describe": null,
|
|
15
|
+
"extends": "empty",
|
|
16
|
+
"chain": ["empty", "one-org"],
|
|
17
|
+
"add": "node scripts/seed.mjs one-org",
|
|
18
|
+
"default": true
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://rehearse.kurvball.ca/schema/v1/services.schema.json",
|
|
4
|
+
"title": "Rehearse v1: rehearse services --json",
|
|
5
|
+
"description": "What can come up, how Rehearse knows it is ready, and what is running now.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["v", "services"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"v": { "$ref": "common.schema.json#/$defs/v" },
|
|
10
|
+
"services": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"required": ["name", "up", "running"],
|
|
15
|
+
"properties": {
|
|
16
|
+
"name": { "type": "string" },
|
|
17
|
+
"describe": { "type": ["string", "null"] },
|
|
18
|
+
"up": {
|
|
19
|
+
"description": "The command that brings it up, before placeholders are filled.",
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"cwd": { "type": ["string", "null"] },
|
|
23
|
+
"url": { "type": ["string", "null"] },
|
|
24
|
+
"port": { "oneOf": [{ "type": "integer" }, { "const": "auto" }, { "type": "null" }] },
|
|
25
|
+
"ready": {
|
|
26
|
+
"oneOf": [
|
|
27
|
+
{ "type": "null" },
|
|
28
|
+
{ "type": "object", "required": ["http"], "properties": { "http": { "type": "string" } } },
|
|
29
|
+
{
|
|
30
|
+
"type": "object",
|
|
31
|
+
"required": ["command"],
|
|
32
|
+
"properties": { "command": { "type": "string" } }
|
|
33
|
+
},
|
|
34
|
+
{ "type": "object", "required": ["log"], "properties": { "log": { "type": "string" } } }
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"down": { "type": ["string", "null"] },
|
|
38
|
+
"isolate": {
|
|
39
|
+
"oneOf": [
|
|
40
|
+
{ "type": "null" },
|
|
41
|
+
{ "type": "object", "required": ["env"], "properties": { "env": { "type": "string" } } }
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"drive": {
|
|
45
|
+
"description": "The service's own driver for flows and rehearse drive, when it has one.",
|
|
46
|
+
"type": ["string", "null"]
|
|
47
|
+
},
|
|
48
|
+
"standins": {
|
|
49
|
+
"description": "The stand-ins that apply to it.",
|
|
50
|
+
"type": "array",
|
|
51
|
+
"items": { "type": "string" }
|
|
52
|
+
},
|
|
53
|
+
"running": {
|
|
54
|
+
"description": "Copies of it up now, one per checkout.",
|
|
55
|
+
"type": "array",
|
|
56
|
+
"items": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"required": ["checkout", "pid"],
|
|
59
|
+
"properties": {
|
|
60
|
+
"checkout": { "type": "string" },
|
|
61
|
+
"url": { "type": ["string", "null"] },
|
|
62
|
+
"port": { "type": ["integer", "null"] },
|
|
63
|
+
"pid": { "type": "integer" },
|
|
64
|
+
"since": { "type": "string", "format": "date-time" }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://rehearse.kurvball.ca/schema/v1/stage.schema.json",
|
|
4
|
+
"title": "Rehearse v1: rehearse stage --json",
|
|
5
|
+
"description": "Where the stage is, once it is up. The command keeps running until it is stopped.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["v", "url", "port", "pid"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"v": { "$ref": "common.schema.json#/$defs/v" },
|
|
10
|
+
"url": { "description": "The stage's address, on 127.0.0.1 only.", "type": "string" },
|
|
11
|
+
"port": { "type": "integer", "minimum": 1, "maximum": 65535 },
|
|
12
|
+
"pid": { "description": "The stage's process: stop it with kill on this.", "type": "integer" }
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://rehearse.kurvball.ca/schema/v1/try.schema.json",
|
|
4
|
+
"title": "Rehearse v1: one person's try",
|
|
5
|
+
"description": "A line of .rehearse/tries.jsonl: what a person said about a scenario on the stage. It is a person's evidence for a review.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["v", "scenario", "works", "note", "mode", "at"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"v": {
|
|
10
|
+
"$ref": "common.schema.json#/$defs/v"
|
|
11
|
+
},
|
|
12
|
+
"scenario": {
|
|
13
|
+
"type": "string"
|
|
14
|
+
},
|
|
15
|
+
"works": {
|
|
16
|
+
"description": "true for Works, false for Doesn't.",
|
|
17
|
+
"type": "boolean"
|
|
18
|
+
},
|
|
19
|
+
"note": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"world": {
|
|
23
|
+
"type": ["string", "null"]
|
|
24
|
+
},
|
|
25
|
+
"person": {
|
|
26
|
+
"$ref": "common.schema.json#/$defs/person"
|
|
27
|
+
},
|
|
28
|
+
"mode": {
|
|
29
|
+
"description": "What the person was looking at. More may come.",
|
|
30
|
+
"type": "string",
|
|
31
|
+
"examples": ["base", "head", "diff"]
|
|
32
|
+
},
|
|
33
|
+
"verdict": {
|
|
34
|
+
"oneOf": [
|
|
35
|
+
{
|
|
36
|
+
"$ref": "common.schema.json#/$defs/verdict"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "null"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
"base": {
|
|
44
|
+
"description": "The base commit.",
|
|
45
|
+
"type": ["string", "null"]
|
|
46
|
+
},
|
|
47
|
+
"head": {
|
|
48
|
+
"description": "The head commit.",
|
|
49
|
+
"type": ["string", "null"]
|
|
50
|
+
},
|
|
51
|
+
"at": {
|
|
52
|
+
"type": "string",
|
|
53
|
+
"format": "date-time"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://rehearse.kurvball.ca/schema/v1/up.schema.json",
|
|
4
|
+
"title": "Rehearse v1: rehearse up --json and rehearse down --json",
|
|
5
|
+
"description": "The services rehearse up brought up (and left running), or rehearse down stopped.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["v", "checkout", "world", "services"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"v": {
|
|
10
|
+
"$ref": "common.schema.json#/$defs/v"
|
|
11
|
+
},
|
|
12
|
+
"checkout": {
|
|
13
|
+
"description": "The checkout, or null for rehearse down --all.",
|
|
14
|
+
"type": ["string", "null"]
|
|
15
|
+
},
|
|
16
|
+
"world": {
|
|
17
|
+
"type": ["string", "null"]
|
|
18
|
+
},
|
|
19
|
+
"services": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "object",
|
|
23
|
+
"required": ["name", "checkout", "pid"],
|
|
24
|
+
"properties": {
|
|
25
|
+
"name": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"checkout": {
|
|
29
|
+
"type": "string"
|
|
30
|
+
},
|
|
31
|
+
"url": {
|
|
32
|
+
"type": ["string", "null"]
|
|
33
|
+
},
|
|
34
|
+
"port": {
|
|
35
|
+
"type": ["integer", "null"]
|
|
36
|
+
},
|
|
37
|
+
"pid": {
|
|
38
|
+
"type": "integer"
|
|
39
|
+
},
|
|
40
|
+
"since": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"format": "date-time"
|
|
43
|
+
},
|
|
44
|
+
"standins": {
|
|
45
|
+
"description": "The stand-ins it runs with; name:real when the real one was chosen.",
|
|
46
|
+
"type": "array",
|
|
47
|
+
"items": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://rehearse.kurvball.ca/schema/v1/validate.schema.json",
|
|
4
|
+
"title": "Rehearse v1: rehearse validate --json",
|
|
5
|
+
"description": "Whether a JSON or YAML file meets one of Rehearse's schemas, and what is wrong where.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["v", "ok", "schema", "errors"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"v": {
|
|
10
|
+
"$ref": "common.schema.json#/$defs/v"
|
|
11
|
+
},
|
|
12
|
+
"ok": {
|
|
13
|
+
"type": "boolean"
|
|
14
|
+
},
|
|
15
|
+
"schema": {
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
18
|
+
"file": {
|
|
19
|
+
"type": ["string", "null"]
|
|
20
|
+
},
|
|
21
|
+
"errors": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "object",
|
|
25
|
+
"required": ["at", "says"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"at": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"line": {
|
|
31
|
+
"type": "integer"
|
|
32
|
+
},
|
|
33
|
+
"says": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://rehearse.kurvball.ca/schema/v1/worlds.schema.json",
|
|
4
|
+
"title": "Rehearse v1: rehearse worlds --json",
|
|
5
|
+
"description": "The named starting states, each with the chain of worlds it is built from.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": ["v", "worlds"],
|
|
8
|
+
"properties": {
|
|
9
|
+
"v": { "$ref": "common.schema.json#/$defs/v" },
|
|
10
|
+
"worlds": {
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"required": ["name", "chain", "default"],
|
|
15
|
+
"properties": {
|
|
16
|
+
"name": { "type": "string" },
|
|
17
|
+
"describe": { "type": ["string", "null"] },
|
|
18
|
+
"extends": { "type": ["string", "null"] },
|
|
19
|
+
"chain": {
|
|
20
|
+
"description": "The worlds applied in order, from the root to this one.",
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": { "type": "string" }
|
|
23
|
+
},
|
|
24
|
+
"add": {
|
|
25
|
+
"description": "The command that adds this world on top of the one it extends.",
|
|
26
|
+
"type": ["string", "null"]
|
|
27
|
+
},
|
|
28
|
+
"default": { "type": "boolean" }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rehearse
|
|
3
|
+
description: Use in a repository with a rehearse.yaml, or when asked to try, compare, prove or check a change before it ships, write piece/flow/call/file scenarios, or drive a running product step by step. Teaches Rehearse's commands, its scenario formats and how to read a comparison's verdicts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Rehearse
|
|
7
|
+
|
|
8
|
+
Rehearse sits beside a repository. It brings the product up, signs in as named people, starts from named worlds, runs
|
|
9
|
+
scenarios on a base and on the head, and compares them. Every command takes `--json` and prints one object whose
|
|
10
|
+
schema is in Rehearse's `schema/v1/`. Read JSON, not the words: the words are for people.
|
|
11
|
+
|
|
12
|
+
## 1. Look before you change anything
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
rehearse check --json # the manifest reads; how many scenarios of each kind; files it couldn't read
|
|
16
|
+
rehearse list --json # every scenario: id, kind, name, file, area
|
|
17
|
+
rehearse services --json # what can come up
|
|
18
|
+
rehearse people --json # who you can sign in as (people holds tokens: never print or store them)
|
|
19
|
+
rehearse worlds --json # the named starting states
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
A scenario's id is its file, then `#` and its name when the file holds more than one:
|
|
23
|
+
`apps/api/members.hurl#A member isn't told the directory exists`, `src/Badge.stories.tsx#Primary`,
|
|
24
|
+
`flows/sign-in.flow.yaml`.
|
|
25
|
+
|
|
26
|
+
## 2. Find what your change reaches
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
rehearse list --affected <file>… --json # or --since main
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Each scenario comes with `reachedBy`: why the change reaches it.
|
|
33
|
+
|
|
34
|
+
## 3. Write a scenario beside what it tries
|
|
35
|
+
|
|
36
|
+
| Kind | Write | Rehearse compares |
|
|
37
|
+
| ----- | --------------------------------------- | ----------------------------------------------------- |
|
|
38
|
+
| piece | a CSF story beside the component | the accessibility tree, logged errors, axe violations |
|
|
39
|
+
| flow | `*.flow.yaml`: steps by accessible name | the tree after each step |
|
|
40
|
+
| call | Hurl's plain part, beside the handler | status, content type, body (ids and times set aside) |
|
|
41
|
+
| file | `*.rehearse.yaml`: input, run, output | the output, by column or by line |
|
|
42
|
+
|
|
43
|
+
**A call**, one per thing a person would check, named by the comment above it, sent as a person:
|
|
44
|
+
|
|
45
|
+
```hurl
|
|
46
|
+
# A member isn't told the directory exists
|
|
47
|
+
GET {{api}}/v1/organizations/{{organization}}/members
|
|
48
|
+
Authorization: Bearer {{member}}
|
|
49
|
+
HTTP 404
|
|
50
|
+
[Asserts]
|
|
51
|
+
jsonpath "$.error.code" == "not_found"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`{{api}}` is the calls service's URL; `{{member}}` is that person's token; no `Authorization` means nobody. Only Hurl's
|
|
55
|
+
plain part is read: `[Query]`, `[Options]` (retry, retry-interval), `[Captures]`, `[Asserts]` with status, header, body,
|
|
56
|
+
duration and jsonpath queries. Anything more is refused by name.
|
|
57
|
+
|
|
58
|
+
**A flow**: steps by the names a screen reader says.
|
|
59
|
+
|
|
60
|
+
```yaml
|
|
61
|
+
name: The owner adds two things to the basket
|
|
62
|
+
service: web # or piece: src/Counter.stories.tsx#Default
|
|
63
|
+
person: owner
|
|
64
|
+
steps:
|
|
65
|
+
- fill: Search
|
|
66
|
+
with: pens
|
|
67
|
+
- click: Add to basket
|
|
68
|
+
role: button
|
|
69
|
+
- snapshot: Basket
|
|
70
|
+
role: status
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**A file scenario**:
|
|
74
|
+
|
|
75
|
+
```yaml
|
|
76
|
+
name: The weekly stock report lists every item with its price
|
|
77
|
+
input: { file: stock.json }
|
|
78
|
+
run: node report.mjs {{input}} {{output}}/weekly.csv
|
|
79
|
+
output: { file: weekly.csv, layout: csv }
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Layouts: csv, tsv, json, lines, fixed (named columns by position), zip (entries by glob: csv, tsv, json, lines, zip,
|
|
83
|
+
skip).
|
|
84
|
+
|
|
85
|
+
**A piece** is a Storybook story. `play` functions are not run; Storybook's hooks (`useArgs`) and `storybook/test` are
|
|
86
|
+
answered by shims.
|
|
87
|
+
|
|
88
|
+
## 4. Run one, then compare
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
rehearse run '<id>' --json # one observation on this checkout
|
|
92
|
+
rehearse compare --base main --json # every scenario, base against head
|
|
93
|
+
rehearse compare --base main --affected --json # only what the change reaches
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Read `line`, then each entry of `scenarios`:
|
|
97
|
+
|
|
98
|
+
| verdict | Meaning | What you do |
|
|
99
|
+
| -------- | ---------------------------------------------------------------------- | ---------------------------------------- |
|
|
100
|
+
| `same` | as on the base | nothing |
|
|
101
|
+
| `said` | changed and said so (`said`: announced or edited) | check `differences` match what you meant |
|
|
102
|
+
| `unsaid` | changed without saying so | fix it, or announce it if you meant it |
|
|
103
|
+
| `new` | not on the base | check it passes |
|
|
104
|
+
| `fails` | fails on the head (`failures`); `failsOnBase` means the base fails too | fix it unless `failsOnBase` is true |
|
|
105
|
+
|
|
106
|
+
`byChange` groups unannounced changes by what changed. `notRun` lists scenarios that couldn't run, and `base.ok: false`
|
|
107
|
+
means the base didn't come up. The command exits 0 only when nothing fails on the head and nothing changed unsaid.
|
|
108
|
+
|
|
109
|
+
## 5. Announce what you meant to change
|
|
110
|
+
|
|
111
|
+
Write `.rehearse/announce.yaml` beside `rehearse.yaml` (or pass `--announce <file>`, or `--said <id>`):
|
|
112
|
+
|
|
113
|
+
```yaml
|
|
114
|
+
changes:
|
|
115
|
+
- scenario: "apps/api/members.hurl#A creator isn't told the directory exists"
|
|
116
|
+
why: A non-administrator now gets 403 instead of the concealed 404.
|
|
117
|
+
- scenario: 'src/Badge.stories.tsx#*'
|
|
118
|
+
why: Badges use the new colour tokens.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Editing a scenario's own definition also counts as saying so. Announce only what you changed on purpose.
|
|
122
|
+
|
|
123
|
+
## 6. Drive the product step by step
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
rehearse drive start --json # --service, --piece, --world, --as, --scheme dark
|
|
127
|
+
rehearse drive snapshot --json # the accessibility tree
|
|
128
|
+
rehearse drive click --name "Add to basket" --role button --json
|
|
129
|
+
rehearse drive fill --name Search --with pens --json
|
|
130
|
+
rehearse drive key Enter --json
|
|
131
|
+
rehearse drive screenshot shot.png --json
|
|
132
|
+
rehearse drive stop --json
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
A result is `{ok, command, ms, file, tree}` or `{ok: false, failure, says}`. On `not_found`, `says` lists the names
|
|
136
|
+
close to the one you asked for. Exit 0 done, 1 failed, 2 usage.
|
|
137
|
+
|
|
138
|
+
## 7. Show a person
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
rehearse open '<id>' --json # the stage's address for it, for a PR or a message
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Rules
|
|
145
|
+
|
|
146
|
+
- Never print, log or commit a token from `rehearse people --json`. Rehearse scrubs them from what it keeps.
|
|
147
|
+
- Run one comparison at a time: services, browsers and builds are heavy.
|
|
148
|
+
- `rehearse down --all` and `rehearse drive stop` stop what you started.
|