@shivaedev/test-story 0.32.0 → 0.34.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 (303) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +122 -23
  3. package/dist/client/adapters/reactRendering.d.ts +7 -0
  4. package/dist/client/adapters/reactRendering.d.ts.map +1 -0
  5. package/dist/client/adapters/reactRendering.js +4 -0
  6. package/dist/client/adapters/reactRendering.js.map +1 -0
  7. package/dist/client/adapters/waitForReact.d.ts +2 -0
  8. package/dist/client/adapters/waitForReact.d.ts.map +1 -0
  9. package/dist/client/adapters/waitForReact.js +8 -0
  10. package/dist/client/adapters/waitForReact.js.map +1 -0
  11. package/dist/client/react.d.ts +5 -4
  12. package/dist/client/react.d.ts.map +1 -1
  13. package/dist/client/react.js +9 -10
  14. package/dist/client/react.js.map +1 -1
  15. package/dist/server/adapters/installOutbound.d.ts.map +1 -0
  16. package/dist/server/{internal → adapters}/installOutbound.js +38 -12
  17. package/dist/server/adapters/installOutbound.js.map +1 -0
  18. package/dist/server/adapters/receiveOtlp.d.ts +4 -0
  19. package/dist/server/adapters/receiveOtlp.d.ts.map +1 -0
  20. package/dist/server/adapters/receiveOtlp.js +39 -0
  21. package/dist/server/adapters/receiveOtlp.js.map +1 -0
  22. package/dist/server/adapters/screenAct.d.ts +4 -0
  23. package/dist/server/adapters/screenAct.d.ts.map +1 -0
  24. package/dist/server/adapters/screenAct.js +14 -0
  25. package/dist/server/adapters/screenAct.js.map +1 -0
  26. package/dist/server/adapters/screenDialogs.d.ts +2 -0
  27. package/dist/server/adapters/screenDialogs.d.ts.map +1 -0
  28. package/dist/server/adapters/screenDialogs.js +9 -0
  29. package/dist/server/adapters/screenDialogs.js.map +1 -0
  30. package/dist/server/adapters/screenElements.d.ts +3 -0
  31. package/dist/server/adapters/screenElements.d.ts.map +1 -1
  32. package/dist/server/adapters/screenElements.js +9 -0
  33. package/dist/server/adapters/screenElements.js.map +1 -1
  34. package/dist/server/adapters/screenMutations.d.ts +1 -1
  35. package/dist/server/adapters/screenMutations.d.ts.map +1 -1
  36. package/dist/server/adapters/screenMutations.js +1 -1
  37. package/dist/server/adapters/screenMutations.js.map +1 -1
  38. package/dist/server/adapters/screenNavigation.d.ts +1 -1
  39. package/dist/server/adapters/screenNavigation.d.ts.map +1 -1
  40. package/dist/server/adapters/screenNavigation.js +1 -1
  41. package/dist/server/adapters/screenNavigation.js.map +1 -1
  42. package/dist/server/adapters/screenQueries.d.ts +2 -0
  43. package/dist/server/adapters/screenQueries.d.ts.map +1 -1
  44. package/dist/server/adapters/screenQueries.js +27 -3
  45. package/dist/server/adapters/screenQueries.js.map +1 -1
  46. package/dist/server/adapters/storyFailure.d.ts +6 -0
  47. package/dist/server/adapters/storyFailure.d.ts.map +1 -0
  48. package/dist/server/adapters/storyFailure.js +13 -0
  49. package/dist/server/adapters/storyFailure.js.map +1 -0
  50. package/dist/server/adapters/visitHttp.d.ts +2 -0
  51. package/dist/server/adapters/visitHttp.d.ts.map +1 -0
  52. package/dist/server/adapters/visitHttp.js +4 -0
  53. package/dist/server/adapters/visitHttp.js.map +1 -0
  54. package/dist/server/adapters/writeSnapshot.d.ts +3 -0
  55. package/dist/server/adapters/writeSnapshot.d.ts.map +1 -0
  56. package/dist/server/adapters/writeSnapshot.js +24 -0
  57. package/dist/server/adapters/writeSnapshot.js.map +1 -0
  58. package/dist/server/browserReads.d.ts +6 -6
  59. package/dist/server/browserReads.d.ts.map +1 -1
  60. package/dist/server/browserReads.js +3 -16
  61. package/dist/server/browserReads.js.map +1 -1
  62. package/dist/server/domEnvironment.config.js +1 -1
  63. package/dist/server/domPage.d.ts +1 -1
  64. package/dist/server/domPage.d.ts.map +1 -1
  65. package/dist/server/domPage.js +2 -1
  66. package/dist/server/domPage.js.map +1 -1
  67. package/dist/server/fakeHttpService.d.ts +3 -1
  68. package/dist/server/fakeHttpService.d.ts.map +1 -1
  69. package/dist/server/fakeHttpService.js +9 -6
  70. package/dist/server/fakeHttpService.js.map +1 -1
  71. package/dist/server/forwardingProxy.d.ts +1 -1
  72. package/dist/server/forwardingProxy.d.ts.map +1 -1
  73. package/dist/server/forwardingProxy.js +1 -1
  74. package/dist/server/forwardingProxy.js.map +1 -1
  75. package/dist/server/httpVisitor.d.ts +12 -0
  76. package/dist/server/httpVisitor.d.ts.map +1 -0
  77. package/dist/server/httpVisitor.js +29 -0
  78. package/dist/server/httpVisitor.js.map +1 -0
  79. package/dist/server/internal/adapters/pageFetch.d.ts +1 -1
  80. package/dist/server/internal/adapters/pageFetch.d.ts.map +1 -1
  81. package/dist/server/internal/adapters/pageFetch.js +1 -1
  82. package/dist/server/internal/adapters/pageFetch.js.map +1 -1
  83. package/dist/server/internal/browserReadObserver.d.ts +4 -3
  84. package/dist/server/internal/browserReadObserver.d.ts.map +1 -1
  85. package/dist/server/internal/browserReadObserver.js +19 -3
  86. package/dist/server/internal/browserReadObserver.js.map +1 -1
  87. package/dist/server/internal/browserSubscriptions.d.ts +3 -2
  88. package/dist/server/internal/browserSubscriptions.d.ts.map +1 -1
  89. package/dist/server/internal/browserSubscriptions.js +14 -4
  90. package/dist/server/internal/browserSubscriptions.js.map +1 -1
  91. package/dist/server/internal/compose.d.ts.map +1 -1
  92. package/dist/server/internal/compose.js +2 -1
  93. package/dist/server/internal/compose.js.map +1 -1
  94. package/dist/server/internal/domDocument.d.ts +1 -1
  95. package/dist/server/internal/domDocument.d.ts.map +1 -1
  96. package/dist/server/internal/domDocument.js +1 -1
  97. package/dist/server/internal/domDocument.js.map +1 -1
  98. package/dist/server/internal/engineSnapshot.d.ts.map +1 -1
  99. package/dist/server/internal/engineSnapshot.js +2 -13
  100. package/dist/server/internal/engineSnapshot.js.map +1 -1
  101. package/dist/server/internal/failureReport.d.ts +1 -0
  102. package/dist/server/internal/failureReport.d.ts.map +1 -1
  103. package/dist/server/internal/failureReport.js +9 -3
  104. package/dist/server/internal/failureReport.js.map +1 -1
  105. package/dist/server/internal/fakeHttpAnswer.d.ts.map +1 -1
  106. package/dist/server/internal/fakeHttpAnswer.js +12 -4
  107. package/dist/server/internal/fakeHttpAnswer.js.map +1 -1
  108. package/dist/server/internal/fakeHttpControls.d.ts +1 -1
  109. package/dist/server/internal/fakeHttpControls.d.ts.map +1 -1
  110. package/dist/server/internal/fakeHttpControls.js +1 -1
  111. package/dist/server/internal/fakeHttpControls.js.map +1 -1
  112. package/dist/server/internal/fakeHttpGates.d.ts.map +1 -1
  113. package/dist/server/internal/fakeHttpGates.js +2 -1
  114. package/dist/server/internal/fakeHttpGates.js.map +1 -1
  115. package/dist/server/internal/fakeHttpReceive.d.ts +1 -1
  116. package/dist/server/internal/fakeHttpReceive.d.ts.map +1 -1
  117. package/dist/server/internal/fakeHttpReceive.js +4 -7
  118. package/dist/server/internal/fakeHttpReceive.js.map +1 -1
  119. package/dist/server/internal/fakeHttpScripts.js +1 -1
  120. package/dist/server/internal/fakeHttpScripts.js.map +1 -1
  121. package/dist/server/internal/fakeHttpSignals.d.ts +10 -0
  122. package/dist/server/internal/fakeHttpSignals.d.ts.map +1 -0
  123. package/dist/server/internal/fakeHttpSignals.js +26 -0
  124. package/dist/server/internal/fakeHttpSignals.js.map +1 -0
  125. package/dist/server/internal/hooked.d.ts +1 -1
  126. package/dist/server/internal/hooked.d.ts.map +1 -1
  127. package/dist/server/internal/hooked.js +1 -1
  128. package/dist/server/internal/hooked.js.map +1 -1
  129. package/dist/server/internal/loadingDeadline.d.ts +1 -1
  130. package/dist/server/internal/loadingDeadline.d.ts.map +1 -1
  131. package/dist/server/internal/loadingDeadline.js +2 -1
  132. package/dist/server/internal/loadingDeadline.js.map +1 -1
  133. package/dist/server/internal/loopback.d.ts +1 -1
  134. package/dist/server/internal/loopback.d.ts.map +1 -1
  135. package/dist/server/internal/loopback.js +1 -1
  136. package/dist/server/internal/loopback.js.map +1 -1
  137. package/dist/server/internal/narration.d.ts +6 -9
  138. package/dist/server/internal/narration.d.ts.map +1 -1
  139. package/dist/server/internal/narration.js +17 -18
  140. package/dist/server/internal/narration.js.map +1 -1
  141. package/dist/server/internal/nextClientHint.d.ts +3 -2
  142. package/dist/server/internal/nextClientHint.d.ts.map +1 -1
  143. package/dist/server/internal/nextClientHint.js +10 -2
  144. package/dist/server/internal/nextClientHint.js.map +1 -1
  145. package/dist/server/internal/observeBrowser.d.ts +61 -0
  146. package/dist/server/internal/observeBrowser.d.ts.map +1 -0
  147. package/dist/server/internal/observeBrowser.js +21 -0
  148. package/dist/server/internal/observeBrowser.js.map +1 -0
  149. package/dist/server/internal/otlpReadout.js +1 -1
  150. package/dist/server/internal/otlpReadout.js.map +1 -1
  151. package/dist/server/internal/otlpReadouts.d.ts +9 -0
  152. package/dist/server/internal/otlpReadouts.d.ts.map +1 -0
  153. package/dist/server/internal/otlpReadouts.js +44 -0
  154. package/dist/server/internal/otlpReadouts.js.map +1 -0
  155. package/dist/server/internal/otlpTracing.d.ts +10 -0
  156. package/dist/server/internal/otlpTracing.d.ts.map +1 -0
  157. package/dist/server/internal/otlpTracing.js +45 -0
  158. package/dist/server/internal/otlpTracing.js.map +1 -0
  159. package/dist/server/internal/otlpValue.d.ts +1 -1
  160. package/dist/server/internal/otlpValue.d.ts.map +1 -1
  161. package/dist/server/internal/otlpValue.js +1 -1
  162. package/dist/server/internal/otlpValue.js.map +1 -1
  163. package/dist/server/internal/recordedSignals.d.ts +1 -1
  164. package/dist/server/internal/recordedSignals.d.ts.map +1 -1
  165. package/dist/server/internal/recordedSignals.js +4 -1
  166. package/dist/server/internal/recordedSignals.js.map +1 -1
  167. package/dist/server/internal/runUntil.d.ts +1 -1
  168. package/dist/server/internal/runUntil.d.ts.map +1 -1
  169. package/dist/server/internal/runUntil.js +1 -1
  170. package/dist/server/internal/runUntil.js.map +1 -1
  171. package/dist/server/internal/screenReadouts.d.ts +2 -0
  172. package/dist/server/internal/screenReadouts.d.ts.map +1 -1
  173. package/dist/server/internal/screenReadouts.js +13 -1
  174. package/dist/server/internal/screenReadouts.js.map +1 -1
  175. package/dist/server/internal/screenWaits.d.ts +1 -1
  176. package/dist/server/internal/screenWaits.d.ts.map +1 -1
  177. package/dist/server/internal/screenWaits.js +1 -1
  178. package/dist/server/internal/screenWaits.js.map +1 -1
  179. package/dist/server/internal/seed.d.ts +2 -1
  180. package/dist/server/internal/seed.d.ts.map +1 -1
  181. package/dist/server/internal/seed.js +4 -1
  182. package/dist/server/internal/seed.js.map +1 -1
  183. package/dist/server/internal/start.d.ts +1 -1
  184. package/dist/server/internal/start.d.ts.map +1 -1
  185. package/dist/server/internal/start.js +7 -4
  186. package/dist/server/internal/start.js.map +1 -1
  187. package/dist/server/internal/storyIt.d.ts.map +1 -1
  188. package/dist/server/internal/storyIt.js +2 -1
  189. package/dist/server/internal/storyIt.js.map +1 -1
  190. package/dist/server/internal/visitorCookies.d.ts +5 -0
  191. package/dist/server/internal/visitorCookies.d.ts.map +1 -0
  192. package/dist/server/internal/visitorCookies.js +50 -0
  193. package/dist/server/internal/visitorCookies.js.map +1 -0
  194. package/dist/server/internal/waitForScreen.d.ts +1 -1
  195. package/dist/server/internal/waitForScreen.d.ts.map +1 -1
  196. package/dist/server/internal/waitForScreen.js +7 -3
  197. package/dist/server/internal/waitForScreen.js.map +1 -1
  198. package/dist/server/internal/withWatchedClock.d.ts +1 -1
  199. package/dist/server/internal/withWatchedClock.d.ts.map +1 -1
  200. package/dist/server/internal/withWatchedClock.js +2 -1
  201. package/dist/server/internal/withWatchedClock.js.map +1 -1
  202. package/dist/server/lineSignals.d.ts +1 -1
  203. package/dist/server/lineSignals.d.ts.map +1 -1
  204. package/dist/server/lineSignals.js +1 -1
  205. package/dist/server/lineSignals.js.map +1 -1
  206. package/dist/server/memberScreens.d.ts +3 -2
  207. package/dist/server/memberScreens.d.ts.map +1 -1
  208. package/dist/server/memberScreens.js +5 -5
  209. package/dist/server/memberScreens.js.map +1 -1
  210. package/dist/server/otlpReceiver.d.ts +15 -4
  211. package/dist/server/otlpReceiver.d.ts.map +1 -1
  212. package/dist/server/otlpReceiver.js +9 -40
  213. package/dist/server/otlpReceiver.js.map +1 -1
  214. package/dist/server/outcomes.d.ts +1 -1
  215. package/dist/server/outcomes.d.ts.map +1 -1
  216. package/dist/server/outcomes.js +1 -1
  217. package/dist/server/outcomes.js.map +1 -1
  218. package/dist/server/routeOutbound.d.ts +1 -1
  219. package/dist/server/routeOutbound.d.ts.map +1 -1
  220. package/dist/server/routeOutbound.js +2 -2
  221. package/dist/server/routeOutbound.js.map +1 -1
  222. package/dist/server/screenDriver.d.ts +9 -4
  223. package/dist/server/screenDriver.d.ts.map +1 -1
  224. package/dist/server/screenDriver.js +15 -4
  225. package/dist/server/screenDriver.js.map +1 -1
  226. package/dist/server/seedCookies.d.ts +3 -3
  227. package/dist/server/seedCookies.d.ts.map +1 -1
  228. package/dist/server/seedCookies.js +4 -4
  229. package/dist/server/seedCookies.js.map +1 -1
  230. package/dist/server/until.d.ts +3 -1
  231. package/dist/server/until.d.ts.map +1 -1
  232. package/dist/server/until.js +4 -1
  233. package/dist/server/until.js.map +1 -1
  234. package/dist/server/watchedClock.d.ts +3 -1
  235. package/dist/server/watchedClock.d.ts.map +1 -1
  236. package/dist/server/watchedClock.js +5 -1
  237. package/dist/server/watchedClock.js.map +1 -1
  238. package/package.json +12 -6
  239. package/src/client/adapters/reactRendering.ts +5 -0
  240. package/src/client/adapters/waitForReact.ts +7 -0
  241. package/src/client/react.ts +13 -12
  242. package/src/server/{internal → adapters}/installOutbound.ts +47 -12
  243. package/src/server/adapters/receiveOtlp.ts +45 -0
  244. package/src/server/adapters/screenAct.ts +20 -0
  245. package/src/server/adapters/screenDialogs.ts +12 -0
  246. package/src/server/adapters/screenElements.ts +9 -0
  247. package/src/server/adapters/screenMutations.ts +1 -1
  248. package/src/server/adapters/screenNavigation.ts +1 -1
  249. package/src/server/adapters/screenQueries.ts +31 -5
  250. package/src/server/adapters/storyFailure.ts +20 -0
  251. package/src/server/adapters/visitHttp.ts +3 -0
  252. package/src/server/adapters/writeSnapshot.ts +25 -0
  253. package/src/server/browserReads.ts +6 -20
  254. package/src/server/domEnvironment.config.ts +1 -1
  255. package/src/server/domPage.ts +2 -1
  256. package/src/server/fakeHttpService.ts +9 -6
  257. package/src/server/forwardingProxy.ts +1 -1
  258. package/src/server/httpVisitor.ts +37 -0
  259. package/src/server/internal/adapters/pageFetch.ts +1 -1
  260. package/src/server/internal/browserReadObserver.ts +20 -3
  261. package/src/server/internal/browserSubscriptions.ts +14 -4
  262. package/src/server/internal/compose.ts +2 -1
  263. package/src/server/internal/domDocument.ts +1 -1
  264. package/src/server/internal/engineSnapshot.ts +2 -20
  265. package/src/server/internal/failureReport.ts +14 -3
  266. package/src/server/internal/fakeHttpAnswer.ts +11 -4
  267. package/src/server/internal/fakeHttpControls.ts +1 -1
  268. package/src/server/internal/fakeHttpGates.ts +2 -1
  269. package/src/server/internal/fakeHttpReceive.ts +4 -7
  270. package/src/server/internal/fakeHttpScripts.ts +1 -1
  271. package/src/server/internal/fakeHttpSignals.ts +28 -0
  272. package/src/server/internal/hooked.ts +1 -1
  273. package/src/server/internal/loadingDeadline.ts +2 -1
  274. package/src/server/internal/loopback.ts +1 -1
  275. package/src/server/internal/narration.ts +26 -25
  276. package/src/server/internal/nextClientHint.ts +14 -4
  277. package/src/server/internal/observeBrowser.ts +25 -0
  278. package/src/server/internal/otlpReadout.ts +1 -1
  279. package/src/server/internal/otlpReadouts.ts +50 -0
  280. package/src/server/internal/otlpTracing.ts +56 -0
  281. package/src/server/internal/otlpValue.ts +1 -1
  282. package/src/server/internal/recordedSignals.ts +4 -1
  283. package/src/server/internal/runUntil.ts +1 -1
  284. package/src/server/internal/screenReadouts.ts +13 -1
  285. package/src/server/internal/screenWaits.ts +1 -1
  286. package/src/server/internal/seed.ts +5 -1
  287. package/src/server/internal/start.ts +10 -4
  288. package/src/server/internal/storyIt.ts +2 -1
  289. package/src/server/internal/visitorCookies.ts +62 -0
  290. package/src/server/internal/waitForScreen.ts +7 -3
  291. package/src/server/internal/withWatchedClock.ts +2 -1
  292. package/src/server/lineSignals.ts +1 -1
  293. package/src/server/memberScreens.ts +9 -5
  294. package/src/server/otlpReceiver.ts +13 -46
  295. package/src/server/outcomes.ts +1 -1
  296. package/src/server/routeOutbound.ts +2 -2
  297. package/src/server/screenDriver.ts +23 -10
  298. package/src/server/seedCookies.ts +6 -6
  299. package/src/server/until.ts +5 -1
  300. package/src/server/watchedClock.ts +5 -1
  301. package/dist/server/internal/installOutbound.d.ts.map +0 -1
  302. package/dist/server/internal/installOutbound.js.map +0 -1
  303. /package/dist/server/{internal → adapters}/installOutbound.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,42 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.34.0 - 2026-11-02
