footprintjs 9.48.2 → 10.0.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 (326) hide show
  1. package/AGENTS.md +12 -10
  2. package/CLAUDE.md +21 -23
  3. package/README.md +1 -1
  4. package/dist/advanced.js +71 -128
  5. package/dist/esm/advanced.d.ts +24 -58
  6. package/dist/esm/advanced.js +13 -51
  7. package/dist/esm/index.d.ts +5 -8
  8. package/dist/esm/index.js +3 -3
  9. package/dist/esm/lib/builder/FlowChartBuilder.d.ts +1 -1
  10. package/dist/esm/lib/builder/FlowChartBuilder.js +3 -3
  11. package/dist/esm/lib/builder/structure/StructureRecorder.d.ts +1 -1
  12. package/dist/esm/lib/builder/structure/StructureRecorder.js +1 -1
  13. package/dist/esm/lib/capture/index.d.ts +0 -1
  14. package/dist/esm/lib/capture/index.js +1 -2
  15. package/dist/esm/lib/engine/graph/prefixNodeTree.js +2 -2
  16. package/dist/esm/lib/engine/handlers/ResumeEntry.d.ts +3 -3
  17. package/dist/esm/lib/engine/handlers/ResumeEntry.js +4 -4
  18. package/dist/esm/lib/engine/handlers/SubflowExecutor.d.ts +1 -2
  19. package/dist/esm/lib/engine/handlers/SubflowExecutor.js +4 -8
  20. package/dist/esm/lib/engine/index.d.ts +1 -1
  21. package/dist/esm/lib/engine/index.js +1 -1
  22. package/dist/esm/lib/engine/narrative/CombinedNarrativeRecorder.d.ts +4 -4
  23. package/dist/esm/lib/engine/narrative/CombinedNarrativeRecorder.js +1 -1
  24. package/dist/esm/lib/engine/narrative/index.d.ts +1 -1
  25. package/dist/esm/lib/engine/narrative/index.js +1 -1
  26. package/dist/esm/lib/engine/narrative/narrativeTypes.d.ts +1 -11
  27. package/dist/esm/lib/engine/narrative/narrativeTypes.js +1 -1
  28. package/dist/esm/lib/engine/traversal/FlowchartTraverser.d.ts +2 -10
  29. package/dist/esm/lib/engine/traversal/FlowchartTraverser.js +4 -6
  30. package/dist/esm/lib/engine/traversalContext.d.ts +1 -1
  31. package/dist/esm/lib/engine/traversalContext.js +2 -2
  32. package/dist/esm/lib/engine/types.d.ts +2 -10
  33. package/dist/esm/lib/engine/types.js +1 -1
  34. package/dist/esm/lib/engine/walkSubflowSpec.js +2 -2
  35. package/dist/esm/lib/ids/reservedIds.js +2 -2
  36. package/dist/esm/lib/memory/DiagnosticCollector.js +2 -2
  37. package/dist/esm/lib/memory/StageContext.d.ts +2 -4
  38. package/dist/esm/lib/memory/StageContext.js +2 -2
  39. package/dist/esm/lib/memory/borrowedMutation.js +2 -2
  40. package/dist/esm/lib/memory/index.d.ts +6 -21
  41. package/dist/esm/lib/memory/index.js +4 -22
  42. package/dist/esm/lib/memory/redaction.d.ts +1 -1
  43. package/dist/esm/lib/memory/redaction.js +2 -2
  44. package/dist/esm/lib/memory/runPolicy.d.ts +3 -2
  45. package/dist/esm/lib/memory/runPolicy.js +1 -1
  46. package/dist/esm/lib/reactive/createTypedScope.js +2 -2
  47. package/dist/esm/lib/reactive/writeTraps.js +2 -2
  48. package/dist/esm/lib/recorder/ControlDepRecorder.d.ts +3 -2
  49. package/dist/esm/lib/recorder/ControlDepRecorder.js +3 -2
  50. package/dist/esm/lib/recorder/EmitRecorder.d.ts +1 -1
  51. package/dist/esm/lib/recorder/EmitRecorder.js +1 -1
  52. package/dist/esm/lib/recorder/InOutRecorder.js +2 -2
  53. package/dist/esm/lib/recorder/qualityTrace.d.ts +1 -1
  54. package/dist/esm/lib/recorder/qualityTrace.js +2 -2
  55. package/dist/esm/lib/runner/DeferredObserverTier.js +2 -2
  56. package/dist/esm/lib/runner/ExecutionRuntime.d.ts +4 -5
  57. package/dist/esm/lib/runner/ExecutionRuntime.js +2 -5
  58. package/dist/esm/lib/runner/FlowChartExecutor.d.ts +1 -1
  59. package/dist/esm/lib/runner/FlowChartExecutor.js +1 -1
  60. package/dist/esm/lib/runner/getSubtreeSnapshot.d.ts +1 -1
  61. package/dist/esm/lib/runner/getSubtreeSnapshot.js +4 -4
  62. package/dist/esm/lib/runner/resume.js +2 -2
  63. package/dist/esm/lib/runner/snapshot.js +3 -2
  64. package/dist/esm/lib/scope/ScopeFacade.js +2 -2
  65. package/dist/esm/lib/scope/state/zod/scopeFactory.js +2 -2
  66. package/dist/esm/recorders.d.ts +2 -3
  67. package/dist/esm/recorders.js +1 -1
  68. package/dist/esm/trace.d.ts +11 -57
  69. package/dist/esm/trace.js +10 -68
  70. package/dist/index.js +3 -3
  71. package/dist/lib/builder/FlowChartBuilder.js +5 -5
  72. package/dist/lib/builder/structure/StructureRecorder.js +1 -1
  73. package/dist/lib/capture/index.js +2 -4
  74. package/dist/lib/engine/graph/prefixNodeTree.js +5 -5
  75. package/dist/lib/engine/handlers/ResumeEntry.js +4 -4
  76. package/dist/lib/engine/handlers/SubflowExecutor.js +5 -9
  77. package/dist/lib/engine/index.js +1 -1
  78. package/dist/lib/engine/narrative/CombinedNarrativeRecorder.js +1 -1
  79. package/dist/lib/engine/narrative/index.js +1 -1
  80. package/dist/lib/engine/narrative/narrativeTypes.js +1 -1
  81. package/dist/lib/engine/traversal/FlowchartTraverser.js +8 -10
  82. package/dist/lib/engine/traversalContext.js +4 -4
  83. package/dist/lib/engine/types.js +1 -1
  84. package/dist/lib/engine/walkSubflowSpec.js +3 -3
  85. package/dist/lib/ids/reservedIds.js +5 -5
  86. package/dist/lib/memory/DiagnosticCollector.js +3 -3
  87. package/dist/lib/memory/StageContext.js +3 -3
  88. package/dist/lib/memory/borrowedMutation.js +3 -3
  89. package/dist/lib/memory/index.js +7 -42
  90. package/dist/lib/memory/redaction.js +3 -3
  91. package/dist/lib/memory/runPolicy.js +1 -1
  92. package/dist/lib/reactive/createTypedScope.js +3 -3
  93. package/dist/lib/reactive/writeTraps.js +4 -4
  94. package/dist/lib/recorder/ControlDepRecorder.js +3 -2
  95. package/dist/lib/recorder/EmitRecorder.js +1 -1
  96. package/dist/lib/recorder/InOutRecorder.js +3 -3
  97. package/dist/lib/recorder/qualityTrace.js +4 -4
  98. package/dist/lib/runner/DeferredObserverTier.js +3 -3
  99. package/dist/lib/runner/ExecutionRuntime.js +6 -9
  100. package/dist/lib/runner/FlowChartExecutor.js +1 -1
  101. package/dist/lib/runner/getSubtreeSnapshot.js +6 -6
  102. package/dist/lib/runner/resume.js +3 -3
  103. package/dist/lib/runner/snapshot.js +6 -5
  104. package/dist/lib/scope/ScopeFacade.js +3 -3
  105. package/dist/lib/scope/state/zod/scopeFactory.js +4 -4
  106. package/dist/recorders.js +1 -1
  107. package/dist/trace.js +18 -120
  108. package/dist/types/advanced.d.ts +24 -58
  109. package/dist/types/index.d.ts +5 -8
  110. package/dist/types/lib/builder/FlowChartBuilder.d.ts +1 -1
  111. package/dist/types/lib/builder/structure/StructureRecorder.d.ts +1 -1
  112. package/dist/types/lib/capture/index.d.ts +0 -1
  113. package/dist/types/lib/engine/handlers/ResumeEntry.d.ts +3 -3
  114. package/dist/types/lib/engine/handlers/SubflowExecutor.d.ts +1 -2
  115. package/dist/types/lib/engine/index.d.ts +1 -1
  116. package/dist/types/lib/engine/narrative/CombinedNarrativeRecorder.d.ts +4 -4
  117. package/dist/types/lib/engine/narrative/index.d.ts +1 -1
  118. package/dist/types/lib/engine/narrative/narrativeTypes.d.ts +1 -11
  119. package/dist/types/lib/engine/traversal/FlowchartTraverser.d.ts +2 -10
  120. package/dist/types/lib/engine/traversalContext.d.ts +1 -1
  121. package/dist/types/lib/engine/types.d.ts +2 -10
  122. package/dist/types/lib/memory/StageContext.d.ts +2 -4
  123. package/dist/types/lib/memory/index.d.ts +6 -21
  124. package/dist/types/lib/memory/redaction.d.ts +1 -1
  125. package/dist/types/lib/memory/runPolicy.d.ts +3 -2
  126. package/dist/types/lib/recorder/ControlDepRecorder.d.ts +3 -2
  127. package/dist/types/lib/recorder/EmitRecorder.d.ts +1 -1
  128. package/dist/types/lib/recorder/qualityTrace.d.ts +1 -1
  129. package/dist/types/lib/runner/ExecutionRuntime.d.ts +4 -5
  130. package/dist/types/lib/runner/FlowChartExecutor.d.ts +1 -1
  131. package/dist/types/lib/runner/getSubtreeSnapshot.d.ts +1 -1
  132. package/dist/types/recorders.d.ts +2 -3
  133. package/dist/types/trace.d.ts +11 -57
  134. package/package.json +6 -15
  135. package/dist/esm/lib/capture/freeze.d.ts +0 -91
  136. package/dist/esm/lib/capture/freeze.js +0 -314
  137. package/dist/esm/lib/capture/ownData.d.ts +0 -7
  138. package/dist/esm/lib/capture/ownData.js +0 -15
  139. package/dist/esm/lib/capture/valueKinds.d.ts +0 -57
  140. package/dist/esm/lib/capture/valueKinds.js +0 -142
  141. package/dist/esm/lib/ids/runtimeStageId.d.ts +0 -173
  142. package/dist/esm/lib/ids/runtimeStageId.js +0 -194
  143. package/dist/esm/lib/memory/EventLog.d.ts +0 -105
  144. package/dist/esm/lib/memory/EventLog.js +0 -148
  145. package/dist/esm/lib/memory/RecordFrame.d.ts +0 -232
  146. package/dist/esm/lib/memory/RecordFrame.js +0 -296
  147. package/dist/esm/lib/memory/SharedMemory.d.ts +0 -46
  148. package/dist/esm/lib/memory/SharedMemory.js +0 -88
  149. package/dist/esm/lib/memory/TransactionBuffer.d.ts +0 -521
  150. package/dist/esm/lib/memory/TransactionBuffer.js +0 -946
  151. package/dist/esm/lib/memory/admission.d.ts +0 -81
  152. package/dist/esm/lib/memory/admission.js +0 -153
  153. package/dist/esm/lib/memory/backtrack.d.ts +0 -286
  154. package/dist/esm/lib/memory/backtrack.js +0 -457
  155. package/dist/esm/lib/memory/commitLogUtils.d.ts +0 -217
  156. package/dist/esm/lib/memory/commitLogUtils.js +0 -384
  157. package/dist/esm/lib/memory/deltaEncoding.d.ts +0 -66
  158. package/dist/esm/lib/memory/deltaEncoding.js +0 -122
  159. package/dist/esm/lib/memory/equality.d.ts +0 -93
  160. package/dist/esm/lib/memory/equality.js +0 -262
  161. package/dist/esm/lib/memory/eventPosition.d.ts +0 -18
  162. package/dist/esm/lib/memory/eventPosition.js +0 -2
  163. package/dist/esm/lib/memory/honesty.d.ts +0 -93
  164. package/dist/esm/lib/memory/honesty.js +0 -92
  165. package/dist/esm/lib/memory/keyPaths.d.ts +0 -125
  166. package/dist/esm/lib/memory/keyPaths.js +0 -227
  167. package/dist/esm/lib/memory/logModel.d.ts +0 -76
  168. package/dist/esm/lib/memory/logModel.js +0 -364
  169. package/dist/esm/lib/memory/merge.d.ts +0 -26
  170. package/dist/esm/lib/memory/merge.js +0 -60
  171. package/dist/esm/lib/memory/pathOps.d.ts +0 -115
  172. package/dist/esm/lib/memory/pathOps.js +0 -290
  173. package/dist/esm/lib/memory/paths.d.ts +0 -52
  174. package/dist/esm/lib/memory/paths.js +0 -57
  175. package/dist/esm/lib/memory/placeholders.d.ts +0 -39
  176. package/dist/esm/lib/memory/placeholders.js +0 -40
  177. package/dist/esm/lib/memory/recordCommit.d.ts +0 -45
  178. package/dist/esm/lib/memory/recordCommit.js +0 -61
  179. package/dist/esm/lib/memory/scrub.d.ts +0 -53
  180. package/dist/esm/lib/memory/scrub.js +0 -74
  181. package/dist/esm/lib/memory/types.d.ts +0 -209
  182. package/dist/esm/lib/memory/types.js +0 -10
  183. package/dist/esm/lib/memory/utils.d.ts +0 -73
  184. package/dist/esm/lib/memory/utils.js +0 -159
  185. package/dist/esm/lib/memory/verbs.d.ts +0 -333
  186. package/dist/esm/lib/memory/verbs.js +0 -427
  187. package/dist/esm/lib/recorder/CommitRangeIndex.d.ts +0 -147
  188. package/dist/esm/lib/recorder/CommitRangeIndex.js +0 -207
  189. package/dist/esm/lib/scope/detectCircular.d.ts +0 -13
  190. package/dist/esm/lib/scope/detectCircular.js +0 -14
  191. package/dist/esm/lib/scope/recorders/summarizeValue.d.ts +0 -5
  192. package/dist/esm/lib/scope/recorders/summarizeValue.js +0 -6
  193. package/dist/esm/lib/slice/elementProvenance.d.ts +0 -81
  194. package/dist/esm/lib/slice/elementProvenance.js +0 -190
  195. package/dist/esm/lib/slice/forwardSliceForKey.d.ts +0 -88
  196. package/dist/esm/lib/slice/forwardSliceForKey.js +0 -243
  197. package/dist/esm/lib/slice/index.d.ts +0 -25
  198. package/dist/esm/lib/slice/index.js +0 -25
  199. package/dist/esm/lib/slice/keyIndex.d.ts +0 -137
  200. package/dist/esm/lib/slice/keyIndex.js +0 -293
  201. package/dist/esm/lib/slice/keyTimeline.d.ts +0 -49
  202. package/dist/esm/lib/slice/keyTimeline.js +0 -113
  203. package/dist/esm/lib/slice/keysReadSources.d.ts +0 -51
  204. package/dist/esm/lib/slice/keysReadSources.js +0 -95
  205. package/dist/esm/lib/slice/serialize.d.ts +0 -78
  206. package/dist/esm/lib/slice/serialize.js +0 -278
  207. package/dist/esm/lib/slice/sliceForKey.d.ts +0 -47
  208. package/dist/esm/lib/slice/sliceForKey.js +0 -88
  209. package/dist/esm/lib/slice/types.d.ts +0 -567
  210. package/dist/esm/lib/slice/types.js +0 -25
  211. package/dist/esm/lib/time-travel/axis.d.ts +0 -119
  212. package/dist/esm/lib/time-travel/axis.js +0 -179
  213. package/dist/esm/lib/time-travel/bundles.d.ts +0 -77
  214. package/dist/esm/lib/time-travel/bundles.js +0 -136
  215. package/dist/esm/lib/time-travel/chain.d.ts +0 -93
  216. package/dist/esm/lib/time-travel/chain.js +0 -188
  217. package/dist/esm/lib/time-travel/commitStops.d.ts +0 -55
  218. package/dist/esm/lib/time-travel/commitStops.js +0 -202
  219. package/dist/esm/lib/time-travel/index.d.ts +0 -22
  220. package/dist/esm/lib/time-travel/index.js +0 -21
  221. package/dist/esm/lib/time-travel/stateAt.d.ts +0 -102
  222. package/dist/esm/lib/time-travel/stateAt.js +0 -153
  223. package/dist/esm/lib/time-travel/tagStops.d.ts +0 -72
  224. package/dist/esm/lib/time-travel/tagStops.js +0 -102
  225. package/dist/esm/lib/time-travel/timeTravel.d.ts +0 -70
  226. package/dist/esm/lib/time-travel/timeTravel.js +0 -360
  227. package/dist/esm/lib/time-travel/types.d.ts +0 -470
  228. package/dist/esm/lib/time-travel/types.js +0 -23
  229. package/dist/esm/write.d.ts +0 -47
  230. package/dist/esm/write.js +0 -46
  231. package/dist/lib/capture/freeze.js +0 -320
  232. package/dist/lib/capture/ownData.js +0 -19
  233. package/dist/lib/capture/valueKinds.js +0 -146
  234. package/dist/lib/ids/runtimeStageId.js +0 -210
  235. package/dist/lib/memory/EventLog.js +0 -152
  236. package/dist/lib/memory/RecordFrame.js +0 -300
  237. package/dist/lib/memory/SharedMemory.js +0 -92
  238. package/dist/lib/memory/TransactionBuffer.js +0 -950
  239. package/dist/lib/memory/admission.js +0 -159
  240. package/dist/lib/memory/backtrack.js +0 -463
  241. package/dist/lib/memory/commitLogUtils.js +0 -399
  242. package/dist/lib/memory/deltaEncoding.js +0 -128
  243. package/dist/lib/memory/equality.js +0 -266
  244. package/dist/lib/memory/eventPosition.js +0 -3
  245. package/dist/lib/memory/honesty.js +0 -95
  246. package/dist/lib/memory/keyPaths.js +0 -243
  247. package/dist/lib/memory/logModel.js +0 -372
  248. package/dist/lib/memory/merge.js +0 -64
  249. package/dist/lib/memory/pathOps.js +0 -306
  250. package/dist/lib/memory/paths.js +0 -62
  251. package/dist/lib/memory/placeholders.js +0 -43
  252. package/dist/lib/memory/recordCommit.js +0 -65
  253. package/dist/lib/memory/scrub.js +0 -79
  254. package/dist/lib/memory/types.js +0 -11
  255. package/dist/lib/memory/utils.js +0 -178
  256. package/dist/lib/memory/verbs.js +0 -444
  257. package/dist/lib/recorder/CommitRangeIndex.js +0 -211
  258. package/dist/lib/scope/detectCircular.js +0 -21
  259. package/dist/lib/scope/recorders/summarizeValue.js +0 -10
  260. package/dist/lib/slice/elementProvenance.js +0 -195
  261. package/dist/lib/slice/forwardSliceForKey.js +0 -247
  262. package/dist/lib/slice/index.js +0 -42
  263. package/dist/lib/slice/keyIndex.js +0 -313
  264. package/dist/lib/slice/keyTimeline.js +0 -117
  265. package/dist/lib/slice/keysReadSources.js +0 -101
  266. package/dist/lib/slice/serialize.js +0 -286
  267. package/dist/lib/slice/sliceForKey.js +0 -93
  268. package/dist/lib/slice/types.js +0 -26
  269. package/dist/lib/time-travel/axis.js +0 -184
  270. package/dist/lib/time-travel/bundles.js +0 -144
  271. package/dist/lib/time-travel/chain.js +0 -193
  272. package/dist/lib/time-travel/commitStops.js +0 -206
  273. package/dist/lib/time-travel/index.js +0 -32
  274. package/dist/lib/time-travel/stateAt.js +0 -160
  275. package/dist/lib/time-travel/tagStops.js +0 -106
  276. package/dist/lib/time-travel/timeTravel.js +0 -364
  277. package/dist/lib/time-travel/types.js +0 -24
  278. package/dist/types/lib/capture/freeze.d.ts +0 -91
  279. package/dist/types/lib/capture/ownData.d.ts +0 -7
  280. package/dist/types/lib/capture/valueKinds.d.ts +0 -57
  281. package/dist/types/lib/ids/runtimeStageId.d.ts +0 -173
  282. package/dist/types/lib/memory/EventLog.d.ts +0 -105
  283. package/dist/types/lib/memory/RecordFrame.d.ts +0 -232
  284. package/dist/types/lib/memory/SharedMemory.d.ts +0 -46
  285. package/dist/types/lib/memory/TransactionBuffer.d.ts +0 -521
  286. package/dist/types/lib/memory/admission.d.ts +0 -81
  287. package/dist/types/lib/memory/backtrack.d.ts +0 -286
  288. package/dist/types/lib/memory/commitLogUtils.d.ts +0 -217
  289. package/dist/types/lib/memory/deltaEncoding.d.ts +0 -66
  290. package/dist/types/lib/memory/equality.d.ts +0 -93
  291. package/dist/types/lib/memory/eventPosition.d.ts +0 -18
  292. package/dist/types/lib/memory/honesty.d.ts +0 -93
  293. package/dist/types/lib/memory/keyPaths.d.ts +0 -125
  294. package/dist/types/lib/memory/logModel.d.ts +0 -76
  295. package/dist/types/lib/memory/merge.d.ts +0 -26
  296. package/dist/types/lib/memory/pathOps.d.ts +0 -115
  297. package/dist/types/lib/memory/paths.d.ts +0 -52
  298. package/dist/types/lib/memory/placeholders.d.ts +0 -39
  299. package/dist/types/lib/memory/recordCommit.d.ts +0 -45
  300. package/dist/types/lib/memory/scrub.d.ts +0 -53
  301. package/dist/types/lib/memory/types.d.ts +0 -209
  302. package/dist/types/lib/memory/utils.d.ts +0 -73
  303. package/dist/types/lib/memory/verbs.d.ts +0 -333
  304. package/dist/types/lib/recorder/CommitRangeIndex.d.ts +0 -147
  305. package/dist/types/lib/scope/detectCircular.d.ts +0 -13
  306. package/dist/types/lib/scope/recorders/summarizeValue.d.ts +0 -5
  307. package/dist/types/lib/slice/elementProvenance.d.ts +0 -81
  308. package/dist/types/lib/slice/forwardSliceForKey.d.ts +0 -88
  309. package/dist/types/lib/slice/index.d.ts +0 -25
  310. package/dist/types/lib/slice/keyIndex.d.ts +0 -137
  311. package/dist/types/lib/slice/keyTimeline.d.ts +0 -49
  312. package/dist/types/lib/slice/keysReadSources.d.ts +0 -51
  313. package/dist/types/lib/slice/serialize.d.ts +0 -78
  314. package/dist/types/lib/slice/sliceForKey.d.ts +0 -47
  315. package/dist/types/lib/slice/types.d.ts +0 -567
  316. package/dist/types/lib/time-travel/axis.d.ts +0 -119
  317. package/dist/types/lib/time-travel/bundles.d.ts +0 -77
  318. package/dist/types/lib/time-travel/chain.d.ts +0 -93
  319. package/dist/types/lib/time-travel/commitStops.d.ts +0 -55
  320. package/dist/types/lib/time-travel/index.d.ts +0 -22
  321. package/dist/types/lib/time-travel/stateAt.d.ts +0 -102
  322. package/dist/types/lib/time-travel/tagStops.d.ts +0 -72
  323. package/dist/types/lib/time-travel/timeTravel.d.ts +0 -70
  324. package/dist/types/lib/time-travel/types.d.ts +0 -470
  325. package/dist/types/write.d.ts +0 -47
  326. package/dist/write.js +0 -52
