@crvouga/atlas 0.4.0 → 0.6.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 (444) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/README.md +191 -611
  3. package/dist/bun/src/driver.d.ts +41 -7
  4. package/dist/bun/src/driver.js +47 -6
  5. package/dist/bun/src/index.d.ts +8 -0
  6. package/dist/bun/src/index.js +8 -0
  7. package/dist/core/src/cli.d.ts +14 -1
  8. package/dist/core/src/cli.js +35 -1
  9. package/dist/core/src/config.d.ts +77 -4
  10. package/dist/core/src/config.js +110 -17
  11. package/dist/core/src/events/cloudevents.d.ts +54 -9
  12. package/dist/core/src/events/cloudevents.js +60 -9
  13. package/dist/core/src/graph.d.ts +21 -0
  14. package/dist/core/src/graph.js +26 -0
  15. package/dist/core/src/index.d.ts +11 -0
  16. package/dist/core/src/index.js +11 -0
  17. package/dist/core/src/lint.d.ts +30 -0
  18. package/dist/core/src/lint.js +13 -0
  19. package/dist/core/src/plan.d.ts +39 -1
  20. package/dist/core/src/plan.js +28 -1
  21. package/dist/core/src/privacy.d.ts +29 -2
  22. package/dist/core/src/privacy.js +19 -2
  23. package/dist/core/src/report/formats.d.ts +34 -4
  24. package/dist/core/src/report/formats.js +24 -4
  25. package/dist/core/src/report/markdown.d.ts +15 -0
  26. package/dist/core/src/report/markdown.js +8 -0
  27. package/dist/core/src/run/clients.d.ts +44 -5
  28. package/dist/core/src/run/clients.js +46 -2
  29. package/dist/core/src/run/execute.d.ts +75 -16
  30. package/dist/core/src/run/execute.js +71 -18
  31. package/dist/core/src/run/frames.d.ts +13 -4
  32. package/dist/core/src/run/frames.js +19 -4
  33. package/dist/core/src/run/http.d.ts +34 -1
  34. package/dist/core/src/run/http.js +14 -1
  35. package/dist/core/src/run/types.d.ts +76 -3
  36. package/dist/core/src/run/types.js +19 -3
  37. package/dist/core/src/signals.d.ts +49 -5
  38. package/dist/core/src/signals.js +22 -5
  39. package/dist/core/src/spec/compose.d.ts +23 -1
  40. package/dist/core/src/spec/compose.js +10 -1
  41. package/dist/core/src/spec/index.d.ts +9 -1
  42. package/dist/core/src/spec/index.js +9 -1
  43. package/dist/core/src/spec/load.d.ts +22 -1
  44. package/dist/core/src/spec/load.js +31 -1
  45. package/dist/core/src/spec/parse.d.ts +16 -2
  46. package/dist/core/src/spec/parse.js +25 -2
  47. package/dist/core/src/spec/scxml.d.ts +25 -4
  48. package/dist/core/src/spec/scxml.js +36 -4
  49. package/dist/core/src/spec/types.d.ts +52 -1
  50. package/dist/core/src/spec/types.js +24 -0
  51. package/dist/detox/src/index.d.ts +54 -11
  52. package/dist/detox/src/index.js +45 -7
  53. package/dist/playwright/src/driver.d.ts +39 -3
  54. package/dist/playwright/src/driver.js +27 -3
  55. package/dist/playwright/src/index.d.ts +10 -0
  56. package/dist/playwright/src/index.js +10 -0
  57. package/dist/playwright/src/media.d.ts +50 -4
  58. package/dist/playwright/src/media.js +55 -4
  59. package/dist/playwright/src/signals.d.ts +44 -5
  60. package/dist/playwright/src/signals.js +29 -5
  61. package/dist/reports/src/attachment-files.d.ts +44 -0
  62. package/dist/reports/src/attachment-files.js +121 -0
  63. package/dist/reports/src/attachment-response.d.ts +31 -0
  64. package/dist/reports/src/attachment-response.js +55 -0
  65. package/dist/reports/src/aws-credentials.d.ts +48 -0
  66. package/dist/reports/src/aws-credentials.js +221 -0
  67. package/dist/reports/src/browser-navigation.d.ts +14 -0
  68. package/dist/reports/src/browser-navigation.js +7 -0
  69. package/dist/reports/src/bundle.d.ts +34 -2
  70. package/dist/reports/src/bundle.js +38 -2
  71. package/dist/reports/src/catalog.d.ts +34 -3
  72. package/dist/reports/src/catalog.js +17 -3
  73. package/dist/reports/src/cli-stores.d.ts +36 -0
  74. package/dist/reports/src/cli-stores.js +73 -0
  75. package/dist/reports/src/clock.d.ts +7 -2
  76. package/dist/reports/src/clock.js +5 -2
  77. package/dist/reports/src/completion-order.d.ts +18 -5
  78. package/dist/reports/src/completion-order.js +18 -5
  79. package/dist/reports/src/compose.d.ts +80 -0
  80. package/dist/reports/src/compose.js +117 -0
  81. package/dist/reports/src/copy-store.d.ts +29 -0
  82. package/dist/reports/src/copy-store.js +52 -0
  83. package/dist/reports/src/directory-outline.d.ts +38 -0
  84. package/dist/reports/src/directory-outline.js +103 -0
  85. package/dist/reports/src/directory-store.d.ts +20 -0
  86. package/dist/reports/src/directory-store.js +166 -0
  87. package/dist/reports/src/doctor.d.ts +29 -0
  88. package/dist/reports/src/doctor.js +85 -0
  89. package/dist/reports/src/effective-delta.d.ts +34 -0
  90. package/dist/reports/src/effective-delta.js +25 -0
  91. package/dist/reports/src/evidence-detail.d.ts +64 -0
  92. package/dist/reports/src/evidence-detail.js +92 -0
  93. package/dist/reports/src/evidence-live.d.ts +35 -5
  94. package/dist/reports/src/evidence-live.js +18 -2
  95. package/dist/reports/src/evidence-types.d.ts +68 -1
  96. package/dist/reports/src/evidence-types.js +5 -1
  97. package/dist/reports/src/evidence-view.d.ts +43 -4
  98. package/dist/reports/src/evidence-view.js +13 -2
  99. package/dist/reports/src/explorer-types.d.ts +40 -3
  100. package/dist/reports/src/explorer-types.js +8 -0
  101. package/dist/reports/src/explorer-versions.d.ts +9 -1
  102. package/dist/reports/src/explorer-versions.js +18 -1
  103. package/dist/reports/src/export-evidence.d.ts +16 -1
  104. package/dist/reports/src/export-evidence.js +52 -1
  105. package/dist/reports/src/fetcher.d.ts +27 -3
  106. package/dist/reports/src/fetcher.js +11 -3
  107. package/dist/reports/src/format-date.d.ts +6 -0
  108. package/dist/reports/src/format-date.js +6 -0
  109. package/dist/reports/src/format.d.ts +16 -0
  110. package/dist/reports/src/format.js +10 -0
  111. package/dist/reports/src/frames.d.ts +36 -3
  112. package/dist/reports/src/frames.js +22 -3
  113. package/dist/reports/src/hash.d.ts +18 -0
  114. package/dist/reports/src/hash.js +13 -0
  115. package/dist/reports/src/host.d.ts +29 -0
  116. package/dist/reports/src/host.js +64 -0
  117. package/dist/reports/src/html-frame.d.ts +5 -6
  118. package/dist/reports/src/html-frame.js +12 -1
  119. package/dist/reports/src/http-store.d.ts +56 -0
  120. package/dist/reports/src/http-store.js +148 -0
  121. package/dist/reports/src/http.d.ts +7 -0
  122. package/dist/reports/src/http.js +6 -0
  123. package/dist/reports/src/ingest.d.ts +54 -0
  124. package/dist/reports/src/ingest.js +210 -0
  125. package/dist/reports/src/init.d.ts +40 -0
  126. package/dist/reports/src/init.js +369 -0
  127. package/dist/reports/src/junit.d.ts +33 -6
  128. package/dist/reports/src/junit.js +87 -21
  129. package/dist/reports/src/keyboard.d.ts +20 -0
  130. package/dist/reports/src/keyboard.js +11 -0
  131. package/dist/reports/src/keys.d.ts +21 -3
  132. package/dist/reports/src/keys.js +21 -3
  133. package/dist/reports/src/layer-axes.d.ts +35 -5
  134. package/dist/reports/src/layer-axes.js +25 -5
  135. package/dist/reports/src/layer-catalog.d.ts +28 -1
  136. package/dist/reports/src/layer-catalog.js +18 -1
  137. package/dist/reports/src/layer-merge.d.ts +98 -9
  138. package/dist/reports/src/layer-merge.js +147 -31
  139. package/dist/reports/src/layer-source.d.ts +18 -0
  140. package/dist/reports/src/layer-source.js +11 -0
  141. package/dist/reports/src/layer-store.d.ts +42 -0
  142. package/dist/reports/src/layer-store.js +63 -5
  143. package/dist/reports/src/layer-types.d.ts +32 -1
  144. package/dist/reports/src/layers-route.d.ts +47 -4
  145. package/dist/reports/src/layers-route.js +86 -7
  146. package/dist/reports/src/live-reporter.d.ts +34 -0
  147. package/dist/reports/src/live-reporter.js +122 -0
  148. package/dist/reports/src/media-types.d.ts +11 -0
  149. package/dist/reports/src/media-types.js +22 -0
  150. package/dist/reports/src/namespace-guard.d.ts +10 -1
  151. package/dist/reports/src/namespace-guard.js +10 -1
  152. package/dist/reports/src/navigation.d.ts +12 -0
  153. package/dist/reports/src/navigation.js +7 -0
  154. package/dist/reports/src/object-io.d.ts +11 -4
  155. package/dist/reports/src/object-io.js +4 -4
  156. package/dist/reports/src/object-store-conformance.d.ts +27 -0
  157. package/dist/reports/src/object-store-conformance.js +87 -0
  158. package/dist/reports/src/object-store.d.ts +33 -24
  159. package/dist/reports/src/object-store.js +17 -24
  160. package/dist/reports/src/parse-with.d.ts +16 -0
  161. package/dist/reports/src/parse-with.js +14 -0
  162. package/dist/reports/src/performance-part.d.ts +25 -1
  163. package/dist/reports/src/performance-part.js +15 -1
  164. package/dist/reports/src/performance.d.ts +22 -2
  165. package/dist/reports/src/performance.js +12 -2
  166. package/dist/reports/src/persist.d.ts +12 -3
  167. package/dist/reports/src/persist.js +12 -3
  168. package/dist/reports/src/phone.d.ts +18 -1
  169. package/dist/reports/src/phone.js +18 -1
  170. package/dist/reports/src/protocol.d.ts +26 -4
  171. package/dist/reports/src/protocol.js +15 -4
  172. package/dist/reports/src/publication.d.ts +21 -1
  173. package/dist/reports/src/publication.js +21 -1
  174. package/dist/reports/src/publish-checks.d.ts +35 -0
  175. package/dist/reports/src/publish-checks.js +122 -0
  176. package/dist/reports/src/publish.d.ts +42 -9
  177. package/dist/reports/src/publish.js +36 -7
  178. package/dist/reports/src/read.d.ts +46 -16
  179. package/dist/reports/src/read.js +38 -14
  180. package/dist/reports/src/recording-bundle.d.ts +13 -2
  181. package/dist/reports/src/recording-bundle.js +4 -2
  182. package/dist/reports/src/recording-keys.d.ts +15 -1
  183. package/dist/reports/src/recording-keys.js +15 -1
  184. package/dist/reports/src/remote-report.d.ts +28 -7
  185. package/dist/reports/src/remote-report.js +15 -7
  186. package/dist/reports/src/report-cli.d.ts +51 -0
  187. package/dist/reports/src/report-cli.js +486 -0
  188. package/dist/reports/src/report-index.d.ts +99 -0
  189. package/dist/reports/src/report-index.js +337 -0
  190. package/dist/reports/src/report-loader.d.ts +10 -0
  191. package/dist/reports/src/report-loader.js +6 -0
  192. package/dist/reports/src/report-parts.d.ts +29 -3
  193. package/dist/reports/src/report-parts.js +37 -3
  194. package/dist/reports/src/report-status.d.ts +48 -0
  195. package/dist/reports/src/report-status.js +156 -0
  196. package/dist/reports/src/report-types.d.ts +73 -0
  197. package/dist/reports/src/report-types.js +3 -0
  198. package/dist/reports/src/reporter.d.ts +67 -0
  199. package/dist/reports/src/reporter.js +128 -0
  200. package/dist/reports/src/reports-explorer-route.d.ts +541 -0
  201. package/dist/reports/src/reports-explorer-route.js +11 -0
  202. package/dist/reports/src/reports-list-route.d.ts +9 -0
  203. package/dist/reports/src/reports-list-route.js +9 -0
  204. package/dist/reports/src/reports-route.d.ts +561 -22
  205. package/dist/reports/src/reports-route.js +11 -3
  206. package/dist/reports/src/reports-store.d.ts +19 -2
  207. package/dist/reports/src/reports-store.js +10 -2
  208. package/dist/reports/src/resilient-cache.d.ts +14 -1
  209. package/dist/reports/src/resilient-cache.js +8 -1
  210. package/dist/reports/src/retention.d.ts +17 -1
  211. package/dist/reports/src/retention.js +5 -1
  212. package/dist/reports/src/run-bundle.d.ts +63 -0
  213. package/dist/reports/src/run-bundle.js +159 -0
  214. package/dist/reports/src/s3-store.d.ts +79 -0
  215. package/dist/reports/src/s3-store.js +295 -0
  216. package/dist/reports/src/scenario.d.ts +14 -4
  217. package/dist/reports/src/scenario.js +5 -4
  218. package/dist/reports/src/sigv4.d.ts +72 -0
  219. package/dist/reports/src/sigv4.js +96 -0
  220. package/dist/reports/src/snapshot-bundle.d.ts +24 -1
  221. package/dist/reports/src/snapshot-bundle.js +27 -2
  222. package/dist/reports/src/snapshot-surface.d.ts +20 -9
  223. package/dist/reports/src/snapshot-surface.js +32 -19
  224. package/dist/reports/src/source-content.d.ts +23 -0
  225. package/dist/reports/src/source-content.js +30 -1
  226. package/dist/reports/src/source-entries.d.ts +13 -0
  227. package/dist/reports/src/source-entries.js +6 -0
  228. package/dist/reports/src/source-part.d.ts +15 -0
  229. package/dist/reports/src/source-part.js +8 -0
  230. package/dist/reports/src/source-reader.d.ts +11 -0
  231. package/dist/reports/src/source-reader.js +5 -0
  232. package/dist/reports/src/spec-evidence.d.ts +12 -2
  233. package/dist/reports/src/spec-evidence.js +6 -2
  234. package/dist/reports/src/spec-inventory.d.ts +15 -1
  235. package/dist/reports/src/spec-inventory.js +22 -1
  236. package/dist/reports/src/spec-link.d.ts +28 -0
  237. package/dist/reports/src/spec-link.js +70 -0
  238. package/dist/reports/src/spec-set.d.ts +63 -0
  239. package/dist/reports/src/spec-set.js +177 -0
  240. package/dist/reports/src/status.d.ts +10 -0
  241. package/dist/reports/src/status.js +5 -0
  242. package/dist/reports/src/store-prefix.d.ts +28 -0
  243. package/dist/reports/src/store-prefix.js +22 -0
  244. package/dist/reports/src/store-url.d.ts +89 -0
  245. package/dist/reports/src/store-url.js +160 -0
  246. package/dist/reports/src/test-catalog-entity.d.ts +11 -0
  247. package/dist/reports/src/test-catalog-entity.js +6 -0
  248. package/dist/reports/src/types.d.ts +6 -1
  249. package/dist/reports/src/use-report-nav.d.ts +35 -0
  250. package/dist/reports/src/use-report-nav.js +12 -0
  251. package/dist/runners/src/codecept.d.ts +14 -0
  252. package/dist/runners/src/codecept.js +16 -0
  253. package/dist/runners/src/jest.d.ts +50 -0
  254. package/dist/runners/src/jest.js +52 -0
  255. package/dist/runners/src/mocha.d.ts +40 -0
  256. package/dist/runners/src/mocha.js +39 -0
  257. package/dist/runners/src/node-test.d.ts +28 -0
  258. package/dist/runners/src/node-test.js +44 -0
  259. package/dist/runners/src/publish.d.ts +30 -0
  260. package/dist/runners/src/publish.js +68 -0
  261. package/dist/schema/src/api.d.ts +800 -0
  262. package/dist/schema/src/api.js +201 -0
  263. package/dist/schema/src/cli-results.d.ts +210 -0
  264. package/dist/schema/src/cli-results.js +124 -0
  265. package/dist/schema/src/common.d.ts +53 -0
  266. package/dist/schema/src/common.js +42 -0
  267. package/dist/schema/src/index.d.ts +16 -0
  268. package/dist/schema/src/index.js +16 -0
  269. package/dist/schema/src/layer.d.ts +2273 -0
  270. package/dist/schema/src/layer.js +462 -0
  271. package/dist/schema/src/live-run.d.ts +123 -0
  272. package/dist/schema/src/live-run.js +30 -0
  273. package/dist/schema/src/manifest.d.ts +97 -2
  274. package/dist/schema/src/manifest.js +84 -0
  275. package/dist/schema/src/project.d.ts +20 -0
  276. package/dist/schema/src/project.js +10 -0
  277. package/dist/schema/src/report-sources.d.ts +29 -0
  278. package/dist/schema/src/report-sources.js +27 -1
  279. package/dist/schema/src/runs-index.d.ts +17 -1
  280. package/dist/schema/src/runs-index.js +15 -0
  281. package/dist/schema/src/server-config.d.ts +177 -0
  282. package/dist/schema/src/server-config.js +85 -0
  283. package/dist/schema/src/spec.d.ts +69 -0
  284. package/dist/schema/src/spec.js +58 -0
  285. package/dist/server/src/app.d.ts +72 -0
  286. package/dist/server/src/app.js +557 -0
  287. package/dist/server/src/auth.d.ts +41 -0
  288. package/dist/server/src/auth.js +59 -0
  289. package/dist/server/src/config.d.ts +83 -0
  290. package/dist/server/src/config.js +204 -0
  291. package/dist/server/src/dev.d.ts +12 -0
  292. package/dist/server/src/dev.js +89 -0
  293. package/dist/server/src/events.d.ts +29 -0
  294. package/dist/server/src/events.js +101 -0
  295. package/dist/server/src/host.d.ts +30 -0
  296. package/dist/server/src/host.js +115 -0
  297. package/dist/server/src/index.d.ts +18 -0
  298. package/dist/server/src/index.js +18 -0
  299. package/dist/server/src/live-runs.d.ts +52 -0
  300. package/dist/server/src/live-runs.js +229 -0
  301. package/dist/server/src/llms.d.ts +19 -0
  302. package/dist/server/src/llms.js +63 -0
  303. package/dist/server/src/main.d.ts +30 -0
  304. package/dist/server/src/main.js +114 -0
  305. package/dist/server/src/openapi.d.ts +56 -0
  306. package/dist/server/src/openapi.js +438 -0
  307. package/dist/server/src/problem.d.ts +8 -0
  308. package/dist/server/src/problem.js +39 -0
  309. package/dist/server/src/projects.d.ts +3 -0
  310. package/dist/server/src/projects.js +154 -0
  311. package/dist/server/src/settings-page.d.ts +9 -0
  312. package/dist/server/src/settings-page.js +93 -0
  313. package/dist/server/src/settings.d.ts +23 -0
  314. package/dist/server/src/settings.js +72 -0
  315. package/dist/server/src/site.d.ts +15 -0
  316. package/dist/server/src/site.js +78 -0
  317. package/dist/server/src/store-api.d.ts +28 -0
  318. package/dist/server/src/store-api.js +180 -0
  319. package/dist/server/src/validate.d.ts +71 -0
  320. package/dist/server/src/validate.js +197 -0
  321. package/dist/vitest/src/index.d.ts +27 -5
  322. package/dist/vitest/src/index.js +18 -5
  323. package/dist/webdriver/src/driver.d.ts +63 -11
  324. package/dist/webdriver/src/driver.js +57 -6
  325. package/dist/webdriver/src/index.d.ts +8 -0
  326. package/dist/webdriver/src/index.js +1 -0
  327. package/dist/webdriver/src/protocol.d.ts +75 -6
  328. package/dist/webdriver/src/protocol.js +79 -6
  329. package/docs/agents.md +137 -0
  330. package/docs/deploying.md +345 -0
  331. package/docs/dogfooding.md +175 -0
  332. package/docs/extending.md +242 -0
  333. package/docs/integrating.md +485 -0
  334. package/docs/reference/bun.md +141 -0
  335. package/docs/reference/cli.md +148 -0
  336. package/docs/reference/core.md +2432 -0
  337. package/docs/reference/detox.md +150 -0
  338. package/docs/reference/http-api.md +799 -0
  339. package/docs/reference/playwright.md +303 -0
  340. package/docs/reference/reports.md +7152 -0
  341. package/docs/reference/runners.md +169 -0
  342. package/docs/reference/schema.md +1762 -0
  343. package/docs/reference/server.md +825 -0
  344. package/docs/reference/vitest.md +45 -0
  345. package/docs/reference/webdriver.md +330 -0
  346. package/docs/report-backends.md +144 -0
  347. package/docs/report-contract.md +400 -0
  348. package/docs/reporting-issues.md +160 -0
  349. package/docs/runners.md +69 -0
  350. package/docs/server.md +321 -0
  351. package/docs/statecharts.md +643 -0
  352. package/llms-full.txt +4114 -0
  353. package/llms.txt +49 -0
  354. package/package.json +61 -11
  355. package/packages/core/README.md +2 -1
  356. package/packages/reports/README.md +65 -0
  357. package/packages/reports/STORAGE.md +4 -0
  358. package/packages/runners/README.md +6 -0
  359. package/packages/runners/compat/codecept.cjs +2 -0
  360. package/packages/runners/compat/jest.cjs +2 -0
  361. package/packages/runners/compat/mocha.cjs +2 -0
  362. package/packages/schema/README.md +14 -0
  363. package/packages/schema/schemas/atlas-change.schema.json +4 -0
  364. package/packages/schema/schemas/check-detail.schema.json +1032 -0
  365. package/packages/schema/schemas/checks-result.schema.json +26 -0
  366. package/packages/schema/schemas/command-error.schema.json +35 -0
  367. package/packages/schema/schemas/doctor-result.schema.json +60 -0
  368. package/packages/schema/schemas/effective-delta.schema.json +490 -0
  369. package/packages/schema/schemas/effective-evidence.schema.json +471 -0
  370. package/packages/schema/schemas/evidence-page.schema.json +271 -0
  371. package/packages/schema/schemas/hello-event.schema.json +26 -0
  372. package/packages/schema/schemas/init-plan.schema.json +347 -0
  373. package/packages/schema/schemas/layer-rows.schema.json +199 -0
  374. package/packages/schema/schemas/layer.schema.json +2888 -0
  375. package/packages/schema/schemas/live-run-start.schema.json +42 -0
  376. package/packages/schema/schemas/live-run-update.schema.json +93 -0
  377. package/packages/schema/schemas/live-run.schema.json +225 -0
  378. package/packages/schema/schemas/merge-result.schema.json +40 -0
  379. package/packages/schema/schemas/outline.schema.json +62 -0
  380. package/packages/schema/schemas/problem.schema.json +37 -0
  381. package/packages/schema/schemas/project-slug.schema.json +8 -0
  382. package/packages/schema/schemas/project.schema.json +22 -0
  383. package/packages/schema/schemas/projects.schema.json +33 -0
  384. package/packages/schema/schemas/publish-checks.schema.json +1413 -0
  385. package/packages/schema/schemas/publish-result.schema.json +168 -0
  386. package/packages/schema/schemas/ready.schema.json +68 -0
  387. package/packages/schema/schemas/report-event.schema.json +100 -0
  388. package/packages/schema/schemas/report-status.schema.json +370 -0
  389. package/packages/schema/schemas/server-config.schema.json +208 -0
  390. package/packages/schema/schemas/server-editable-settings.schema.json +132 -0
  391. package/packages/schema/schemas/server-info.schema.json +114 -0
  392. package/packages/schema/schemas/server-settings-snapshot.schema.json +285 -0
  393. package/packages/schema/schemas/spec-set.schema.json +103 -0
  394. package/packages/schema/schemas/store-listing.schema.json +29 -0
  395. package/packages/schema/schemas/store-write-result.schema.json +28 -0
  396. package/packages/schema/schemas/stream-result.schema.json +59 -0
  397. package/packages/server/README.md +43 -0
  398. package/packages/server/openapi.json +11021 -0
  399. package/packages/visualizer/README.md +32 -11
  400. package/packages/visualizer/bin/atlas-client.mjs +176 -0
  401. package/packages/visualizer/bin/atlas-visualizer.mjs +2 -175
  402. package/packages/visualizer/src/app/AppShell.tsx +32 -16
  403. package/packages/visualizer/src/app/report-sources.tsx +7 -4
  404. package/packages/visualizer/src/app/router.tsx +3 -3
  405. package/packages/visualizer/src/components/ActivityIndicator.module.css +4 -0
  406. package/packages/visualizer/src/components/ActivityIndicator.tsx +6 -0
  407. package/packages/visualizer/src/components/Header.module.css +101 -192
  408. package/packages/visualizer/src/components/Header.tsx +88 -13
  409. package/packages/visualizer/src/components/ProjectPicker.tsx +64 -0
  410. package/packages/visualizer/src/data/adapters/adapter.ts +5 -17
  411. package/packages/visualizer/src/data/adapters/index.ts +10 -1
  412. package/packages/visualizer/src/data/adapters/report-backend.test.ts +3 -2
  413. package/packages/visualizer/src/data/adapters/report-backend.ts +1 -1
  414. package/packages/visualizer/src/data/queries.ts +14 -7
  415. package/packages/visualizer/src/evidence/api.ts +16 -3
  416. package/packages/visualizer/src/evidence/artifacts.module.css +213 -0
  417. package/packages/visualizer/src/evidence/artifacts.tsx +272 -0
  418. package/packages/visualizer/src/evidence/check-detail.tsx +21 -4
  419. package/packages/visualizer/src/evidence/document-page.tsx +6 -2
  420. package/packages/visualizer/src/evidence/evidence-context.tsx +79 -12
  421. package/packages/visualizer/src/evidence/evidence.module.css +11 -1
  422. package/packages/visualizer/src/evidence/feature-page.tsx +7 -3
  423. package/packages/visualizer/src/evidence/model-page.tsx +6 -2
  424. package/packages/visualizer/src/evidence/project-home.tsx +45 -0
  425. package/packages/visualizer/src/evidence/recording-page.tsx +4 -1
  426. package/packages/visualizer/src/evidence/spec-index.tsx +2 -1
  427. package/packages/visualizer/src/evidence/spec-page.tsx +23 -16
  428. package/packages/visualizer/src/evidence/test-filter.tsx +21 -0
  429. package/packages/visualizer/src/find/Finder.tsx +1 -7
  430. package/packages/visualizer/src/find/open.ts +4 -0
  431. package/packages/visualizer/src/live/live-query.ts +21 -0
  432. package/packages/visualizer/src/live/live-runs.tsx +69 -0
  433. package/packages/visualizer/src/live/live-stream.ts +225 -0
  434. package/packages/visualizer/src/live/report-progress.ts +62 -0
  435. package/packages/visualizer/src/live/test-progress.tsx +34 -0
  436. package/packages/visualizer/src/runtime.ts +35 -0
  437. package/packages/visualizer/src/state/ui-store.ts +3 -2
  438. package/packages/visualizer/src/views/ChartPage.tsx +2 -0
  439. package/packages/visualizer/src/views/ChartTests.tsx +43 -0
  440. package/packages/visualizer/src/views/SidePanel.tsx +2 -0
  441. package/packages/visualizer/vite/atlas-files.test.ts +4 -4
  442. package/packages/visualizer/vite/atlas-files.ts +1 -5
  443. package/packages/visualizer/vite/atlas-server-proxy.ts +37 -0
  444. package/packages/visualizer/vite.config.ts +11 -3
