@dialecte/core 0.8.1 → 0.10.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 (304) hide show
  1. package/dist/assets/hub.worker-35vzG0HK.js +2 -0
  2. package/dist/dialecte/create-dialecte-project.d.ts +1 -2
  3. package/dist/dialecte/create-dialecte-project.d.ts.map +1 -1
  4. package/dist/dialecte/create-project-factory.d.ts +5 -5
  5. package/dist/dialecte/create-project-factory.d.ts.map +1 -1
  6. package/dist/dialecte/define-dialecte.d.ts +2 -2
  7. package/dist/dialecte/dialecte.types.d.ts +11 -23
  8. package/dist/dialecte/dialecte.types.d.ts.map +1 -1
  9. package/dist/{dialecte-gIPrRzni.js → dialecte-CVLWSkgW.js} +1726 -1673
  10. package/dist/document/document.d.ts +1 -1
  11. package/dist/document/query/get/record/get-record.d.ts +14 -1
  12. package/dist/document/query/get/record/get-record.d.ts.map +1 -1
  13. package/dist/document/query/get/record/get-records.d.ts +12 -2
  14. package/dist/document/query/get/record/get-records.d.ts.map +1 -1
  15. package/dist/{engine-store-CIEqgPUb.js → engine-store-Deo9XNhr.js} +21 -21
  16. package/dist/engine.constants-Bi4gw6BR.js +205 -0
  17. package/dist/errors/{codes.d.ts → codes.constants.d.ts} +33 -105
  18. package/dist/errors/{codes.d.ts.map → codes.constants.d.ts.map} +1 -1
  19. package/dist/errors/core-codes.constants.d.ts +3 -0
  20. package/dist/errors/core-codes.constants.d.ts.map +1 -0
  21. package/dist/errors/errors.constants.d.ts +5 -0
  22. package/dist/errors/errors.constants.d.ts.map +1 -1
  23. package/dist/errors/errors.d.ts.map +1 -1
  24. package/dist/errors/index.d.ts +1 -1
  25. package/dist/errors/index.d.ts.map +1 -1
  26. package/dist/errors/types.d.ts +1 -1
  27. package/dist/errors/types.d.ts.map +1 -1
  28. package/dist/{helpers-DVShv41E.js → helpers-D8p0KiJu.js} +1 -1
  29. package/dist/helpers.js +2 -2
  30. package/dist/{in-process-link-DBeAOZRp.js → in-process-link-B-TCHrlb.js} +996 -993
  31. package/dist/index.js +8 -7
  32. package/dist/project/index.d.ts +1 -1
  33. package/dist/project/index.d.ts.map +1 -1
  34. package/dist/project/io/store-runtime.types.d.ts +1 -3
  35. package/dist/project/io/store-runtime.types.d.ts.map +1 -1
  36. package/dist/project/project.d.ts +13 -15
  37. package/dist/project/project.d.ts.map +1 -1
  38. package/dist/project/types.d.ts +24 -19
  39. package/dist/project/types.d.ts.map +1 -1
  40. package/dist/{project-key-Ch34EtFa.js → project-key-2ccZ-0gu.js} +195 -205
  41. package/dist/running-operations-DCKvzlU7.js +107 -0
  42. package/dist/{same-json-value-C6kUaoyt.js → same-json-value-_AChwM_n.js} +41 -41
  43. package/dist/sqlite-engine.d.ts +7 -0
  44. package/dist/sqlite-engine.d.ts.map +1 -0
  45. package/dist/{engine.js → sqlite-engine.js} +4144 -4079
  46. package/dist/sqlite.d.ts +27 -2
  47. package/dist/sqlite.d.ts.map +1 -1
  48. package/dist/sqlite.js +1118 -917
  49. package/dist/store/in-memory/in-memory-state.constants.d.ts +14 -0
  50. package/dist/store/in-memory/in-memory-state.constants.d.ts.map +1 -0
  51. package/dist/store/in-memory/in-memory-state.d.ts +0 -4
  52. package/dist/store/in-memory/in-memory-state.d.ts.map +1 -1
  53. package/dist/store/in-memory/in-memory-store.d.ts.map +1 -1
  54. package/dist/store/in-memory/types.d.ts +1 -2
  55. package/dist/store/in-memory/types.d.ts.map +1 -1
  56. package/dist/store/index.d.ts +2 -1
  57. package/dist/store/index.d.ts.map +1 -1
  58. package/dist/store/lost-write.d.ts +8 -8
  59. package/dist/store/lost-write.d.ts.map +1 -1
  60. package/dist/store/lost-write.types.d.ts +1 -1
  61. package/dist/store/lost-write.types.d.ts.map +1 -1
  62. package/dist/store/{engine/project-key.d.ts → project-key.d.ts} +0 -5
  63. package/dist/store/project-key.d.ts.map +1 -0
  64. package/dist/store/resolve-store.d.ts +6 -18
  65. package/dist/store/resolve-store.d.ts.map +1 -1
  66. package/dist/store/sqlite/adapter/in-process-link.constants.d.ts +12 -0
  67. package/dist/store/sqlite/adapter/in-process-link.constants.d.ts.map +1 -0
  68. package/dist/store/sqlite/adapter/in-process-link.d.ts +1 -1
  69. package/dist/store/sqlite/adapter/in-process-link.d.ts.map +1 -1
  70. package/dist/store/sqlite/adapter/sqlite-connector.d.ts +12 -11
  71. package/dist/store/sqlite/adapter/sqlite-connector.d.ts.map +1 -1
  72. package/dist/store/sqlite/adapter/sqlite-connector.types.d.ts +7 -0
  73. package/dist/store/sqlite/adapter/sqlite-connector.types.d.ts.map +1 -0
  74. package/dist/store/sqlite/adapter/sqlite-hub-spawner.d.ts +8 -3
  75. package/dist/store/sqlite/adapter/sqlite-hub-spawner.d.ts.map +1 -1
  76. package/dist/store/sqlite/adapter/sqlite-hub-spawner.types.d.ts +12 -1
  77. package/dist/store/sqlite/adapter/sqlite-hub-spawner.types.d.ts.map +1 -1
  78. package/dist/store/sqlite/adapter/sqlite-worker-connector.d.ts +2 -2
  79. package/dist/store/sqlite/adapter/sqlite-worker-connector.d.ts.map +1 -1
  80. package/dist/store/sqlite/adapter/sqlite-worker-connector.types.d.ts +1 -1
  81. package/dist/store/sqlite/adapter/sqlite-worker-connector.types.d.ts.map +1 -1
  82. package/dist/store/sqlite/engine/engine.types.d.ts +2 -2
  83. package/dist/store/sqlite/engine/engine.types.d.ts.map +1 -1
  84. package/dist/store/sqlite/engine/schema.d.ts.map +1 -1
  85. package/dist/store/sqlite/engine/sqlite-engine.d.ts.map +1 -1
  86. package/dist/store/{hub-public.d.ts → sqlite/hub-public.d.ts} +9 -9
  87. package/dist/store/sqlite/hub-public.d.ts.map +1 -0
  88. package/dist/store/sqlite/packaging/engine-packaging.constants.d.ts +15 -0
  89. package/dist/store/sqlite/packaging/engine-packaging.constants.d.ts.map +1 -0
  90. package/dist/store/sqlite/runtime/close-engine.d.ts +5 -2
  91. package/dist/store/sqlite/runtime/close-engine.d.ts.map +1 -1
  92. package/dist/store/sqlite/runtime/engine-control-loop.d.ts +11 -0
  93. package/dist/store/sqlite/runtime/engine-control-loop.d.ts.map +1 -0
  94. package/dist/store/sqlite/runtime/install-pool.d.ts +1 -1
  95. package/dist/store/sqlite/runtime/install-pool.d.ts.map +1 -1
  96. package/dist/store/sqlite/runtime/progress-beat.d.ts +1 -1
  97. package/dist/store/sqlite/runtime/progress-beat.d.ts.map +1 -1
  98. package/dist/store/sqlite/runtime/runtime.types.d.ts +7 -4
  99. package/dist/store/sqlite/runtime/runtime.types.d.ts.map +1 -1
  100. package/dist/store/sqlite/runtime/serve-sqlite-engine.d.ts +9 -0
  101. package/dist/store/sqlite/runtime/serve-sqlite-engine.d.ts.map +1 -0
  102. package/dist/store/sqlite/runtime/serve-sqlite-engine.types.d.ts +27 -0
  103. package/dist/store/sqlite/runtime/serve-sqlite-engine.types.d.ts.map +1 -0
  104. package/dist/store/sqlite/served/client/check-engine-wire.d.ts.map +1 -0
  105. package/dist/store/{engine → sqlite/served}/client/client.constants.d.ts +3 -3
  106. package/dist/store/sqlite/served/client/client.constants.d.ts.map +1 -0
  107. package/dist/store/{engine → sqlite/served}/client/client.types.d.ts +13 -8
  108. package/dist/store/sqlite/served/client/client.types.d.ts.map +1 -0
  109. package/dist/store/{engine → sqlite/served}/client/engine-client.d.ts +1 -1
  110. package/dist/store/sqlite/served/client/engine-client.d.ts.map +1 -0
  111. package/dist/store/sqlite/served/client/engine-control.d.ts.map +1 -0
  112. package/dist/store/sqlite/served/client/heartbeat-watch.d.ts.map +1 -0
  113. package/dist/store/{engine → sqlite/served}/client/hub-connector.d.ts +1 -1
  114. package/dist/store/sqlite/served/client/hub-connector.d.ts.map +1 -0
  115. package/dist/store/{engine → sqlite/served}/client/hub-connector.types.d.ts +6 -7
  116. package/dist/store/sqlite/served/client/hub-connector.types.d.ts.map +1 -0
  117. package/dist/store/sqlite/served/client/worker-connector.d.ts.map +1 -0
  118. package/dist/store/sqlite/served/creation-refusal.d.ts.map +1 -0
  119. package/dist/store/sqlite/served/dialecte-refusal.d.ts +19 -0
  120. package/dist/store/sqlite/served/dialecte-refusal.d.ts.map +1 -0
  121. package/dist/store/sqlite/served/engine-lock.d.ts +6 -0
  122. package/dist/store/sqlite/served/engine-lock.d.ts.map +1 -0
  123. package/dist/store/sqlite/served/engine-store.constants.d.ts +3 -0
  124. package/dist/store/sqlite/served/engine-store.constants.d.ts.map +1 -0
  125. package/dist/store/{engine → sqlite/served}/engine-store.d.ts +6 -6
  126. package/dist/store/sqlite/served/engine-store.d.ts.map +1 -0
  127. package/dist/store/sqlite/served/engine-store.types.d.ts.map +1 -0
  128. package/dist/store/sqlite/served/engine.constants.d.ts.map +1 -0
  129. package/dist/store/{engine → sqlite/served}/engine.types.d.ts +2 -4
  130. package/dist/store/sqlite/served/engine.types.d.ts.map +1 -0
  131. package/dist/store/sqlite/served/host/changed.d.ts +5 -0
  132. package/dist/store/sqlite/served/host/changed.d.ts.map +1 -0
  133. package/dist/store/sqlite/served/host/engine-wire.d.ts.map +1 -0
  134. package/dist/store/{engine → sqlite/served}/host/heartbeat.d.ts +1 -1
  135. package/dist/store/sqlite/served/host/heartbeat.d.ts.map +1 -0
  136. package/dist/store/sqlite/served/host/host.constants.d.ts.map +1 -0
  137. package/dist/store/{engine → sqlite/served}/host/host.types.d.ts +4 -3
  138. package/dist/store/sqlite/served/host/host.types.d.ts.map +1 -0
  139. package/dist/store/sqlite/served/host/store-events.constants.d.ts +9 -0
  140. package/dist/store/sqlite/served/host/store-events.constants.d.ts.map +1 -0
  141. package/dist/store/sqlite/served/host/store-events.d.ts.map +1 -0
  142. package/dist/store/sqlite/served/hub/hub-client.constants.d.ts.map +1 -0
  143. package/dist/store/sqlite/served/hub/hub-client.d.ts.map +1 -0
  144. package/dist/store/{engine → sqlite/served}/hub/hub-client.types.d.ts +2 -9
  145. package/dist/store/sqlite/served/hub/hub-client.types.d.ts.map +1 -0
  146. package/dist/store/sqlite/served/hub/hub-protocol.types.d.ts.map +1 -0
  147. package/dist/store/sqlite/served/hub/hub-router.d.ts.map +1 -0
  148. package/dist/store/sqlite/served/hub/hub-shell.d.ts.map +1 -0
  149. package/dist/store/sqlite/served/hub/hub-shell.types.d.ts.map +1 -0
  150. package/dist/store/{engine → sqlite/served}/hub/hub.constants.d.ts +3 -3
  151. package/dist/store/sqlite/served/hub/hub.constants.d.ts.map +1 -0
  152. package/dist/store/{engine → sqlite/served}/hub/hub.types.d.ts +2 -2
  153. package/dist/store/sqlite/served/hub/hub.types.d.ts.map +1 -0
  154. package/dist/store/sqlite/served/hub/hub.worker.d.ts.map +1 -0
  155. package/dist/store/sqlite/served/hub/realm-host.d.ts.map +1 -0
  156. package/dist/store/{engine → sqlite/served}/hub/realm-host.types.d.ts +3 -3
  157. package/dist/store/sqlite/served/hub/realm-host.types.d.ts.map +1 -0
  158. package/dist/store/sqlite/served/wire/error-envelope.d.ts.map +1 -0
  159. package/dist/store/sqlite/served/wire/wire-values.d.ts.map +1 -0
  160. package/dist/store/sqlite/served/wire/wire.constants.d.ts.map +1 -0
  161. package/dist/store/{engine → sqlite/served}/wire/wire.types.d.ts +1 -1
  162. package/dist/store/sqlite/served/wire/wire.types.d.ts.map +1 -0
  163. package/dist/store/sqlite/sqlite-connector-params.d.ts +13 -0
  164. package/dist/store/sqlite/sqlite-connector-params.d.ts.map +1 -0
  165. package/dist/store/sqlite/sqlite-engine-registration.d.ts +30 -0
  166. package/dist/store/sqlite/sqlite-engine-registration.d.ts.map +1 -0
  167. package/dist/store/sqlite/sqlite-error-entry.d.ts +10 -0
  168. package/dist/store/sqlite/sqlite-error-entry.d.ts.map +1 -0
  169. package/dist/store/sqlite/sqlite-errors.constants.d.ts +110 -0
  170. package/dist/store/sqlite/sqlite-errors.constants.d.ts.map +1 -0
  171. package/dist/store/sqlite/sqlite-errors.types.d.ts +7 -0
  172. package/dist/store/sqlite/sqlite-errors.types.d.ts.map +1 -0
  173. package/dist/store/sqlite/sqlite-storage-kind.constants.d.ts +10 -0
  174. package/dist/store/sqlite/sqlite-storage-kind.constants.d.ts.map +1 -0
  175. package/dist/store/sqlite/sqlite-storage-kind.d.ts +3 -0
  176. package/dist/store/sqlite/sqlite-storage-kind.d.ts.map +1 -0
  177. package/dist/store/sqlite/sqlite-storage.constants.d.ts +24 -0
  178. package/dist/store/sqlite/sqlite-storage.constants.d.ts.map +1 -0
  179. package/dist/store/sqlite/sqlite-storage.types.d.ts +27 -0
  180. package/dist/store/sqlite/sqlite-storage.types.d.ts.map +1 -0
  181. package/dist/store/sqlite/sqlite-store-of.d.ts +8 -3
  182. package/dist/store/sqlite/sqlite-store-of.d.ts.map +1 -1
  183. package/dist/store/storage-kinds.constants.d.ts +16 -0
  184. package/dist/store/storage-kinds.constants.d.ts.map +1 -0
  185. package/dist/store/storage-kinds.d.ts +43 -0
  186. package/dist/store/storage-kinds.d.ts.map +1 -0
  187. package/dist/store/storage-kinds.types.d.ts +46 -0
  188. package/dist/store/storage-kinds.types.d.ts.map +1 -0
  189. package/dist/store/store.types.d.ts +6 -4
  190. package/dist/store/store.types.d.ts.map +1 -1
  191. package/dist/test/assert-xml/assert-xml.d.ts +4 -2
  192. package/dist/test/assert-xml/assert-xml.d.ts.map +1 -1
  193. package/dist/test/assert-xml/index.d.ts +1 -0
  194. package/dist/test/assert-xml/index.d.ts.map +1 -1
  195. package/dist/test/assert-xml/xml-assertion-error.d.ts +8 -0
  196. package/dist/test/assert-xml/xml-assertion-error.d.ts.map +1 -0
  197. package/dist/test/create-test-dialecte.constants.d.ts +4 -0
  198. package/dist/test/create-test-dialecte.constants.d.ts.map +1 -0
  199. package/dist/test/create-test-dialecte.d.ts.map +1 -1
  200. package/dist/test/indexeddb-storage.setup.d.ts +1 -0
  201. package/dist/test/indexeddb-storage.setup.d.ts.map +1 -0
  202. package/dist/test/test-storage/index.d.ts +1 -1
  203. package/dist/test/test-storage/index.d.ts.map +1 -1
  204. package/dist/test/test-storage/sqlite-test-store.d.ts +15 -0
  205. package/dist/test/test-storage/sqlite-test-store.d.ts.map +1 -0
  206. package/dist/test/test-storage/test-storage.types.d.ts +12 -0
  207. package/dist/test/test-storage/test-storage.types.d.ts.map +1 -1
  208. package/dist/test/test-storage/test-store-for.d.ts +18 -6
  209. package/dist/test/test-storage/test-store-for.d.ts.map +1 -1
  210. package/dist/test/test-storage/test-store-providers.constants.d.ts +8 -0
  211. package/dist/test/test-storage/test-store-providers.constants.d.ts.map +1 -0
  212. package/dist/test/test-storage/test-store-providers.d.ts +11 -0
  213. package/dist/test/test-storage/test-store-providers.d.ts.map +1 -0
  214. package/dist/test.js +805 -765
  215. package/dist/{utils-USNkj4sT.js → utils-Cv4oHia0.js} +63 -137
  216. package/dist/utils.js +1 -1
  217. package/package.json +40 -8
  218. package/skills/dialecte/SKILL.md +8 -6
  219. package/skills/dialecte/references/api.json +93 -66
  220. package/skills/dialecte/references/api.md +463 -461
  221. package/skills/dialecte/references/core-api.md +42 -15
  222. package/skills/dialecte/references/testing.md +167 -11
  223. package/skills/dialecte-contributing/SKILL.md +1 -1
  224. package/skills/dialecte-contributing/references/code-rules.md +7 -0
  225. package/skills/dialecte-contributing/references/landing-changes.md +4 -4
  226. package/skills/dialecte-lot/SKILL.md +67 -28
  227. package/skills/dialecte-lot/references/briefs.md +30 -6
  228. package/skills/dialecte-lot/references/standard-check.md +2 -2
  229. package/skills/dialecte-lot/references/stations.md +5 -3
  230. package/dist/assets/hub.worker-B1HcVDhn.js +0 -2
  231. package/dist/engine.constants-DBMjMmV9.js +0 -98
  232. package/dist/engine.d.ts +0 -9
  233. package/dist/engine.d.ts.map +0 -1
  234. package/dist/running-operations-vnijBvn7.js +0 -76
  235. package/dist/store/engine/client/check-engine-wire.d.ts.map +0 -1
  236. package/dist/store/engine/client/client.constants.d.ts.map +0 -1
  237. package/dist/store/engine/client/client.types.d.ts.map +0 -1
  238. package/dist/store/engine/client/engine-client.d.ts.map +0 -1
  239. package/dist/store/engine/client/engine-control.d.ts.map +0 -1
  240. package/dist/store/engine/client/heartbeat-watch.d.ts.map +0 -1
  241. package/dist/store/engine/client/hub-connector.d.ts.map +0 -1
  242. package/dist/store/engine/client/hub-connector.types.d.ts.map +0 -1
  243. package/dist/store/engine/client/worker-connector.d.ts.map +0 -1
  244. package/dist/store/engine/creation-refusal.d.ts.map +0 -1
  245. package/dist/store/engine/dialecte-refusal.d.ts +0 -18
  246. package/dist/store/engine/dialecte-refusal.d.ts.map +0 -1
  247. package/dist/store/engine/engine-store.d.ts.map +0 -1
  248. package/dist/store/engine/engine-store.types.d.ts.map +0 -1
  249. package/dist/store/engine/engine.constants.d.ts.map +0 -1
  250. package/dist/store/engine/engine.types.d.ts.map +0 -1
  251. package/dist/store/engine/host/engine-wire.d.ts.map +0 -1
  252. package/dist/store/engine/host/heartbeat.d.ts.map +0 -1
  253. package/dist/store/engine/host/host.constants.d.ts.map +0 -1
  254. package/dist/store/engine/host/host.types.d.ts.map +0 -1
  255. package/dist/store/engine/host/store-events.d.ts.map +0 -1
  256. package/dist/store/engine/hub/hub-client.constants.d.ts.map +0 -1
  257. package/dist/store/engine/hub/hub-client.d.ts.map +0 -1
  258. package/dist/store/engine/hub/hub-client.types.d.ts.map +0 -1
  259. package/dist/store/engine/hub/hub-protocol.types.d.ts.map +0 -1
  260. package/dist/store/engine/hub/hub-router.d.ts.map +0 -1
  261. package/dist/store/engine/hub/hub-shell.d.ts.map +0 -1
  262. package/dist/store/engine/hub/hub-shell.types.d.ts.map +0 -1
  263. package/dist/store/engine/hub/hub.constants.d.ts.map +0 -1
  264. package/dist/store/engine/hub/hub.types.d.ts.map +0 -1
  265. package/dist/store/engine/hub/hub.worker.d.ts.map +0 -1
  266. package/dist/store/engine/hub/realm-host.d.ts.map +0 -1
  267. package/dist/store/engine/hub/realm-host.types.d.ts.map +0 -1
  268. package/dist/store/engine/project-key.d.ts.map +0 -1
  269. package/dist/store/engine/wire/error-envelope.d.ts.map +0 -1
  270. package/dist/store/engine/wire/wire-values.d.ts.map +0 -1
  271. package/dist/store/engine/wire/wire.constants.d.ts.map +0 -1
  272. package/dist/store/engine/wire/wire.types.d.ts.map +0 -1
  273. package/dist/store/hub-public.d.ts.map +0 -1
  274. package/dist/store/sqlite/runtime/serve-dialecte-engine.d.ts +0 -16
  275. package/dist/store/sqlite/runtime/serve-dialecte-engine.d.ts.map +0 -1
  276. package/dist/store/sqlite-storage.constants.d.ts +0 -14
  277. package/dist/store/sqlite-storage.constants.d.ts.map +0 -1
  278. package/dist/store/sqlite-storage.d.ts +0 -22
  279. package/dist/store/sqlite-storage.d.ts.map +0 -1
  280. package/dist/store/sqlite-storage.types.d.ts +0 -24
  281. package/dist/store/sqlite-storage.types.d.ts.map +0 -1
  282. package/dist/test/test-dialecte.worker.d.ts +0 -2
  283. package/dist/test/test-dialecte.worker.d.ts.map +0 -1
  284. /package/dist/store/{engine → sqlite/served}/client/check-engine-wire.d.ts +0 -0
  285. /package/dist/store/{engine → sqlite/served}/client/engine-control.d.ts +0 -0
  286. /package/dist/store/{engine → sqlite/served}/client/heartbeat-watch.d.ts +0 -0
  287. /package/dist/store/{engine → sqlite/served}/client/worker-connector.d.ts +0 -0
  288. /package/dist/store/{engine → sqlite/served}/creation-refusal.d.ts +0 -0
  289. /package/dist/store/{engine → sqlite/served}/engine-store.types.d.ts +0 -0
  290. /package/dist/store/{engine → sqlite/served}/engine.constants.d.ts +0 -0
  291. /package/dist/store/{engine → sqlite/served}/host/engine-wire.d.ts +0 -0
  292. /package/dist/store/{engine → sqlite/served}/host/host.constants.d.ts +0 -0
  293. /package/dist/store/{engine → sqlite/served}/host/store-events.d.ts +0 -0
  294. /package/dist/store/{engine → sqlite/served}/hub/hub-client.constants.d.ts +0 -0
  295. /package/dist/store/{engine → sqlite/served}/hub/hub-client.d.ts +0 -0
  296. /package/dist/store/{engine → sqlite/served}/hub/hub-protocol.types.d.ts +0 -0
  297. /package/dist/store/{engine → sqlite/served}/hub/hub-router.d.ts +0 -0
  298. /package/dist/store/{engine → sqlite/served}/hub/hub-shell.d.ts +0 -0
  299. /package/dist/store/{engine → sqlite/served}/hub/hub-shell.types.d.ts +0 -0
  300. /package/dist/store/{engine → sqlite/served}/hub/hub.worker.d.ts +0 -0
  301. /package/dist/store/{engine → sqlite/served}/hub/realm-host.d.ts +0 -0
  302. /package/dist/store/{engine → sqlite/served}/wire/error-envelope.d.ts +0 -0
  303. /package/dist/store/{engine → sqlite/served}/wire/wire-values.d.ts +0 -0
  304. /package/dist/store/{engine → sqlite/served}/wire/wire.constants.d.ts +0 -0