4
+
5
+ ### Added
6
+
7
+ - Fake HTTP services expose replaying `received` and `completed` Effect streams so stories can wait independently for each request's arrival and response completion, separately from abandonment.
8
+ - Add scoped HTTP visitors with separate cookie jars and forwarding proxies. Stories can model a public HTTPS origin, retain app cookies, and present foreign Origin and forged forwarding headers over real HTTP.
9
+ - Read labelled element text with `labelledText(label)` and native table rows with `table(label)` in screen drivers.
10
+ - Scope a screen driver to a portal with `dialog(target)`. Member screens find body portals linked by their triggers' `aria-controls` while keeping other members' dialogs out of reach.
11
+
12
+ ### Fixed
13
+
14
+ - Keep member screen dialog queries inside the member's root, including when the driver uses a child mount. Mount member portals inside `member.root` so their controls remain accessible to that member. Standalone screen drivers continue to find document portals.
15
+ - Compose outbound routes acquired in separate scopes. Each scope removes only its own registrations; the newest active route for a shared hostname wins, and closing it restores the earlier route.
16
+ - Subscription opening waits settle when a stream completes without a value, dies or disconnects, preserving answered subscriptions and tagged refusals.
17
+
18
+ ### Breaking
19
+
20
+ - Held route replies and scripted status reply functions now compute at request arrival, before waiting for release. Move state changes that should affect the reply before sending the request, or use an immediate `fault` to replace a waiting reply at injection time.
21
+ - `screenDriver` with client activity now exposes `SignalNotReceived` from `nextLiveHint()` when the activity stream ends without a new hint. Handle this typed error from `@shivaedev/test-story/server/until.ts` instead of assuming the wait always succeeds. Subscription readouts include a `closed` state for streams that terminate before answering; consumers matching subscription states must handle `closed`.
22
+
23
+ ## 0.33.0 - 2026-11-02
24
+
25
+ ### Added
26
+
27
+ - Read exported secrets, traced SQL queries and reported errors from the fake OTLP receiver in stories.
28
+ - Build a scoped tracing layer with the tracer logger included, and flush buffered and in-flight spans to the receiver without stopping tracing.
29
+
30
+ ### Changed
31
+
32
+ - Story kits and the Effect test adapter import native Effect submodules instead of whole barrels. Cookie windows, member windows, React mounting and OTLP decoding load when used; browser RPC imports use dedicated modules.
33
+ - App test workers reuse Node's on-disk compilation cache while keeping Vitest's file isolation.
34
+
35
+ ### Fixed
36
+
37
+ - A timed-out DOM screen lookup closes its interrupted React `act()` scope before the story finishes, so later stories in the same file render and respond normally.
38
+ - Creation failures keep their original cause and name the story kit, the create phase and the rerun command. Cleanup failures evaluate asynchronous inspect hooks with the kit's services and print their state instead of serializing an Effect.
39
+
3
40
  ## 0.32.0 - 2026-11-01