package/README.md CHANGED
@@ -1,669 +1,249 @@
1
1
  # Atlas
2
2
 
3
- **Executable statecharts.** Write down how a product behaves as statecharts in open formats, then
4
- let Atlas lint them, plan paths that cover every transition, run those paths against the real
5
- product through any driver (a browser, a phone, a plain function), and write a manifest of what
6
- happened, with screenshots, video clips, captions, business events and standard test reports.
7
-
8
- ```
9
- specs/ atlas lint the charts are pure, reachable, free of silent dead ends,
10
- app.scxml ──▶ and every journey replays
11
- child.machine.yaml atlas plan curated journeys + shortest paths covering every transition
12
- journeys.yaml atlas run each path against the product, through a driver
13
- │
14
- ▼
15
- atlas-runs/<run>/manifest.json, junit.xml, ctrf.json, chart.mmd, media/
3
+ **Specs of any kind, reported as layered evidence.** Atlas lays the results of every suite that
4
+ checks your specs (Gherkin, Quint, DMN, Alloy, OpenSLO, unit and end-to-end tests, linters,
5
+ statecharts) over the specs themselves, across machines, branches, environments and storage
6
+ backends, and tells you in one command whether the product still does what it was specified to do.
7
+
8
+ - **Any spec, any runner.** Anything that ends in "this check passed or failed" publishes a *layer*:
9
+ from a JUnit or CTRF file, a ten-line script, or code. No runner and no notation is privileged.
10
+ - **Layered within each project.** A report is computed from layers, not stored as "the run". Partial
11
+ runs on separate nodes, branches and devices are how a report is built, and they compose without
12
+ coordinating: the same layers give the same report in any order, split any way.
13
+ - **Open evidence.** A result carries whatever your framework produces: screenshots, videos, traces, logs, DOM
14
+ snapshots, timelines, retries, annotations, your own structured data. Any media type, nothing registered, and
15
+ new kinds never break older readers ([extending](docs/extending.md)). Specs stay opinionated (statecharts,
16
+ Gherkin, Quint, DMN, Alloy, OpenSLO); evidence stays open.
17
+ - **Open standards, stable schemas.** JUnit XML and CTRF in, JSON Schema 2020-12 contracts, a
18
+ versioned layer format with a golden fixture, and an `ObjectStore` interface any bucket fits.
19
+ - **One node, many projects.** `atlas server` runs a Bun API and serves the Atlas client from the same host. Reports, specs, recordings and live progress are partitioned by project slug.
20
+ Every laptop and CI job sends results to it as they finish (`atlas report publish`, or `atlas report stream` while
21
+ a suite runs), it keeps them on its own disk (or in S3, R2, MinIO), and every client sees the combined report
22
+ update live, receiving only what changed ([the server](docs/server.md), [deploying](docs/deploying.md)).
23
+ - **Fast and fail-closed.** Publishing is two small writes. A thousand layers of a hundred checks
24
+ combine in about a second. An unreadable layer, a downed backend or a check still running is never
25
+ counted as a pass.
26
+ - **Executable statecharts too.** Atlas can also run a product's flows as statecharts against the
27
+ real app, and publishes those runs as layers like any other ([below](#executable-statecharts)).
28
+
29
+ ```
30
+ any suite ──▶ layer ─┐ atlas report status exit 1 unless it passes
31
+ any node ──▶ layer ─┼─▶ backends ─▶ combine ─▶ the Atlas client browse it beside the specs
32
+ any branch ──▶ layer ─┘ (directories, buckets, …) combineBackends() your own code
16
33
  ```
17
34
 
18
- The spec is the source of truth for the product's behaviour, not for the test code: a state says
19
- what a person sees, an event says what happens in business language ("Adds a todo", "Sync fails"),
20
- and the implementation says how a driver makes each event happen and recognises each state.
21
-
22
35
  > [!IMPORTANT]
23
36
  > **Dogfooding phase:** Atlas is developed by using it in real projects. Those projects install the
24
- > published packages from npm and report bugs and missing features as GitHub issues; they do not
37
+ > published package from npm and report bugs and missing features as GitHub issues; they do not
25
38
  > change this repository. If you are integrating Atlas, or are an agent working in a project that
26
- > uses it, read [using Atlas from another project](docs/dogfooding.md) and
27
- > [reporting issues](docs/reporting-issues.md). Releases are automatic: see
28
- > [releasing](docs/releasing.md).
39
+ > uses it, read **[integrating Atlas](docs/integrating.md)**, then
40
+ > [using Atlas from another project](docs/dogfooding.md) and [reporting issues](docs/reporting-issues.md).
41
+ > Releases are automatic: see [releasing](https://github.com/crvouga/atlas/blob/main/docs/releasing.md).
29
42
 
30
- Atlas also owns specification and test-evidence visualization: Gherkin, Quint, DMN, Alloy, OpenSLO and supporting documents appear in **Specs and evidence**, alongside commit-scoped checks, recordings and performance measurements. See [Atlas reports](packages/reports/README.md).
31
-
32
- ## One package
43
+ ## Run this repository's example
33
44
 
34
- Atlas is a single npm package. Each part is its own import path, so a bundler keeps only what you
35
- import. It runs on Bun and on Node 22.18 or later, with any package manager:
45
+ Use two terminals:
36
46
 
37
47
  ```sh