@@ -21,13 +21,13 @@ in the installed `.d.ts` or the repo before calling. Paths are relative to the c
21
21
 
22
22
  ## Entry points
23
23
 
24
- | Import | What is there |
25
- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
26
- | `@dialecte/core` | Project, Document, Query, Transaction, `defineDialecte`, `createProjectFactory`, stores, XML parse/build, errors, diagnostics, perf, all types |
27
- | `@dialecte/core/helpers` | record converters, guards, `readAttribute(s)`, `standardizeRecord`, `mergeExtensions`, `stripAttributes`, write-path guards, namespace constants |
28
- | `@dialecte/core/utils` | attribute rules, definition resolution, xsi:type, namespaces, ordering, `invariant`, `formatXml` / `formatEmbeddedXml`, `saveToDisk` |
29
- | `@dialecte/core/test` | `createTestHelpers`, `createTestRunner`, `createTestProject`, XML/XPath assertions, test dialecte, `normalizeUuids` |
30
- | `@dialecte/core/sqlite` | opt-in SQLite storage: importing it registers `{ type: 'sqlite' }`; `connectHub`, `adoptHubPort`, `listProjects` |
24
+ | Import | What is there |
25
+ | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
26
+ | `@dialecte/core` | Project, Document, Query, Transaction, `defineDialecte`, `createProjectFactory`, stores, XML parse/build, errors, diagnostics, perf, all types |
27
+ | `@dialecte/core/helpers` | record converters, guards, `readAttribute(s)`, `standardizeRecord`, `mergeExtensions`, `stripAttributes`, write-path guards, namespace constants |
28
+ | `@dialecte/core/utils` | attribute rules, definition resolution, xsi:type, namespaces, ordering, `invariant`, `formatXml` / `formatEmbeddedXml`, `saveToDisk` |
29
+ | `@dialecte/core/test` | `createTestHelpers`, `createTestRunner`, `createTestProject`, XML/XPath assertions, test dialecte, `normalizeUuids` |
30
+ | `@dialecte/core/sqlite` | opt-in SQLite storage: importing it registers `{ type: 'sqlite' }`; `serveSqliteEngine` (the app's one engine worker file), `registerSqliteEngine` (the page, once), `connectHub`, `adoptHubPort`, `listProjects` |
31
31
 
32
32
  ## Project (`project/project.ts`)
33
33
 
@@ -53,7 +53,8 @@ in the installed `.d.ts` or the repo before calling. Paths are relative to the c
53
53
  in-memory) the channel is the Project's own and reposts what the store tells; on `local` (IndexedDB) it is