4
41
 
5
42
  ### Added
package/README.md CHANGED
@@ -38,14 +38,14 @@ The bakery when the test failed:
38
38
  {"bowls":1,"capacity":3,"dough":0,"flour":0,"loaves":1,"minute":1,"orders":[],"ovenLit":true,"overfired":false,
39
39
  "smoking":false,"starter":false}
40
40
 
41
- Rerun: vitest run src/test-support/failingStories.ts -t "Bakery Story: marks where an assertion stopped the story"
41
+ Rerun: vitest run 'src/test-support/failingStories.ts' -t 'Bakery Story: marks where an assertion stopped the story'
42
42
  ```
43
43
 
44
44
  The first line is the assertion's own message. The box under it tells a reader who has never seen the package how to read what follows. Then comes the story: the two traits the test named, the line the bakery told as it baked, and a `✗` where the test stopped, with the spec line it stopped at. Last come the bakery's whole state at that moment and the command that reruns the test, so the failure alone is enough to find the cause.
45
45
 
46
46
  ## Using it
47
47
 
48
- Every source module is available through its `.ts` subpath, including modules under `server/internal/`. Kit authors choose which engine pieces to depend on.
48
+ Every source module is available through its `.ts` subpath, including modules under `server/internal/`. Kit authors choose which engine pieces to depend on. The core kit imports Effect submodules directly and leaves DOM, browser, PostgreSQL and OTLP engines out of its module graph. React mounting, member windows, cookie seeding, browser reads and OTLP decoding load their optional implementations when used, so a shared application kit can import an integration without loading its engine.
49
49
 
50
50
  Before writing or reviewing stories, follow the [story-testing skill](https://github.com/ShivaeDev/platform/blob/main/packages/skills/skills/story-testing/SKILL.md), shipped by `@shivaedev/skills`. It owns the rules for how a story reads, observable evidence, boundary-driven setup, verbs and readouts, assertions, jobs, framework gaps, faked preconditions, database isolation and focused runs. The examples below explain this package's API; framework fixtures exercise this package's responsibilities, rather than prescribe application scenarios.
51
51
 
@@ -208,7 +208,9 @@ const app = storyKit({
208
208
 
209
209
  `routeOutbound(routes)` from `@shivaedev/test-story/server/routeOutbound.ts` installs the same routing in the current Effect Scope. Acquire a `fakeHttpService` in `create`, then yield `routeOutbound({ "api.example.com": api.url })` so the fake listener and its routing belong to that story. Pass `{ passthrough: true }` as its second argument to allow unrouted Node fetch requests.
210
210
 
211
- Routing uses the global dispatcher that Node's built-in `fetch` already uses. The kit's `outbound` option installs routing before `around`, creation, traits and the body, stays active during scoped cleanup, and restores the previous dispatcher after each story, including a failing story. Stories within one worker must run one at a time because that dispatcher is shared; parallelism belongs between workers or inside one story. The DOM environment uses the same routing for host-side Node fetch and document requests, including redirect destinations. It refuses external hosts even when the kit omits `outbound`.
211
+ Separate registrations compose: every active registration's hosts remain reachable. If registrations name the same host, the newest active registration wins. Closing a scope removes only its registrations, revealing any earlier route for that host. Unrouted external hosts remain refused while any active registration requires strict routing.
212
+
213
+ Routing uses the global dispatcher that Node's built-in `fetch` already uses. The kit's `outbound` option installs routing before `around`, creation, traits and the body, stays active during scoped cleanup, and removes its registrations after each story, including a failing story. The original dispatcher is restored when the last registration closes. Stories within one worker must run one at a time because that dispatcher is shared; parallelism belongs between workers or inside one story. The DOM environment uses the same routing for host-side Node fetch and document requests, including redirect destinations. It refuses external hosts even when the kit omits `outbound`.
212
214
 
213
215
  #### Asserting on application traces
214
216
 
@@ -277,7 +279,48 @@ app.it("continues the trace context a request's headers carry", [], function* ({
277
279
 
278
280
  `describeSpan` turns each span into words once in the kit, so the specs compare sentences instead of reading span fields and tags. Detachment only removes the incoming parent: spans that application startup explicitly creates still follow native Effect semantics.
279
281
 
280
- #### Forwarding requests to a host
282
+ #### Visiting an app over HTTP
283
+
284
+ Use `httpVisitor` from `@shivaedev/test-story/server/httpVisitor.ts` in the kit's scoped `create` or `after` hook after starting the real app. Each call acquires a separate cookie jar and a separate edge proxy, which closes with the calling Scope:
285
+
286
+ ```ts
287
+ import { httpVisitor } from "@shivaedev/test-story/server/httpVisitor.ts";
288
+
289
+ const ada = yield* httpVisitor(upstream, {
290
+ baseUrl: "https://app.example",
291
+ headers: {
292
+ origin: "https://foreign.example",
293
+ "x-forwarded-for": "198.51.100.7",
294
+ "x-real-ip": "192.0.2.4",
295
+ },
296
+ edge: { forwardedHops: ["203.0.113.9"] },
297
+ });
298
+
299
+ const bob = yield* httpVisitor(upstream, { baseUrl: "https://app.example" });
300
+ ```
301
+
302
+ `upstream` is the app's local HTTP listener. `baseUrl` is the public URL the visitor sees; it defaults to `upstream`. HTTPS here models TLS termination at the edge: transport to the local app remains HTTP. Requests present that public URL through `X-Forwarded-Host` and `X-Forwarded-Proto`. Secure cookies are accepted and sent only for HTTPS public URLs, including when the hostname is localhost. Ordinary and HttpOnly cookies are kept automatically, scoped by host/domain and path, and updated or removed by the app's Set-Cookie headers. Cookie expiry uses the story's Effect Clock. The visitors never share cookies.
303
+
304
+ `headers` supplies visitor request defaults; a request's own headers override them without case sensitivity. In this example the app receives Origin `https://foreign.example`, X-Forwarded-For `198.51.100.7, 203.0.113.9`, and X-Real-IP `192.0.2.4`. `edge` accepts `ForwardingProxyOptions`: its headers override the visitor's headers, and `forwardedHops` chooses which addresses the edge appends. Give each visitor its own edge policy to test trusted proxy boundaries.
305
+
306
+ `yield* ada.request("/session")` returns a native Response in an Effect. It accepts a path or an absolute public URL and optional fetch request options for method, headers, body and signal. Every request goes through this visitor's edge to the same upstream app; an absolute URL changes the public host/scheme used for headers and cookie selection. Redirects are returned without following them, and their cookies are retained, so the next story action can explicitly visit the Location. There is no credentials or redirect option. This HTTP client does not enforce browser CORS or SameSite policy.
307
+
308
+ Keep requests and response decoding inside the application's verbs and readouts. A verb performs one action, and a readout translates the HTTP answer into domain words such as `"signed in as ada"` or `"signed out"`; specs never inspect Exit, Cause or `_tag` shapes. For example, an application's kit exposes `as(name).signsIn()` and `as(name).session()` over its visitor:
309
+
310
+ ```ts
311
+ app.it("keeps ada's session separate from bob's", [visiting("ada"), visiting("bob")], function* ({ as }) {
312
+ yield* as("ada").signsIn();
313
+
314
+ yield* outcomes([
315
+ ["ada's session", () => as("ada").session(), "signed in as ada"],
316
+ ["bob's session", () => as("bob").session(), "signed out"],
317
+ ]);
318
+ });
319
+ ```
320
+
321
+ The kit awaits the HTTP answer directly; it needs no sleeps, polling or manual Cookie header copying. For DOM rendering and browser sign-in flows, use the document and member-screen transports below.
322
+
323
+ #### Controlling a forwarding proxy directly
281
324
 