38
- bun add -d @crvouga/atlas
48
+ bun atlas # starts the project-agnostic Atlas node at http://localhost:5180
49
+ bun example:run # runs tests and streams results, current steps and progress as they execute
39
50
  ```
40
51
 
41
- | Import | What it is |
42
- | --- | --- |
43
- | [`@crvouga/atlas`](packages/core) | Spec loading (SCXML and XState), composition, lint, planning, the runner, multi-client runs (`combineDrivers`), `httpDriver` and `functionDriver`, reports, CloudEvents, privacy, config and the `atlas` CLI. `@crvouga/atlas/spec` is a browser-safe subset; `@crvouga/atlas/signals` holds the driver-neutral signals. |
44
- | [`@crvouga/atlas/playwright`](packages/playwright) | Playwright driver: signal-based screen recognisers, paced taps and typing with a touch overlay, device-resolution screenshots and H.264 clips. |
45
- | [`@crvouga/atlas/bun`](packages/bun) | Bun WebView driver: Bun's built-in headless browser (the system WebKit on macOS, Chrome elsewhere), nothing to download. |
46
- | [`@crvouga/atlas/webdriver`](packages/webdriver) | W3C WebDriver driver with no dependencies: Safari, Chrome, Firefox and Edge, and native iOS and Android apps through Appium. |
47
- | [`@crvouga/atlas/detox`](packages/detox) | Detox driver for iOS and Android apps, inside a Detox test run. |
48
- | [`@crvouga/atlas/vitest`](packages/vitest) | Run a config as a test suite in Vitest, `bun test` or any Jest-style runner, one test per planned path. |
49
- | [`@crvouga/atlas/schema`](packages/schema) | The contract: Zod schemas and JSON Schemas for specs, journeys, manifests, timelines and the runs index. |
50
- | [`@crvouga/atlas/reports/<module>`](packages/reports) | Publish, store, retain and serve test evidence, and combine it across backends, branches and commits. |
51
- | [`atlas-visualizer`](packages/visualizer) (command) | Browse charts and runs: every state with its screenshots, every transition with its clip. |
52
+ The server starts independently with data in `./atlas-data`; it never loads example specs or reports. `bun example:run` publishes the Todo example under `todo-app`. Select a project using the top-right picker, then use the spec dropdown breadcrumbs to navigate. Other projects set `ATLAS_SERVER_URL`, `ATLAS_PROJECT` (for example `checkout-service`) and their publish token. Every uploader talks to the node; storage credentials stay on the server.
52
53
 
53
- ## Open standards
54
+ Every Gherkin scenario runs, including sharing and renaming. Test reports show running spinners,
55
+ live step logs and a Running status filter. Producers send heartbeats every
56
+ 5 seconds. A run becomes interrupted after 30 seconds without a heartbeat, or 15 minutes without progress;
57
+ configure `ATLAS_RUN_TIMEOUT_SECONDS` and `ATLAS_RUN_STALL_SECONDS` (0 disables the progress timeout),
58
+ or edit these settings in the client. An interruption never turns missing outcomes into passes.
54
59
 
55
- Atlas invents as little as it can. Everything it reads or writes is a format other tools already
56
- understand.
60
+ ## For AI agents
57
61
 
58
- | Standard | Used for |
59
- | --- | --- |
60
- | [W3C SCXML](https://www.w3.org/TR/scxml/) | Charts (`*.scxml`), with business metadata in an `atlas` XML namespace |
61
- | [XState v5](https://stately.ai/docs/machines) machine config | Charts (`*.machine.json`, `*.machine.yaml`): the JSON shape Stately Studio imports and exports |
62
- | [JSON Schema 2020-12](https://json-schema.org/draft/2020-12) | The manifest, journeys, state nodes, timelines and runs index (`packages/schema/schemas`) |
63
- | [JUnit XML](https://github.com/testmoapp/junitxml) | `junit.xml`: one test case per path, for any CI system |
64
- | [CTRF](https://ctrf.io) | `ctrf.json`: Common Test Report Format |
65
- | [WebVTT](https://www.w3.org/TR/webvtt1/) | Captions for every clip: each tap, keystroke, system call and screen change |
66
- | [CloudEvents 1.0](https://cloudevents.io) | Business events the product emits (HTTP structured, binary and batch modes) |
67
- | [W3C WebDriver](https://www.w3.org/TR/webdriver2/) | Driving browsers and, through Appium, native iOS and Android apps |
68
- | [WAI-ARIA](https://www.w3.org/TR/wai-aria/) roles and accessible names | Signals that recognise screens the same way on every driver |
69
- | MP4 / H.264 | Clips of each transition, encoded with FFmpeg |
70
- | PNG / WebP | Screenshots at device resolution, with WebP thumbnails |
71
- | [Mermaid](https://mermaid.js.org/syntax/stateDiagram.html) `stateDiagram-v2` | `chart.mmd`, and `atlas export --format mermaid` |
72
-
73
- ## Quick start: the todo example
74
-
75
- [`examples/todo`](examples/todo) is a dependency-free web app (static HTML and vanilla JavaScript
76
- served by a small Node server) specified as two charts:
62
+ Atlas is built to be integrated and operated by agents, with nothing to click and nothing to guess.
77
63
 
78
- - `specs/todo-app.scxml`, the root chart in SCXML: a welcome screen, a "Setting up" state that
79
- invokes the child chart, and a `<parallel>` "Working on the list" state whose "Sync" and "List"
80
- regions change independently.
81
- - `specs/getting-started.machine.yaml`, the child chart in XState YAML. Its two final states hand
82
- back to the parent through `meta.doneEvent`.
83
- - `specs/journeys.yaml`, four curated journeys.
84
- - `specs/getting-started.feature` and `specs/working-the-list.feature`, the same stories in Gherkin.
85
- - `specs/todo.qnt`, the list, its sync, and its actions as a Quint model.
64
+ - **`atlas init`** detects a project's test runners, specs and CI and prints a plan (`--format json`) of the exact commands to
65
+ run each suite and send its results; `--write` creates the CI workflow and an `AGENTS.md` section. Running it twice
66
+ changes nothing.
67
+ - **Every command prints JSON on request** (`--format json`), every document has a published JSON Schema, exit codes mean the
68
+ same everywhere (`0` worked, `1` the answer is no, `2` the command was wrong), and every operation is safe to repeat.
69
+ - **The server describes itself:** `GET /api/openapi.json` (OpenAPI 3.1) and `GET /llms.txt` (a guide for an agent given only
70
+ the address) need no token; errors are RFC 9457 problem documents that say what to do.
71
+ - **Documentation is generated from the code beside it:** `llms.txt` / `llms-full.txt` (also in the package), the TypeScript
72
+ reference in [`docs/reference/`](docs/reference/server.md), the CLI and HTTP references, and the settings tables; tests fail when
73
+ any of it drifts.
86
74
 
87
- The visualizer lists the features under Gherkin and the model under Quint.
75
+ Start with **[Atlas for AI agents](docs/agents.md)**.
88
76
 
89
- It has every kind of event: user events (taps and typing), a **system** event ("Sync fails", which
90
- the test triggers through a real HTTP endpoint on the example server), a **time** event ("Retry
91
- timer elapses", which jumps Playwright's clock 30 seconds) and **hand-off** events from the child
92
- chart. The server reports business events as CloudEvents to an Atlas `cloudEventsHttpSource`, so
93
- the states' `meta.events` are checked on every run.
94
-
95
- This repository runs on [Bun](https://bun.sh). Video clips and WebP thumbnails need FFmpeg on the
96
- `PATH`. From the repository root:
77
+ ## Integrate in five minutes
97
78
 
98
79
  ```sh