54
54
  shared by project name.
55
55
  - `listProjects({ dialecteId? })` from `@dialecte/core/sqlite` (SQLite projects of the origin, read from the private
56
- file system) and `factory.destroyProject({ name })` (delete one without opening it).
56
+ file system) and `factory.destroyProject({ name, storage })` (delete one without opening it, from the storage named:
57
+ `storage: { type: 'sqlite' }` for a project on SQLite; any kind works the same way).
57
58
 
58
59
  ## Document (`document/document.ts`)
59
60
 
@@ -184,13 +185,39 @@ needs the parent's `updated` (children list) too.
184
185
 
185
186
  ## Stores (`store/`)
186
187
 
187
- - `storage` param: `{ type: 'local' }` (IndexedDB, the default), `{ type: 'sqlite' }` (the SQLite
188
- engine in a worker, one per project shared by every tab through the hub; opt-in: the app imports
189
- `@dialecte/core/sqlite` once, else `PROJECT_SQLITE_NOT_IMPORTED`; opened from a dialecte's project
190
- factory, which names its engine worker),
191
- `{ type: 'inMemory', writable? }`,
192
- `{ type: 'custom', store }`. The store is a switch: results must be identical on every store,
193
- only speed changes. A difference is a store bug.
188
+ - `storage` param: `{ type: 'local' }` (IndexedDB, the default), `{ type: 'inMemory', writable? }`,
189
+ `{ type: 'custom', store }` - core's own kinds - and any kind an entry registers: `{ type: 'sqlite' }` (the SQLite
190
+ engine in a worker, one per project shared by every tab through the hub; setup below) exists once
191
+ `@dialecte/core/sqlite` is imported. The store is a switch: results must be identical on every store, only speed
192
+ changes. A difference is a store bug.
193
+ - Storage kinds are a registry: an entry adds its kind with `registerStorageKind({ type, kind: { id, storeOf } })`
194
+ (from `@dialecte/core`) and widens `StorageParam` by augmenting `interface StorageKinds` of `@dialecte/core`
195
+ (`declare module '@dialecte/core' { interface StorageKinds { mine: { type: 'mine'; url: string } } }`) - how a
196
+ store package plugs in like SQLite does. A type nobody registered (an app that never imported
197
+ `@dialecte/core/sqlite`) is refused `PROJECT_STORAGE_NOT_REGISTERED`; another kind under a taken type,
198
+ `STORE_KIND_TAKEN`.
199
+ - SQLite storage is opt-in and **the app assembles its engine**; a dialecte package ships its declaration
200
+ only, no worker. The SQLite calls come from `@dialecte/core/sqlite`, which the app imports once (the factory and
201
+ the rest of the API stay in `@dialecte/core`):
202
+ - the app's one engine worker file (say `engine.worker.ts` in its sources) calls `serveSqliteEngine({ dialectes })`
203
+ with every dialecte the app opens on SQLite - one file for all of them, not one per dialecte;
204
+ - the page calls `registerSqliteEngine({ url, dialectes })` once, before the first project opens: `url` a
205
+ `?worker&url` import of that file, `dialectes` the same list (declarations fit);
206
+ - `createProjectFactory({ dialecte })` takes the declaration only, no engine URL; a project opens with
207
+ `storage: { type: 'sqlite' }`; `connectHub()` takes no parameter (optional: a project opening on
208
+ `sqlite` offers the registered engines too).
209
+ - SQLite refusals: entry never imported → `PROJECT_STORAGE_NOT_REGISTERED` (core: no `sqlite` kind); no
210
+ registration, or one that does not name the project's dialecte → `PROJECT_SQLITE_ENGINE_NOT_REGISTERED`, nothing
211
+ started; a worker file that fails to load, or cannot load the engine's chunk (a precache list that leaves it out)
212
+ → `PROJECT_ENGINE_UNAVAILABLE`; a project stored by another layout → `PROJECT_LAYOUT_OUTDATED`. The keys only SQLite
213
+ raises (`PROJECT_SQLITE_*`, `PROJECT_ENGINE_*`, `PROJECT_LAYOUT_OUTDATED`, `PROJECT_DATABASE_LOST`, the hub's
214
+ `STORE_HUB_*`, `STORE_REALM_*`, `STORE_PROTOCOL_MISMATCH`, `STORE_SQLITE_ENGINE_FIXED`) are declared by
215
+ `SQLITE_ERRORS` from `@dialecte/core/sqlite`, codes unchanged: match them with
216
+ `isKnownDialecteError(error, { catalogues: [SQLITE_ERRORS] })` or `SQLITE_ERRORS.<KEY>.key`.
217
+ - A store behind a connection (SQLite's worker, a remote store) that loses it refuses the call
218
+ `STORE_CONNECTION_LOST` (core); for a write, `meta.writeId` and `meta.outcome` (`applied`, `not-applied`,
219
+ `running`, `unknown`) say whether it landed - a Document's commit and a Project's import ask it once themselves;
220
+ never write again blindly (`store.getWriteOutcome({ writeId })`).
194
221
  - `Store` interface is public surface for custom stores. The patch merge every built-in store uses
195
222
  is internal to the stores (not exported): a custom store merges a `RecordPatch` itself.
196
223
 
@@ -58,24 +58,180 @@ A dialecte package's runner has the same shape with its own types (`<Name>Test.T
58
58
 
59
59
  ## Rules
60
60
 
61
+ A test is read far more often than it is written: by the reviewer, by the next person who changes the code,
62
+ by whoever reads a failure. Every rule below keeps one case readable on its own and keeps each behaviour proven
63
+ in exactly one place.
64
+
65
+ ### The table
66
+
61
67
  - **Red first, one case at a time.** Add one case with `only: true`, run it, see it fail for the
62
68
  right reason (an assertion, not a missing module - stub the function with the right type first),
63
- write the minimum code, then the next case. Remove every `only` at the end. A table written after
64
- the implementation only pins what the code happens to do.
65
- - **Case keys** read `<initial state> → <outcome>`.
66
- - **Fixtures are inline XML** in the test file. `dev:db-id` (`CUSTOM_RECORD_ID_ATTRIBUTE`) gives
67
- records stable ids; choose ids that say intent (`orphaned-ref`, `a-without-child`). Comment the
68
- elements that are deliberately absent. No `<?xml ?>` declaration in template literals.
69
- - **Expectations are structural XPath with meaningful predicates.** `//default:AA_1` alone proves
70
- nothing; a case can pass because ANOTHER element matched. Do not assert on `dev:db-id` in XPath.
71
- Pair `unexpectedQueries` with the commented-out source when asserting a deletion.
69
+ then the next case. Remove every `only` before the red is recorded (`dialecte tdd red` refuses a
70
+ focused file), then write the minimum code. Record per case where it failed (`<case title>: failed on
71
+ <assertion>`); a case that never failed is listed with its reason (existing behaviour the change
72
+ touches). A table written after the implementation only pins what the code happens to do.
73
+ - **One table per behaviour.** `.withExport` with `expectedQueries` when the outcome is XML;
74
+ `.withoutExport` only for a returned value or warnings; a refusal's table runs `.withExport` (see
75
+ Refusals below). A case field that picks which assertions run (`check: 'children' | 'references'`,
76
+ `if (testCase.setup === 'x')`) means two behaviours share a table: split it. A flag marking the
77
+ refusal cases of a table is fine.
78
+
79
+ ```ts
80
+ // BAD: one table, the case picks what the act checks
81
+ if (testCase.check === 'children') expect(children).toHaveLength(1)
82
+ else expect(references).toEqual([])
83
+
84
+ // GOOD: one table per behaviour, the same act for every case of a table
85
+ runTestCases.withExport({ testCases: addsChildCases, act: addsChildAct })
86
+ runTestCases.withExport({ testCases: keepsReferencesCases, act: keepsReferencesAct })
87
+ ```
88
+
89
+ - **Case keys** read `<initial state> → <outcome>`. No plan, round, station or ticket tags in titles
90
+ or file names (`round 2`, `step 3`, an issue number).
91
+ - **Only the behaviour the change touches.** No preservation cases for code the change leaves alone.
92
+ Each case is written once, for the Node tier; no browser copy of a case. The package's whole-suite
93
+ runs on other tiers or stores are its gate, not duplicates.
94
+ - **Readable size.** Aim for 200-300 lines per test file, one verb or behaviour per file. A file
95
+ growing past that holds two behaviours: split it by behaviour, not by line count.
96
+
97
+ ### One call of the unit
98
+
99
+ A verb's test proves that verb's behaviour, nothing else. The `act` makes **one call of the unit under
100
+ test** - the function itself (`fn(tx, params)`, `fn(source.query, params)`) or its bound method
101
+ `tx.<ns>.<verb>`; either is one call, never both in one test - then returns or asserts the outcome.
102
+
103
+ - No second or third call, no retry, no loop over the call.
104
+ - No capture before the call: no snapshot of the staged operations, no copy of the document's metadata,
105
+ to compare after. The outcome is what the call left: `expectedQueries`, a returned value, a staged
106
+ list compared with a literal. "Unchanged" is a case of its own only where it is the behaviour.
107
+ - No XPath on the source inside the `act`, no branch on the case.
108
+ - Not in a verb's test: the transaction's rollback, source-document purity, id or date formats, timestamps,
109
+ provenance details. Their owners test them (core's transaction, the writer of the timestamp, schema
110
+ validation, one acceptance case for source purity); a verb re-proving them breaks when the owner
111
+ changes, not when the verb does.
112
+ - A **reshape** keeps every behaviour covered **by the test that owns it**. List each check it removes
113
+ with the test that covers it, and open that test: it must really assert it, or the reshape adds the case
114
+ there first.
115
+
116
+ ```ts
117
+ // BAD: a state captured before the call, compared after it
118
+ const before = structuredClone(await source.query.getDocumentInfo())
119
+ await source.transaction(async (tx) => addFirstChild(tx, testCase.params))
120
+ expect(await source.query.getDocumentInfo()).not.toEqual(before)
121
+
122
+ // GOOD: one call; the case's expectedQueries carry the outcome
123
+ async function act({
124
+ testCase,
125
+ source,
126
+ }: ActParams<TestDialecteConfig, TestCase>): Promise<ActResult> {
127
+ await source.transaction(async (tx) => addFirstChild(tx, testCase.params))
128
+ return { assertOn: 'source' }
129
+ }
130
+ ```
131
+
132
+ ### Refusals assert outcomes, never spies
133
+
134
+ A refusal is proven by what it leaves: the error key, nothing staged, the documents unchanged.
135
+
136
+ - Catch the refusal inside its transaction, assert its key, then `tx.getStagedOperations()` equal to
137
+ `[]`, still inside that transaction.
138
+ - Run the table `.withExport` so the source's `expectedQueries` show the document unchanged.
139
+ - No `vi.spyOn` on a transaction or query method: a spy tests how the code writes, and passes while the
140
+ document is wrong.
141
+
142
+ ```ts
143
+ // BAD: a spy on how it writes
144
+ const addChild = vi.spyOn(tx, 'addChild')
145
+ await expect(addFirstChild(tx, params)).rejects.toThrow()
146
+ expect(addChild).not.toHaveBeenCalled()
147
+
148
+ // GOOD: the key, nothing staged, the document checked by expectedQueries
149
+ await source.transaction(async (tx) => {
150
+ await expect(addFirstChild(tx, testCase.params)).rejects.toMatchObject({
151
+ cause: { key: 'ELEMENT_NOT_FOUND' },
152
+ })
153
+ expect(tx.getStagedOperations()).toEqual([])
154
+ })
155
+ return { assertOn: 'source' }
156
+ ```
157
+
158
+ ### Real records, no fakes
159
+
160
+ - Test through the public interfaces: no mocks of internal collaborators, no hand-written fake `Query`,
161
+ no mock of a query module.
162
+ - A step that reads real records gets one real-engine case asserting the values it read, before any
163
+ mock is considered.
164
+
165
+ ### Fixtures are whole documents
166
+
167
+ Each case's document is written out in full, so a reader sees the exact input without assembling it in
168
+ their head, and holds only the elements the case needs.
169
+
170
+ - **In the test file** (inline in the case, or one file-level constant used whole) when it is at most
171
+ **40 lines**. Above, a sibling file
172
+ `fixtures/<what-it-holds>.xml` read with a static `?raw` import. A fixture file is at most **120 lines**
173
+ and its name says what it holds (`a-with-two-aa-1.xml`, not `fixture2.xml`).
174
+ - **A variant is its own document**, never a copy edited at runtime: no `.replace()` on a fixture, no
175
+ shared XML constant spliced into a case's document (`${CHILDREN}`, `${HEADER}`), no fixture builder
176
+ functions, no `*.test-fixtures.ts` module. Substitutions inside a tag are fine: names (`${ns}`),
177
+ attribute values (`aA="${UUID}"`), namespace declarations. A shared empty target is fine.
178
+ - A case reading a fixture file carries **one comment** naming what matters in that document
179
+ (`// A "one" holds no AA_1; A "two" holds one without bAA_1`).
180
+ - `dev:db-id` (`CUSTOM_RECORD_ID_ATTRIBUTE`) gives records stable ids; choose ids that say intent
181
+ (`orphaned-ref`, `a-without-child`). Comment the elements that are deliberately absent. No
182
+ `<?xml ?>` declaration in template literals.
183
+
184
+ ```ts
185
+ // BAD: assembled from pieces
186
+ sourceXml: `<Root ${XMLNS_DEFAULT_NAMESPACE}>${A_WITH_CHILDREN.replace('aA="one"', 'aA="two"')}</Root>`,
187
+
188
+ // GOOD: the whole document, inline or as its own file
189
+ import aWithTwoAa1 from './fixtures/a-with-two-aa-1.xml?raw'
190
+ // A "one" holds two AA_1; the second has no bAA_1
191
+ sourceXml: aWithTwoAa1,
192
+ ```
193
+
194
+ **Making a variant: a throwaway script, never calls in the test.**
195
+
196
+ 1. Start from `dialecte fixture <Tag>` (the smallest valid document holding the tag) or an existing whole
197
+ fixture.
198
+ 2. Write the variant with a throwaway script:
199
+ `dialecte run make-<what>.ts --in <base>.xml --out fixtures/<what-it-holds>.xml --seed <n> --now <iso>`
200
+ (seed and clock fixed, so the same command gives the same file). The script may use any tested
201
+ feature, the verb being changed included: its current output is a valid starting document.
202
+ 3. Check the result: valid against the schema, and `--expect <file>` (a JSON array of
203
+ `{ tag, where?, under?, count? }`) for what the case needs the document to hold.
204
+ 4. Commit only the `.xml`. The script is never committed, and never thrown away before the review
205
+ either: a fixture whose making cannot be rerun cannot be reviewed. Keep it with the change's
206
+ hand-over notes (the folder handed to the reviewer) as `fixture-scripts/make-<what>.ts`, listed in
207
+ `fixture-scripts.md` (`| fixture | script | command |`), and delete it with the notes once the change
208
+ lands. A document written whole by hand needs no script; say so on its line.
209
+
210
+ ### Expectations are written by hand
211
+
212
+ - **Expectations are structural XPath with meaningful predicates**, written in the test file from the
213
+ requirement. `//default:AA_1` alone proves nothing; a case can pass because ANOTHER element matched.
214
+ Do not assert on `dev:db-id` in XPath. Pair `unexpectedQueries` with the commented-out source when
215
+ asserting a deletion.
216
+ - **Never generated.** For a document outcome, a document produced by the code under test is never
217
+ the expected result: comparing an export with a saved `.xml` is a snapshot in disguise, it passes on
218
+ whatever the code did the day it was saved.
219
+
220
+ ```ts
221
+ // BAD: the code's own output as the truth
222
+ expect(exported).toBe(expectedAfterAddXml)
223
+
224
+ // GOOD: what the requirement says, as queries
225
+ expectedQueries: ['//default:A[@aA="one"]/default:AA_1[@aAA_1="added"]'],
226
+ ```
227
+
228
+ ### The runner and the assertions
229
+
72
230
  - **Fixtures are validated against the schema before a case runs** by the runners `createTestHelpers`