282
325
  Use `forwardingProxy` from `@shivaedev/test-story/server/forwardingProxy.ts` in the kit's scoped `create` or `after` hook after starting the host under test:
283
326
 
@@ -301,21 +344,43 @@ Set `localAddress` to choose the source socket address of the proxy's connection
301
344
 
302
345
  #### Reading OTLP exports
303
346
 
304
- Use `otlpReceiver` from `@shivaedev/test-story/server/otlpReceiver.ts` in a kit's scoped `create` hook. It listens on an allocated loopback port and closes with the story scope. Point the application's real exporter at `${receiver.url}/v1/traces`, then flush the exporter before reading:
347
+ Use `otlpReceiver` from `@shivaedev/test-story/server/otlpReceiver.ts` in a kit's scoped `create` hook. It listens on an allocated loopback port and closes with the story scope. Build the application's tracing layer with `receiver.tracerLayer(options?)`, providing native OTLP serialization and an HTTP client:
348
+
349
+ ```ts
350
+ const receiver = yield* otlpReceiver();
351
+ const tracing = receiver.tracerLayer({ resource: { serviceName: "documents" } }).pipe(
352
+ Layer.provide(OtlpSerialization.layerJson),
353
+ Layer.provide(FetchHttpClient.layer),
354
+ );
355
+ const context = yield* Layer.build(tracing);
356
+ ```
357
+
358
+ Import `Layer` from `effect`, `OtlpSerialization` from `effect/observability` and `FetchHttpClient` from `effect/http`. Provide `context` to the application's work. The layer accepts native tracer options except the destination URL and compression; the receiver supplies its own URL. Use `OtlpSerialization.layerProtobuf` for protobuf exports. The layer includes Effect's tracer logger, so logs become span events even when the surrounding test logger omits it. Logger changes stay inside the provided context, and the story's Scope releases the exporter.
359
+
360
+ Expose `receiver.flush` as a separate story step. It exports buffered traces and waits on receiver signals for every sampled span that ended before the step, including exports already in flight. It leaves tracing running for later actions. Finish the traced operation before flushing; a span still running has nothing to export. This step tracks exporters built with `receiver.tracerLayer`; an independently configured exporter still needs its own flush.
305
361
 