99
- bun install
100
- bunx playwright install chromium
101
-
102
- bun run example:lint # pure, reachable, no undocumented dead ends, journeys replay, everything implemented
103
- bun run example:plan # 4 journeys + 1 generated path cover all 14 transitions
104
- bun run example:fast # run every path quickly
105
- bun run example:run # statechart showcase, then the Gherkin features and the Quint model
106
- bun test examples # the same spec against an in-memory model, as a test suite
80
+ bun add -d @crvouga/atlas # or npm install -D / pnpm add -D; runs on Bun and Node 22.18+
107
81
 
108
- bun run example:clients # clients/: one chart across a phone, a desktop and the sync server at once
109
- bun run example:clients:bun # the same, with the desktop in Bun's WebKit and the phone in Playwright's Chromium
110
- ```
82
+ # 1. Each suite publishes a layer of what it ran: a JUnit or CTRF file, an Atlas run, or a checks file.
83
+ bunx atlas report publish --store atlas-reports --producer web-e2e --junit out.xml --specs ./specs --environment desktop-web
111
84
 
112
- To run every chart of the example and browse the results, run these in separate terminals; the
113
- visualizer updates when a run finishes.
85
+ # 2. Any number of nodes, branches and machines do the same into their own stores. Copying stores
86
+ # together is the aggregate: layers are immutable and named by their content.
87
+ bunx atlas report merge --store node-1 --store node-2 --into all
114
88
 
115
- ```sh
116
- bun run atlas:run # example:clients, then example:run: every chart of the example, in showcase mode
117
- bun run atlas:viz # the example's specs, chart runs, and layered reports
118
- ```
119
-
120
- Each config writes its own run and the visualizer shows one run at a time: the latest is the
121
- single-browser run, and the run across clients is the one before it in the run picker.
122
-
123
- `bun run viz:dev` opens the full coffee example with a layered report, without waiting
124
- for a run. Gherkin, Quint, DMN, Alloy and OpenSLO documents sit beside the charts. The same scenarios
125
- are filled by separate layers across desktop web, mobile web, iOS and Android, and across versions,
126
- branches and backends (this machine, shared reports, and a device lab). A layer that repeated one
127
- scenario leaves the others as the last layer that ran them. One feature is left with no results.
128
- **Sources** in the header switches any of those off. The chart runs stay on the statechart map.
129
-
130
- `bun run atlas:viz` opens the todo example the same way. The Gherkin, Quint, DMN, Alloy and OpenSLO
131
- tabs already show five layers, so each environment is visible before a run. `example:run` adds one
132
- desktop web layer for the scenarios and traces it actually ran. That layer replaces only those
133
- desktop web results. The other environments stay. `ATLAS_REPORTS_MODULE` replaces this example API
134
- with a host's reports.
135
-
136
- A showcase run ends with:
137
-
138
- ```
139
- States 14/14 passed, 0 failed, 0 not reached
140
- Transitions 14/14 passed, 0 failed, 0 not reached
141
- Manifest: examples/todo/atlas-runs/<run-id>/manifest.json
89
+ # 3. The gate: exit 1 on a failed check, a check still running, an unreadable layer, a backend that
90
+ # is down, or an environment with no results.
91
+ bunx atlas report status --store all --specs ./specs --require-environments desktop-web,ios
142
92
  ```
143
93
 
144
- `example:run` then runs the Gherkin features in a browser and the Quint model, and publishes that desktop web layer beside the ones already in the report.
145
-
146
- `bun test examples` runs [`model.test.ts`](examples/todo/model.test.ts): the same charts and journeys
147
- against `TodoModel`, a plain class, through `functionDriver` and `describeAtlas`. Only the driver
148
- and the implementation differ, which is the point: the spec belongs to the product, not to one
149
- test tool.
150
-
151
- ## Writing specs
152
-
153
- ### Files
154
-
155
- Atlas loads every chart and journeys file directly inside the specs directory:
156
-
157
- - `*.scxml`, `*.machine.json`, `*.machine.yaml` (or `.yml`): one chart each;
158
- - `journeys.yaml` (or `.yml`, `.json`): the curated journeys.
159
-
160
- The **root** chart is the one no other chart invokes. A chart's id is the SCXML `name` attribute or
161
- the XState `id`.
162
-
163
- ### The pure subset
164
-
165
- Atlas walks charts without running any code, so it executes only the parts of a statechart that
166
- are pure structure:
167
-
168
- - states, nesting (`initial`), `parallel` regions and `final` states;
169
- - event transitions, written as a target (`Opens: Open` or `{ target: '#Open' }`);
170
- - `invoke` that names another chart (`src`, `id`, `onDone`), composed statically;
171
- - `meta`.
172
-
173
- Guards, actions, `entry`/`exit`, `context`, `after` (delays), `always`, `output` and `onError` are
174
- lint errors. A condition becomes a state or an event instead: "Payment declined" is an event the
175
- system sends, not a guard on "Pays"; "30 seconds pass" is a time event, not an `after`.
176
-
177
- State names are global across the composed product (transitions target `#<name>`), so they must be
178
- unique across charts, and they cannot contain dots. Names are business language and may contain
179
- spaces.
180
-
181
- ### `meta`
182
-
183
- | Field | Meaning |
94
+ | Read | When |
184
95
  | --- | --- |