73
231
  builds - every dialecte package's `run<Name>TestCases` / `create<Name>TestProject` (a dialecte may
74
232
  add its own checks, see its skill). Opt out of those extra checks only with a written reason
75
233
  (`skipExtraChecks: '<why>'` on `createTestProject`). Core's own `runTestCases` on the dummy
76
234
  dialecte (`createTestRunner`) validates nothing.
77
- - **Test the function directly** (`fn(source.query, params)` / `fn(tx, params)`), not through the
78
- bound extension method. Use public interfaces; no mocks of internal collaborators.
79
235
  - **No test names its store: the runner chooses it.** A node vitest project whose setup file calls
80
236
  `useTestStorage({ type: 'inMemory' })` (core 0.8+) runs your tests in Node on the in-memory store;
81
237
  without one, the runner's default store. A second project whose setup imports
@@ -121,7 +121,7 @@ what the station records for the hand-over card).
121
121
  5. **Independent review**: have a fresh reviewer (a sub-agent with only the spec, the diff and
122
122
  these rules, or a human) read the diff against the previous version before hand-over. Self-review
123
123
  re-reads your own intent and misses weakened assertions and unusable types.
124
- 6. **Hand over** through `npx dialecte handover <lots.json>`: the agent writes only the lots file, the
124
+ 6. **Hand over** through `npx dialecte handover write <lots.json>`: the agent writes only the lots file, the
125
125
  command writes the hand-over folder and prints the card the user gets
