@virtocommerce/test-automation-framework 0.0.0-stage → 0.1.0-alpha.1

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 (233) hide show
  1. package/.biome/formatter.json +11 -0
  2. package/.biome/imports.json +52 -0
  3. package/.biome/preset.json +4 -0
  4. package/.biome/rules.json +45 -0
  5. package/.claude/agents/qa-automation-expert.md +119 -0
  6. package/.claude/agents/qa-coverage.md +96 -0
  7. package/.claude/agents/qa-explorer.md +112 -0
  8. package/.claude/agents/qa-healer.md +88 -0
  9. package/.claude/agents/qa-judge.md +102 -0
  10. package/.claude/agents/qa-planner.md +104 -0
  11. package/.claude/agents/qa-reviewer.md +121 -0
  12. package/.claude/checks/browser-secrets.mts +107 -0
  13. package/.claude/checks/contract.mts +469 -0
  14. package/.claude/checks/expectation-guard.mts +665 -0
  15. package/.claude/checks/explore-extractors.mts +4 -0
  16. package/.claude/checks/judge-verdict.mts +165 -0
  17. package/.claude/checks/project-facts.mts +491 -0
  18. package/.claude/checks/prove-fails.mts +770 -0
  19. package/.claude/checks/rank-gaps.mts +177 -0
  20. package/.claude/checks/readonly-shell.mts +740 -0
  21. package/.claude/checks/reconcile-run.mts +270 -0
  22. package/.claude/checks/scan-prompts.mts +351 -0
  23. package/.claude/checks/stand.mts +45 -0
  24. package/.claude/checks/test-duration.mts +134 -0
  25. package/.claude/checks/test-shape.mts +224 -0
  26. package/.claude/checks/ticket-card.mts +195 -0
  27. package/.claude/commands/qa-coverage.md +13 -0
  28. package/.claude/commands/qa-explore.md +17 -0
  29. package/.claude/commands/qa-heal.md +44 -0
  30. package/.claude/commands/qa-implement.md +60 -0
  31. package/.claude/commands/qa-plan.md +55 -0
  32. package/.claude/commands/qa-review.md +90 -0
  33. package/.claude/commands/qa.md +156 -0
  34. package/.claude/hooks/readonly-shell.mts +65 -0
  35. package/.claude/settings.json +15 -0
  36. package/.claude/skills/coverage-analysis/SKILL.md +107 -0
  37. package/.claude/skills/create-graphql-layer/SKILL.md +159 -0
  38. package/.claude/skills/create-ui-layer/SKILL.md +189 -0
  39. package/.claude/skills/explore-api/SKILL.md +74 -0
  40. package/.claude/skills/explore-frontend/SKILL.md +85 -0
  41. package/.claude/skills/framework-rules/SKILL.md +189 -0
  42. package/.claude/skills/heal-tests/SKILL.md +197 -0
  43. package/.claude/skills/heal-tests/guard-recipe.md +53 -0
  44. package/.claude/skills/judge-criteria/SKILL.md +40 -0
  45. package/.claude/skills/judge-criteria/coverage.md +9 -0
  46. package/.claude/skills/judge-criteria/expert.md +23 -0
  47. package/.claude/skills/judge-criteria/explorer.md +9 -0
  48. package/.claude/skills/judge-criteria/healer.md +13 -0
  49. package/.claude/skills/judge-criteria/planner.md +12 -0
  50. package/.claude/skills/plan-implementation/SKILL.md +82 -0
  51. package/.claude/skills/plan-implementation/contract-template.md +72 -0
  52. package/.claude/skills/plan-test-strategy/SKILL.md +100 -0
  53. package/.claude/skills/project-facts/SKILL.md +130 -0
  54. package/.claude/skills/read-change/SKILL.md +64 -0
  55. package/.claude/skills/read-ticket/SKILL.md +63 -0
  56. package/.claude/skills/read-ticket/providers.md +58 -0
  57. package/.claude/skills/review-pr/SKILL.md +152 -0
  58. package/.claude/skills/review-test-code/SKILL.md +208 -0
  59. package/.claude/skills/write-e2e-test/SKILL.md +175 -0
  60. package/.claude/skills/write-graphql-test/SKILL.md +158 -0
  61. package/.claude/skills/write-rest-api-test/SKILL.md +182 -0
  62. package/.claude/skills/write-security-test/SKILL.md +253 -0
  63. package/.qa/project.example.json +71 -0
  64. package/CHANGELOG.md +1 -0
  65. package/LICENSE +12 -0
  66. package/README.md +53 -2
  67. package/bin/install-qa-agents.mjs +94 -0
  68. package/dist/auth/credentials.d.ts +10 -0
  69. package/dist/auth/credentials.js +2 -0
  70. package/dist/auth/credentials.js.map +1 -0
  71. package/dist/auth/frontend-browser-sessions.d.ts +71 -0
  72. package/dist/auth/frontend-browser-sessions.js +130 -0
  73. package/dist/auth/frontend-browser-sessions.js.map +1 -0
  74. package/dist/auth/index.d.ts +9 -0
  75. package/dist/auth/index.js +5 -0
  76. package/dist/auth/index.js.map +1 -0
  77. package/dist/auth/platform-browser-sessions.d.ts +47 -0
  78. package/dist/auth/platform-browser-sessions.js +92 -0
  79. package/dist/auth/platform-browser-sessions.js.map +1 -0
  80. package/dist/auth/sign-in-lock.d.ts +14 -0
  81. package/dist/auth/sign-in-lock.js +70 -0
  82. package/dist/auth/sign-in-lock.js.map +1 -0
  83. package/dist/auth/storage-state.d.ts +3 -0
  84. package/dist/auth/storage-state.js +2 -0
  85. package/dist/auth/storage-state.js.map +1 -0
  86. package/dist/auth/token-client.d.ts +82 -0
  87. package/dist/auth/token-client.js +111 -0
  88. package/dist/auth/token-client.js.map +1 -0
  89. package/dist/auth/token-manager.d.ts +67 -0
  90. package/dist/auth/token-manager.js +138 -0
  91. package/dist/auth/token-manager.js.map +1 -0
  92. package/dist/core/default-reporters.d.ts +31 -0
  93. package/dist/core/default-reporters.js +36 -0
  94. package/dist/core/default-reporters.js.map +1 -0
  95. package/dist/core/default-use.d.ts +28 -0
  96. package/dist/core/default-use.js +25 -0
  97. package/dist/core/default-use.js.map +1 -0
  98. package/dist/core/env.d.ts +24 -0
  99. package/dist/core/env.js +33 -0
  100. package/dist/core/env.js.map +1 -0
  101. package/dist/core/error-message.d.ts +10 -0
  102. package/dist/core/error-message.js +13 -0
  103. package/dist/core/error-message.js.map +1 -0
  104. package/dist/core/index.d.ts +16 -0
  105. package/dist/core/index.js +11 -0
  106. package/dist/core/index.js.map +1 -0
  107. package/dist/core/is-ci.d.ts +14 -0
  108. package/dist/core/is-ci.js +18 -0
  109. package/dist/core/is-ci.js.map +1 -0
  110. package/dist/core/parse-env.d.ts +13 -0
  111. package/dist/core/parse-env.js +21 -0
  112. package/dist/core/parse-env.js.map +1 -0
  113. package/dist/core/projects.d.ts +24 -0
  114. package/dist/core/projects.js +33 -0
  115. package/dist/core/projects.js.map +1 -0
  116. package/dist/core/run-options.d.ts +31 -0
  117. package/dist/core/run-options.js +43 -0
  118. package/dist/core/run-options.js.map +1 -0
  119. package/dist/core/secret.d.ts +105 -0
  120. package/dist/core/secret.js +167 -0
  121. package/dist/core/secret.js.map +1 -0
  122. package/dist/core/string-schemas.d.ts +39 -0
  123. package/dist/core/string-schemas.js +56 -0
  124. package/dist/core/string-schemas.js.map +1 -0
  125. package/dist/core/url-path.d.ts +7 -0
  126. package/dist/core/url-path.js +2 -0
  127. package/dist/core/url-path.js.map +1 -0
  128. package/dist/dataset/collection.d.ts +44 -0
  129. package/dist/dataset/collection.js +76 -0
  130. package/dist/dataset/collection.js.map +1 -0
  131. package/dist/dataset/index.d.ts +11 -0
  132. package/dist/dataset/index.js +6 -0
  133. package/dist/dataset/index.js.map +1 -0
  134. package/dist/dataset/load-dataset.d.ts +39 -0
  135. package/dist/dataset/load-dataset.js +62 -0
  136. package/dist/dataset/load-dataset.js.map +1 -0
  137. package/dist/dataset/manifest.d.ts +77 -0
  138. package/dist/dataset/manifest.js +10 -0
  139. package/dist/dataset/manifest.js.map +1 -0
  140. package/dist/dataset/placeholders.d.ts +66 -0
  141. package/dist/dataset/placeholders.js +87 -0
  142. package/dist/dataset/placeholders.js.map +1 -0
  143. package/dist/dataset/seed-collection.d.ts +53 -0
  144. package/dist/dataset/seed-collection.js +115 -0
  145. package/dist/dataset/seed-collection.js.map +1 -0
  146. package/dist/dataset/seed-dataset.d.ts +70 -0
  147. package/dist/dataset/seed-dataset.js +138 -0
  148. package/dist/dataset/seed-dataset.js.map +1 -0
  149. package/dist/dataset/seed-events.d.ts +81 -0
  150. package/dist/dataset/seed-events.js +2 -0
  151. package/dist/dataset/seed-events.js.map +1 -0
  152. package/dist/dataset/seed-requests.d.ts +102 -0
  153. package/dist/dataset/seed-requests.js +160 -0
  154. package/dist/dataset/seed-requests.js.map +1 -0
  155. package/dist/dataset/seed-scope.d.ts +39 -0
  156. package/dist/dataset/seed-scope.js +67 -0
  157. package/dist/dataset/seed-scope.js.map +1 -0
  158. package/dist/fixtures/default-fixtures.d.ts +93 -0
  159. package/dist/fixtures/default-fixtures.js +105 -0
  160. package/dist/fixtures/default-fixtures.js.map +1 -0
  161. package/dist/fixtures/index.d.ts +2 -0
  162. package/dist/fixtures/index.js +2 -0
  163. package/dist/fixtures/index.js.map +1 -0
  164. package/dist/graphql/graphql-client.d.ts +78 -0
  165. package/dist/graphql/graphql-client.js +83 -0
  166. package/dist/graphql/graphql-client.js.map +1 -0
  167. package/dist/graphql/graphql-codegen.d.ts +56 -0
  168. package/dist/graphql/graphql-codegen.js +42 -0
  169. package/dist/graphql/graphql-codegen.js.map +1 -0
  170. package/dist/graphql/graphql-error.d.ts +54 -0
  171. package/dist/graphql/graphql-error.js +74 -0
  172. package/dist/graphql/graphql-error.js.map +1 -0
  173. package/dist/graphql/index.d.ts +6 -0
  174. package/dist/graphql/index.js +4 -0
  175. package/dist/graphql/index.js.map +1 -0
  176. package/dist/http/authentication.d.ts +16 -0
  177. package/dist/http/authentication.js +2 -0
  178. package/dist/http/authentication.js.map +1 -0
  179. package/dist/http/http-client.d.ts +110 -0
  180. package/dist/http/http-client.js +237 -0
  181. package/dist/http/http-client.js.map +1 -0
  182. package/dist/http/http-error.d.ts +26 -0
  183. package/dist/http/http-error.js +34 -0
  184. package/dist/http/http-error.js.map +1 -0
  185. package/dist/http/http-method.d.ts +2 -0
  186. package/dist/http/http-method.js +2 -0
  187. package/dist/http/http-method.js.map +1 -0
  188. package/dist/http/http-response.d.ts +137 -0
  189. package/dist/http/http-response.js +166 -0
  190. package/dist/http/http-response.js.map +1 -0
  191. package/dist/http/index.d.ts +7 -0
  192. package/dist/http/index.js +4 -0
  193. package/dist/http/index.js.map +1 -0
  194. package/dist/http/request-options.d.ts +62 -0
  195. package/dist/http/request-options.js +2 -0
  196. package/dist/http/request-options.js.map +1 -0
  197. package/dist/modules/index.d.ts +2 -0
  198. package/dist/modules/index.js +2 -0
  199. package/dist/modules/index.js.map +1 -0
  200. package/dist/modules/installed-modules.d.ts +86 -0
  201. package/dist/modules/installed-modules.js +135 -0
  202. package/dist/modules/installed-modules.js.map +1 -0
  203. package/docs/README.md +43 -0
  204. package/docs/concepts/areas.md +38 -0
  205. package/docs/concepts/auth.md +92 -0
  206. package/docs/concepts/config.md +102 -0
  207. package/docs/concepts/dataset.md +183 -0
  208. package/docs/concepts/environment.md +54 -0
  209. package/docs/concepts/fixtures.md +109 -0
  210. package/docs/concepts/graphql.md +76 -0
  211. package/docs/concepts/http.md +88 -0
  212. package/docs/concepts/modules.md +63 -0
  213. package/docs/concepts/secrets.md +50 -0
  214. package/docs/contributing/architecture.md +67 -0
  215. package/docs/contributing/conventions.md +39 -0
  216. package/docs/contributing/documentation.md +37 -0
  217. package/docs/contributing/releasing.md +76 -0
  218. package/docs/examples/auth.ts +20 -0
  219. package/docs/examples/config.ts +36 -0
  220. package/docs/examples/dataset.ts +70 -0
  221. package/docs/examples/environment.ts +8 -0
  222. package/docs/examples/fixtures.ts +41 -0
  223. package/docs/examples/getting-started.ts +22 -0
  224. package/docs/examples/graphql-codegen.ts +9 -0
  225. package/docs/examples/graphql.ts +32 -0
  226. package/docs/examples/http.ts +18 -0
  227. package/docs/examples/modules.ts +19 -0
  228. package/docs/examples/secrets.ts +11 -0
  229. package/docs/examples/tsconfig.json +10 -0
  230. package/docs/getting-started.md +106 -0
  231. package/docs/guides/generating-types.md +75 -0
  232. package/docs/guides/qa-agents.md +66 -0
  233. package/package.json +156 -4