185
- | `description` | What is true in this state. Required on every state by default (`requiredMeta` changes that). |
186
- | `snapshot` | What a person sees, in words. |
187
- | `events` | Business events that happen on entering the state, checked against what event sources observed. |
188
- | `checks` | Things to verify on screen, quoted from the spec; the implementation's `checks()` returns their results. |
189
- | `confidence` | `confirmed` or `assumed`. |
190
- | `source` | Where the behaviour is documented. |
191
- | `deadEnd` | Why a state with no way out is meant to be one. Without it, a dead end is a lint error. |
192
- | `doneEvent` | On a child chart's final state: the event its parent receives from that final. |
193
- | `childMachine`, `childFinalEvents` | Legacy composition on the parent state. Prefer `invoke`. |
194
-
195
- ### SCXML conventions
196
-
197
- SCXML ids are XML IDs and event attributes are token lists, so business names travel in an
198
- `atlas:name` attribute next to a token id. Metadata lives in the `atlas` namespace, as SCXML allows:
199
-
200
- ```xml
201
- <scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:atlas="https://github.com/crvouga/atlas/ns/1"
202
- version="1.0" datamodel="null" name="Todo app" initial="welcome">
203
- <state id="welcome" atlas:name="Welcome">
204
- <atlas:meta>
205
- <atlas:description>The first screen a person sees.</atlas:description>
206
- <atlas:event>App opened</atlas:event>
207
- </atlas:meta>
208
- <transition event="starts-setup" atlas:name="Starts setup" target="setting-up"/>
209
- </state>
210
- <state id="setting-up" atlas:name="Setting up">
211
- <atlas:meta><atlas:description>The child chart runs here.</atlas:description></atlas:meta>
212
- <invoke id="getting-started" src="getting-started.machine.yaml" atlas:name="Getting started"/>
213
- <transition event="done.invoke.getting-started" target="working"/>
214
- </state>
215
- ...
216
- </scxml>
217
- ```
96
+ | **[Integrating Atlas](docs/integrating.md)** | Start here. Step by step, with the command and expected output for each step, a CI workflow for sharded nodes, and troubleshooting. |
97
+ | **[The Atlas server](docs/server.md)** | The living application: configuration, tokens, the upload and streaming protocol, the full API, what it refuses, performance. |
98
+ | **[Running Atlas for a project](docs/deploying.md)** | Production: the server (Docker, Kubernetes, auth), sending results from CI and laptops, an S3 bucket and its policies, filters, operating it. |
99
+ | [The report contract](docs/report-contract.md) | The exact rules: the layer document, how layers compose, guarantees, backends, versioning, failure behaviour. |
100
+ | **[Evidence: attachments, timelines and everything else](docs/extending.md)** | What a result can carry, the rules that keep the format compatible forever, and how to attach anything from any framework. |
101
+ | [Report backends and live snapshots](docs/report-backends.md) | Connecting directories, HTTP files and APIs, streaming, and writing another transport. |
102
+ | [`@crvouga/atlas/reports`](packages/reports/README.md) | The programmatic API: `publishChecks`, `combineBackends`, `reportStatus`, `directoryStore`, `reportsHost`. |
103
+ | [`@crvouga/atlas/schema`](packages/schema/README.md) | The JSON Schemas and Zod schemas of every document. |
218
104
 
219
- `<atlas:event>`, `<atlas:check>` and `<atlas:source>` repeat to form lists; `<atlas:dead-end>` is
220
- `meta.deadEnd`; a final state's `atlas:done-event` attribute is `meta.doneEvent`. `atlas export
221
- --format scxml` writes any chart (or the composed product) back out in this form, and reading it
222
- again gives the same chart.
223
-
224
- ### Composition
225
-
226
- A parent state runs a child chart with any of:
227
-
228
- 1. XState `invoke: { src: 'Child', id: 'child', onDone: '#Next' }`, or SCXML `<invoke id="child">`
229
- plus a `done.invoke.child` transition;
230
- 2. `meta.doneEvent` on the child's final states, each naming the event the parent receives, which
231
- the parent handles in its `on` (a final whose event the parent does not handle goes to
232
- `onDone`);
233
- 3. legacy `meta.childMachine: 'Child'` and `meta.childFinalEvents: { <final>: <event> }` on the
234
- parent state.
235
-
236
- Atlas inlines each child into the state that invokes it. The child's final states stay as states
237
- (so they keep their screenshots and checks) but take the parent's transition for their hand-off
238
- event. When a path reaches one, the hand-off happens by itself: journeys never list hand-off
239
- events, and the planner inserts them. Give each hand-off event an implementation of kind
240
- `hand-off` (usually a no-op); events without an implementation count as blocked.
241
-
242
- ### Journeys
243
-
244
- ```yaml
245
- journeys:
246
- Keeps working through a sync outage:
247
- description: Adds todos while the sync is down, and the retry catches up.
248
- events: [Starts setup, Skips naming the list, Adds a todo, Sync fails, Adds a todo, Retry timer elapses]
249
- endsIn: [Some todos open, Synced]
250
- ```
251
-
252
- The linter replays each journey through the composed chart and checks it ends in every `endsIn`
253
- state. Each journey runs as its own path; generated paths only cover what journeys leave out.
254
-
255
- ## Implementing a spec
105
+ ## One package
256
106
 
257
- An implementation tells a driver how to make each event happen and how to recognise each state.
258
- Events are keyed by their exact name in the spec.
107
+ Atlas is a single npm package. Each part is its own import path, so a bundler keeps only what you
108
+ import. It runs on Bun and on Node 22.18 or later, with any package manager:
259
109
 
260
- ```ts
261
- import { defineConfig } from '@crvouga/atlas';
262
- import { playwrightDriver, role, screen, text } from '@crvouga/atlas/playwright';
263
-
264
- export default defineConfig({
265
- specs: './specs',
266
- driver: () => playwrightDriver({ clock: true }),
267
- targets: ['http://127.0.0.1:4317'],
268
- implementation: {
269
- async setup({ page }) {
270
- await page.goto('http://127.0.0.1:4317');
271
- },
272
- events: {
273
- 'Adds a todo': {
274
- kind: 'user',
275
- how: 'Types a todo and taps "Add".',
276
- async run({ page, user }) {
277
- await user.type(page.getByLabel('New todo'), 'Water the plants', 'New todo');
278
- await user.tap(page.getByRole('button', { name: 'Add' }), 'Add');
279
- }
280
- },
281
- 'Retry timer elapses': {
282
- kind: 'time',
283
- how: 'Jumps the page clock 30 seconds.',
284
- run: ({ page }) => page.clock.fastForward(30_000)
285
- }
286
- },
287
- states: {
288
- 'No todos': screen({ all: [text('Nothing to do yet')] }),
289
- Offline: screen({ all: [text('Offline')], none: [text('All changes synced')] })
290
- }
291
- }
292
- });
110
+ ```sh
111
+ bun add -d @crvouga/atlas
293
112
  ```
294
113
 