306
362
  ```ts
307
- app.it("exports the work span without the planted secret", [], function* ({ runWork, disposeRuntime, exportedSpanNames, exportsContaining }) {
308
- yield* runWork();
309
- yield* disposeRuntime();
363
+ app.it("exports a leaked credential and omits a redacted credential", [], function* ({ tracesSecret, flush, exportsSecret }) {
364
+ yield* tracesSecret("redacted credential", true);
365
+ yield* tracesSecret("leaked credential", false);
366
+ yield* flush();
310
367
 
311
368
  yield* outcomes([
312
- ["exported spans", () => exportedSpanNames(), ["CountWords"]],
313
- ["exports with the planted secret", () => exportsContaining("planted-secret"), 0],
369
+ ["redacted credential exported", () => exportsSecret("redacted credential"), false],
370
+ ["leaked credential exported", () => exportsSecret("leaked credential"), true],
314
371
  ]);
315
372
  });
316
373
  ```
317
374
 
318
- Here `app` is the application's kit. Its `create` acquires the receiver and the real exporter pointed at that receiver, `runWork` performs the traced operation, `disposeRuntime` disposes the exporter's runtime and flushes pending spans, and `exportedSpanNames` and `exportsContaining` are Effect readouts over the receiver's `spans` and `requests`. Each action is visible in the spec. The receiver accepts OTLP/HTTP JSON and protobuf. `spans` flattens all exports into decoded trace and span IDs, parent span IDs, names, numeric OTLP kinds and status codes, attributes, events and links. Attributes retain OTLP key/value objects, including lossless decimal strings for integers; each span also has `resourceAttributes`. `requests` retains every request's unmodified `body` Buffer, parsed `headers`, original `rawHeaders` pairs and `path`. Search all body bytes when checking that a secret was not exported. Optional `path`, `status` (a number or attempt callback) and `answer` configure collector responses for failure stories.
375
+ Here `app` is the application's kit. `tracesSecret` performs one traced action, and the kit exposes the receiver's readouts through its own domain verbs. Readouts return values and the spec states expectations:
376
+
377
+ | Readout | Returns |
378
+ | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
379
+ | `receiver.exportsSecret(value)` | Whether the value occurs in any received export body. It searches raw bytes and decoded JSON keys and values, including escaped strings and fields outside the decoded spans. Transport headers are excluded. |
380
+ | `receiver.queries()` | SQL text from `db.query.text` or the older `db.statement` attribute, in received span order. Repeated queries remain repeated. |
381
+ | `receiver.errors()` | Exception events as `{ operation, message, type }`, where operation is the span name and type is the optional exception type. A failed span without an exception event contributes its status message (or span name), with no type. Status and exception representations of the same failure produce one entry. |
382
+
383
+ The receiver accepts OTLP/HTTP JSON and protobuf. `spans` flattens all exports into decoded trace and span IDs, parent span IDs, names, numeric OTLP kinds and status codes, attributes, events and links. Attributes retain OTLP key/value objects, including lossless decimal strings for integers; each span also has `resourceAttributes`. `requests` retains every request's unmodified `body` Buffer, parsed `headers`, original `rawHeaders` pairs and `path`. Optional `path`, `status` (a number or attempt callback) and `answer` configure collector responses for failure stories.
319
384
 
320
385
  For timeout stories, return `undefined` from the `status` callback to accept an export without sending response headers. Set `answer: null` to send headers without completing the response body.
321
386
 
@@ -351,7 +416,7 @@ yield* paused.release;
351
416
  const user = yield* Fiber.join(pending);
352
417
  ```
353
418
 
354
- `application.loadUser` is the application's real client call. `scriptFault` affects the next authorized matching request to that named route, then the route answers normally. `hold` pauses that route until `release`; `waiting` completes when a request reaches the hold, so a story needs no polling to know when to release it. Other routes still answer. Use a live-clock kit for HTTP stories that need real-time waits; a TestClock kit can still drive the real HTTP client while controlling the fake’s reply time.
419
+ `application.loadUser` is the application's real client call. `scriptFault` affects the next authorized matching request to that named route, then the route answers normally. `hold` pauses delivery until `release`; the route's reply handler runs when the request arrives, so a held reply sees the request and state at arrival. `waiting` completes when the first request reaches the hold. For several arrivals, observe `received` as described under [waiting for a signal](#waiting-for-a-signal). Other routes still answer. Use a live-clock kit for HTTP stories that need real-time waits; a TestClock kit can still drive the real HTTP client while controlling the fake’s reply time.
355
420
 
356
421
  Use the controls through kit verbs after acquiring the service. `scriptFault(route, { kind: "status", reply })` scripts the next authorized reply, including raw bytes or `chunks`, a synchronous or asynchronous iterable of strings and byte arrays. Set `headers["content-type"]` to the story's media type; the default is JSON. Chunks are written in iteration order as they become available, so an async iterable can wait between pieces.
357
422
 
@@ -378,7 +443,7 @@ const bytes = yield* Fiber.join(pending);
378
443
 
379
444
  Use `scriptFault(route, fault, options)` to install a fault for future authorized matching requests. It returns a control with a narrated `lift` effect. The default strikes once before the route's reply runs; `{ repeat: true }` keeps it installed until lifted. Status faults can repeat too.
380
445
 
381
- A status fault’s `reply` can be a fixed `FakeHttpReply` or a function `(request, now) => FakeHttpReply`. The fake evaluates the function when it answers, using the request being answered (including a held request for `fault`) and milliseconds from the Effect `Clock` captured when the service was created. A repeating fault rebuilds its reply for every request. TestClock stories therefore get deterministic refusal times:
446
+ A status fault’s `reply` can be a fixed `FakeHttpReply` or a function `(request, now) => FakeHttpReply`. A scripted function runs at arrival, before any hold, using the arriving request and milliseconds from the Effect `Clock` captured when the service was created. A repeating fault rebuilds its reply for every request. An immediate `fault` evaluates its function when injected, using the waiting request and the clock at injection. TestClock stories therefore get deterministic refusal times:
382
447
 
383
448
  ```ts