@@ -1,217 +0,0 @@
1
- /**
2
- * Typed utilities for querying the commit log.
3
- *
4
- * The commitLog is an ordered array of CommitBundle — one per stage commit.
5
- * These helpers provide type-safe queries without (b: any) casts.
6
- */
7
- import type { RegisteredCode } from './honesty.js';
8
- import type { CommitBundle, CommitPhase } from './types.js';
9
- import { type Touch } from './verbs.js';
10
- /**
11
- * Find the first commit by `stageId`, optionally the first one that WROTE `key` — under the writer
12
- * rule: a row on the key, inside it, or around it that changed it (see {@link writersOf}).
13
- */
14
- export declare function findCommit(commitLog: CommitBundle[], stageId: string, key?: string): CommitBundle | undefined;
15
- /** Find all commits by stageId. */
16
- export declare function findCommits(commitLog: CommitBundle[], stageId: string): CommitBundle[];
17
- /**
18
- * Find the last commit that WROTE `key` before `beforeIdx` (exclusive; default: the whole log) —
19
- * the anchor of every backward question ("who made it this?").
20
- *
21
- * The writer rule (`keyPaths.ts`): a commit writes `key` when one of its rows is ON the key,
22
- * INSIDE it (a subflow's input seed writes `cfg␟a`; an outputMapper merge-back writes `cfg␟b`;
23
- * either is a write of `cfg`), or AROUND it with the value at the key different across the commit
24
- * (a `set` of `cfg` writes `cfg␟a`; a `merge` of `cfg` that never reaches `a` does not). A write
25
- * found through a row INSIDE the key wrote only PART of its value — the slice readers say so with
26
- * the `'nested-rows'` note.
27
- *
28
- * @param key A DELIM-joined path (`normalisePath`); a top-level key is a one-segment path.
29
- */
30
- export declare function findLastWriter(commitLog: CommitBundle[], key: string, beforeIdx?: number): CommitBundle | undefined;
31
- /** What {@link writersOf} is asked. */
32
- export interface WritersOptions {
33
- /** The last commit ARRAY index considered, inclusive. Default: the whole log. */
34
- readonly end?: number;
35
- }
36
- /**
37
- * The ARRAY positions (ascending) of every commit in `commitLog[0..end]` that WROTE `key` — the
38
- * writer rule of `keyPaths.ts`, the one definition every key query shares (`logModel.ts` applies it).
39
- */
40
- export declare function writersOf(commitLog: readonly CommitBundle[], key: string, options?: WritersOptions): number[];
41
- /**
42
- * Every row under `key`'s TOP-LEVEL key in `commitLog[0..end]`, in commit order — the rows the value
43
- * rule folds ({@link foldKey}), each with its {@link Touch.relation} to `key` (absent for a sibling
44
- * under the same top-level key: applied, not observed) — found through the log's index. A row whose
45
- * verb is not one of the four is refused with {@link UnknownVerbError} naming the row — whether or
46
- * not the fold would have reached it: the answer must not depend on where an optimisation starts.
47
- */
48
- export declare function rowsUnderRoot(commitLog: readonly CommitBundle[], key: string, end: number): Touch[];
49
- /**
50
- * Reconstruct the FULL value of `key` as of commit array index `idx`
51
- * (inclusive) — the migration helper for the "read `bundle.overwrite[key]`
52
- * as the full value written" pattern (#13c-B).
53
- *
54
- * The value rule (`keyPaths.ts`, 9.33.0): every row under the key's TOP-LEVEL
55
- * key in `commitLog[0..idx]` is folded, anchored at that key's last `set` /
56
- * `delete`, with the SAME step and clone discipline the replay uses
57
- * (`verbs.ts` · `foldKey`), and the result is read at `key`. So the answer is
58
- * the value `stateAt` gives at that path when it folds the log alone — rows
59
- * INSIDE the key (a subflow seed, an outputMapper merge-back) and AROUND it (a
60
- * `set` of the container) count; before 9.33.0 only rows on the exact path did,
61
- * and a seeded `cfg` read as `undefined`. Under `commitValues: 'delta'`, an
62
- * `append` row's `overwrite[key]` holds only the TAIL; the fold puts the array
63
- * back together. Two `merge` rows of one bundle see one copy of the bundle's
64
- * delta, as the replay's do.
65
- *
66
- * @param key A DELIM-joined path (`normalisePath`); a top-level key is a
67
- * one-segment path.
68
- * @param idx CommitBundle ARRAY index (the `bundle.idx` position),
69
- * inclusive. NOT the executionIndex from a runtimeStageId.
70
- * @returns The reconstructed value (a detached clone), or `undefined` when no
71
- * row in `commitLog[0..idx]` is on, inside or around the key, or the fold
72
- * leaves it absent (its last write was a delete). Caveat: a key that held a
73
- * value in the run's INITIAL state folds from absent here — the log alone
74
- * cannot see the pre-run base, so merges and nested writes onto a seeded key
75
- * give only what they added. Since 9.17.0 the base TRAVELS with the log:
76
- * `stateAt(snapshot, idx)` (footprintjs/trace) folds from
77
- * `RuntimeSnapshot.initialState`, which this function never receives.
78
- * @throws {@link UnknownVerbError} when a row under the key's top-level key
79
- * carries a verb other than `set | merge | append | delete` — a foreign or
80
- * corrupted log is refused, not folded as a `merge`. Engine-written logs
81
- * never carry one.
82
- * @see commitValueAtWithBasis — the same answer, with the codes that say WHY it is
83
- * `undefined` or partial (and the `initialState` base this function never receives).
84
- */
85
- export declare function commitValueAt(commitLog: CommitBundle[], idx: number, key: string): unknown;
86
- /**
87
- * Why {@link commitValueAtWithBasis} answered what it did. Each code is registered, with the one
88
- * sentence that says what it means, in `memory/honesty.ts · HONESTY_CODES` (served on
89
- * `footprintjs/trace`); the union declares its members through `RegisteredCode`.
90
- *
91
- * - `'never-written'` — no commit in range wrote the key (the writer rule — the answer
92
- * `findLastWriter` and the slice layer give), unless the run removed a value
93
- * the passed `initialState` held (then `'deleted'`), or a redaction at or
94
- * around the key hid the write (then `'redacted'` alone).
95
- * - `'deleted'` — the answer is `undefined` and the key WAS written: its last write left it
96
- * absent.
97
- * - `'nested-rows'` — the value rests on rows INSIDE the key (a subflow seed, an outputMapper
98
- * merge-back, a fork child's namespace) with no `set`/`delete` of the key or
99
- * of a container around it in range.
100
- * - `'from-initial-state'` — no `set`/`delete` of the key or around it in range, so the value rests on
101
- * the pre-run base: folded from `options.initialState` when it holds the
102
- * key's top-level key, partial when no `initialState` was passed.
103
- * - `'redacted'` — a path at, inside or around the key is in the `redactedPaths` of a commit
104
- * the value rests on (from its last `set`/`delete` on, or the whole range).
105
- */
106
- export type ValueBasis = RegisteredCode<'never-written' | 'deleted' | 'nested-rows' | 'from-initial-state' | 'redacted'>;
107
- /** What {@link commitValueAtWithBasis} is asked besides the log, the index and the key. */
108
- export interface ValueBasisOptions {
109
- /**
110
- * The state before the run — `RuntimeSnapshot.initialState` (or a subflow's
111
- * `treeContext.initialState`). When given, a key with no `set`/`delete` in range folds from it, as
112
- * `stateAt` does; when absent, such an answer is the log-only fold and carries `'from-initial-state'`.
113
- */
114
- readonly initialState?: Readonly<Record<string, unknown>>;
115
- }
116
- /** A key's value read off the log, and the codes that say what it rests on — absent codes = an exact answer. */
117
- export interface ValueWithBasis {
118
- readonly value: unknown;
119
- /** In the order of {@link ValueBasis}'s list; EMPTY when a `set`/`delete` of the key or around it anchors the value and no redaction touched it. */
120
- readonly basis: ValueBasis[];
121
- }
122
- /**
123
- * {@link commitValueAt}, with the codes that say what the answer rests on. Without `options.initialState`
124
- * the value IS `commitValueAt(commitLog, idx, key)` (pinned by a property); with it, a key that has no
125
- * `set`/`delete` of itself or of a container around it in range folds from that base — the value
126
- * `stateAt(snapshot, idx)` gives at the key. Refuses an unknown verb exactly as `commitValueAt` does.
127
- *
128
- * @example
129
- * ```typescript
130
- * const { value, basis } = commitValueAtWithBasis(snap.commitLog, i, 'cfg', { initialState: snap.initialState });
131
- * for (const code of basis) console.log(code, HONESTY_CODES[code]);
132
- * ```
133
- */
134
- export declare function commitValueAtWithBasis(commitLog: CommitBundle[], idx: number, key: string, options?: ValueBasisOptions): ValueWithBasis;
135
- /**
136
- * Why {@link findLastWriterWithBasis} answered what it did — registered in `HONESTY_CODES`:
137
- * `'never-written'` (no writer before the bound), `'nested-rows'` (the writer reached the key only
138
- * through rows inside it, so it wrote part of the value), `'redacted'` (no writer the log can see, because a
139
- * redaction at or around the key hid the write — the rule `commitValueAtWithBasis` follows).
140
- */
141
- export type WriterBasis = RegisteredCode<'never-written' | 'nested-rows' | 'redacted'>;
142
- /** The last writer of a key, and the codes that say what kind of write it was — absent codes = a write on or around the key. */
143
- export interface WriterWithBasis {
144
- /** Absent exactly when `basis` holds `'never-written'` or `'redacted'`. */
145
- readonly writer?: CommitBundle;
146
- readonly basis: WriterBasis[];
147
- }
148
- /**
149
- * {@link findLastWriter}, with the code that says why: `writer` is `findLastWriter(commitLog, key, beforeIdx)`;
150
- * `basis` is `['never-written']` when there is none and `['nested-rows']` when that commit wrote the key
151
- * only through rows inside it.
152
- */
153
- export declare function findLastWriterWithBasis(commitLog: CommitBundle[], key: string, beforeIdx?: number): WriterWithBasis;
154
- /**
155
- * Position index over a commit log: `runtimeStageId` → the ARRAY INDEX of the
156
- * FIRST bundle that stage committed. The map's insertion order is the order
157
- * the stages first committed — execution order.
158
- *
159
- * "First" is the contract, and it is load-bearing. A stage normally commits
160
- * exactly one bundle, but some executions commit more under one
161
- * `runtimeStageId`: a subflow MOUNT (the merge-back, then the exit), a fork
162
- * child (its own commit, then the fan-out's). Since 9.39.0 the WRITER names
163
- * each continuation on the bundle (`CommitBundle.phase`: `'exit'` /
164
- * `'repeat'`), and every continuation is written after the execution's own
165
- * bundle — so "where does this stage start?" is the first bundle, and the
166
- * grouping every reader's axis uses (`commitStops`) is this index. No reader
167
- * tells a continuation from the log's shape.
168
- *
169
- * Build this ONCE when resolving many ids; use {@link commitIndexOf} for a
170
- * single lookup.
171
- *
172
- * @param commitLog Ordered commit bundles — `getSnapshot().commitLog`.
173
- * @returns A fresh Map, owned by the caller.
174
- */
175
- export declare function buildCommitIndex(commitLog: readonly CommitBundle[]): Map<string, number>;
176
- /**
177
- * Whether a log RECORDS phases — any bundle carries `phase` — i.e. it was
178
- * written by 9.39.0 or later and holds at least one continuation. A log that
179
- * does not either has no continuation at all, or predates the field (see
180
- * {@link inferLegacyPhases}).
181
- */
182
- export declare function recordsPhases(commitLog: readonly CommitBundle[]): boolean;
183
- /**
184
- * THE LEGACY READER — the one place a continuation's phase is INFERRED, for a
185
- * log written before 9.39.0 (which carries no `phase` anywhere). Returns the
186
- * phase each bundle would have been stamped with, by the rule every reader
187
- * applied through 9.38.0: a stage's bundle that IMMEDIATELY follows its first
188
- * bundle is a mount's exit; any later bundle of the same `runtimeStageId` is
189
- * a fork child's repeat; a first bundle is the stage's own (`undefined`).
190
- *
191
- * The rule is a guess, and the guess has a known miss — a single-child fork
192
- * whose child is a leaf looks exactly like a mount — which is why a reader
193
- * asks it only when the log records no phase AND it has no execution tree to
194
- * ask instead (`commitStops`). A log that records phases is never inferred.
195
- */
196
- export declare function inferLegacyPhases(commitLog: readonly CommitBundle[]): (CommitPhase | undefined)[];
197
- /**
198
- * The ARRAY INDEX of the first commit a given `runtimeStageId` produced, or
199
- * `-1` when that stage is not in this log (`indexOf` semantics — the name's
200
- * promise).
201
- *
202
- * This is the address translation every reader needs and nobody exported: a
203
- * `runtimeStageId` is the id an event carries, a commit index is what
204
- * `commitValueAt` / `stateAt` / `CommitRangeIndex` speak. O(n) — for many
205
- * lookups build the map once with {@link buildCommitIndex}.
206
- *
207
- * A stage that ran inside a SUBFLOW is not in the run-level log (subflows
208
- * commit to their own isolated log); look it up in that subflow's own
209
- * `history` instead — see `getSubtreeSnapshot`.
210
- *
211
- * @example
212
- * ```typescript
213
- * const idx = commitIndexOf(snapshot.commitLog, 'score-risk#7');
214
- * const before = idx > 0 ? commitValueAt(snapshot.commitLog, idx - 1, 'risk') : undefined;
215
- * ```
216
- */
217
- export declare function commitIndexOf(commitLog: readonly CommitBundle[], runtimeStageId: string): number;