295
- **Events** (`EventImplementation<C>`): `kind` is `user`, `system`, `time` or `hand-off`; `how` is a
296
- plain-language note shown in reports; `run(ctx, tools)` makes it happen; `prepare(ctx, tools)`
297
- creates test data before the path starts; `blocked: '<reason>'` marks an event that cannot run yet,
298
- so paths stop before it and report why.
299
-
300
- **States** (`StateImplementation<C>`): `recognize(ctx)` returns whether the state is showing and the
301
- signals it looked at. Optional: `checks(ctx)` (results for `meta.checks`; a failed check fails the
302
- state), `lookIn(ctx)` (where to look when the change happens off screen, such as reloading or
303
- opening another tab), `settle(ctx)` (within-state actions after the screenshot, such as
304
- dismissing a toast), `transient` (shown too briefly to wait for) and `sameAs` (a state the UI cannot
305
- tell apart from this one).
306
-
307
- **Setup**: `setup(ctx, { path, tools })` puts the product in the path's start configuration;
308
- `canStart(active)` returns `true` or the reason a start configuration cannot be set up yet. It is
309
- optional when seeds cover every start.
114
+ | Import | What it is |
115
+ | --- | --- |
116
+ | [`@crvouga/atlas/reports/<module>`](packages/reports) | Evidence for any spec: publish layers (`publish-checks`, `ingest`, `reporter` to stream them), store them (`s3-store`, `directory-store`, `http-store` for a server, any `object-store`), combine and gate them (`compose`, `report-status`), copy them (`copy-store`). |
117
+ | [`@crvouga/atlas/server`](packages/server) | The Atlas server as a `fetch` handler (`createAtlasServer`), served over HTTP on Bun and Node (`listen`). |
118
+ | [`@crvouga/atlas/schema`](packages/schema) | The contract: Zod schemas and JSON Schemas for layers, check files, report status, specs, journeys, manifests, timelines and the runs index. |
119
+ | [`@crvouga/atlas`](packages/core) | Spec loading (SCXML and XState), composition, lint, planning, the runner, multi-client runs (`combineDrivers`), `httpDriver` and `functionDriver`, CloudEvents, privacy, config and the `atlas` CLI. `@crvouga/atlas/spec` is a browser-safe subset; `@crvouga/atlas/signals` holds the driver-neutral signals. |
120
+ | [`@crvouga/atlas/playwright`](packages/playwright) | Playwright driver: signal-based screen recognisers, paced taps and typing with a touch overlay, device-resolution screenshots and H.264 clips. |
121
+ | [`@crvouga/atlas/bun`](packages/bun) | Bun WebView driver: Bun's built-in headless browser (the system WebKit on macOS, Chrome elsewhere), nothing to download. |
122
+ | [`@crvouga/atlas/webdriver`](packages/webdriver) | W3C WebDriver driver with no dependencies: Safari, Chrome, Firefox and Edge, and native iOS and Android apps through Appium. |
123
+ | [`@crvouga/atlas/detox`](packages/detox) | Detox driver for iOS and Android apps, inside a Detox test run. |
124
+ | [`@crvouga/atlas/vitest`](packages/vitest) | Run a config as a test suite in Vitest, `bun test` or any Jest-style runner, one test per planned path. |
125
+ | [`atlas client`](packages/visualizer) (command) | Browse specs, charts and layered reports: every spec with its result per environment, every state with its screenshots, every transition with its clip. |
310
126
 