384
449
  yield* api.scriptFault("user", {
@@ -462,7 +527,7 @@ The bakery when the test failed:
462
527
  {"bowls":1,"capacity":3,"dough":0,"flour":0,"loaves":0,"minute":0,"orders":[],"ovenLit":true,"overfired":false,
463
528
  "smoking":false,"starter":false}
464
529
 
465
- Rerun: vitest run src/test-support/failingStories.ts -t "Bakery Story: marks the trait that refused"
530
+ Rerun: vitest run 'src/test-support/failingStories.ts' -t 'Bakery Story: marks the trait that refused'
466
531
  ```
467
532
 
468
533
  The first line names the trait and what it threw, which the error also keeps as its `cause`, and the `help:` line says what to change. The `✗` marks the trait that refused, and the line under it points at the spec line that named it. A trait that fails with a string, a plain object or a tagged error prints by its content, never as `[object Object]`, and an interrupted trait stays interrupted.
@@ -677,7 +742,34 @@ const completed = yield* receiver.untilSpan(
677
742
  );
678
743
  ```
679
744
 
680
- `fakeHttpService` offers `untilAbandoned(matches, options)`. It returns the request record when the connection closes before its response finishes, including a held request or a stalled response body. Completed responses do not emit this signal. An unfinished connection closed by a scripted fault also qualifies; the signal observes the connection, not who closed it.
745
+ `fakeHttpService` exposes two Effect streams of `FakeHttpRequestRecord`: `received` emits once the request body is read and path parameters are decoded, before guards and holds; `completed` emits when the server finishes writing the response, including its body. Receipt includes guard rejections, unmatched routes and malformed path parameters. A held request has arrived without completing; a stalled body has sent headers without completing. Each record's `status` reflects its current state, just like `requests`.
746
+
747
+ ```ts
748
+ const arrived = yield* until(
749
+ service.received,
750
+ (request) => request.path === "/orders/42",
751
+ { name: "order request received" },
752
+ );
753
+ const completed = yield* until(
754
+ service.completed,
755
+ (request) => request.path === "/orders/42",
756
+ { name: "order response completed" },
757
+ );
758
+ ```
759
+
760
+ Import `until` and `collectUntil` from `@shivaedev/test-story/server/until.ts`. To wait for several new arrivals to the same path, drop the already recorded requests before filtering and collecting. Capture this stream before starting the requests:
761
+
762
+ ```ts
763
+ const arrivals = service.received.pipe(
764
+ Stream.drop(service.requests.length),
765
+ Stream.filter((request) => request.path === "/orders/42"),
766
+ );
767
+ yield* collectUntil(arrivals, (requests) => requests.length === 3, { name: "three order requests received" });
768
+ ```
769
+
770
+ Both streams replay observations from acquisition to each subscriber independently. A wait can therefore start before or after arrival or completion; observing one request does not consume another observer's signal. Use different predicates to wait for individual requests, or drop earlier observations as above when requests share a path. These waits use `until`'s live-time deadline and `SignalNotReceived` diagnostics.
771
+
772
+ `untilAbandoned(matches, options)` returns the request record when the connection closes before its response finishes, including a held request or a stalled response body. Completed responses do not emit this signal, and abandoned responses do not emit `completed`. An unfinished connection closed by a scripted fault also qualifies; the signal observes the connection, not who closed it.
681
773
 
682
774
  ```ts
683
775
  const abandoned = yield* service.untilAbandoned(
@@ -694,7 +786,7 @@ After the engine has been created, a failing story test adds the story to its fi
694
786
  - a short guide to reading the story, in a box;
695
787
  - every line in order, traits marked `given`;
696
788
  - `✗` after the last line, on the trait that refused, or alone when the test failed before the story told a line, and under it the spec line where the test stopped or that named the refusing trait;
697
- - the engine's state from `inspect` as JSON, broken between its fields to fit 120 columns. State longer than 2,000 characters is written to `node_modules/.cache/test-story/` under the working directory, and the failure names the file;
789
+ - the engine's state from `inspect` as JSON, broken between its fields to fit 120 columns. State longer than 2,000 characters is written to `node_modules/.cache/test-story/` under the working directory, and the failure names the file. If writing fails, the report keeps the story and shows the filesystem error;
698
790
  - the command that reruns the test, with `-t` on a second line when one line would pass 120 columns.
699
791
 
700
792
  The package wraps between words or JSON fields toward 120 columns and prints the story's own lines whole. An indivisible word, field or rerun command component can exceed that width. A passing test adds nothing. A typed failure with no message, such as an `after` hook's `NoBowls`, prints by its tag.
@@ -804,7 +896,7 @@ socialApp.it("a social sign-in returns with a cookie session", [], function* ({
804
896
 
805
897
  #### Several members on one host
806
898
 
807
- Use `memberScreens` from `@shivaedev/test-story/server/memberScreens.ts` inside a DOM kit's `create` hook. Supply `baseUrl`, `mount(member)` returning an Effect, and `verbs(member, tell)` returning that member's verbs and readouts. Each `MemberScreen` carries its `name`, `fetch`, `registry` and `root`. Mount the application into that root with that registry, and give its auth and HTTP clients the member's fetch. Cookie contexts are independent even when every member uses the same host.
899
+ Use `memberScreens` from `@shivaedev/test-story/server/memberScreens.ts` inside a DOM kit's `create` hook. Supply `baseUrl`, `mount(member)` returning an Effect, and `verbs(member, tell)` returning that member's verbs and readouts. Each `MemberScreen` carries its `name`, `fetch`, `registry` and `root`. Mount the application into that root with that registry, and give its auth and HTTP clients the member's fetch. Cookie contexts are independent even when every member uses the same host. Each member's screen driver finds dialogs inside that member's root and body portals linked by an element in that root through `aria-controls`. Give body portals unique IDs and point each member's trigger at its own dialog. Unlinked body dialogs remain outside member screens; standalone drivers can find document-wide portals.
808
900
 
809
901
  A trait calls `yield* members.open("ada", cookies)` with a minted session's cookies. The kit's verbs hook returns `members.verbs(story.tell)`, exposing `as("ada")` to the spec. Member narration includes the name. The calling Scope closes every cookie context, disposes every registry and removes every root. Register renderer unmounting in the mount hook with `Effect.acquireRelease` so it runs before the registry and root are released.
810
902
 
@@ -871,14 +963,20 @@ yield* screen.settle();
871
963
  expect(screen.text("output")).toBe("Saved title");
872
964
  ```
873
965
 
874
- This form of `settle()` observes client activity changes and flushes the renderer before returning. Finite RPC calls, coalesced invalidations and refreshing query atoms all keep it waiting; subscription streams themselves do not. `find()` waits for idle client activity and a matching target, including a target rendered by a later DOM mutation. Keep live coalescing enabled. `nextLiveHint()` waits for the next subscription update received after the verb starts, including initial or resync updates; it does not wait for a refresh. Start the wait before another viewer writes, then settle before reading the resulting screen. It needs client activity; a callback-only driver fails with `MissingClientActivity`.
966
+ This form of `settle()` observes client activity changes and flushes the renderer before returning. Finite RPC calls, coalesced invalidations and refreshing query atoms all keep it waiting; subscription streams themselves do not. `find()` waits for idle client activity and a matching target, including a target rendered by a later DOM mutation. Keep live coalescing enabled. `nextLiveHint()` waits for the next subscription update received after the verb starts, including initial or resync updates; it does not wait for a refresh. Start the wait before another viewer writes, then settle before reading the resulting screen. If the client activity stream ends without a new hint, the wait fails with `SignalNotReceived` from `server/until.ts`. It needs client activity; a callback-only driver fails with `MissingClientActivity`.
875
967
 
876
- `click(selector)`, `enter(selector, value)`, `select(selector, value)` and `submit(selector = "form")` return Effects. Selectors identify exactly one descendant of the root or a dialog portalled into its document; missing or ambiguous controls fail. Hidden targets and targets inside hidden ancestors refuse actions and readouts. Text entry focuses an input or textarea and dispatches input and change events. Select focuses a native `<select>`, sets an available option value and dispatches change inside `act`. Disabled controls refuse clicks, entry and selection, inert ancestors also prevent form submission, and read-only fields refuse entry. Actions do not wait for settlement, so a story can release a held request before calling `settle()`.
968
+ `click(selector)`, `enter(selector, value)`, `select(selector, value)` and `submit(selector = "form")` return Effects. Selectors identify exactly one descendant of the root or a dialog portalled into its document (owned by that member for `memberScreens`); missing or ambiguous controls fail. Hidden targets and targets inside hidden ancestors refuse actions and readouts. Text entry focuses an input or textarea and dispatches input and change events. Select focuses a native `<select>`, sets an available option value and dispatches change inside `act`. Disabled controls refuse clicks, entry and selection, inert ancestors also prevent form submission, and read-only fields refuse entry. Actions do not wait for settlement, so a story can release a held request before calling `settle()`.
877
969
 
878
970
  `within(container)` returns the same driver scoped to that container, including nested `within` calls. Pass a selector, a role/name target or an `HTMLElement`. Selector and role containers must resolve to one rendered descendant and use the usual missing or ambiguous target diagnostics. For example, `within({ role: "region", name: "Billing" }).click({ role: "button", name: "Save" })` can address a Save button when Delivery has an identical button. A scoped driver searches only that container, including when the container is a portalled dialog. Settlement keeps the original pending signal and error type.
879
971
 
972
+ `dialog(target)` searches under `body` for exactly one visible native dialog, `role="dialog"` or `role="alertdialog"` matching a selector or role/name target, then returns a driver scoped to it. It keeps the original driver’s member ownership, renderer and pending signal, including through nested scopes. For example, `screen.dialog({ role: "dialog", name: "Preferences" }).click({ role: "button", name: "Confirm" })` acts only inside that screen's Preferences dialog, even when another member has an identically named body portal. The member's trigger must link a body portal through `aria-controls`.
973
+
880
974
  `text(selector?)` reads visible HTML text from the selected element or the whole root. Block boundaries (using CSS display) and `<br>` separate adjacent text with a newline when there is no existing whitespace; inline text, including emphasis, stays joined. A card's title, message and action read as separate parts. Text transforms and layout wrapping are not applied. `value(selector)` returns the current input or textarea value. Both narrate what they read through `tell` and leave assertions to the spec. Entry narration omits the supplied value.
881
975
 
976
+ `labelledText(label)` reads visible text from one element named by `aria-label`, `aria-labelledby` or a native form label. It accepts an exact string or a regular expression and fails for missing, hidden or ambiguous readouts. For example, `labelledText("Summary")` reads a labelled region without needing its role or CSS selector.
977
+
978
+ `table(label)` finds a native HTML table by its accessible name, including a heading referenced through `aria-labelledby`, and returns an array of rows, each an array of visible cell text. Header and body rows retain DOM order; hidden rows, cells and nested hidden text are excluded. For example, `table("Ready deliveries")` returns `[["City", "Status"], ["London", "Ready"], ["Paris", "In transit"]]`. Strings match exactly and regular expressions match the table's name. These readouts narrate their results through `tell` and leave assertions to the spec.
979
+
882
980
  `click`, `enter`, `select`, `submit`, `text` and `value` also accept a `ScreenTarget` object such as `{ role: "button", name: "Save" }` or `{ role: "textbox", name: /email/i }`. The role and computed accessible name must match exactly when strings are used; regular expressions match the name. An alert without an accessible name can instead match its visible text. Like Testing Library's role queries, these targets exclude hidden elements, including `aria-hidden` ancestors. Missing or ambiguous targets fail with the requested role, name and the visible candidates on screen. Narration names the role and name instead of a selector.
883
981
 
884
982
  `find(target, { timeout }?)` returns an Effect that waits for exactly one matching rendered element and returns that `HTMLElement`. It accepts the same selectors and role/name targets as the actions and narrates the lookup. Its normal live-time budget is 3 seconds, configurable with the driver's `timeoutMs`. While the screen shows a rendered, accessible loading indicator (`role="status"`, `aria-busy="true"`, `Loading…` or `Loading...` text) or an open dialog, the default wait extends to a total of 10 seconds, configurable with `loadingTimeoutMs`. This lets screen transitions take longer on loaded runners. The root and portalled dialogs count; `within` keeps loading detection inside its scope. Once the normal budget has passed, an idle screen without the target fails immediately with the usual target diagnostics, including visible candidates for role/name targets. A per-call `timeout` sets a hard deadline in milliseconds, including while loading.
@@ -908,7 +1006,7 @@ const client = makeClient(Notes, { protocol: observed.protocol, url });
908
1006
 
909
1007
  Expose `observed.readCount`, `observed.reads`, `observed.hints` and `observed.watchHints` through the kit's verbs. `readCount()` counts query requests and `$changes` subscription openings; `readCount("notes.list")` selects one tag. `reads()` returns their `tag`, encoded `payload` and `kind` (`"query"` or `"subscription"`), in send order. Commands and protocol acknowledgements do not count. `hints()` returns the `LiveHint` values received for those subscriptions, including `Resync`.
910
1008
 
911
- `observed.subscriptions()` returns each opening's `tag`, encoded `payload` and `state`: `"open"`, `"answered"` after its first streamed value, or `"refused"` with `refusalTag` from its failure Exit. A refusal is not a hint. Expose `observed.waitForSubscriptions` through the kit and `yield* waitForSubscriptions` after the page has opened its subscriptions. It waits on response signals until every opening has answered or been refused. It has no polling budget and resolves immediately when no opening is pending. It does not wait for future navigation to open subscriptions or for React to render.
1009
+ `observed.subscriptions()` returns each opening's `tag`, encoded `payload` and `state`: `"open"`, `"answered"` after its first streamed value, `"refused"` with `refusalTag` from a tagged failure Exit, or `"closed"` when the stream completes empty, dies or disconnects before answering. A refusal or closure is not a hint. Expose `observed.waitForSubscriptions` through the kit and `yield* waitForSubscriptions` after the page has opened its subscriptions. It waits on response signals until every opening has answered, been refused or closed. Closing a client also closes its unanswered openings and leaves other clients' openings pending. It has no polling budget and resolves immediately when no opening is pending. It does not wait for future navigation to open subscriptions or for React to render.
912
1010
 
913
1011
  A story calls `const hints = yield* watchHints()` before the write, then `yield* hints.next` to await its browser delivery. Each watcher buffers its own future deliveries until the calling Scope closes. The wait uses the transport's signal with no polling budget. A hint means the browser received it; wait on the application's query or screen signal separately before asserting its rendered result or refetch count. Give another page its own readout to keep its traffic separate.
914
1012
 
@@ -935,8 +1033,9 @@ Import each module with the prefix `@shivaedev/test-story/`; there is no root en
935
1033
  | `server/genreTags.ts` | `genreTags(...kitNames)`, `GenreTag` |
936
1034
  | `server/domEnvironment.config.ts` | Default Vitest environment preserving Node host globals and happy-dom document transport |
937
1035
  | `server/fakeHttpService.ts` | `fakeHttpService(options)`, `FakeHttpRoute`, `FakeHttpRequest`, `FakeHttpRequestRecord` (`status`: number, `"pending"` or `"unanswered"`), `FakeHttpReply`, `FakeHttpReplySource` (fixed or request/time function), `FakeHttpFault`, `FakeHttpHold`, `FakeHttpHoldOptions` (`params`, `once`), `FakeHttpScope`, `FakeHttpScriptOptions`, `FakeHttpScript`, `FakeHttpServiceOptions` |
1036
+ | `server/httpVisitor.ts` | `httpVisitor(upstream, options?)`, `HttpVisitorOptions`, `VisitorRequest` |
938
1037
  | `server/forwardingProxy.ts` | `forwardingProxy(upstream, options?)`, `ForwardingProxyOptions` |
939
- | `server/otlpReceiver.ts` | `otlpReceiver(options?)`, `OtlpSpan`, `OtlpExport`, `OtlpReceiverOptions` |
1038
+ | `server/otlpReceiver.ts` | `otlpReceiver(options?)`, `OtlpSpan`, `OtlpExport`, `OtlpReceiverOptions`, `OtlpTracerOptions` |
940
1039
 
941
1040
  ### Install and limits
942
1041
 
@@ -948,8 +1047,8 @@ pnpm add --save-dev @shivaedev/test-story @effect/platform-node @effect/vitest e
948
1047
 
949
1048
  Test-story is an application's one test dependency: it brings [`@shivaedev/test`](https://github.com/ShivaeDev/platform/tree/main/packages/test#readme) and [`@shivaedev/test-sql`](https://github.com/ShivaeDev/platform/tree/main/packages/test-sql#readme), which an application on `@shivaedev/platform` imports by their own names without listing them. `@effect/sql-pg` is an optional peer for `test-sql`'s PostgreSQL helpers; install it when the stories use them. A library that tests with test-story still declares `test` or `test-sql` directly when it imports them.
950
1049
  - The package runs inside Vitest. The story reaches the failure by rewriting the first error's message in Vitest's `onTestFailed` hook.
951
- - Layer acquisition and engine creation failures precede that hook and carry no story appendix. A printed rerun command still needs a Vitest configuration that collects its file.
1050
+ - Engine creation failures name the kit and the create phase and include a rerun command. Layer acquisition failures precede the story and carry no story appendix. A printed rerun command still needs a Vitest configuration that collects its file.
952
1051
  - A kit's `it` is created when the kit is defined, so a kit lives in a module that only Vitest test files import.
953
- - `inspect` runs when the story fails, before its Scope closes. Plain functions, generators and functions returning an Effect are supported.
1052
+ - `inspect` runs when the story fails, before its Scope closes. If only cleanup fails, it runs after cleanup with the kit's services. Plain functions, generators and functions returning an Effect are supported.
954
1053
  - The spec line under the `✗` is found by matching the spec's path in the failure's stack, or else in the call site of the last line the story told or the last `runUntil`. A failure raised inside an Effect that the spec does not call directly may have none.
955
1054
  - The package is built for ShivaeDev applications and may change without a deprecation period.
@@ -0,0 +1,7 @@
1
+ export declare function reactRendering(): Promise<[
2
+ typeof import("@effect/atom-react"),
3
+ typeof import("effect/reactivity/AtomRegistry"),
4
+ typeof import("react-dom/client"),
5
+ typeof import("react")
6
+ ]>;
7
+ //# sourceMappingURL=reactRendering.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactRendering.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/reactRendering.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,IAAI,OAAO,CACxC;IAAC,cAAc,oBAAoB,CAAC;IAAE,cAAc,gCAAgC,CAAC;IAAE,cAAc,kBAAkB,CAAC;IAAE,cAAc,OAAO,CAAC;CAAC,CACjJ,CAEA"}
@@ -0,0 +1,4 @@
1
+ export function reactRendering() {
2
+ return Promise.all([import("@effect/atom-react"), import("effect/reactivity/AtomRegistry"), import("react-dom/client"), import("react")]);
3
+ }
4
+ //# sourceMappingURL=reactRendering.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactRendering.js","sourceRoot":"","sources":["../../../src/client/adapters/reactRendering.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc;IAG7B,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC,gCAAgC,CAAC,EAAE,MAAM,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3I,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function waitForReact(): Promise<void>;
2
+ //# sourceMappingURL=waitForReact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForReact.d.ts","sourceRoot":"","sources":["../../../src/client/adapters/waitForReact.ts"],"names":[],"mappings":"AAAA,wBAAsB,YAAY,kBAMjC"}
@@ -0,0 +1,8 @@
1
+ export async function waitForReact() {
2
+ const { act } = await import("react");
3
+ // Responses and React updates must settle together inside act.
4
+ await act(async () => {
5
+ await new Promise((resolve) => setTimeout(resolve, 10));
6
+ });
7
+ }
8
+ //# sourceMappingURL=waitForReact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"waitForReact.js","sourceRoot":"","sources":["../../../src/client/adapters/waitForReact.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,KAAK,UAAU,YAAY;IACjC,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC;IACtC,+DAA+D;IAC/D,MAAM,GAAG,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC/D,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -1,7 +1,8 @@
1
- import { Effect, Scope } from "effect";
2
- import * as AtomRegistry from "effect/reactivity/AtomRegistry";
3
- import { type ReactNode } from "react";
4
- import { type RootOptions } from "react-dom/client";
1
+ import * as Effect from "effect/Effect";
2
+ import type * as AtomRegistry from "effect/reactivity/AtomRegistry";
3
+ import * as Scope from "effect/Scope";
4
+ import type { ReactNode } from "react";
5
+ import type { RootOptions } from "react-dom/client";
5
6
  type CaughtErrorHandler = NonNullable<RootOptions["onCaughtError"]>;
6
7
  export interface ReactWarningsReadout {
7
8
  readonly caughtErrors: readonly unknown[];
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../src/client/react.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,MAAM,EAAQ,KAAK,EAAE,MAAM,QAAQ,CAAC;AACpD,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAKhE,KAAK,kBAAkB,GAAG,WAAW,CAAC,WAAW,C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C,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CA6BtF"}
@@ -1,11 +1,12 @@
1
- import { RegistryContext } from "@effect/atom-react";
2
- import { Clock, Effect, Exit, Scope } from "effect";
3
- import * as AtomRegistry from "effect/reactivity/AtomRegistry";
4
- import { act, createElement } from "react";
5
- import { createRoot } from "react-dom/client";
1
+ import * as Clock from "effect/Clock";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Exit from "effect/Exit";
4
+ import * as Scope from "effect/Scope";
6
5
  import { beforeEach, expect, vi } from "vitest";
7
6
  import { eventually as retry } from "@shivaedev/test/eventually.ts";
8
7
  import { withLive } from "@shivaedev/test/withLive.ts";
8
+ import { reactRendering } from "#client/adapters/reactRendering.ts";
9
+ import { waitForReact } from "#client/adapters/waitForReact.ts";
9
10
  const acquireReactWarnings = Effect.acquireRelease(Effect.sync(() => {
10
11
  const errors = vi.spyOn(console, "error").mockImplementation(() => undefined);
11
12
  let consoleErrors;
@@ -64,10 +65,7 @@ export function eventually(assert) {
64
65
  const started = yield* Clock.currentTimeMillis;
65
66
  return yield* retry(Effect.try({ catch: (error) => error, try: assert }), {
66
67
  timeout: "3 seconds",
67
- // Responses and React updates must settle together inside act.
68
- wait: Effect.promise(() => act(async () => {
69
- await new Promise((resolve) => setTimeout(resolve, 10));
70
- })),
68
+ wait: Effect.promise(waitForReact),
71
69
  }).pipe(Effect.catch((error) => Effect.gen(function* () {
72
70
  const elapsed = (yield* Clock.currentTimeMillis) - started;
73
71
  return yield* Effect.fail(new Error(`Assertion did not pass after ${elapsed}ms: ${error instanceof Error ? error.message : String(error)}`, { cause: error }));
@@ -75,7 +73,8 @@ export function eventually(assert) {
75
73
  }));
76
74
  }
77
75
  export async function render(node, options) {
78
- const registry = AtomRegistry.make();
76
+ const [{ RegistryContext }, registryModule, { createRoot }, { act, createElement }] = await reactRendering();
77
+ const registry = registryModule.make();
79
78
  const container = document.createElement("div");
80
79
  document.body.append(container);
81
80
  const root = createRoot(container, options);
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 -3,11 +3,20 @@ import { unrouted } from "#internal/errors.ts";
3
3
  function isDispatcher(value) {
4
4
  return typeof value === "object" && value !== null && "dispatch" in value && typeof value.dispatch === "function";
5
5
  }
6
- export async function installOutbound(routes, strict = true) {
7
- const origins = new Map(Object.entries(routes).map(([hostname, target]) => [hostname, new URL(target).origin]));
8
- let refused;
9
- // A data URL initializes Node's bundled Undici without sending an HTTP request.
10
- await fetch("data:,");
6
+ const registrations = new Set();
7
+ let restoreDispatchers;
8
+ function routingFor(hostname) {
9
+ let target;
10
+ let strict;
11
+ for (const registration of registrations) {
12
+ target = registration.origins.get(hostname) ?? target;
13
+ if (registration.strict) {
14
+ strict = registration;
15
+ }
16
+ }
17
+ return { strict, target };
18
+ }
19
+ function installDispatchers() {
11
20
  const slots = ["undici.globalDispatcher.1", "undici.globalDispatcher.2"].flatMap((name) => {
12
21
  const key = Symbol.for(name);
13
22
  const previous = Reflect.get(globalThis, key);
@@ -26,13 +35,13 @@ export async function installOutbound(routes, strict = true) {
26
35
  const router = {
27
36
  dispatch(options, handler) {
28
37
  const hostname = new URL(options.origin).hostname;
29
- const target = origins.get(hostname);
30
- if (strict
38
+ const { strict, target } = routingFor(hostname);
39
+ if (strict !== undefined
31
40
  && target === undefined
32
41
  && !["localhost", "[::1]"].includes(hostname)
33
42
  && !(isIP(hostname) === 4 && hostname.startsWith("127."))) {
34
- refused = unrouted(hostname);
35
- throw refused;
43
+ strict.refused = unrouted(hostname);
44
+ throw strict.refused;
36
45
  }
37
46
  return previous.dispatch(target === undefined ? options : { ...options, origin: target }, handler);
38
47
  },
@@ -44,10 +53,27 @@ export async function installOutbound(routes, strict = true) {
44
53
  restore();
45
54
  throw error;
46
55
  }
56
+ return restore;
57
+ }
58
+ export async function installOutbound(routes, strict = true) {
59
+ const registration = {
60
+ origins: new Map(Object.entries(routes).map(([hostname, target]) => [hostname, new URL(target).origin])),
61
+ strict,
62
+ };
63
+ // A data URL initializes Node's bundled Undici without sending an HTTP request.
64
+ await fetch("data:,");
65
+ if (restoreDispatchers === undefined) {
66
+ restoreDispatchers = installDispatchers();
67
+ }
68
+ registrations.add(registration);
47
69
  return () => {
48
- restore();
49
- if (refused !== undefined) {
50
- throw refused;
70
+ registrations.delete(registration);
71
+ if (registrations.size === 0) {
72
+ restoreDispatchers?.();
73
+ restoreDispatchers = undefined;
74
+ }
75
+ if (registration.refused !== undefined) {
76
+ throw registration.refused;
51
77
  }
52
78
  };
53
79
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"installOutbound.js","sourceRoot":"","sources":["../../../src/server/adapters/installOutbound.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAU/C,SAAS,YAAY,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,UAAU,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,QAAQ,KAAK,UAAU,CAAC;AACnH,CAAC;AAQD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAgB,CAAC;AAC9C,IAAI,kBAA4C,CAAC;AAEjD,SAAS,UAAU,CAAC,QAAgB;IACnC,IAAI,MAA0B,CAAC;IAC/B,IAAI,MAAgC,CAAC;IACrC,KAAK,MAAM,YAAY,IAAI,aAAa,EAAE,CAAC;QAC1C,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC;QACtD,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;YACzB,MAAM,GAAG,YAAY,CAAC;QACvB,CAAC;IACF,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,kBAAkB;IAC1B,MAAM,KAAK,GAAG,CAAC,2BAA2B,EAAE,2BAA2B,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;Q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AAkB,GAAG,SAAS,CAAC;QAChC,CAAC;QACD,IAAI,YAAY,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACxC,MAAM,YAAY,CAAC,OAAO,CAAC;QAC5B,CAAC;IACF,CAAC,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { IncomingMessage, ServerResponse } from "node:http";
2
+ import type { OtlpExport, OtlpReceiverOptions, OtlpSpan } from "#otlpReceiver.ts";
3
+ export declare function receiveOtlp(request: IncomingMessage, response: ServerResponse, requests: OtlpExport[], record: (span: OtlpSpan) => void, options: OtlpReceiverOptions): Promise<void>;
4
+ //# sourceMappingURL=receiveOtlp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receiveOtlp.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/receiveOtlp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAElF,wBAAsB,WAAW,CAChC,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,UAAU,EAAE,EACtB,MAAM,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,EAChC,OAAO,EAAE,mBAAmB,iBAmC5B"}