126
126
  ([references/landing-changes.md](references/landing-changes.md)). The agent never commits or pushes.
127
127
 
@@ -12,6 +12,7 @@ does not name.
12
12
  - Files and types
13
13
  - Naming
14
14
  - Comments and committed text
15
+ - Tests
15
16
  - Self-check before hand-over
16
17
 
17
18
  ## Reuse and sources of truth
@@ -87,6 +88,12 @@ does not name.
87
88
  - Do not create documentation that was not asked for, beyond the docs + CHANGELOG the Definition
88
89
  of Done requires.
89
90
 
91
+ ## Tests
92
+
93
+ Tests follow the rules of the `dialecte` skill's references/testing.md (section Rules): the one source for
94
+ how a table, a case, a fixture and an expectation are written. Read it before writing a case; this page
95
+ does not repeat it.
96
+
90
97
  ## Self-check before hand-over
91
98
 
92
99
  ```bash
@@ -8,7 +8,7 @@ script may be waiting or running in the human's terminal.
8
8
 
9
9
  ## The hand-over
10
10
 
11
- The agent writes only a lots file; `npx dialecte handover <lots.json>` does the rest. One lots file per lot
11
+ The agent writes only a lots file; `npx dialecte handover write <lots.json>` does the rest. One lots file per lot
12
12
  group, in an uncommitted hand-over folder (for example `_commit-plan/<topic>-<yyyy-mm-dd>/lots.json` at the
13
13
  workspace root, outside every repo); the hand-over files are written next to it (`--out <dir>` elsewhere):
14
14
 
@@ -64,13 +64,13 @@ workspace root, outside every repo); the hand-over files are written next to it
64
64
  and is for when the person asks. A heavy hook that does run is rehearsed while another suite loads the
65
65
  machine, as it will be when the user commits; when that is not possible, the hand-over notes the machine's
66
66
  load at rehearsal time (`uptime`). The real commit's hook always runs.
67
- - Edited a file after the snapshot (a review fix)? `npx dialecte handover --rehash <lots.json>`.
67
+ - Edited a file after the snapshot (a review fix)? `npx dialecte handover write <lots.json> --rehash` (a cli from 0.2.0 to 0.3: `npx dialecte handover <lots.json> --rehash`).
68
68
  - `npx dialecte handover list` shows every hand-over folder with its state (pending, partly committed,
69
69
  committed, stale); after a merge, `npx dialecte worktree prune` lists the committed ones with the merged
70
70
  worktrees and prints their removal commands: an agent hands them (or the `--yes` command, which asks on
71
71
  a terminal) to the user with their `cd`.
72
- - `handover` comes with `@dialecte/cli` 0.2.0 or later; with an older cli in the package, run
73
- `npx @dialecte/cli@^0.2.0 handover <lots.json>` (never `@latest`, which can be older).
72
+ - `handover write` comes with `@dialecte/cli` 0.4.0 or later; a cli from 0.2.0 to 0.3 takes
73
+ `npx dialecte handover <lots.json>` (the same command 0.4.0 keeps as an alias).
74
74
 
75
75
  ## Commit messages
76
76
 
@@ -52,7 +52,7 @@ follows the hand-over, and the branch goes up by pull request through that repos
52
52
  (`dialecte-contributing`). In an app that consumes a dialecte, the lot ends at
53
53
  Station 6: what comes after belongs to the app's own process - its PR skill and template for the pull
54
54
  request, its own retro and clean-up if it has them - and no further station of this skill runs (no Station 7,
55
- no `dialecte worktree prune`, no dialecte PR or release step). The hand-over's records (`dialecte recap`
55
+ no `dialecte worktree prune`, no dialecte PR or release step). The hand-over's records (`dialecte lot recap <folder>`
56
56
  prints a PR's details part from them) feed the app's template only where its rules ask for it. Pushing and
57
57
  posting stay the user's (or wait for their approval).
58
58
 
@@ -71,9 +71,27 @@ wrong.
71
71
 
72
72
  Before the test station, the plan holds what the tests will pin; a gap found by a reviewer costs a round.
73
73
 
74
+ - **Discovery first**, before any test or code: list what already covers the concept with the whole cli
75
+ surface - `dialecte api find` and the API index, `explain`, `schema`, `fixture`, `standard find` / `show`, the
76
+ package skills - then a code search for what they do not index. The list goes into the lot's `decisions.md`,
77
+ each hit reused or with why not; a shared read found wrong is fixed in place, never forked. Reviewers check the
78
+ diff against that list. The list records evidence: it never limits what a station may use.
79
+ - **An automatic destructive action** (a command or hook that deletes, moves or resets without the person
80
+ running it): the brief opens with its invariant - "never <act> on <thing> unless it is proven <X>, <Y>, <Z>" -
81
+ and a list of adversarial cases written before the tests: for checkouts, other lots, reused or switched
82
+ worktrees and branches, locks, live processes, links; for content, what the target touches, references to
83
+ it, a target emptied and refilled; for both, concurrent runs and an interrupted step. Where proving costs more than
84
+ asking, print the command for the person instead of acting. Keep rules alone let every round find one more
85
+ state.
86
+ - **A step that removes content** (a prune, a redaction, a dedupe): a preservation check per unit (file, page,
87
+ element) proves only the targeted content went, loss counted per unit and never by a summary that hides a
88
+ one-off, and a boundary case (the target touching what must stay) is written before the code.
89
+ - **A rename across many cases** (an output prefix, a message: behaviour, so never an exempt lot): the
90
+ test-station brief states the mapping as a rule (`<call>` → `<expected text>`) and asks for one audit pass
91
+ of every touched file against it before `tdd red`; a text replace without it swaps names in both directions.
74
92
  - **The standard** (a lot whose rules come from a standard the code implements):
75
93
  [references/standard-check.md](references/standard-check.md) - how it is read, the cross-check for a
76
- decision, and what the station records for the hand-over card (`dialecte record standard`).
94
+ decision, and what the station records for the hand-over card (`dialecte lot standard`).
77
95
  - **A tooling lot with shared state or an external tool**: the plan carries the store's transition table, its
78
96
  invariant and the interleavings, the test-station brief asks one forced-order test per interleaving, and the
79
97
  hand-over folder gets a `SMOKE.md` with the lot's one real run; how and where that run happens, and citing
@@ -131,7 +149,13 @@ test edited after red; the test code changed since its freeze; the cases the cha
131
149
  --fast` and `--full` check the receipts in their `tdd` step: every test-code file of the change as frozen,