311
- **Seeds** (`seeds: Record<string, Seed<C>>`): see [Seeds and parallel runs](#seeds-and-parallel-runs).
127
+ Two commands install with it: `atlas` (`report`, `lint`, `plan`, `run`, `merge`, `export`) and
128
+ `atlas client`.
312
129
 
313
- **Correlation**: `correlate(ctx)` returns ids (a user id, a trace id) that tell this attempt's
314
- business events from those of attempts running beside it.
130
+ ## Reports for any spec
315
131
 
316
- Only leaf states need recognisers. `atlas lint --require-implementations` lists every event and
317
- leaf state in scope that has no implementation.
132
+ Atlas separates *what the product should do* (the specs) from *evidence of what it did* (layers).
133
+ Evidence is published by whatever checks the spec, and read back as one report.
318
134
 
319
- ## Seeds and parallel runs
135
+ **A layer** is one focused recording: the checks one producer ran, on one environment, from one
136
+ commit and branch, at one time. It is immutable and addressed by its content. Publish one from:
320
137
 
321
- A chart of a whole product is deep: a member reaches a results screen after signing up,
322
- onboarding, paying and booking. Walking every path from the initial state repeats that prefix
323
- in every path, so a run gets slower the more of the product it covers. Seeds remove the prefix.
138
+ | You have | Publish with |
139
+ | --- | --- |
140
+ | JUnit XML from Cucumber, Jest, Vitest, Bun, pytest, `go test`, Playwright, … | `atlas report publish --junit out.xml` |
141
+ | [CTRF](https://ctrf.io) JSON | `atlas report publish --ctrf ctrf.json` |
142
+ | An Atlas statechart run | `atlas report publish --manifest atlas-runs/<run>/manifest.json` |
143
+ | A script, a model checker, an SLO evaluation, a linter | `atlas report publish --checks checks.json`, or `publishChecks(store, …)` |
144
+
145
+ **Layers compose by one rule.** A *slot* is `(producer, kind, spec, check id, environment,
146
+ parameters)`. Each slot shows the newest completed result of any layer that filled it. Branch, commit,
147
+ backend and run are provenance and never split a slot. So desktop web, mobile web, iOS and Android
148
+ results of one check sit side by side; a layer that re-ran one scenario leaves every other scenario as
149
+ the last layer that ran it; and a fix on any branch replaces the failure it fixes.
150
+
151
+ **The report does not depend on how layers arrived.** Order of reading, number of backends, how
152
+ the layers were split across nodes, and duplicates are all invisible. This is tested over random
153
+ partial runs, and it is why you can shard a suite across ten machines, re-run one failing check
154
+ locally, and publish a device lab's layers from elsewhere, with nothing to coordinate.
155
+
156
+ **Backends** hold layers. A backend is any implementation of the seven-method `ObjectStore`
157
+ interface. Atlas ships an S3 store (AWS S3, R2, MinIO and anything that speaks its protocol, with no SDK)
158
+ and a directory store with atomic writes, and `verifyObjectStore` proves an adapter before you trust it. Several backends are one report, and one
159
+ that is down is named and skipped.
160
+
161
+ **The gate** is `atlas report status`. It exits 0 only if some check completed, none failed, none is
162
+ still running, every layer and backend could be read, and every `--require-environments` environment
163
+ has results. `--format json` is a [stable schema](packages/schema/schemas/report-status.schema.json). Exit code 1
164
+ means the report does not pass; 2 means the command itself was wrong (a missing store directory, a bad
165
+ flag).
166
+
167
+ **The server** is `atlas serve`: one process that serves the client, takes in results and streams the report to
168
+ every client. Point `ATLAS_STORE` at it and every developer's laptop and every CI job sends results with the same
169
+ commands that write to a folder; everyone then looks at one report, live. Results are kept in its data folder
170
+ unless you choose a bucket. `atlas dev` runs the same server with the client's dev server in front, so
171
+ development is one host too. See [the server](docs/server.md) and
172
+ [running Atlas for a project](docs/deploying.md).
324
173
 
325
- A seed puts the system directly in one configuration of the chart, usually through an API or the
326
- database: create a member who has paid, sign them in, open the screen.
174
+ ```sh
175
+ atlas serve # the project's server, at :8080 (ATLAS_TOKEN says who may upload)
327
176
 
328
- ```ts
329
- implementation: {
330
- seeds: {
331
- 'Paid member': {
332
- at: 'Paid', // a state name, or a full state value
333
- how: 'Creates a paid member through the admin API and signs in.',
334
- async run({ page, api }) {
335
- const member = await api.createMember({ plan: 'paid' });
336
- await page.goto(`/sign-in?token=${member.token}`);
337
- }
338
- }
339
- },
340
- events: { /* … */ },
341
- states: { /* … */ }
342
- }
177
+ export ATLAS_STORE=https://atlas.example.com ATLAS_TOKEN=… # on every laptop and CI job
178
+ atlas report publish --producer unit --junit out.xml --specs ./specs # when a suite is done
179
+ my-suite --json | atlas report stream --producer e2e --environment ios # or as its checks finish
180
+ atlas report status --branch main --ignore-modified # the gate, answered by the server
343
181
  ```
344
182
 
345
- With seeds, the plan changes in three ways:
346
-
347
- - **Journeys are cut at seeded configurations.** A journey is replayed from the initial state, and
348
- wherever it passes through a configuration a seed produces, it is cut. Each stretch becomes a path
349
- that starts from that seed. A stretch that several journeys share becomes one path. The manifest's
350
- `journeys` lists the paths each journey is made of. A journey passes when all of them pass, fails
351
- when one fails, and is `not-reached` while any is blocked.
352
- - **Generated paths start from the nearest seed.** A breadth-first search from every start point at
353
- once finds, for each uncovered transition, the shortest way to take it from any seed (or from
354
- `setup`'s start). Ties go to the seed declared first.
355
- - **Redundant paths are dropped.** A generated path that is a prefix of another path from the same
356
- start is not planned.
357
-
358
- The plan is deterministic. The same chart, journeys and seeds give the same paths, ids and keys
359
- (`key` hashes the start and the events) on every machine, so results can be composed:
360
-
361
- - **Workers.** `--workers n` (or `workers` in the config) runs n path attempts at once. Each attempt
362
- gets its own driver context. The longest paths go first, timed by earlier runs.
363
- - The driver's `concurrency` caps the worker count. Playwright and Bun contexts and HTTP clients
364
- run side by side. A WebDriver session or a Detox device runs one at a time unless you raise it.
365
- - The manifest is a pure fold of the path outcomes in plan order, so the same outcomes give the
366
- same report whatever order they finished in.
367
- - **Shards.** `--shard i/n` runs one part of the plan, split by the plan alone, so every machine
368
- agrees on the split. `atlas merge <run-dir>...` composes the shards into one run, with their media
369
- copied in.
370
- - **Reruns.** `--rerun-failed` keeps the passed paths of the newest run, matched by key, and runs
371
- the rest. The result is still one complete run.
372
- - **Areas.** `--seed <name>` (repeatable) runs only the paths that start from that seed (`start`
373
- for paths `setup` starts). `--state <name>` scopes the run to one state of the chart. With these you can
374
- run one area of the product on its own, then merge it into a full run.
375
-
376
- Seeds are what make the composition sound: a seed must leave the system exactly as the steps that
377
- lead there would. Atlas checks this both ways and reports it:
378
- - A seeded path must first recognise its start state.
379
- - The manifest's `seeds` lists, for each seed, the passed paths that reached the same states through
380
- real steps (`verifiedBy`).
381
-
382
- A seed nobody reaches through the steps is a claim that has not been checked yet. In the
383
- visualizer, seeded states carry a "Seeded" tag.
384
-
385
- Business events and parallel runs: a shared source, such as a log file, sees every attempt's events.
386
- `EventSource.mark()` returns a position that `collect(mark)` reads from, so attempts don't consume
387
- each other's marks.
388
- - With `correlate(ctx)`, only events and log lines that mention one of the attempt's ids count.
389
- - Without it, a run on several workers reports business events as "no signal" rather than guessing.
390
-
391
- ## Drivers
392
-
393
- | Driver | Package | Plays | Speed | Clips |
394
- | --- | --- | --- | --- | --- |
395
- | `functionDriver(create)` | `@crvouga/atlas` | A domain model, a CLI, anything reachable from code | Microseconds | No |
396
- | `httpDriver(baseUrl)` | `@crvouga/atlas` | An API client with a cookie jar: a partner system, an operator API, a back office job | Milliseconds | No |
397
- | `bunWebViewDriver()` | `@crvouga/atlas/bun` | A web app in Bun's built-in browser (WebKit on macOS, Chrome elsewhere) | A view in milliseconds, screenshots in about 10 ms | From screenshots |
398
- | `playwrightDriver()` | `@crvouga/atlas/playwright` | A web app (or React Native on the web) in Chromium, with a fake clock | About a second per context | Screencast with a touch overlay |
399
- | `webdriverDriver()` | `@crvouga/atlas/webdriver` | Safari, Chrome, Firefox, Edge; native iOS and Android apps through Appium | Depends on the server | From screenshots, or Appium's recorder |
400
- | `detoxDriver()` | `@crvouga/atlas/detox` | A React Native app, inside a Detox test run | Depends on the device | Detox artifacts |
401
-
402
- The Bun, Playwright, WebDriver and Detox contexts all provide a `SignalContext` (`goto`,
403
- `isVisible`, `user.tap`, `user.type`), and they resolve the same signals (`testId`, `role`, `label`,
404
- `text`, `css` from `@crvouga/atlas/signals`), each against its own UI tree: the DOM, or the
405
- accessibility tree of a native app, where a test ID is the accessibility identifier (React
406
- Native's `testID`). An implementation written
407
- against `SignalContext` with `screen` from `@crvouga/atlas/signals` runs on any of them unchanged.
408
-
409
- `bunWebViewDriver` needs the Bun runtime: run `bun --bun atlas run`. The `atlas` binary runs on
410
- Node (through tsx) or Bun, and Playwright works under Bun too, so one run can mix Bun's WebKit and
411
- Playwright's Chromium.
412
-
413
- ## Several clients in one run
414
-
415
- Product flows cross devices: a member books on an iOS app, an operator approves in a web
416
- dashboard, a partner confirms over an API. `combineDrivers` runs several drivers as the named
417
- clients of one run, and `combineImplementations` merges what each client does and shows:
183
+ **The client** shows each spec (Gherkin, Quint, DMN, Alloy, OpenSLO, and the rest by file type) with
184
+ its combined result per environment and the layer behind it. See
185
+ [integrating Atlas](docs/integrating.md#6-browse-it).
418
186
 
419
187
  ```ts
420
- import { combineDrivers, combineImplementations, defineConfig, httpDriver, type HttpClient } from '@crvouga/atlas';
421
- import { role, screen, text, type SignalContext } from '@crvouga/atlas/signals';
422
- import { playwrightDriver } from '@crvouga/atlas/playwright';
423
- import { accessibilityId, webdriverDriver } from '@crvouga/atlas/webdriver';
424
-
425
- type Clients = { member: SignalContext; operator: SignalContext; partner: HttpClient };
426
-
427
- export default defineConfig<Clients>({
428
- specs: './specs',
429
- driver: combineDrivers<Clients>(
430
- {
431
- member: webdriverDriver({
432
- url: 'http://127.0.0.1:4723', // Appium
433
- capabilities: { platformName: 'iOS', 'appium:automationName': 'XCUITest', 'appium:app': './build/App.app' }
434
- }),
435
- operator: playwrightDriver({ baseUrl: 'http://127.0.0.1:3000', device: { viewport: { width: 1280, height: 800 } } }),
436
- partner: httpDriver('http://127.0.0.1:4000')
437
- },
438
- { screens: 'all' }
439
- ),
440
- implementation: combineImplementations<Clients>(
441
- {
442
- member: {
443
- events: { 'Requests a visit': { kind: 'user', how: 'Taps "Request".', run: (m) => m.user.tap(role('button', 'Request'), 'Request') } },
444
- states: { 'Visit confirmed': screen({ all: [text('Confirmed')] }) }
445
- },
446
- operator: {
447
- setup: (o) => o.goto('/queue'),
448
- events: { 'Operator approves': { kind: 'user', how: 'Approves it in the queue.', run: (o) => o.user.tap(role('button', 'Approve'), 'Approve') } },
449
- states: { 'Waiting for approval': screen({ all: [role('row', 'New request')] }) }
450
- },
451
- partner: {
452
- events: { 'Partner confirms': { kind: 'system', how: 'POSTs the confirmation webhook.', run: (p) => p.post('/webhooks/confirm', { ok: true }).then(() => undefined) } }
453
- }
454
- },
455
- { setup: async ({ partner }) => void (await partner.post('/test/reset')) }
456
- )
457
- });
458
- ```
459
-
460
- - Each client's part is written against that client's own context, so every driver's helpers
461
- work unchanged; `shared` (the second argument) holds setup and events that need several clients
462
- at once. `shared.setup` runs first, then each client's setup in order.
463
- - `onClient(name, impl)` lifts a single event or state implementation to a client.
464
- - An event's client is recorded for its clip; a state's client is the screen it is recognised and
465
- photographed on. With `screens: 'all'`, every other client's screen is captured at the same
466
- moment (`screenshot.also`).
467
- - Timeline entries, clips, states and transitions carry `client` in the manifest;
468
- `run.environment.clients` names the driver each client ran on; a failed attempt keeps one trace
469
- per client.
470
- - If one client cannot open (no simulator booted), the others are closed and the attempt fails
471
- naming that client.
472
-
473
- [`examples/todo/clients`](examples/todo/clients) runs a chart (`specs/clients/shared-list.scxml`)
474
- across a phone, a desktop and the sync server; pick each device's driver with `ATLAS_PHONE` and
475
- `ATLAS_DESKTOP` (`playwright`, `bun` or `webdriver`).
188
+ import { combineBackends } from '@crvouga/atlas/reports/compose';
189
+ import { directoryStore } from '@crvouga/atlas/reports/directory-store';
190
+ import { reportStatus } from '@crvouga/atlas/reports/report-status';
476
191
 
477
- ## Writing a driver
478
-
479
- A driver owns the thing under test for one path attempt: a browser context, a device, a model or
480
- an API client. Only `open` and `close` are required.
481
-
482
- ```ts
483
- type Focus = { client?: string };
484
-
485
- type Driver<C> = {
486
- name: string;
487
- open(input: { path: PlannedPath; attempt: number; mode: RunMode; directory: string; timeline: Timeline }): Promise<C>;
488
- close(ctx: C, input: { failed: boolean; traceFile: string }): Promise<{ trace?: string; traces?: Record<string, string> } | void>;
489
- screenshot?(ctx: C, file: string, focus?: Focus): Promise<Image | null>;
490
- record?(ctx: C, workDirectory: string, focus?: Focus): Promise<{ stop(output: string): Promise<Clip | null> }>;
491
- text?(ctx: C, focus?: Focus): Promise<string>;
492
- hold?(ctx: C, ms: number, focus?: Focus): Promise<void>;
493
- pacing?: { before: number; after: number };
494
- clients?: Record<string, string>;
495
- concurrency?: number;
496
- dispose?(): Promise<void>;
497
- };
192
+ const report = await combineBackends([
193
+ { id: 'ci', store: directoryStore('all') },
194
+ { id: 'lab', label: 'Device lab', store: deviceLabStore() }
195
+ ]);
196
+ const status = reportStatus(report, { requireEnvironments: ['ios'] });
197
+ if (!status.ok) throw new Error(status.reasons.join('\n'));
498
198
  ```
499
199
 
500
- `focus` says which client a multi-client run is looking at; single-client drivers ignore it.
501
- A driver without a native screen recorder can encode clips from screenshots with
502
- `recordFrames(capture, workDirectory)`.
503
-
504
- - `open` returns a fresh context for each attempt; `close` may return the path of a trace file
505
- (Playwright writes one for failed attempts).
506
- - `screenshot` and `record` produce media; `record` is used only in showcase mode, one clip per
507
- transition.
508
- - `text` returns the visible text, for the privacy scan.
509
- - `concurrency` is how many contexts can be open at once (1 when omitted). Workers never exceed
510
- it, so a driver of one device stays sequential while browser contexts run side by side.
511
- - `timeline.add({ kind, label, ... })` logs taps, typing, system calls and time jumps; they become
512
- each clip's captions.
200
+ ## Open standards
513
201
 
514
- For anything you can reach from Node (a domain model, an API client, a CLI), `functionDriver(create)`
515
- is a complete driver:
202
+ Atlas invents as little as it can. Everything it reads or writes is a format other tools already
203
+ understand, or a JSON Schema it publishes.
516
204
 
517
- ```ts
518
- import { functionDriver } from '@crvouga/atlas';
205
+ | Standard | Used for |
206
+ | --- | --- |
207
+ | [JUnit XML](https://github.com/testmoapp/junitxml) | Read: any test runner's results become a layer. Written: `junit.xml`, one test case per statechart path. |
208
+ | [CTRF](https://ctrf.io) | Read: any CTRF report becomes a layer. Written: `ctrf.json` for each statechart run. |
209
+ | [JSON Schema 2020-12](https://json-schema.org/draft/2020-12) | The contract: layers, check files, report status, run manifests, journeys, state nodes, timelines and the runs index (`@crvouga/atlas/schemas/*.schema.json`) |
210
+ | [Gherkin](https://cucumber.io/docs/gherkin/), [Quint](https://quint-lang.org), [DMN](https://www.omg.org/spec/DMN), [Alloy](https://alloytools.org), [OpenSLO](https://openslo.com) | Spec kinds the client lays results over, each in its own tab. Any other file is a spec of its own type. |
211
+ | [W3C SCXML](https://www.w3.org/TR/scxml/) | Statecharts (`*.scxml`), with business metadata in an `atlas` XML namespace |
212
+ | [XState v5](https://stately.ai/docs/machines) machine config | Statecharts (`*.machine.json`, `*.machine.yaml`): the JSON shape Stately Studio imports and exports |
213
+ | [WebVTT](https://www.w3.org/TR/webvtt1/) | Captions for every clip: each tap, keystroke, system call and screen change |
214
+ | [CloudEvents 1.0](https://cloudevents.io) | Business events the product emits (HTTP structured, binary and batch modes) |
215
+ | [W3C WebDriver](https://www.w3.org/TR/webdriver2/) | Driving browsers and, through Appium, native iOS and Android apps |
216
+ | [WAI-ARIA](https://www.w3.org/TR/wai-aria/) roles and accessible names | Signals that recognise screens the same way on every driver |
217
+ | MP4 / H.264 | Clips of each transition, encoded with FFmpeg |
218
+ | PNG / WebP | Screenshots at device resolution, with WebP thumbnails |
219
+ | [Mermaid](https://mermaid.js.org/syntax/stateDiagram.html) `stateDiagram-v2` | `chart.mmd`, and `atlas export --format mermaid` |
519
220
 
520
- const driver = functionDriver(() => new TodoModel());
521
- ```
221
+ ## Executable statecharts
522
222
 
523
- ## CLI
223
+ Atlas can also run a product's flows as statecharts against the real app. Write down how the product
224
+ behaves as statecharts in open formats (W3C SCXML, XState v5 machine config), then let Atlas lint
225
+ them, plan paths that cover every transition, run those paths through any driver (a browser, a
226
+ phone, a plain function), and write a manifest of what happened, with screenshots, video clips,
227
+ captions, business events and standard test reports.
524
228
 
525
229
  ```
526
- atlas lint [--config atlas.config.ts | --specs <dir>] [--require-implementations]
527
- atlas plan [--config atlas.config.ts] [--state <name>]
528
- atlas run [--config atlas.config.ts] [--mode fast|showcase] [--workers n] [--state <name>]
529
- [--seed <name>]... [--paths id,id] [--shard i/n] [--rerun-failed | --reuse <run-dir>]
530
- [--no-retry] [--output <dir>]
531
- atlas merge [--config atlas.config.ts] [--output <dir>] <run-dir> <run-dir>...
532
- atlas export --specs <dir> --format scxml|mermaid|markdown|json [--out <file>]
230
+ specs/ atlas lint the charts are pure, reachable, free of silent dead ends,
231
+ app.scxml ──▶ and every journey replays
232
+ child.machine.yaml atlas plan curated journeys + shortest paths covering every transition
233
+ journeys.yaml atlas run each path against the product, through a driver
234
+ │
235
+ ▼
236
+ atlas-runs/<run>/manifest.json, junit.xml, ctrf.json, chart.mmd, media/
533
237
  ```
534
238
 
535
- - `lint` with `--specs` checks charts and journeys alone; with a config it also lists missing
536
- implementations, and `--require-implementations` makes them errors.
537
- - `plan` prints the seeds and each path with:
538
- - its seed and step count;
539
- - what blocks it;
540
- - the paths each journey is made of;
541
- - the total and longest path length, and how many transitions stay uncovered.
542
- - `run` exits non-zero when a path fails or the privacy scan finds something. `--paths` runs only
543
- the given path ids; `--no-retry` skips the retry of failed paths.
544
- - `--workers`, `--shard`, `--seed`, `--state`, `--rerun-failed` and `--reuse` are described in
545
- [Seeds and parallel runs](#seeds-and-parallel-runs).
546
- - `merge` composes runs of the same plan (shards, or a rerun and its earlier run) into one run.
547
- - `export` writes the composed product (every child inlined) as SCXML, Mermaid, Markdown or
548
- XState JSON. The Markdown is a readable map for the people who own the product: one section per
549
- area (each parallel region apart), every state with its description and what the user sees (a
550
- `snapshot` written as an identifier is left out), a table of every event that can happen there
551
- and where it leads, then the named journeys.
552
-
553
- The config file is TypeScript (loaded with `tsx`) and defaults to `atlas.config.ts` in the current
554
- directory. Relative paths in it resolve against the config file's directory.
555
-
556
- ## Config reference
557
-
558
- `defineConfig<C>(config)` returns the config unchanged, typed for the driver's context `C`.
559
-
560
- | Field | Meaning |
561
- | --- | --- |
562
- | `specs` | The specs directory. |
563
- | `driver` | A `Driver<C>`, or a function returning one (called once per run). |
564
- | `implementation` | `{ events, states, seeds?, setup?, canStart?, correlate? }`. |
565
- | `chart` | Run one chart of the product; the root chart when omitted. |
566
- | `start`, `startLabel` | Where generated paths start (an XState state value) and how to describe it; the initial state when omitted. |
567
- | `entryEvents` | When running one chart or one state: the only events that enter it from outside. |
568
- | `state` | Run one state of a chart and what is inside it, with the transitions into and out of it: one area of a chart that models the whole product. |
569
- | `workers` | Path attempts that run at once, capped by the driver's `concurrency`; one per CPU when omitted. |
570
- | `beforeRun` | Runs once before any path: prepare what every seed relies on (reference data, configuration). |
571
- | `output` | Where runs are written; `atlas-runs` beside the config. |
572
- | `eventSources` | `() => EventSource[]`: where business events come from. |
573
- | `eventMatchers` | How each business event name is recognised: `{ type }`, `{ pattern }` or a function. |
574
- | `privacy` | Extra `deny` patterns, `allowEmails` and `allowHosts`. |
575
- | `targets` | URLs the run reaches, checked against `privacy.allowHosts` before anything runs. |
576
- | `environment` | Recorded in the manifest. |
577
- | `stepTimeoutMs` | How long to wait for a state to show up (default 45 000). |
578
- | `requiredMeta` | `meta` fields every state needs (default `['description']`). |
579
-
580
- The programmatic API mirrors the CLI: `prepare(config)` loads, lints and plans; `runConfig(config,
581
- options)` runs; `loadSpecDirectory`, `lintBundle`, `chartScope`, `planChart` and `runPaths` are the
582
- steps underneath.
583
-
584
- ## How a run works
585
-
586
- 1. **Plan.** Curated journeys come first.
587
- - When running one chart of a larger product, each journey is cut to its stretch inside the
588
- chart, starting at an entry transition.
589
- - With seeds, journeys are also cut wherever they pass through a seeded configuration.
590
- - Then, for each transition still uncovered, the plan adds the shortest path that takes it from
591
- the nearest seed or start. The search is breadth-first, so loops stay bounded.
592
- - Paths stop before blocked events. A blocked path whose runnable part other paths already cover
593
- is reported but not run.
594
- 2. **Run each path.** Paths run on a pool of workers, longest first. Each gets a fresh driver
595
- context, then every event's `prepare`, then its seed's `run` (or `setup`). The start state must
596
- be recognised. Then for each step: run the event, wait for the target state, run its checks,
597
- collect business events, screenshot, `settle`.
598
- 3. **Retry.** A failed path runs once more. Passing the second time makes it `flaky`.
599
- 4. **Write.** The manifest and reports are rewritten each time a path finishes, from every outcome
600
- so far in plan order, so a crash keeps what ran. `outcomes.json` keeps the raw outcomes, for
601
- `atlas merge` and `--rerun-failed`.
602
-
603
- Every path, state and transition ends as `passed`, `failed`, `flaky` or `not-reached`. Reaching a
604
- state also reaches its ancestors. A failure records the recogniser's signals and which known states
605
- the screen looked like instead.
606
-
607
- ### Run modes
608
-
609
- | Mode | Pacing | Media |
610
- | --- | --- | --- |
611
- | `fast` | None | Screenshots of every state (when the driver takes them) |
612
- | `showcase` | Holds before and after each step; taps glide and type at human speed | Screenshots, plus an H.264 clip of every transition with a poster and WebVTT captions |
613
-
614
- ## Manifest and reports
615
-
616
- Each run writes `<output>/<timestamp>-<mode>/`:
617
-
618
- | File | Contents |
619
- | --- | --- |
620
- | `manifest.json` | The run (commit, branch, environment, mode, spec version, scope), every chart, the composed map (nodes and edges), every state and transition with status, media, timeline and reasons, every path with its attempts, coverage and privacy results. Schema: `packages/schema/schemas/manifest.schema.json`. |
621
- | `junit.xml` | One test case per path: failures, skips (with the blocking reason) and flaky passes. |
622
- | `ctrf.json` | The same as CTRF. |
623
- | `chart.mmd` | The composed chart as a Mermaid state diagram. |
624
- | `outcomes.json` | Each path's raw outcome by path key, which the manifest is folded from: for merging shards and reusing passed paths. |
625
- | `media/paths/<path>/NN.png`, `.webp` | Screenshots of each state a path reached; `failed-NN.png` where it failed. |
626
- | `media/clips/<path>/NN.mp4`, `.poster.webp`, `.vtt` | Showcase clips of each transition, with captions. |
627
- | `media/traces/<path>.zip` | Driver traces of failed attempts (Playwright traces with the Playwright driver). |
628
-
629
- ## Business events
630
-
631
- States list the business events that happen on entering them in `meta.events`. An `EventSource`
632
- says what actually happened. `mark()` returns a position before each event, and `collect(mark)`
633
- returns what arrived after it, once the state is recognised:
634
-
635
- - `cloudEventsHttpSource()` starts an HTTP endpoint that accepts CloudEvents in structured, binary
636
- or batch mode. Point the product's event bus, webhook relay or collector at its `url`.
637
- - `logFileSource(file)` collects lines appended to a log, for products whose only event stream is a
638
- log; match them with `{ pattern }`.
639
- - Any object with `name`, `mark` and `collect` works, such as an in-memory bus in a unit test.
640
-
641
- With no matcher, a business event is observed when a CloudEvent's `type` equals its name. Events
642
- with neither a matcher nor a CloudEvents source are reported as "no signal", never as missing.
643
-
644
- ## Privacy
645
-
646
- Runs produce media and manifests that get shared, so Atlas refuses to leak real data:
647
-
648
- - Before running, every `targets` URL must be on `allowHosts` (loopback only by default).
649
- - After every step, the driver's visible text is scanned, and the manifest is scanned before it is
650
- written. By default it flags email addresses outside `example.com`/`.org`/`.net` and the `.test`,
651
- `.example`, `.invalid`, `.localhost` and `.local` domains, anything shaped like a US Social Security
652
- number, and card numbers other than the well-known test cards. Findings describe the match without
653
- repeating it.
654
- - Any finding fails the run. Add `deny` patterns and `allowEmails` in `privacy`.
655
-
656
- ## Visualizer
657
-
658
- The [`atlas-visualizer`](packages/visualizer) command renders the charts from the specs directory and
659
- overlays runs from the runs directory: screenshots on states, clips on transitions, statuses and
660
- history. See its README for how to point it at a project.
661
-
662
- Its open index lists every place, journey and spec beside one plate. Connect multiple local
663
- directories, HTTP report stores and streaming
664
- APIs using [report backends](docs/report-backends.md). The runner publishes reached screens
665
- and completed steps while paths are still running.
239
+ Each run publishes as a layer (`atlas report publish --manifest <run>/manifest.json`), so it combines
240
+ with every other suite's evidence. Shards, seeds, several clients in one run, drivers (Playwright,
241
+ Bun WebView, WebDriver and Appium, Detox, plain functions), business events and the privacy scan are
242
+ in **[Executable statecharts](docs/statecharts.md)**, which starts with a runnable example,
243
+ [`examples/todo`](https://github.com/crvouga/atlas/tree/main/examples/todo).
666
244
 
667
245
  ## License
668
246
 
669
247
  [MIT](LICENSE)
248
+
249
+ Native [CodeceptJS, Mocha, Jest and Node test reporters](docs/runners.md) upload directly to the project server. Open **Settings** in the client to configure storage and report settings for the next restart.