@@ -0,0 +1,189 @@
1
+ ---
2
+ name: framework-rules
3
+ description: "The rules of the test framework itself, the same in every repository that uses it: spec structure, arrange and cleanup, waits, platform defects, module gating, tests that target edge, isolated tests, working discipline and the order in which to read knowledge. Every agent reads this first"
4
+ ---
5
+
6
+ ## Framework Rules
7
+
8
+ These rules belong to the framework, not to a repository. They hold in every repository the agents work in: this
9
+ one and a client repository that builds its suite on `@virtocommerce/test-automation-framework`. Style (naming,
10
+ comments, wording, formatting) is not here: it comes from the repository's own `CLAUDE.md`, linter and formatter
11
+ configuration, and neighbouring files. Facts that belong to this repository's Virto Commerce suite are marked
12
+ **In this suite** and collected at the end.
13
+
14
+ **Precedence.** A framework rule beats a style rule. In a client repository the client's style beats this
15
+ repository's default style. When two framework rules seem to conflict, stop and ask; do not pick one silently.
16
+
17
+ **The suite directory.** The suite the agents work on is `suiteDir` in the project facts (skill `project-facts`).
18
+ Spec paths are repo-relative and every Playwright command on the suite is
19
+ `npx --no playwright test --config=<suiteDir> --no-deps <spec paths> --project=<name>`, without `--config` when
20
+ `suiteDir` is `.`. In this suite `suiteDir` is `virtocommerce`. `--no-deps` keeps a run from seeding the stand again:
21
+ seed once with `commands.seed` before the first run and after a change to the seed data.
22
+
23
+ ## Working Discipline
24
+
25
+ - Think before testing. State what the behaviour is, how it can be observed and what would prove it wrong. If the
26
+ request has two readings, ask, or name the reading you took.
27
+ - Write the simplest spec that proves the behaviour. No helper, parameter or abstraction nobody asked for.
28
+ - Change surgically. Touch only the lines the task needs, match the file around them, and mention unrelated
29
+ problems instead of fixing them.
30
+ - Define success first, as something that can be checked: a command that passes, a count that matches, a record that
31
+ is gone. Loop until the check passes; do not declare success from reading code.
32
+ - Root-cause every failure. No retries, no waits added until it passes, no case-specific workaround.
33
+
34
+ ## Reading Order for Knowledge
35
+
36
+ 1. Read the knowledge snapshot first. Its directory is `knowledgeDir` in the project facts (skill `project-facts`).
37
+ Each entry carries its capture date.
38
+ 2. Call the live service (tracker, documentation, platform, frontend) only when the snapshot cannot answer, or when
39
+ the entry's date makes it unsafe to rely on.
40
+ 3. After a live call, update the snapshot with what you learned and the capture date. Never copy credentials or
41
+ masked values into it.
42
+
43
+ ## Spec Structure
44
+
45
+ - `test` and `expect` come from the suite's fixtures entry (`@fixtures`), never from `@playwright/test`, except in
46
+ unit tests.
47
+ - One `test.describe("<topic> (<who>)")` per identity: `(<a role from roles>)`, `(anonymous)`, or the name the
48
+ repository's existing specs use for another identity; when there is none, ask the person. The `"<topic> (<who>)"`
49
+ describe format and the step wording below are structural formats that belong to the framework, so they are not the
50
+ "naming and wording" style that the repository decides.
51
+ - Who acts is set only with `test.use` on the describe, with the fixture options the suite declares (in this suite
52
+ `user`, `shopperAs` and `modules`). No wrapper functions around `test.use`.
53
+ - Every phase is a `test.step`: `"arrange: …"`, `"act: …"` or `"assert: …"`; `"act and assert: …"` for one call
54
+ whose answer is the assertion. `cleanup:` steps are not written by hand: `arrange` adds them after the test.
55
+ - Setup happens in the test body through `arrange`. A `test.beforeEach` arranges only what every test of its describe
56
+ shares.
57
+ - No conditional logic and no `as` casts in specs. Repeated cases are one table-driven test whose rows may hold small
58
+ lambdas.
59
+ - A read that several tests of one spec repeat may be a `function` declaration at the end of the spec, such as
60
+ `pricelistOf(api, id)`. A read that several specs need goes to the suite's shared code (in this suite `support/`);
61
+ setup that several specs need becomes an `arrange` method.
62
+ - No raw selectors in specs. Add them to the page objects.
63
+ - Place a test by the platform module that owns the behaviour, not by the noun in its title.
64
+
65
+ ## Layers and Imports
66
+
67
+ - Imports follow the layer configuration of the repository; the linter enforces it, do not work around it. The
68
+ framework never imports suite code, and the suite imports the framework only by its package name,
69
+ `@virtocommerce/test-automation-framework/<area>`.
70
+ - Generated code (GraphQL documents and types, REST types) is never edited by hand; regenerate it.
71
+
72
+ ## Data, `arrange` and Cleanup
73
+
74
+ - Read seeded data from the dataset; a spec may name a dataset id as a constant. Create what the test changes with
75
+ `arrange`, which removes it after the test, last first, so tests have no teardown code.
76
+ - A test that changes the acting customer's own state (cart, lists, addresses, locks) uses a customer created for the
77
+ test, never a dataset user.
78
+ - REST administration tests run as `roleFor.admin`, the role the project facts name for administration. A test that
79
+ locks, deletes or changes the password of the acting user creates its own user through `arrange`.
80
+ - When the create is the action under test, register its removal with the `…Later` method of `arrange`: before the
81
+ act when a builder gave the draft a client-side id the platform keeps, right after the act when the platform assigns
82
+ the id, and always before the first assertion. `…Later` methods create nothing.
83
+ - Data `arrange` has no method for gets a new `arrange` method, never teardown code in the spec.
84
+ - Find records by search criteria, never by "is listed in the first N" windows. Assert on the test's own records,
85
+ never on a whole shared list.
86
+ - Prove a deletion by reading the record by id (the read returns `undefined` or 404), not by a search.
87
+ - A test that leaves data it cannot remove says why in a `leaves data` annotation.
88
+ - Respect the stand profile's data modes and `owned` marks where the profile provides them: change only data the
89
+ profile marks as owned. Where it does not yet, let `arrange` remove everything created and change nothing
90
+ platform-wide outside the isolated tests.
91
+
92
+ ## Isolated Tests
93
+
94
+ - Tests that change platform-wide state (global settings, store access, the search index, a restart) are the only
95
+ tests allowed to change state that other tests share. They live in the suite's isolated directory (in this suite
96
+ `tests/isolated/{restapi,graphql}/`, project `isolated`, one worker), and their describe carries
97
+ `{ tag: DESTRUCTIVE_TAG }` from `@virtocommerce/test-automation-framework/core`.
98
+ - They run only when `RUN_DESTRUCTIVE_TESTS` is on, in a run of their own (in this suite `npm run test:vc:isolated`),
99
+ never next to the other projects.
100
+ - They still change state only through `arrange` methods that restore it, and wait for the change to take effect.
101
+
102
+ ## Layers of Testing
103
+
104
+ - A UI test checks the UI. Data rules (search semantics, prices, scopes, validation) are checked once through the API.
105
+
106
+ ## Waiting
107
+
108
+ - Index-backed reads lag. Wait in `arrange` through its index-wait methods. In an assertion, use
109
+ `expect.poll(…, { timeout: INDEX_LAG_TIMEOUT_MS })` or `expect(…).toPass({ timeout })`. Inside `arrange` and shared
110
+ code, wait with `pollUntil(read, isDone, describe, timeoutMs)`.
111
+ - Never `waitForTimeout`, `networkidle` or a sleep. A browser action waits for the state or the response it causes.
112
+
113
+ ## Failing Loudly
114
+
115
+ - Missing data fails loudly: `requireFields(value, [...], label)` or `requireDefined(list, label)`, never `?? ""`,
116
+ `?? []` or `?? 0`.
117
+ - A skipped test without a reason is a failure. A test skips only through `modules` (a required module is missing or
118
+ outside its versions) or the stand profile; never `test.skip` or `test.fixme`. `test.fail` marks only a known
119
+ platform defect (Platform Defects).
120
+
121
+ ## Assertions
122
+
123
+ - Expected HTTP errors: the client never throws on a status, so check it:
124
+ `expect(response.status).toBe(400)` and `expect(response.text).toContain(reason)`, or `response.errorJson<T>()` to
125
+ read the error body. Success bodies go through `expectOk().json<T>()`, which fails on any other status.
126
+ - Expected GraphQL errors: `execute` throws a `GraphqlError` whose message lists each error as `[CODE] message`, so
127
+ `rejects.toThrow("[CODE]")`; `executeRaw` returns `data` and `errors` for partial data or several errors.
128
+ - Never change an expected value or assertion to make a test pass against the build.
129
+
130
+ ## Platform Defects
131
+
132
+ - A test asserts the correct behaviour. When the platform gets it wrong, the expectation stays as it is: no edited
133
+ expectation, no retry, no `test.fixme`, no skip and no symptom workaround.
134
+ - A new defect stays failing until a person confirms it: listed under `## Platform defects` of an approved contract,
135
+ or confirmed in the review.
136
+ - A confirmed defect that fails every time becomes a known issue: the test gets `PLATFORM_DEFECT_TAG`, the ticket as
137
+ an `issue` annotation when one exists, and `test.fail(true, "<ticket>: <defect>")` as the first line of its body.
138
+ The test keeps running; it passes while the defect is there and fails as soon as the platform is fixed, which is the
139
+ signal to remove the mark.
140
+
141
+ ```ts
142
+ test("anonymous visitors cannot list the coupons", {
143
+ tag: PLATFORM_DEFECT_TAG,
144
+ annotation: { type: "issue", description: "<tracker URL of the ticket>" },
145
+ }, async ({ shopper }) => {
146
+ test.fail(true, "<ticket>: anonymous visitors can list the coupons");
147
+ …
148
+ });
149
+ ```
150
+
151
+ - A defect that hits whichever test runs at the moment, such as a database deadlock, cannot be marked on a test: it
152
+ stays failing and is reported for the platform to fix.
153
+ - `test.fail` is never used for anything else, and only the expert adds it, for a confirmed defect; the healer never
154
+ does.
155
+
156
+ - Other annotations explain facts the test cannot avoid, such as `leaves data` or `database difference`; they never
157
+ excuse a failure.
158
+
159
+ ## Optional Modules
160
+
161
+ - A test that needs an optional module, or a module version, declares it on its describe:
162
+ `test.use({ modules: { pickup: MODULES.pickup } })`. The test is skipped where the module is missing or outside its
163
+ range (`minVersion` inclusive, `beforeVersion` exclusive), and the skip reason names the module. The seed manifest
164
+ uses the same `MODULES` entries, so a collection the seed skips and the tests that read it skip for the same reason.
165
+ - An inner `test.use` replaces the outer `modules`; spread them to keep both.
166
+ - Keep that module's GraphQL fields out of shared fragments.
167
+
168
+ ## Tests Target Edge
169
+
170
+ - Tests are written for the edge versions of the platform and its modules. Never adapt a test or an expectation to an
171
+ older (stable) platform. When a test relies on a newer fix or feature, raise that module's `minVersion` so older
172
+ platforms skip it.
173
+
174
+ ## Example from this repository
175
+
176
+ - Fixtures entry `virtocommerce/fixtures/index.ts` (`@fixtures`); options `user`, `shopperAs`, `modules`; module
177
+ constants `MODULES` in `virtocommerce/modules.ts` (`@modules`), each `minVersion` the edge version the suite is
178
+ proven on.
179
+ - Describe identities: `(anonymous)`, `(store administrator)` (our `roleFor.admin`, `user: STORE_ADMINISTRATOR`),
180
+ `(customer of their own)` for `shopperAs: "customer"` or `arrange.customers.customer()`, `(signed-in customer)`
181
+ for a dataset shopper, and `(platform admin)` for the admin UI signed in as `ADMINISTRATOR`.
182
+ - `arrange` domains: `customers`, `carts`, `orders`, `catalog`, `pickup`, `content`, `platform`, `mailbox`,
183
+ `security`, `pricing`, `marketing` (`virtocommerce/arrange/`). Index-wait methods:
184
+ `arrange.customers.searchableMemberships`, `arrange.customers.lockMemberships`, `arrange.pickup.pickupLocations`,
185
+ `cartPickupLocations`, `productPickupLocations`.
186
+ - `requireFields`, `requireDefined` (`@support/require-fields.ts`), `pollUntil`, `INDEX_LAG_TIMEOUT_MS`
187
+ (`@support/poll.ts`); `expect(cart).toHaveConsistentTotals()` from `@fixtures`.
188
+ - Place by module: users and accounts are `security`, not `customer`.
189
+ - Layers: `.biome/layers.json`; the tables are in `CLAUDE.md` "Layers".
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: heal-tests
3
+ description: "Heal failing or flaky specs: reproduce, classify each failure (test defect, product defect, stand data, flaky), fix only test infrastructure under the healer paths (never a spec) within the area's autonomy, at most three rounds, write the heal report and the flaky list, finish with the expectation guard"
4
+ argument-hint: "<spec-file | test-title | .qa/runs/<contract-name>/>"
5
+ ---
6
+
7
+ ## Heal Tests
8
+
9
+ Used by `qa-healer`. Read first: the skill `framework-rules`, then `project-facts`
10
+ (`node .claude/checks/project-facts.mts`). The rule above all others: **an expected value or an assertion never moves
11
+ toward what the build does.** A failure that can only be made green by changing one is a product defect, and it stays
12
+ red.
13
+
14
+ ## Step 1: Target, Slug, Baseline
15
+
16
+ - The target is a spec file, a test title or a run record directory `.qa/runs/<contract-name>/`. For a run record,
17
+ the failing tests are what this prints under `failures`, for each project whose pair of files the directory holds
18
+ (the names are in `project-facts`, "Hand-off Paths"):
19
+ `node .claude/checks/reconcile-run.mts .qa/runs/<contract-name>/list.<project>.json .qa/runs/<contract-name>/report.<project>.json`.
20
+ A failure of a test whose case the contract lists under `## Platform defects` is a known product defect: list it,
21
+ heal nothing for it. No target: stop and say so.
22
+ - `<slug>` is the target in lower case letters, digits and hyphens. Writing `.qa/runs/heal-<slug>/baseline.txt` below
23
+ creates the git-ignored run directory.
24
+ - A hook confines you: Write, Edit and MultiEdit work only under `facts.healerPaths`, `.qa/reports/heal-<slug>.md`,
25
+ `.qa/reports/flaky.md` and `.qa/runs/heal-<slug>/`, never on a `.git*` name or in the directory git runs hooks
26
+ from; Bash runs only the commands shown in this skill (git reads, `node .claude/checks/<module>.mts`,
27
+ `npx --no playwright test` with `--config=<suiteDir>`, `--project`, `--repeat-each`, `--retries=0`, `--reporter`,
28
+ `-g`; `npx --no tsc -p <suiteDir> --noEmit`; `npx --no biome check <paths>`;
29
+ `node .claude/checks/expectation-guard.mts --base=<sha>`). `npx` always carries `--no`, which stops npm from
30
+ fetching a package it does not find. `--config=<suiteDir>` is the `suiteDir` of the facts and is left out when it
31
+ is `.`. A refused call is final: do not look for a way around it, report it.
32
+ - The dispatch carries a baseline: a git tree id that `/qa` or `/qa-heal` recorded with
33
+ `node .claude/checks/expectation-guard.mts --snapshot` before you started (working tree, untracked files included). It
34
+ is what the guard in step 7 compares against. Without one, stop and say so. Never record or replace a baseline
35
+ yourself: a new one would hide the changes made before it. Save the id in `.qa/runs/heal-<slug>/baseline.txt` for the
36
+ report.
37
+ - You may edit only files under `facts.healerPaths`. A spec is never one of them.
38
+ - Find the Playwright project of each test:
39
+ `npx --no playwright test --config=<suiteDir> --list --reporter=json <spec>` names it per test. `<spec>` is
40
+ repository-relative. Run a project only when it is a key of `commands.test`.
41
+
42
+ ## Step 2: Reproduce
43
+
44
+ For each project, run the failing tests with `npx --no playwright test` itself (the hook refuses npm scripts), with
45
+ the suite's config and the project's name from `commands.test`. `-g` takes one word without quotes or spaces: join
46
+ the words of a title with `.`. The leading variable sends the JSON report to your run directory:
47
+
48
+ ```shell
49
+ PLAYWRIGHT_JSON_OUTPUT_FILE=.qa/runs/heal-<slug>/round-0.<project>.json npx --no playwright test --config=<suiteDir> --no-deps <spec> --project=<project> -g <title.words> --reporter=list,json
50
+ PLAYWRIGHT_JSON_OUTPUT_FILE=.qa/runs/heal-<slug>/list.<project>.json npx --no playwright test --config=<suiteDir> --no-deps --list --reporter=json <spec> --project=<project> -g <title.words>
51
+ node .claude/checks/reconcile-run.mts .qa/runs/heal-<slug>/list.<project>.json .qa/runs/heal-<slug>/round-0.<project>.json
52
+ ```
53
+
54
+ Set the variable the way the shell does it. Do not hand-edit either JSON file. If a project's test command in
55
+ `commands.test` needs more than `playwright test` with the suite's config and that project, apart from leaving out
56
+ destructive tests (it sets an environment variable, for instance), say so in the report and stop: you may not run it.
57
+ Everything `reconcile-run` lists under `failures` (failed, flaky, missing from the report, skipped without a reason) is
58
+ a failure to classify. A stand that does not answer: report "not done" and stop; write no run record by hand.
59
+
60
+ ## Step 3: Classify Every Failure
61
+
62
+ Read the failure's message, the error context and trace under the suite's `test-results/`
63
+ (`<suiteDir>/test-results/`), the spec, and what it calls. Then:
64
+
65
+ | Evidence | Class |
66
+ |---|---|
67
+ | A locator found nothing or too much, and the snapshot shows the element under another test id, role or text | test defect (locator) |
68
+ | The element or record exists but appears later than the test looks (an index lag, an animation, a request still in flight) | test defect (wait) |
69
+ | A builder, dataset id or `arrange` call produces an invalid or removed record; setup or cleanup throws | test defect (data) |
70
+ | An `expect` mismatch, or an expected-error check that sees another status | product defect, unless the expectation's own source (the oracle, the contract) shows the expectation is stale: then do not edit it either, escalate to the person |
71
+ | A 5xx, a GraphQL error or a console error for a valid request | product defect |
72
+ | A seeded record, account, module or setting the test needs is missing or changed on the stand | stand data |
73
+ | It passed and failed in the same series (step 4) | flaky |
74
+
75
+ An assertion failure is never "healed". Write down, for each failure, the evidence you saw (message line, snapshot
76
+ fact, status code) and the class. When two classes fit, take the stricter reading: product defect over test defect.
77
+
78
+ What you do with each class:
79
+
80
+ | Class | What it is | You |
81
+ |---|---|---|
82
+ | Test defect | The test side is wrong: a stale locator, a missing wait, bad or stale test data, a broken setup | fix (autonomy permitting) |
83
+ | Product defect | The build contradicts a correct expectation, or answers an error to a valid request | edit nothing; the test stays failing; report it as a product defect |
84
+ | Stand data | A record, module, account or setting the test needs is missing or changed on the stand | report what is missing; edit nothing |
85
+ | Flaky | Passes and fails in one series of runs with no change | decided only by the series; list it, fix only a cause you can name on the test side |
86
+
87
+ ## Step 4: The Flaky Series
88
+
89
+ A failure is called flaky only from a series, never from a single re-run, one pass or one failure. For the tests
90
+ whose first run failed in a way that could be intermittent (a timeout, a wait, an order), and for any test the
91
+ person named as flaky, run `facts.flakyRunSeries` times per project:
92
+
93
+ ```shell
94
+ PLAYWRIGHT_JSON_OUTPUT_FILE=.qa/runs/heal-<slug>/series.<project>.json npx --no playwright test --config=<suiteDir> --no-deps <spec> --project=<project> -g <title.words> --repeat-each=<flakyRunSeries> --retries=0 --reporter=list,json
95
+ PLAYWRIGHT_JSON_OUTPUT_FILE=.qa/runs/heal-<slug>/series-list.<project>.json npx --no playwright test --config=<suiteDir> --no-deps --list --reporter=json <spec> --project=<project> -g <title.words> --repeat-each=<flakyRunSeries>
96
+ node .claude/checks/reconcile-run.mts .qa/runs/heal-<slug>/series-list.<project>.json .qa/runs/heal-<slug>/series.<project>.json
97
+ ```
98
+
99
+ Count the entries under `failures` against `expected`. Every run failed: deterministic, not flaky; classify it by
100
+ step 3. None failed: not reproduced; change nothing, list it in the flaky list as "not reproduced in <n> runs". Some
101
+ failed and some passed: flaky. Update `.qa/reports/flaky.md` (format below), and fix it only if you can name a
102
+ test-side cause (a missing wait, shared data between tests) and the area's autonomy allows it.
103
+
104
+ ## Step 5: Fix
105
+
106
+ Only a test defect, within the area's autonomy:
107
+
108
+ - Any key of `autonomy` other than `*` that matches the area: it equals a directory name in the spec's path or a word
109
+ of the topic of its `test.describe("<topic> (<who>)")`. One match: its value. Two or more matches: `propose`. No
110
+ match: `autonomy["*"]`. An area named in `critical` with no key of its own is `propose`.
111
+ - `apply`: make the fix and re-run. `propose`: edit nothing; the report holds the exact change as a diff, and you
112
+ wait.
113
+ - What a fix may change, only under `facts.healerPaths`:
114
+ - Page objects and components: a locator that no longer matches, a missing wait for the element, the selector
115
+ priority of `framework-rules`.
116
+ - Data: a builder, record or `arrange` method that is stale or invalid, never a value the test asserts against.
117
+ - Waits: `arrange` index-wait methods where a read lags behind a write; never `waitForTimeout`, `networkidle` or
118
+ `expect.poll`.
119
+ - Setup and cleanup that live in those directories (the `arrange` methods and the removals they register).
120
+ - A locator is fixed in the page object (selector priority: `framework-rules`, `create-ui-layer` "Locator
121
+ Conventions"). A lagging read is fixed in `arrange` (the dataset's index-wait methods). Never `waitForTimeout`,
122
+ `networkidle`, `expect.poll`, a raised retry count, a blanket timeout, a skip, `fixme` or an annotation that hides
123
+ the failure (`testInfo.skip` and `test.info().fixme` too): the guard flags each of them as an added line.
124
+ - The code you write runs with the user's rights when the tests run; the hook confines your tool calls, not that
125
+ code. So it never reaches past the page: no `fs` or `child_process`, `require`, dynamic `import(`, `process.env`,
126
+ file writes or spawned processes (the guard flags those as added lines too). On an untrusted stand, heal only in a
127
+ sandbox.
128
+ - Never edit a spec, and never touch an `expect` line, a matcher argument, an `assert:` step, a helper's expected
129
+ value or an `expected…` constant, even to rename a locator inside it. If the fix needs a spec change, it is not
130
+ yours: write the proposed change as a diff in the report under Escalated and stop on that failure.
131
+ - A product defect: edit nothing and never mark the test expected to fail. The test stays failing; the report names
132
+ the test, the expected value and its oracle, what the build answered, and the evidence, so that a person can file
133
+ the ticket and add its link to the test as an `issue` annotation.
134
+
135
+ ## Step 6: Re-run, at Most Three Rounds
136
+
137
+ After each applied round run the same commands as step 2 (`round-<n>.<project>.json`) and reconcile. Typecheck
138
+ with `npx --no tsc -p <suiteDir> --noEmit` (it only reads) must be clean. Lint only the files you changed, in the
139
+ linter's check mode and never with a command that fixes: `commands.lint` here is `npm run check`
140
+ (`biome check --write .`), which rewrites specs and `.claude/checks/` and would create findings, so run
141
+ `npx --no biome check <changed files>` without `--write` (the hook refuses any flag). Fix what it reports by hand,
142
+ inside the healer paths. A fix that makes another test red is
143
+ reverted. After round three, whatever is still red is escalated: do not start a fourth round and do not change the
144
+ class to get out of it.
145
+
146
+ ## Step 7: Guard, Then Report
147
+
148
+ Run the guard against the baseline you were given:
149
+
150
+ ```shell
151
+ node .claude/checks/expectation-guard.mts --base=<tree id in .qa/runs/heal-<slug>/baseline.txt>
152
+ ```
153
+
154
+ This is your own early check; the hook keeps you from writing `.claude/checks/`, and the dispatcher repeats it from the
155
+ baseline's own copy of `.claude/checks/`, taken with `git cat-file`, together with a fingerprint of the git
156
+ configuration and hooks (`/qa`, `/qa-heal`, with `guard-recipe.md` in this directory, which is theirs and not yours to
157
+ run). It compares the working tree, untracked files included, with that tree, and reads `healerPaths` from the
158
+ baseline's `.qa/project.json`. Exit 0: every changed file is under `healerPaths`, no expectation line changed and no
159
+ added line switches a check off. Exit 1 lists `outside healer paths: <file>`, a changed expectation line, or
160
+ `<file>: added <line>`: undo the edit that caused each one (a finding is your mistake, not a style matter), re-run the
161
+ guard until clean, and say in the report which fix you undid. Any other non-zero exit means the guard could not run:
162
+ report "not checked", never clean.
163
+
164
+ **What the guard cannot see, so say it in the report and leave it to the person and the judge:** a locator or value
165
+ edit that is legal by path and line but changes meaning (`page.locator("body")` in a page object, which makes every
166
+ check on it pass), a changed builder or `arrange` default that feeds the expected value, and a compensating
167
+ computation (`price - 2`) in the dataset. For each change under `healerPaths`, the report states what the old and new
168
+ code select or compute and why the test still checks the same behaviour.
169
+
170
+ Write `.qa/reports/heal-<slug>.md`, at most 200 lines. Every failure has an entry: its class, the evidence you saw,
171
+ the fix applied or proposed (or none), and why it is the right one:
172
+
173
+ ```
174
+ # Heal: <target>
175
+ <date> · baseline <tree> · rounds used <n> of 3 · result <passed>/<expected> per project · guard <clean | not checked>
176
+
177
+ ## Failures
178
+ ### <test title> (<project>)
179
+ - Class: test defect | product defect | stand data | flaky | unclassified
180
+ - Evidence: <message line, snapshot fact, status code>
181
+ - Fix: applied <file: what changed> | proposed (autonomy <mode> for <area>) <diff> | none
182
+ - Why: <why this is the right fix, or why nothing was changed>
183
+ - Product defect: <expected value and its oracle, what the build answered> (product defects only)
184
+
185
+ ## Escalated
186
+ <each failure still red after round three or needing a person, with what was tried>
187
+ ```
188
+
189
+ `.qa/reports/flaky.md` is one list for the repository. Keep its other rows; replace the row of the same test and
190
+ project:
191
+
192
+ ```
193
+ | Test | Project | Date | Runs | Failed | First failure message | Cause or status |
194
+ |---|---|---|---|---|---|---|
195
+ ```
196
+
197
+ Never put a credential, token or personal data in either file.
@@ -0,0 +1,53 @@
1
+ # Guard Recipe
2
+
3
+ The dispatcher's check after a heal: `/qa` (stage Heal) and `/qa-heal` (step 2) store this file from the baseline
4
+ with `git cat-file blob` before dispatching the healer, never read it from the working tree after the heal, and run
5
+ the stored copy word for word. It is never the
6
+ healer's: the healer may not run `--repo-fingerprint`, and its own early check is step 7 of `SKILL.md`.
7
+
8
+ ## Run the Guard
9
+
10
+ Recompute the fingerprint and run the guard, both from the baseline's own copy of `.claude/checks/`, never from the
11
+ working tree (the healer could have changed it), so only the healer's changes are judged. Take that copy with
12
+ `git cat-file blob`, which applies no attributes, filters or hooks, and never with `git archive` or a checkout, which
13
+ run a smudge filter a planted `.git/info/attributes` or a global attributes file names; `--no-replace-objects` and
14
+ `GIT_NO_LAZY_FETCH=1` keep a replace ref or a partial clone's fetch from changing what it reads. The fingerprint comes before
15
+ any git command that can run configured code:
16
+
17
+ ```shell
18
+ dir=$(mktemp -d) && mkdir "$dir/checks" || exit 1
19
+ for m in expectation-guard project-facts; do GIT_NO_LAZY_FETCH=1 git --no-replace-objects -c core.fsmonitor=false cat-file blob <baseline tree id>:.claude/checks/$m.mts > "$dir/checks/$m.mts" || { rm -rf "$dir"; exit 1; }; done
20
+ fp=$(node "$dir/checks/expectation-guard.mts" --repo-fingerprint 2>"$dir/fp.err") && [ ${#fp} -eq 64 ] && case $fp in *[!0-9a-f]*) false;; esac || { err=$(grep -m1 '^expectation-guard:' "$dir/fp.err" || tail -n 1 "$dir/fp.err"); echo "fingerprint could not be computed: ${err:-not 64 lowercase hex characters}"; rm -rf "$dir"; exit 1; }
21
+ test "$fp" = "<fingerprint>" || { echo "repository config changed by the healer"; rm -rf "$dir"; exit 1; }
22
+ node "$dir/checks/expectation-guard.mts" --base=<baseline tree id>; code=$?
23
+ test $code -eq 0 && { new=$(node "$dir/checks/expectation-guard.mts" --snapshot) || code=1; }; rm -rf "$dir"; test $code -eq 0 && echo "healed tree: $new"; test $code -eq 0
24
+ ```
25
+
26
+ On a clean guard the last line prints `healed tree: <new tree id>`, the working tree right after the guard, taken
27
+ with the baseline's copy of the guard.
28
+
29
+ ## What the Outcome Means
30
+
31
+ "repository config changed by the healer" (the fingerprint differs from the recorded one) or "fingerprint could not
32
+ be computed: <its stderr line>" (it exited non-zero or printed something other than 64 lowercase hex characters, a
33
+ configuration file under a healer path for one; the line is the guard's `expectation-guard:` line, else the last
34
+ line of its stderr, so a Node warning is not taken for it): stop there, show the line to the person, and run no other git
35
+ command or test in the repository until they have looked; a planted hook or config line runs with their rights. Any other non-zero
36
+ result means "not clean" (the recipe exits 1 whatever the guard's own code, so a baseline without the two
37
+ `.claude/checks/` files also gives it). Findings listed (a file outside the healer paths, which are directories of the
38
+ suite such as `virtocommerce/pages/`, a changed expectation, an added skip, wait or similar): stop, show them to the
39
+ person, and go on to neither the judge nor a review. No finding listed: the guard could not run; report "not
40
+ checked", never clean, and go on to neither the judge nor a review.
41
+
42
+ ## After a Clean Guard
43
+
44
+ When the heal belongs to a contract's run record:
45
+
46
+ After a clean guard, re-run the definition of done's commands yourself (a mechanical re-run, not a role's work), so
47
+ that the reviewer reconciles the healed state and not the expert's red record: for each project of the contract's
48
+ case rows, with the expert's spec files, the stable series and the list into the same `report.<project>.json` and
49
+ `list.<project>.json`, then reconcile ("Hand-off Paths", all three commands, the listing with
50
+ `--config=<suiteDir>` from the facts, such as `npx --no -- playwright test --config=virtocommerce --list ...`).
51
+ The expert's spec files are the ones that record's `list.<project>.json` files name; those name them relative to the
52
+ suite directory (`tests/restapi/...`), so pass them as `<suiteDir>/<path>` (`virtocommerce/tests/restapi/...`). Exit 1
53
+ on a project (a stand that is not reachable included): the run is not done; show the reconcile lines to the person.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: judge-criteria
3
+ description: "The criteria the judge answers pass or fail on, one file per role (planner, expert, explorer, healer, coverage), and the shape of the verdict file it writes"
4
+ ---
5
+
6
+ ## Judge Criteria
7
+
8
+ One file per role holds that role's criteria and nothing else is a source for them: `planner.md`, `expert.md`,
9
+ `explorer.md`, `healer.md`, `coverage.md`. In a flow the judge reads `expert.md` only; the other files serve the
10
+ evaluation suite.
11
+
12
+ ## Step 1: Read Your Role's File
13
+
14
+ Read the one file for the role you were given. Every `- \`name\`` line is a criterion; answer each, by that exact
15
+ name, and answer no other.
16
+
17
+ ## Step 2: Answer Each Criterion From Evidence
18
+
19
+ - `pass` is true only when you have shown the criterion holds, from the output under judgement and what the
20
+ repository, the stand's read-only records or a command's output tell you. Say where: file and line, command and
21
+ its line of output.
22
+ - Never use the agent's own summary or reasoning as evidence. If you were handed one, ignore it.
23
+ - When the evidence is missing, thin or points both ways, `pass` is false and the evidence says what is missing.
24
+
25
+ ## Step 3: Write the Verdict File
26
+
27
+ Write `.qa/judge/<contract-name>/judge-<role>.json` (`<contract-name>`: `project-facts`, "Hand-off Paths"; in the
28
+ evaluation suite, the directory the brief names), nowhere else:
29
+
30
+ ```json
31
+ {
32
+ "role": "expert",
33
+ "subject": "<the contract path, or the files judged>",
34
+ "criteria": [{ "name": "<criterion>", "pass": false, "evidence": "<what you saw, where>" }],
35
+ "verdict": "fail"
36
+ }
37
+ ```
38
+
39
+ `verdict` is `pass` only when every criterion passes, and `fail` otherwise. Then run
40
+ `node .claude/checks/judge-verdict.mts check <file>`; it must print `ok`. Fix the file, not the criteria, until it does.
@@ -0,0 +1,9 @@
1
+ # Criteria: the coverage report
2
+
3
+ Judged from the report, the tests in the repository and the weights in the project facts, never from the coverage
4
+ agent's reasoning.
5
+
6
+ - `each-gap-is-real`: no existing test covers the behaviour each listed gap names. Search the tests for each gap
7
+ and quote the result.
8
+ - `order-follows-weights`: the order of the gaps follows the weights in the project facts, as the ranking script
9
+ computes it, not the agent's preference.
@@ -0,0 +1,23 @@
1
+ # Criteria: the expert's tests
2
+
3
+ Judged from the contract, the diff and the files it touches, never from the expert's reasoning or summary. The
4
+ judge proves a test fails with `node .claude/checks/prove-fails.mts`; the model does not run the test on a broken
5
+ copy itself.
6
+
7
+ - `case-has-test`: every case row of the contract has a test, or a written reason why it has none (an approved
8
+ amendment, a requirement the stand cannot meet). A case under `## Platform defects` has a test like any other.
9
+ List each case with its test or its reason.
10
+ - `checks-claimed-behaviour`: each test asserts the behaviour its case claims, on the data role and project the
11
+ case names, against the expected value of the case's oracle. A test that asserts something easier or different is
12
+ a fail. A test of a platform-defect case asserts the correct behaviour, not what the build does.
13
+ - `fails-when-behaviour-breaks`: each test fails when that behaviour breaks. Prove it where the script can change a
14
+ literal of the assertion (evidence: the `prove-fails` output with `failed: true` and the line it changed); where
15
+ none can, say why and reason from the assertion. A bound (`toBeGreaterThan`, `toBeLessThan` and their `OrEqual`
16
+ forms) and a line with more than one assertion are never proved by the script: reason from the assertion, and pass
17
+ a bound only when its limit is the oracle's and the tightest the case allows. A test of a case under
18
+ `## Platform defects` already fails on the defect: its failure line, showing the oracle's value against the
19
+ build's, is the evidence. An assertion that cannot fail (a tautology, a check on a value the test set itself, a
20
+ missing await, an assertion on something that is always present) is a fail.
21
+ - `skip-has-reason`: every skip carries a reason a reader can act on: the `modules` option (the missing or older
22
+ module) or a stand-profile condition. A silent skip, a `test.skip` or `test.fixme` in a spec, and a `test.fail` on a case
23
+ that is not under `## Platform defects`, is a fail.
@@ -0,0 +1,9 @@
1
+ # Criteria: the explorer's report
2
+
3
+ Judged from the report and the stand it describes, through read-only means, never from the explorer's reasoning.
4
+
5
+ - `selectors-and-operations-exist`: every selector, test id, page, operation and field the report lists exists on
6
+ the stand or in the schema. Check a sample large enough to cover each kind and every one the report marks as
7
+ confirmed; quote what you found.
8
+ - `nothing-invented`: nothing in the report is absent from the stand, the schema or the source it cites, and every
9
+ claim names how it was observed.
@@ -0,0 +1,13 @@
1
+ # Criteria: the healer's fixes
2
+
3
+ Judged from the diff the healer left and the failing run it started from, never from the healer's reasoning.
4
+
5
+ - `test-side-defect-fixed`: the defect the fix targets was in the test side (a page object, data or a wait), the
6
+ test passes after the fix, and the failure it started from is gone, not hidden by a skip or a retry.
7
+ - `no-expectation-moved-toward-build`: no expected value or assertion changed, weakened or removed to match what the
8
+ build does; a product defect stayed failing, unmarked, and reported as a product defect.
9
+ - `every-fix-explained`: every change in the diff has an explanation that says why it fixes the failure.
10
+ - `no-meaning-change-by-edit`: the code check sees paths and lines, not meaning. Read each change under the healer
11
+ paths for what it now selects or computes: a locator widened until anything matches (`page.locator("body")`), a
12
+ builder or `arrange` default that feeds an expected value, a compensating computation (`price - 2`). Each is a fail
13
+ unless the report shows the old and new code check the same behaviour.
@@ -0,0 +1,12 @@
1
+ # Criteria: the planner's contract
2
+
3
+ Judged from the contract file and its source (the ticket card, the document or the area), never from the planner's
4
+ reasoning.
5
+
6
+ - `requirements-covered`: every acceptance criterion or documented rule of the source became a case row or an
7
+ out-of-scope line with a reason. List each requirement with the row or line that holds it.
8
+ - `oracle-source-named`: every case's oracle names where its expected value comes from (`ticket`, `doc`, `schema` or
9
+ `observed`), and the named source says what the case expects. An `observed` oracle is listed for confirmation and
10
+ holds a value the report it names recorded.
11
+ - `nothing-invented`: no case, rule or expected value is absent from the source, the schemas and what the explorer
12
+ observed. Quote the source of any doubtful row.