132
150
  every new or changed case red then green (or unchanged), the flags and deleted cases listed.
133
151
 
134
- **Exempt lots.** A lot that changes no behaviour - a wording, a rename, a doc-only or a CHANGELOG-only
152
+ **Checks run per step, not at the end of the lot**: the other tests related to the touched files (`vitest
153
+ related` or `--changed <base>`), `check` (its type-check covers the tests) and, in a dialecte package, `dialecte
154
+ rules` on the touched files. The whole suite runs once, at `gate --full`. After any edit of a test (a test-review
155
+ return included, a type-only one too), the test station takes `tdd red` again before `tdd green`: a case greened
156
+ over an unproven edit ends up accepted, not proven.
157
+
158
+ **Exempt lots.** A lot that changes no behaviour - a wording, a rename nothing outputs, a doc-only or a CHANGELOG-only
135
159
  lot - has no red to prove. The orchestrator declares it in the brief and writes
136
160
  `{ "tdd": "exempt: <reason>" }` to `.dialecte/lot.json` at the package root of the worktree; the gate's
137
161
  `tdd` step passes with the reason and what the change touches ("exempt: <reason> (n production files, m
@@ -152,7 +176,8 @@ Before touching code (the implement station; the test station does the same befo
152
176
  can assume things that changed. A contradiction stops you: say it, do not reinterpret the plan.
153
177
  2. `git status -sb` in your worktree: right branch, clean (or dirty only with your own earlier work).
154
178
  Note the HEAD sha for your report.
155
- 3. Load `dialecte` (and `dialecte-contributing` in a dialecte package); run the reuse ladder before writing anything.
179
+ 3. Load `dialecte` (and `dialecte-contributing` in a dialecte package); run the reuse ladder before writing anything,
180
+ starting from the lot's discovery list in `decisions.md` (Station 0).
156
181
 
157
182
  Then, within the step:
158
183
 
@@ -261,8 +286,10 @@ copy of every file `git status --porcelain -z --untracked-files=all` lists at th
261
286
  untracked, at its path relative to the repository root, and beside it `round-<n>.deleted`, NUL-separated, naming
262
287
  each deleted file and the old path of each rename (beside the copy, never in it: it is no file of the lot). A copy,
263
288
  not a patch: nothing to apply, binary files included. The lot stays uncommitted until the hand-over, so HEAD is the
264
- base for the whole loop: these snapshots are the only refs the later rounds have. From cli 0.2.0,
265
- `dialecte record snapshot <folder> --round <n>` takes it (and `dialecte review delta` reads it); the text here is
289
+ base for the whole loop: these snapshots are the only refs the later rounds have. Every round gets one, round 1
290
+ and a verify-only round included: without it a throwaway worktree holds the only copy of that round's state,
291
+ lost when the throwaway is removed. From cli 0.4.0,
292
+ `dialecte lot snapshot <folder> --round <n>` takes it (and `dialecte lot delta` reads it); the text here is
266
293
  the manual fallback for an older cli.
267
294
 
268
295
  - **Round 1 - full review**, blind to the implementer's conclusions, every severity. The checklist, each angle
@@ -276,8 +303,8 @@ the manual fallback for an older cli.
276
303
  the findings ledger. The last round reports what its class acts on; anything below is logged as a follow-up, not
277
304
  fixed in the lot. A finding the last round acts on is fixed; the round that would verify the fix goes to the user
278
305
  (above). The floor rises so the rounds converge. The review has three parts:
279
- - (a) **Each fix verified on the old code.** From cli 0.2.0,
280
- `dialecte review delta <folder> --round <n> --worktree` makes the throwaway worktree holding `round-<n-1>/`
306
+ - (a) **Each fix verified on the old code.** From cli 0.4.0,
307
+ `dialecte lot delta <folder> --round <n> --worktree` makes the throwaway worktree holding `round-<n-1>/`
281
308
  (the fixer's, when it made one: Station 4, reused, never a second); with an older cli, the orchestrator makes one by hand on its own branch
282
309
  (never the lot's), copies the snapshot over it, removes its deleted files - the one place a `git rm` is
283
310
  allowed, never in the lot's worktree - and passes the path (`worktree prune` lists it after the lot):
@@ -313,13 +340,15 @@ the manual fallback for an older cli.
313
340
  - (c) **One line naming what round 1 did not look at.**
314
341
 
315
342
  **The findings ledger** (`findings-ledger.md` in the hand-over folder) is the lot's memory across rounds. Only the
316
- orchestrator writes it, by hand or, from cli 0.2.0, with `dialecte record review` (a new row, `open`) and
317
- `dialecte record decision` (the states `open`, `fix to verify`, `fixed <n> [note]`, `accepted`, `logged`). The
318
- cli writes neither the risk-class line nor `reopened`, and its `fix to verify` carries no blast radius: write
319
- those by hand, or keep the blast-radius lines in a fixes file beside the ledger. Reviewers propose rows. It
320
- opens with the risk class (`Risk class: <class> - <rounds> rounds, last round acts on <floor>, a further round
321
- only with the user - set by <files>`). One row per finding: id, round
322
- raised, severity, file:line, state - `open`, `fix to verify - <blast radius>` (the fixer says fixed; its
343
+ orchestrator writes it, by hand or, from cli 0.4.0, with
344
+ `dialecte lot finding <folder> --round <n> --severity <blocking|should-fix|nit> --at <file:line> <finding>`
345
+ (a new row, `open`) and
346
+ `dialecte lot decide <folder> <finding> <open | fix-to-verify | fixed <round> [note] | accepted <reason> | logged <where>>`
347
+ (the ledger row spells the state `fix to verify`). The cli writes neither the risk-class line nor `reopened`,
348
+ and its `fix-to-verify` carries no blast radius: write those by hand, or keep the blast-radius lines in a fixes
349
+ file beside the ledger. Reviewers propose rows. It opens with the risk class (`Risk class: <class> - <rounds>
350
+ rounds, last round acts on <floor>, a further round only with the user - set by <files>`). One row per finding:
351
+ id, round raised, severity, file:line, state - `open`, `fix to verify - <blast radius>` (the fixer says fixed; its
323
352
  blast-radius line comes with it), `fixed <n>` (n = the round that verified the fix; `fixed <n> (reasoned)` when the
324
353
  guard was not run), `reopened <n> by <id>` (a later fix broke it again), `accepted <reason>`, `logged <follow-up>`.
325
354
  Every reviewer reads it; a finding fixed or accepted is not raised again unless the fix is wrong. Outside every
@@ -362,8 +391,8 @@ that fixes one finding and hides another, a fix that undoes an earlier one.
362
391
 
363
392
  **The red of a fix's new test comes from the tree the round reviewed, never from production put back.** Write the
364
393
  test before the fix and take its red with `npx dialecte tdd red` while the code it pins is still the reviewed one.
365
- When production already holds the fix, run the new test where the old code still lives: `npx dialecte review delta
366
- <folder> --round <n+1> --worktree` (n = the round whose findings you fix; cli 0.2.0, else the orchestrator's
394
+ When production already holds the fix, run the new test where the old code still lives: `npx dialecte lot delta
395
+ <folder> --round <n+1> --worktree` (n = the round whose findings you fix; cli 0.4.0, else the orchestrator's
367
396
  hand-made throwaway of Station 3 (a)) makes a throwaway worktree holding `round-<n>/` and prints its removal
368
397
  command; copy the new test file in, with the test code it imports that the round changed, run it there - it must
369
398
  fail on its assertion - and in the lot's worktree, where it passes. The report says the red was taken on
@@ -381,12 +410,13 @@ it from a test-first red (it flags `red after green` only when the case already
381
410
 
382
411
  ## Station 6 - hand over
383
412
 
384
- Write only the lots file and run `npx dialecte handover
385
- <lots.json>`: it writes the hand-over folder and prints its card. Never a hand-written script, nor a file per
386
- commit. When the repository has a commit hook (`core.hooksPath`), rehearse first with `npx dialecte handover
387
- run <folder> --rehearse`: a scratch clone holding your tree, the hooks folder and `node_modules`, so the hook
388
- runs as it will for the user. Rehearse a heavy hook while another suite loads the machine, or at least note
389
- the load at rehearsal time (`uptime`) after the card: a quiet rehearsal hides a time bound that fails under load.
413
+ Write only the lots file and run
414
+ `npx dialecte handover write <lots.json>`: it writes the hand-over folder and prints its card. Never a
415
+ hand-written script, nor a file per commit. When the repository has a commit hook (`core.hooksPath`),
416
+ rehearse first with `npx dialecte handover run <folder> --rehearse`: a scratch clone holding your tree, the
417
+ hooks folder and `node_modules`, so the hook runs as it will for the user. Rehearse a heavy hook while another
418
+ suite loads the machine, or at least note the load at rehearsal time (`uptime`) after the card: a quiet
419
+ rehearsal hides a time bound that fails under load.
390
420
 
391
421
  **A check's result belongs to the tree it ran on.** From cli 0.2.0 every gate and hook result is recorded with
392
422
  what it checked - the tree, the installed lock, the linked `file:` dependencies and the command - and a run with
@@ -411,7 +441,9 @@ never a pasted or retyped card, which goes stale as soon as a record changes. Wi
411
441
  **is the card** `handover` printed - repository, worktree, branch, HEAD, gates, the lots with their files and
412
442
  messages, and the command with its absolute `cd` - pasted as printed, never retyped. After it: what was not verified, and one usage line (the lot's sub-agent tokens, in total
413
443
  and by station: [references/retro.md](references/retro.md)). A refusal is a finding: fix the file or the
414
- message, do not loosen the lots. `npx dialecte handover list` shows every hand-over waiting on the machine.
444
+ message, do not loosen the lots. Before reporting, stop every background task you started and check with `ps`
445
+ that none is left: a forgotten wait loop holds the worktree, and `lot close` keeps it, for as long as it runs.
446
+ `npx dialecte handover list` shows every hand-over waiting on the machine.
415
447
  Never commit, push, stage, or touch a repository's index while a hand-over may be waiting.
416
448
 
417
449
  ## Station 7 - retro
@@ -433,10 +465,15 @@ that is rewritten every retro never settles.
433
465
  in its worktree before anything else. Its hygiene step fails on a staged file or a stash added since the
434
466
  worktree was made, whatever wrote it. A failure is a finding: look with the read-only commands it prints
435
467
  and report it; never repair it with a git command that writes. When the agent changed nothing, the gate
436
- still runs its hygiene and `tdd` step and answers the rest from its record of that tree.
468
+ still runs its hygiene and `tdd` step and answers the rest from its record of that tree. Then check with `ps`
469
+ that no task the agent started is still running in its worktree: one left is stopped and reported.
437
470
  - Write each brief from [references/briefs.md](references/briefs.md): the brief is the agent's whole
438
471
  context; synthesise, do not say "based on the findings". Every brief carries its lines for all stations
439
- (nothing under `.git` by hand, no workflow without the user's opt-in, no `rm` on a variable path).
472
+ (nothing under `.git` by hand, no workflow without the user's opt-in, no `rm` on a variable path, files
473
+ edited with the edit tool, a rewriting script reads before it opens for writing, no ad-hoc file-writing
474
+ script with a lot's worktree as its working folder: it runs from the scratchpad or the hand-over folder; no
475
+ real person's name or handle in any file, test values included; every background task it started stopped,
476
+ checked with `ps`, before it reports).
440
477
  - Each station agent is defined once, for every host, in [references/stations.md](references/stations.md):
441
478
  its tier, its access (`read`, `review`: runs commands but edits nothing, `edit`) and its role (`test-writer`,
442
479
  `test-reviewer`, `implementer`, `implementer-strong`, `reviewer`, `fixer`, `eval-runner`, `grader`,
@@ -477,8 +514,8 @@ orchestrator launches in the background gets a **deadline** when it is launched:
477
514
  you - a scheduled check or a wake-up at the deadline, or a monitor on the run's log - so you are woken even
478
515
  if no notice comes. A host with none polls at the deadline.
479
516
  - **At the deadline, look at the run itself**: its process tree (`pgrep -P <pid>`, `ps -o pid,stat,time,command`:
480
- is its CPU time growing?), the agent's last activity or the log's last line and its time, and `dialecte runs`
481
- once the cli has it (the live runs of the machine, each with its state).
517
+ is its CPU time growing?), the agent's last activity or the log's last line and its time, and a list of the
518
+ machine's live runs, each with its state, once the cli has one.
482
519
  - **Kill on what you see, never on the clock.** No new output and no CPU time gained by the tree since the
483
520
  last look: it is stuck - tell the user what you saw (the tree, the last line, since when) and stop or
484
521
  restart it. Still gaining CPU time or writing output: set one more deadline. Past that second deadline it
@@ -521,6 +558,8 @@ hooks. What differs is how a host starts a session, spawns an agent and wakes yo
521
558
  - `rm`, `mv` or `xargs` on a variable path: leave temporary files in the hand-over folder or the scratchpad.
522
559
  - Wait on a background run with no deadline, or on its completion notice alone.
523
560
  - Hand over a hand-written commit or merge script.
561
+ - Write a real person's name or handle in any file, test values included: neutral names (`reviewer`,
562
+ `person-a`).
524
563
  - Implement two lots in one station "because they are small".
525
564
  - Reach for `any`, `@ts-ignore` or a skipped test to get green.
526
565
  - Let an output live only in the chat.
@@ -14,6 +14,14 @@ Never edit, move or remove a file under a repository's .git folder (a lock, a co
14
14
  No multi-agent workflow (a host tool that fans out many agents at once) unless the user opted in; a sub-agent
15
15
  of yours has its own spawn. No rm, mv or xargs on a variable path: leave temporary files in the
16
16
  hand-over folder or the scratchpad.
17
+ Edit files with the edit tool. A script that rewrites a file reads it fully before it opens the file for
18
+ writing, never both in one expression (opening for writing empties the file before the read).
19
+ Never run an ad-hoc script that writes files with a lot's worktree as its working folder: cd to the scratchpad
20
+ or the hand-over folder first, and name a worktree file by its absolute path.
21
+ No real person's name or handle in any file you write, test values included: use neutral names (`reviewer`,
22
+ `person-a`).
23
+ Before you report, stop every background task you started (a wait loop, a watcher, a server) and check with
24
+ `ps` that none is left.
17
25
  ```
18
26
 
19
27
  ## Test-station brief
@@ -24,6 +32,10 @@ Tier: standard (model-tiers.md; `npx @dialecte/cli models` says which model). St
24
32
 
25
33
  Step: <the 3-6 behaviours of the step, as case keys "<state> → <outcome>">
26
34
  Spec: <the plan section(s), by path and heading; the decisions that bind it>
35
+ Invariant (a lot that deletes, moves or resets on its own; else no such line): <never <act> on <thing> unless
36
+ proven <X>, <Y>>; every test checks it, and the adversarial cases are written first.
37
+ Preservation (a step that removes content; else no such line): a check per unit that only the target went, and
38
+ a boundary case where the target touches what must stay.
27
39
  Read: this brief and the existing code only - not an implementation, not another agent's notes.
28
40
  Worktree: <absolute path>, branch <branch>, base <sha>. Work only there. Never commit, stage, push,
29
41
  `git stash` or any git command that writes the index.
@@ -31,9 +43,15 @@ You may change: the test files of the step, and stubs - new exports with their r
31
43
  `new Error('not implemented: <name>')`. Never a behaviour of the production code.
32
44
  Each test calls the code under test inside an `expect(...)` a matcher completes, so a stub's error is a
33
45
  red on the behaviour. Remove every `.only` and `only: true` before `tdd red` (it refuses a file holding one).
46
+ Each case spells its full title: `tdd` keys a case by its title, and vitest cuts each `$` field of an
47
+ `it.each(...)` title (`'$name'`) at 40 characters, so long names collide - never a `$` field for them.
34
48
  A test that reads the disk, spawns a process or measures time carries an explicit bound with wide slack,
35
49
  a named constant (core: `SOURCE_SCAN_TIMEOUT_MS` in `src/test/test-timing.constants.ts`), never the
36
50
  runner's default timeout.
51
+ Rename mapping (a lot that renames an output across many cases; else no such line): <the rule, `<call>` →
52
+ `<expected text>`>. Before `tdd red`, one audit pass of every touched file against it.
53
+ Per step: the other tests related to the files you touched, `check`, and `dialecte rules` on them (a dialecte
54
+ package). After any edit of a test - a test-review return included - you take `tdd red` again.
37
55
  Done when `npx dialecte tdd red` records a red for every case of the step; a refused case (passes, missing
38
56
  export, type or syntax error, timeout, stub at import or before the assertion) is fixed in the test.
39
57
  Report: the `tdd red` output, unfiltered, and the list of stubs.
@@ -86,7 +104,9 @@ Skills: load dialecte and dialecte-lot (and dialecte-contributing in a dialecte
86
104
  before the change; runs with and before the change on the standard and strong tiers, several per
87
105
  configuration; graded blind by
88
106
  a separate agent, never by you; its benchmark and viewer paths in your report.
89
- Gates: fast gate per behaviour; full Definition of Done once at the end (<the package's commands>).
107
+ Gates: per step, the tests related to the touched files, `check` and `dialecte rules` on them (a dialecte
108
+ package); fast gate per behaviour; full Definition of Done once at the end (<the package's commands>).
109
+ Discovery: <the lot's decisions.md> lists what already covers the concept; reuse it, or add why not there.
90
110
  Mutation (a dialecte package that declares a mutation scope; else no such line): <off | changed | gate | audit, set in .dialecte/lot.json>; once green (a gate lot: again after the last
91
111
  fix), `dialecte mutants run` in the background, survivors judged (`dialecte mutants judge --json`, then a
92
112
  test, `record` or `schedule`), `dialecte mutants status` before the report: no new survivor, no died run, a
@@ -121,8 +141,8 @@ Later rounds - delta review of the fix diff and its blast radius only. Start fro
121
141
  `git diff --no-index --no-color --no-ext-diff round-<n-1>/<file> <worktree>/<file>`; not in round-<n-1>/ (at
122
142
  the base then), `git -C <worktree> diff --no-color --no-ext-diff HEAD -- <file>`, or /dev/null as the left
123
143
  side for a file the base does not have or that round-<n-1>.deleted lists; gone from the worktree, /dev/null as
124
- the right side (from cli 0.2.0, `dialecte review delta <folder> --round <n>` prints that diff per file).
125
- Throwaway worktree: <path - from `dialecte review delta <folder> --round <n> --worktree` (cli 0.2.0; the
144
+ the right side (from cli 0.4.0, `dialecte lot delta <folder> --round <n>` prints that diff per file).
145
+ Throwaway worktree: <path - from `dialecte lot delta <folder> --round <n> --worktree` (cli 0.4.0; the
126
146
  fixer's, when it made one), or made by the orchestrator with `dialecte worktree add <repository> <lot-branch>-round-<n-1> --from
127
147
  <base>`, round-<n-1>/ copied over, `git -C <throwaway> rm -q --pathspec-from-file=<folder>/round-<n-1>.deleted
128
148
  --pathspec-file-nul` | none>. Verify each fix: copy its new test file in and run it there - it must fail - and in
@@ -133,7 +153,11 @@ Later rounds - delta review of the fix diff and its blast radius only. Start fro
133
153
  Rules: the repository's code rules and Definition of Done (dialecte-contributing in a dialecte package), dialecte (reuse ladder).
134
154
  Run (read-only): the tests of the lot, `skills check`, the type-check - report the real counts.
135
155
  Check: every time bound of a test reading the disk, spawning a process or measuring time holds under load;
136
- a hand-written commit or merge script in the hand-over is a finding (it goes through `dialecte handover`).
156
+ a hand-written commit or merge script in the hand-over is a finding (it goes through `dialecte handover`);
157
+ the diff against the discovery list in <the lot's decisions.md> (a hand-rolled helper it missed is a
158
+ finding); `git -C <worktree> grep -i -w -f <names file>` over the changed files for real people's names and
159
+ handles, test values included (<names file: one name or handle per line, kept outside every repository, the
160
+ brief carries only its path>).
137
161
  Answer: would you approve? Use the review report shape, with a severity per finding and the proposed findings-ledger rows.
138
162
  Max ~80 lines, most severe first, file:line for each finding.
139
163
  ```
@@ -150,8 +174,8 @@ Blast radius, one line under each fix: what it widens, excludes or replaces (a p
150
174
  now matching more or less; the earlier code or fix it replaces), and the findings-ledger rows it touches - its
151
175
  own and any other whose code it changes ("none beyond <id>" when so). The next round's reviewer starts there.
152
176
  A fix's new test: write it before the fix and take its red with `npx dialecte tdd red`; when production already
153
- holds the fix, run it on round <n>'s tree - `npx dialecte review delta <hand-over folder> --round <n+1>
154
- --worktree` (cli 0.2.0; else the throwaway I made: <path>) makes the throwaway and prints its removal command;
177
+ holds the fix, run it on round <n>'s tree - `npx dialecte lot delta <hand-over folder> --round <n+1>
178
+ --worktree` (cli 0.4.0; else the throwaway I made: <path>) makes the throwaway and prints its removal command;
155
179
  copy in the test file and the test code it imports - where it must fail on its assertion, and report "red on
156
180
  round-<n>/: <failing line>" with the throwaway's path. Never edit production back to the old behaviour to get
157
181
  a red.