footprintjs 11.2.0 → 12.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 (369) hide show
  1. package/dist/esm/index.d.ts +4 -20
  2. package/dist/esm/index.js +2 -2
  3. package/dist/esm/lib/attempt/policy.d.ts +1 -1
  4. package/dist/esm/lib/attempt/policy.js +2 -2
  5. package/dist/esm/lib/attempt/types.d.ts +2 -1
  6. package/dist/esm/lib/attempt/types.js +1 -1
  7. package/dist/esm/lib/budget/timeBudget.d.ts +13 -5
  8. package/dist/esm/lib/budget/timeBudget.js +28 -13
  9. package/dist/esm/lib/builder/FlowChartBuilder.d.ts +74 -35
  10. package/dist/esm/lib/builder/FlowChartBuilder.js +164 -112
  11. package/dist/esm/lib/builder/index.d.ts +3 -2
  12. package/dist/esm/lib/builder/index.js +4 -3
  13. package/dist/esm/lib/builder/retryLoop.d.ts +1 -1
  14. package/dist/esm/lib/builder/retryLoop.js +1 -1
  15. package/dist/esm/lib/builder/structure/StructureRecorder.d.ts +11 -14
  16. package/dist/esm/lib/builder/structure/StructureRecorder.js +3 -4
  17. package/dist/esm/lib/builder/structure/StructureRecorderDispatcher.js +18 -3
  18. package/dist/esm/lib/builder/types.d.ts +5 -4
  19. package/dist/esm/lib/builder/types.js +4 -3
  20. package/dist/esm/lib/capture/checkpointCapture.d.ts +1 -0
  21. package/dist/esm/lib/capture/checkpointCapture.js +10 -4
  22. package/dist/esm/lib/capture/envelope.d.ts +6 -3
  23. package/dist/esm/lib/capture/envelope.js +25 -10
  24. package/dist/esm/lib/capture/historyNote.js +3 -3
  25. package/dist/esm/lib/capture/nativeCoverage.d.ts +6 -0
  26. package/dist/esm/lib/capture/nativeCoverage.js +11 -1
  27. package/dist/esm/lib/capture/policies.d.ts +2 -2
  28. package/dist/esm/lib/capture/policies.js +3 -3
  29. package/dist/esm/lib/capture/summarize.d.ts +2 -1
  30. package/dist/esm/lib/capture/summarize.js +36 -8
  31. package/dist/esm/lib/contract/schema.js +14 -5
  32. package/dist/esm/lib/decide/types.d.ts +11 -8
  33. package/dist/esm/lib/decide/types.js +1 -1
  34. package/dist/esm/lib/detach/drivers/batch.js +2 -15
  35. package/dist/esm/lib/detach/drivers/immediate.js +3 -2
  36. package/dist/esm/lib/detach/drivers/sendBeacon.d.ts +4 -4
  37. package/dist/esm/lib/detach/drivers/sendBeacon.js +7 -6
  38. package/dist/esm/lib/detach/drivers/workerThread.d.ts +20 -1
  39. package/dist/esm/lib/detach/drivers/workerThread.js +56 -12
  40. package/dist/esm/lib/detach/errors.d.ts +7 -0
  41. package/dist/esm/lib/detach/errors.js +21 -0
  42. package/dist/esm/lib/detach/registry.d.ts +19 -18
  43. package/dist/esm/lib/detach/registry.js +20 -19
  44. package/dist/esm/lib/detach/spawn.d.ts +1 -2
  45. package/dist/esm/lib/detach/spawn.js +2 -3
  46. package/dist/esm/lib/detach/types.d.ts +6 -5
  47. package/dist/esm/lib/detach/types.js +5 -4
  48. package/dist/esm/lib/engine/handlers/ChildrenExecutor.js +3 -2
  49. package/dist/esm/lib/engine/handlers/DeciderHandler.js +8 -2
  50. package/dist/esm/lib/engine/handlers/NodeResolver.d.ts +9 -1
  51. package/dist/esm/lib/engine/handlers/NodeResolver.js +15 -8
  52. package/dist/esm/lib/engine/handlers/ParallelForEachHandler.d.ts +6 -1
  53. package/dist/esm/lib/engine/handlers/ParallelForEachHandler.js +150 -58
  54. package/dist/esm/lib/engine/handlers/RuntimeStructureManager.d.ts +9 -1
  55. package/dist/esm/lib/engine/handlers/RuntimeStructureManager.js +28 -17
  56. package/dist/esm/lib/engine/handlers/SelectorHandler.js +10 -3
  57. package/dist/esm/lib/engine/handlers/SubflowExecutor.d.ts +4 -2
  58. package/dist/esm/lib/engine/handlers/SubflowExecutor.js +55 -17
  59. package/dist/esm/lib/engine/handlers/SubflowInputMapper.js +33 -15
  60. package/dist/esm/lib/engine/handlers/mapperEdits.d.ts +23 -0
  61. package/dist/esm/lib/engine/handlers/mapperEdits.js +95 -0
  62. package/dist/esm/lib/engine/handlers/mapperScope.d.ts +81 -0
  63. package/dist/esm/lib/engine/handlers/mapperScope.js +151 -0
  64. package/dist/esm/lib/engine/handlers/plainObject.d.ts +15 -0
  65. package/dist/esm/lib/engine/handlers/plainObject.js +21 -0
  66. package/dist/esm/lib/engine/handlers/selectionProblem.d.ts +9 -0
  67. package/dist/esm/lib/engine/handlers/selectionProblem.js +15 -0
  68. package/dist/esm/lib/engine/narrative/CombinedNarrativeRecorder.d.ts +4 -2
  69. package/dist/esm/lib/engine/narrative/CombinedNarrativeRecorder.js +18 -10
  70. package/dist/esm/lib/engine/narrative/FlowRecorderDispatcher.d.ts +2 -2
  71. package/dist/esm/lib/engine/narrative/FlowRecorderDispatcher.js +1 -1
  72. package/dist/esm/lib/engine/narrative/NarrativeFlowRecorder.d.ts +3 -5
  73. package/dist/esm/lib/engine/narrative/NarrativeFlowRecorder.js +8 -25
  74. package/dist/esm/lib/engine/narrative/formatting/ruleEvidence/index.js +10 -2
  75. package/dist/esm/lib/engine/narrative/recorders/AdaptiveNarrativeFlowRecorder.d.ts +5 -1
  76. package/dist/esm/lib/engine/narrative/recorders/AdaptiveNarrativeFlowRecorder.js +9 -5
  77. package/dist/esm/lib/engine/narrative/recorders/ManifestFlowRecorder.d.ts +9 -1
  78. package/dist/esm/lib/engine/narrative/recorders/ManifestFlowRecorder.js +27 -6
  79. package/dist/esm/lib/engine/narrative/recorders/MilestoneNarrativeFlowRecorder.d.ts +4 -0
  80. package/dist/esm/lib/engine/narrative/recorders/MilestoneNarrativeFlowRecorder.js +8 -1
  81. package/dist/esm/lib/engine/narrative/recorders/ProgressiveNarrativeFlowRecorder.d.ts +2 -0
  82. package/dist/esm/lib/engine/narrative/recorders/ProgressiveNarrativeFlowRecorder.js +6 -1
  83. package/dist/esm/lib/engine/narrative/recorders/SeparateNarrativeFlowRecorder.d.ts +1 -1
  84. package/dist/esm/lib/engine/narrative/recorders/SeparateNarrativeFlowRecorder.js +2 -2
  85. package/dist/esm/lib/engine/narrative/types.d.ts +1 -1
  86. package/dist/esm/lib/engine/narrative/types.js +1 -1
  87. package/dist/esm/lib/engine/traversal/FlowchartTraverser.d.ts +41 -44
  88. package/dist/esm/lib/engine/traversal/FlowchartTraverser.js +74 -27
  89. package/dist/esm/lib/engine/types.d.ts +14 -4
  90. package/dist/esm/lib/engine/types.js +1 -1
  91. package/dist/esm/lib/filter/evaluator.d.ts +6 -0
  92. package/dist/esm/lib/filter/evaluator.js +144 -20
  93. package/dist/esm/lib/ids/reservedIds.d.ts +2 -2
  94. package/dist/esm/lib/ids/reservedIds.js +3 -3
  95. package/dist/esm/lib/memory/StageContext.d.ts +140 -10
  96. package/dist/esm/lib/memory/StageContext.js +292 -36
  97. package/dist/esm/lib/memory/borrowedMutation.d.ts +18 -0
  98. package/dist/esm/lib/memory/borrowedMutation.js +40 -1
  99. package/dist/esm/lib/memory/frameTypes.d.ts +6 -4
  100. package/dist/esm/lib/memory/frameTypes.js +2 -2
  101. package/dist/esm/lib/memory/hiddenObjectTrail.d.ts +118 -0
  102. package/dist/esm/lib/memory/hiddenObjectTrail.js +221 -0
  103. package/dist/esm/lib/memory/keptReads.d.ts +62 -0
  104. package/dist/esm/lib/memory/keptReads.js +79 -0
  105. package/dist/esm/lib/memory/markPlaces.d.ts +98 -0
  106. package/dist/esm/lib/memory/markPlaces.js +124 -0
  107. package/dist/esm/lib/memory/pathTargets.d.ts +48 -0
  108. package/dist/esm/lib/memory/pathTargets.js +89 -0
  109. package/dist/esm/lib/memory/redaction.d.ts +142 -24
  110. package/dist/esm/lib/memory/redaction.js +276 -87
  111. package/dist/esm/lib/memory/retainedValue/index.js +13 -2
  112. package/dist/esm/lib/memory/runPolicy.d.ts +10 -8
  113. package/dist/esm/lib/memory/runPolicy.js +3 -3
  114. package/dist/esm/lib/memory/selectedObjects.d.ts +215 -0
  115. package/dist/esm/lib/memory/selectedObjects.js +603 -0
  116. package/dist/esm/lib/memory/servedPlaces.d.ts +41 -0
  117. package/dist/esm/lib/memory/servedPlaces.js +138 -0
  118. package/dist/esm/lib/observer-queue/index.d.ts +3 -2
  119. package/dist/esm/lib/observer-queue/index.js +4 -3
  120. package/dist/esm/lib/pause/types.d.ts +8 -6
  121. package/dist/esm/lib/pause/types.js +8 -6
  122. package/dist/esm/lib/reactive/allowlist.d.ts +12 -3
  123. package/dist/esm/lib/reactive/allowlist.js +17 -6
  124. package/dist/esm/lib/reactive/arrayTraps.d.ts +10 -2
  125. package/dist/esm/lib/reactive/arrayTraps.js +117 -19
  126. package/dist/esm/lib/reactive/createTypedScope.js +35 -9
  127. package/dist/esm/lib/reactive/handles.js +3 -5
  128. package/dist/esm/lib/reactive/jsonProjection.d.ts +4 -4
  129. package/dist/esm/lib/reactive/jsonProjection.js +7 -9
  130. package/dist/esm/lib/reactive/liveView.d.ts +4 -1
  131. package/dist/esm/lib/reactive/liveView.js +10 -3
  132. package/dist/esm/lib/reactive/structuralWrite.js +23 -5
  133. package/dist/esm/lib/reactive/types.d.ts +6 -0
  134. package/dist/esm/lib/reactive/types.js +1 -1
  135. package/dist/esm/lib/reactive/writeTraps.d.ts +20 -1
  136. package/dist/esm/lib/reactive/writeTraps.js +78 -6
  137. package/dist/esm/lib/recorder/AttemptRecorder.js +2 -2
  138. package/dist/esm/lib/recorder/BoundaryStateStore.d.ts +4 -2
  139. package/dist/esm/lib/recorder/BoundaryStateStore.js +9 -6
  140. package/dist/esm/lib/recorder/CombinedRecorder.d.ts +4 -3
  141. package/dist/esm/lib/recorder/CombinedRecorder.js +3 -3
  142. package/dist/esm/lib/recorder/CompositeRecorder.d.ts +1 -1
  143. package/dist/esm/lib/recorder/CompositeRecorder.js +1 -1
  144. package/dist/esm/lib/recorder/ControlDepRecorder.d.ts +1 -1
  145. package/dist/esm/lib/recorder/ControlDepRecorder.js +2 -2
  146. package/dist/esm/lib/recorder/EmitRecorder.d.ts +1 -1
  147. package/dist/esm/lib/recorder/EmitRecorder.js +2 -2
  148. package/dist/esm/lib/recorder/QualityRecorder.js +5 -2
  149. package/dist/esm/lib/recorder/TopologyRecorder.js +14 -7
  150. package/dist/esm/lib/runner/ExecutionRuntime.d.ts +2 -3
  151. package/dist/esm/lib/runner/ExecutionRuntime.js +3 -4
  152. package/dist/esm/lib/runner/FlowChartExecutor.d.ts +12 -5
  153. package/dist/esm/lib/runner/FlowChartExecutor.js +43 -22
  154. package/dist/esm/lib/runner/RunContext.d.ts +25 -3
  155. package/dist/esm/lib/runner/RunContext.js +14 -5
  156. package/dist/esm/lib/runner/RunnableChart.d.ts +10 -3
  157. package/dist/esm/lib/runner/RunnableChart.js +45 -25
  158. package/dist/esm/lib/runner/deadline.d.ts +1 -0
  159. package/dist/esm/lib/runner/deadline.js +1 -1
  160. package/dist/esm/lib/runner/options.d.ts +6 -6
  161. package/dist/esm/lib/runner/options.js +1 -1
  162. package/dist/esm/lib/runner/recordSink.js +4 -2
  163. package/dist/esm/lib/runner/snapshot.js +3 -3
  164. package/dist/esm/lib/runner/stringifySnapshot.d.ts +4 -3
  165. package/dist/esm/lib/runner/stringifySnapshot.js +38 -4
  166. package/dist/esm/lib/schema/detect.d.ts +1 -6
  167. package/dist/esm/lib/schema/detect.js +2 -7
  168. package/dist/esm/lib/schema/validate.js +13 -3
  169. package/dist/esm/lib/scope/ScopeFacade.d.ts +4 -2
  170. package/dist/esm/lib/scope/ScopeFacade.js +17 -8
  171. package/dist/esm/lib/scope/protection/createProtectedScope.js +6 -19
  172. package/dist/esm/lib/scope/recorders/DebugRecorder.d.ts +1 -1
  173. package/dist/esm/lib/scope/recorders/DebugRecorder.js +2 -2
  174. package/dist/esm/lib/scope/state/zod/scopeFactory.js +33 -10
  175. package/dist/esm/lib/scope/state/zod/utils/validateHelper.js +1 -15
  176. package/dist/esm/lib/sinks/fileSink.d.ts +4 -1
  177. package/dist/esm/lib/sinks/fileSink.js +57 -28
  178. package/dist/esm/lib/sinks/indexedAdmission.d.ts +2 -0
  179. package/dist/esm/lib/sinks/indexedAdmission.js +11 -1
  180. package/dist/esm/lib/sinks/indexedRecordFile.js +3 -3
  181. package/dist/esm/lib/sinks/indexedScan.js +3 -4
  182. package/dist/esm/recorders.js +1 -1
  183. package/dist/index.js +3 -3
  184. package/dist/lib/attempt/policy.js +2 -2
  185. package/dist/lib/attempt/types.js +1 -1
  186. package/dist/lib/budget/timeBudget.js +28 -13
  187. package/dist/lib/builder/FlowChartBuilder.js +163 -111
  188. package/dist/lib/builder/index.js +4 -3
  189. package/dist/lib/builder/retryLoop.js +1 -1
  190. package/dist/lib/builder/structure/StructureRecorder.js +3 -4
  191. package/dist/lib/builder/structure/StructureRecorderDispatcher.js +18 -3
  192. package/dist/lib/builder/types.js +4 -3
  193. package/dist/lib/capture/checkpointCapture.js +9 -3
  194. package/dist/lib/capture/envelope.js +25 -10
  195. package/dist/lib/capture/historyNote.js +2 -2
  196. package/dist/lib/capture/nativeCoverage.js +13 -2
  197. package/dist/lib/capture/policies.js +3 -3
  198. package/dist/lib/capture/summarize.js +36 -8
  199. package/dist/lib/contract/schema.js +14 -5
  200. package/dist/lib/decide/types.js +1 -1
  201. package/dist/lib/detach/drivers/batch.js +4 -17
  202. package/dist/lib/detach/drivers/immediate.js +3 -2
  203. package/dist/lib/detach/drivers/sendBeacon.js +7 -6
  204. package/dist/lib/detach/drivers/workerThread.js +56 -12
  205. package/dist/lib/detach/errors.js +25 -0
  206. package/dist/lib/detach/registry.js +20 -19
  207. package/dist/lib/detach/spawn.js +2 -3
  208. package/dist/lib/detach/types.js +5 -4
  209. package/dist/lib/engine/handlers/ChildrenExecutor.js +3 -2
  210. package/dist/lib/engine/handlers/DeciderHandler.js +8 -2
  211. package/dist/lib/engine/handlers/NodeResolver.js +15 -8
  212. package/dist/lib/engine/handlers/ParallelForEachHandler.js +150 -58
  213. package/dist/lib/engine/handlers/RuntimeStructureManager.js +28 -17
  214. package/dist/lib/engine/handlers/SelectorHandler.js +10 -3
  215. package/dist/lib/engine/handlers/SubflowExecutor.js +55 -17
  216. package/dist/lib/engine/handlers/SubflowInputMapper.js +35 -17
  217. package/dist/lib/engine/handlers/mapperEdits.js +99 -0
  218. package/dist/lib/engine/handlers/mapperScope.js +157 -0
  219. package/dist/lib/engine/handlers/plainObject.js +25 -0
  220. package/dist/lib/engine/handlers/selectionProblem.js +19 -0
  221. package/dist/lib/engine/narrative/CombinedNarrativeRecorder.js +18 -10
  222. package/dist/lib/engine/narrative/FlowRecorderDispatcher.js +1 -1
  223. package/dist/lib/engine/narrative/NarrativeFlowRecorder.js +8 -25
  224. package/dist/lib/engine/narrative/formatting/ruleEvidence/index.js +10 -2
  225. package/dist/lib/engine/narrative/recorders/AdaptiveNarrativeFlowRecorder.js +9 -5
  226. package/dist/lib/engine/narrative/recorders/ManifestFlowRecorder.js +27 -6
  227. package/dist/lib/engine/narrative/recorders/MilestoneNarrativeFlowRecorder.js +8 -1
  228. package/dist/lib/engine/narrative/recorders/ProgressiveNarrativeFlowRecorder.js +6 -1
  229. package/dist/lib/engine/narrative/recorders/SeparateNarrativeFlowRecorder.js +2 -2
  230. package/dist/lib/engine/narrative/types.js +1 -1
  231. package/dist/lib/engine/traversal/FlowchartTraverser.js +74 -27
  232. package/dist/lib/engine/types.js +1 -1
  233. package/dist/lib/filter/evaluator.js +144 -20
  234. package/dist/lib/ids/reservedIds.js +3 -3
  235. package/dist/lib/memory/StageContext.js +290 -34
  236. package/dist/lib/memory/borrowedMutation.js +42 -2
  237. package/dist/lib/memory/frameTypes.js +2 -2
  238. package/dist/lib/memory/hiddenObjectTrail.js +225 -0
  239. package/dist/lib/memory/keptReads.js +83 -0
  240. package/dist/lib/memory/markPlaces.js +132 -0
  241. package/dist/lib/memory/pathTargets.js +95 -0
  242. package/dist/lib/memory/redaction.js +281 -90
  243. package/dist/lib/memory/retainedValue/index.js +13 -2
  244. package/dist/lib/memory/runPolicy.js +3 -3
  245. package/dist/lib/memory/selectedObjects.js +608 -0
  246. package/dist/lib/memory/servedPlaces.js +142 -0
  247. package/dist/lib/observer-queue/index.js +4 -3
  248. package/dist/lib/pause/types.js +8 -6
  249. package/dist/lib/reactive/allowlist.js +19 -7
  250. package/dist/lib/reactive/arrayTraps.js +116 -18
  251. package/dist/lib/reactive/createTypedScope.js +34 -8
  252. package/dist/lib/reactive/handles.js +3 -5
  253. package/dist/lib/reactive/jsonProjection.js +7 -9
  254. package/dist/lib/reactive/liveView.js +10 -3
  255. package/dist/lib/reactive/structuralWrite.js +23 -5
  256. package/dist/lib/reactive/types.js +1 -1
  257. package/dist/lib/reactive/writeTraps.js +82 -7
  258. package/dist/lib/recorder/AttemptRecorder.js +2 -2
  259. package/dist/lib/recorder/BoundaryStateStore.js +9 -6
  260. package/dist/lib/recorder/CombinedRecorder.js +3 -3
  261. package/dist/lib/recorder/CompositeRecorder.js +1 -1
  262. package/dist/lib/recorder/ControlDepRecorder.js +2 -2
  263. package/dist/lib/recorder/EmitRecorder.js +2 -2
  264. package/dist/lib/recorder/QualityRecorder.js +5 -2
  265. package/dist/lib/recorder/TopologyRecorder.js +14 -7
  266. package/dist/lib/runner/ExecutionRuntime.js +3 -4
  267. package/dist/lib/runner/FlowChartExecutor.js +43 -22
  268. package/dist/lib/runner/RunContext.js +14 -5
  269. package/dist/lib/runner/RunnableChart.js +47 -26
  270. package/dist/lib/runner/deadline.js +1 -1
  271. package/dist/lib/runner/options.js +1 -1
  272. package/dist/lib/runner/recordSink.js +4 -2
  273. package/dist/lib/runner/snapshot.js +3 -3
  274. package/dist/lib/runner/stringifySnapshot.js +38 -4
  275. package/dist/lib/schema/detect.js +2 -7
  276. package/dist/lib/schema/validate.js +13 -3
  277. package/dist/lib/scope/ScopeFacade.js +17 -8
  278. package/dist/lib/scope/protection/createProtectedScope.js +6 -19
  279. package/dist/lib/scope/recorders/DebugRecorder.js +2 -2
  280. package/dist/lib/scope/state/zod/scopeFactory.js +32 -9
  281. package/dist/lib/scope/state/zod/utils/validateHelper.js +1 -15
  282. package/dist/lib/sinks/fileSink.js +57 -28
  283. package/dist/lib/sinks/indexedAdmission.js +13 -2
  284. package/dist/lib/sinks/indexedRecordFile.js +2 -2
  285. package/dist/lib/sinks/indexedScan.js +2 -3
  286. package/dist/recorders.js +1 -1
  287. package/dist/types/index.d.ts +4 -20
  288. package/dist/types/lib/attempt/policy.d.ts +1 -1
  289. package/dist/types/lib/attempt/types.d.ts +2 -1
  290. package/dist/types/lib/budget/timeBudget.d.ts +13 -5
  291. package/dist/types/lib/builder/FlowChartBuilder.d.ts +74 -35
  292. package/dist/types/lib/builder/index.d.ts +3 -2
  293. package/dist/types/lib/builder/retryLoop.d.ts +1 -1
  294. package/dist/types/lib/builder/structure/StructureRecorder.d.ts +11 -14
  295. package/dist/types/lib/builder/types.d.ts +5 -4
  296. package/dist/types/lib/capture/checkpointCapture.d.ts +1 -0
  297. package/dist/types/lib/capture/envelope.d.ts +6 -3
  298. package/dist/types/lib/capture/nativeCoverage.d.ts +6 -0
  299. package/dist/types/lib/capture/policies.d.ts +2 -2
  300. package/dist/types/lib/capture/summarize.d.ts +2 -1
  301. package/dist/types/lib/decide/types.d.ts +11 -8
  302. package/dist/types/lib/detach/drivers/sendBeacon.d.ts +4 -4
  303. package/dist/types/lib/detach/drivers/workerThread.d.ts +20 -1
  304. package/dist/types/lib/detach/errors.d.ts +7 -0
  305. package/dist/types/lib/detach/registry.d.ts +19 -18
  306. package/dist/types/lib/detach/spawn.d.ts +1 -2
  307. package/dist/types/lib/detach/types.d.ts +6 -5
  308. package/dist/types/lib/engine/handlers/NodeResolver.d.ts +9 -1
  309. package/dist/types/lib/engine/handlers/ParallelForEachHandler.d.ts +6 -1
  310. package/dist/types/lib/engine/handlers/RuntimeStructureManager.d.ts +9 -1
  311. package/dist/types/lib/engine/handlers/SubflowExecutor.d.ts +4 -2
  312. package/dist/types/lib/engine/handlers/mapperEdits.d.ts +23 -0
  313. package/dist/types/lib/engine/handlers/mapperScope.d.ts +81 -0
  314. package/dist/types/lib/engine/handlers/plainObject.d.ts +15 -0
  315. package/dist/types/lib/engine/handlers/selectionProblem.d.ts +9 -0
  316. package/dist/types/lib/engine/narrative/CombinedNarrativeRecorder.d.ts +4 -2
  317. package/dist/types/lib/engine/narrative/FlowRecorderDispatcher.d.ts +2 -2
  318. package/dist/types/lib/engine/narrative/NarrativeFlowRecorder.d.ts +3 -5
  319. package/dist/types/lib/engine/narrative/recorders/AdaptiveNarrativeFlowRecorder.d.ts +5 -1
  320. package/dist/types/lib/engine/narrative/recorders/ManifestFlowRecorder.d.ts +9 -1
  321. package/dist/types/lib/engine/narrative/recorders/MilestoneNarrativeFlowRecorder.d.ts +4 -0
  322. package/dist/types/lib/engine/narrative/recorders/ProgressiveNarrativeFlowRecorder.d.ts +2 -0
  323. package/dist/types/lib/engine/narrative/recorders/SeparateNarrativeFlowRecorder.d.ts +1 -1
  324. package/dist/types/lib/engine/narrative/types.d.ts +1 -1
  325. package/dist/types/lib/engine/traversal/FlowchartTraverser.d.ts +41 -44
  326. package/dist/types/lib/engine/types.d.ts +14 -4
  327. package/dist/types/lib/filter/evaluator.d.ts +6 -0
  328. package/dist/types/lib/ids/reservedIds.d.ts +2 -2
  329. package/dist/types/lib/memory/StageContext.d.ts +140 -10
  330. package/dist/types/lib/memory/borrowedMutation.d.ts +18 -0
  331. package/dist/types/lib/memory/frameTypes.d.ts +6 -4
  332. package/dist/types/lib/memory/hiddenObjectTrail.d.ts +118 -0
  333. package/dist/types/lib/memory/keptReads.d.ts +62 -0
  334. package/dist/types/lib/memory/markPlaces.d.ts +98 -0
  335. package/dist/types/lib/memory/pathTargets.d.ts +48 -0
  336. package/dist/types/lib/memory/redaction.d.ts +142 -24
  337. package/dist/types/lib/memory/runPolicy.d.ts +10 -8
  338. package/dist/types/lib/memory/selectedObjects.d.ts +215 -0
  339. package/dist/types/lib/memory/servedPlaces.d.ts +41 -0
  340. package/dist/types/lib/observer-queue/index.d.ts +3 -2
  341. package/dist/types/lib/pause/types.d.ts +8 -6
  342. package/dist/types/lib/reactive/allowlist.d.ts +12 -3
  343. package/dist/types/lib/reactive/arrayTraps.d.ts +10 -2
  344. package/dist/types/lib/reactive/jsonProjection.d.ts +4 -4
  345. package/dist/types/lib/reactive/liveView.d.ts +4 -1
  346. package/dist/types/lib/reactive/types.d.ts +6 -0
  347. package/dist/types/lib/reactive/writeTraps.d.ts +20 -1
  348. package/dist/types/lib/recorder/BoundaryStateStore.d.ts +4 -2
  349. package/dist/types/lib/recorder/CombinedRecorder.d.ts +4 -3
  350. package/dist/types/lib/recorder/CompositeRecorder.d.ts +1 -1
  351. package/dist/types/lib/recorder/ControlDepRecorder.d.ts +1 -1
  352. package/dist/types/lib/recorder/EmitRecorder.d.ts +1 -1
  353. package/dist/types/lib/runner/ExecutionRuntime.d.ts +2 -3
  354. package/dist/types/lib/runner/FlowChartExecutor.d.ts +12 -5
  355. package/dist/types/lib/runner/RunContext.d.ts +25 -3
  356. package/dist/types/lib/runner/RunnableChart.d.ts +10 -3
  357. package/dist/types/lib/runner/deadline.d.ts +1 -0
  358. package/dist/types/lib/runner/options.d.ts +6 -6
  359. package/dist/types/lib/runner/stringifySnapshot.d.ts +4 -3
  360. package/dist/types/lib/schema/detect.d.ts +1 -6
  361. package/dist/types/lib/scope/ScopeFacade.d.ts +4 -2
  362. package/dist/types/lib/scope/recorders/DebugRecorder.d.ts +1 -1
  363. package/dist/types/lib/sinks/fileSink.d.ts +4 -1
  364. package/dist/types/lib/sinks/indexedAdmission.d.ts +2 -0
  365. package/package.json +6 -8
  366. package/dist/esm/lib/scope/state/installResolvers.d.ts +0 -4
  367. package/dist/esm/lib/scope/state/installResolvers.js +0 -15
  368. package/dist/lib/scope/state/installResolvers.js +0 -19
  369. package/dist/types/lib/scope/state/installResolvers.d.ts +0 -4
@@ -41,7 +41,7 @@ export declare class StageContext {
41
41
  /** @internal Stamped before observers; never inherited by another frame or persisted. */
42
42
  bindFailureIdentity(runId: string, runtimeStageId: string): void;
43
43
  /**
44
- * The record half of this frame (`RecordFrame.ts`, L3, C3): the heap and,
44
+ * The record half of this frame (foottrace's `RecordFrame`, C3): the heap and,
45
45
  * when the run keeps them, the redacted mirror and the log; the address;
46
46
  * the first-touch base; the lazy transaction buffer; the readKeys list.
47
47
  * Every state read of this frame goes through it, and so does every
@@ -135,6 +135,8 @@ export declare class StageContext {
135
135
  * facade path never allocates it.
136
136
  */
137
137
  private _nestedReads?;
138
+ /** Which reads this frame has already kept: a read is kept once for each object a key holds (`keptReads.ts`). */
139
+ private readonly keptReads;
138
140
  /**
139
141
  * Dev mode only: the root keys whose LAST tracked read was served from
140
142
  * committed state — before this stage's first write, when no transaction
@@ -144,6 +146,15 @@ export declare class StageContext {
144
146
  * stage wrote them. Never allocated outside `enableDevMode()`.
145
147
  */
146
148
  private _viewReads?;
149
+ /**
150
+ * Dev mode only: the root keys read LIVE through {@link readLiveRoot} (a subflow mount's mappers and
151
+ * its list append). Such a read is of committed state as it was at that moment, not of this frame's
152
+ * pinned view, and a mount stays open for the whole run of its subflow: a parallel sibling may
153
+ * rightly replace the key in between. {@link warnOnBorrowedMutation} has no pinned value to compare
154
+ * the copy with, so it skips these keys, as it skips every read the live fallback served.
155
+ * Never allocated outside `enableDevMode()`.
156
+ */
157
+ private _liveReads?;
147
158
  /**
148
159
  * Has this frame committed at least once? The borrowed-read guard runs on
149
160
  * the FIRST commit only — see {@link warnOnBorrowedMutation}. The frame
@@ -155,8 +166,19 @@ export declare class StageContext {
155
166
  private _committed;
156
167
  /** Tracked reads of a selected value ({@link selectedReads}). */
157
168
  private _selectedReads;
158
- /** Each object this frame read under a selected name → that read's verdict (`stageWrite` hands it on). */
159
- private _selectedObjects?;
169
+ /**
170
+ * Follows the objects this frame read under a selected name into what it writes: at each write, and
171
+ * once more at commit (`hiddenObjectTrail.ts`). Made at the first write or read a redaction rule
172
+ * has something to say about, so a run without a policy holds none.
173
+ */
174
+ private _trail?;
175
+ /**
176
+ * This frame's staged deletes of keys the redaction rule keeps hidden (`redaction.ts · markStagedWrite`),
177
+ * each with the absolute path it deletes. A delete is only STAGED until the frame commits, so no mark
178
+ * ends at the write: {@link endMarksOfLandedDeletes} asks the state once the commit has landed. A
179
+ * discarded try drops them; a delete that never landed ends nothing.
180
+ */
181
+ private _stagedDeletes?;
160
182
  /**
161
183
  * RFC-003 D2 honesty markers — untracked read paths used during THIS
162
184
  * stage's execution (`'args'` / `'env'` / `'silent'`). Marked by
@@ -214,7 +236,7 @@ export declare class StageContext {
214
236
  /**
215
237
  * Install a parallel redacted mirror. Subsequent `commit()` calls apply
216
238
  * the already-computed redacted patches — the ones the log records — to
217
- * this mirror, beside the raw patches on the heap (`recordCommit`).
239
+ * this mirror, beside the raw patches on the heap (foottrace's `RecordFrame · commit`).
218
240
  * Child / next contexts inherit the mirror via `createNext` / `createChild`.
219
241
  *
220
242
  * Called on a runtime's root frame by `ExecutionRuntime` when the run's policy keeps a mirror.
@@ -274,7 +296,7 @@ export declare class StageContext {
274
296
  * one `stageWrite` decided BEFORE staging, carried to commit with the
275
297
  * value. The staged write itself is unaffected — redaction of the
276
298
  * committed payload is the record frame's scrub of that write
277
- * (`RecordFrame · write`, then `scrub.ts` at commit).
299
+ * (`RecordFrame · write`, then foottrace's scrub at commit).
278
300
  */
279
301
  private trackWrite;
280
302
  /**
@@ -301,7 +323,8 @@ export declare class StageContext {
301
323
  * 2. identity inheritance — `inheritByIdentity`, against this frame's
302
324
  * selected reads as they stand after step 1;
303
325
  * 3. the bytes — `RecordFrame · write`, the op and its scrub (the whole
304
- * value, or the fields inside it);
326
+ * value, or the fields inside it). Steps 2 and 3 are one call,
327
+ * `HiddenObjectTrail · stage`, which also keeps what the key showed;
305
328
  * 4. the marks — `markStagedWrite`, only once the write staged, so a
306
329
  * write that fails to stage marks nothing.
307
330
  * Each step reads the rule (and the selected reads) when it acts, as this
@@ -309,6 +332,22 @@ export declare class StageContext {
309
332
  * under the same decision.
310
333
  */
311
334
  private stageWrite;
335
+ /**
336
+ * The frame's staged writes have landed. A delete among them ends its key's mark NOW, and only when
337
+ * the key is really gone from the state. WHY ask the state: a stage that deletes a key and writes it
338
+ * again before its commit has not deleted it (the record shows no delete either), and what it wrote
339
+ * back may be the hidden value it read first.
340
+ */
341
+ private endMarksOfLandedDeletes;
342
+ /** This frame's trail of hidden objects, made when first asked for (`hiddenObjectTrail.ts`). */
343
+ private get trail();
344
+ /**
345
+ * Search what this frame wrote once more, as it stands now, before it is recorded
346
+ * (`HiddenObjectTrail · followAtCommit`, why). A key that gained a hidden place there was staged
347
+ * again; here it gets its marks. And every write the frame kept for its snapshot takes the verdict
348
+ * its kept form is taken under: this runs before {@link materialiseWrites}.
349
+ */
350
+ private followLateEdits;
312
351
  /**
313
352
  * Write and read at ANOTHER frame's address (its run namespace) while this
314
353
  * frame keeps its own identity on the record — `stage`, `stageId`,
@@ -337,8 +376,9 @@ export declare class StageContext {
337
376
  /**
338
377
  * Tracked read. The returned value is BORROWED — see the contract on
339
378
  * `ScopeFacade.getValue`. Read-tracking cost is policy-gated (#14):
340
- * `'full'` clones the value into `_stageReads` (historical default),
341
- * `'summary'` records a cheap marker, `'off'` records nothing.
379
+ * `'full'` keeps a clone of the value in `_stageReads` (the default), once
380
+ * for each object a key holds ({@link keepOnce}); `'summary'` records a
381
+ * cheap marker, `'off'` records nothing.
342
382
  */
343
383
  getValue(path: string[], key?: string, description?: string): unknown;
344
384
  /**
@@ -349,6 +389,67 @@ export declare class StageContext {
349
389
  inspectValue(path: string[], key?: string): unknown;
350
390
  private retainedRead;
351
391
  private readRetainedValue;
392
+ /**
393
+ * A read of one ROOT key of live committed state, recorded as a read of THIS step. The mount of a
394
+ * subflow reads this way: its two mappers (`engine/handlers/mapperScope.ts`) and its merge-back,
395
+ * which reads what is there before it adds to it (`SubflowInputMapper · applyOutputMapping`). The
396
+ * value is live state at the root, exactly what those were handed before. What is new is that the
397
+ * read is RECORDED: on the frame's read prefix, under the rule's verdict, in the taint count and
398
+ * in `stageReads`. A key the state does not hold reads `undefined` and records nothing, as before.
399
+ *
400
+ * WHY NOT `getValue`: that serves the frame's own view, pinned at its first touch. A mount's
401
+ * output mapping runs after the subflow has run, and reads state as it is THEN; a pinned view
402
+ * would hand it state as it was when the mount began.
403
+ *
404
+ * WHAT `stageReads` KEEPS IS THE RUN'S OWN SETTING (`readTracking`), as for every read of every
405
+ * step: a copy under `'full'`, a marker under `'summary'`, nothing under `'off'`. The first cut kept
406
+ * a marker whatever the setting said, to spare a mount in a loop the copy. That broke what `'full'`
407
+ * promises a reader of the record (every read of a step is there as a value), and a consumer's own
408
+ * test caught it. The copy is the setting's price, here as for a stage; `bench/mapper-reads.ts`
409
+ * measures it, and `'summary'` is the setting for a run that hands large values on.
410
+ *
411
+ * WITH READ SOURCES ON (`readSources: true`) this read has no source of its own: the record's
412
+ * source-capturing door reads the frame's view, not live root state. The capture says so
413
+ * (`untracked-read`, status `partial`) and never reports a run with such a read as fully captured.
414
+ */
415
+ readLiveRoot(key: string): unknown;
416
+ /**
417
+ * A read of `key` as THIS frame's writes see it (its own address, then the root), recorded as a read
418
+ * of this step like any other. A subflow's merge-back reads this way before it merges a plain object
419
+ * field by field: what comes out under `key` is what was there with those fields changed, and the
420
+ * fields are written where the frame writes. (For a mount whose frame writes at the root, which is
421
+ * every mount the builder makes, this is the root key; read at the root regardless, a frame that
422
+ * writes under a namespace would be given the wrong writer.) A key that is not there reads
423
+ * `undefined` and records nothing: that is all this door adds to {@link getValue}.
424
+ */
425
+ readOwnView(key: string): unknown;
426
+ /**
427
+ * `value` is about to be written at `path`/`key` in PIECES: a subflow's merge-back merges a plain
428
+ * object field by field and appends a list as a new array. The write funnel then sees only the
429
+ * pieces, so an object this frame read under a selected name would lose its rule on the way (step 2
430
+ * of {@link stageWrite}, which follows an object by identity). Asked here with the whole value
431
+ * first, the target inherits what a whole write would have given it.
432
+ */
433
+ inheritRule(path: string[], key: string, value: unknown): void;
434
+ /**
435
+ * `handed` is what user code was given in place of `value`, an object this frame read under a
436
+ * selected name: the redaction rule hands a subflow mapper a VIEW of a record whose fields are
437
+ * selected, not the record. It carries the same rule, so that a copy of it written under another
438
+ * name is found by identity ({@link inheritRule}, {@link stageWrite}) as the record itself would be.
439
+ */
440
+ sameRuleFor(handed: unknown, value: unknown): void;
441
+ /**
442
+ * `copy` is a full copy the scope made of `value` and handed to user code (`$batchArray`). An object
443
+ * taken out of the copy is the selected value's all the same.
444
+ */
445
+ copyOfSelected(copy: unknown, value: unknown): void;
446
+ /** What every tracked read keeps, once the value is in hand and its verdict known (see {@link getValue}). */
447
+ private retainRead;
448
+ /**
449
+ * Keep what this read saw in {@link _stageReads}: once for each object a root key holds, not once for
450
+ * each read of it. The rule, why it holds and what it leaves alone are in `keptReads.ts`.
451
+ */
452
+ private keepOnce;
352
453
  /**
353
454
  * How many tracked reads of this frame read a value the run's rule selects
354
455
  * (a key it masks whole, or one with secret fields). A boundary that maps
@@ -368,7 +469,20 @@ export declare class StageContext {
368
469
  * retained or reported.
369
470
  */
370
471
  noteUntrackedRead(key: string | undefined, value: unknown): void;
371
- /** A read with no key hands the stage everything under `path`, so it counts when that holds a selected name. */
472
+ /**
473
+ * The stage asked for its input (`$getArgs()`): what the rule hides in it stays hidden wherever the
474
+ * stage writes it (`HiddenObjectTrail · rememberInput`). Never counted as a selected read: the taint
475
+ * law asks the input itself (`redaction.ts`, "the taint law").
476
+ */
477
+ noteInputRead(input: unknown, source?: unknown): void;
478
+ /** An object read under a selected name, and every object inside it, keeps its rule wherever the stage writes it (`selectedObjects.ts`). */
479
+ private rememberSelected;
480
+ /**
481
+ * A read with no key hands the stage everything under `path`, so it counts when that holds a selected
482
+ * name, and each selected value in it is remembered like one read by its key (`selectedObjects.ts`):
483
+ * the value at a selected path, or, for the whole state, the value of each selected key (the keys of
484
+ * every run namespace included).
485
+ */
372
486
  private noteKeylessRead;
373
487
  private noteAndJudgeRead;
374
488
  private judgeRead;
@@ -379,7 +493,13 @@ export declare class StageContext {
379
493
  getValueDirect(path: string[], key?: string): unknown;
380
494
  getRoot(key: string): any;
381
495
  getGlobal(key: string): any;
382
- getScope(): Record<string, unknown>;
496
+ /**
497
+ * The names of the root keys of committed state, as they stand now: what a subflow mapper may read
498
+ * (`engine/handlers/mapperScope.ts`). Names only; a value is read through {@link readLiveRoot}.
499
+ */
500
+ rootKeys(): string[];
501
+ /** Does committed state hold `key` at its root, as it stands now? A name is asked, no value is read. */
502
+ hasRootKey(key: unknown): key is string;
383
503
  getRunId(): string;
384
504
  /**
385
505
  * RFC-003 D2: record that this stage consumed an untracked read path.
@@ -512,6 +632,16 @@ export declare class StageContext {
512
632
  * every attempt did, and the retry feature's whole point is that the earlier
513
633
  * attempts stay visible.
514
634
  *
635
+ * Also KEPT: what the attempt read under a selected name — the count
636
+ * (`_selectedReads`, so {@link selectedReads} and {@link taintedReads} still
637
+ * count it) and the objects it read (`HiddenObjectTrail`, so `stageWrite`
638
+ * still hands their rule on). A later attempt can hold what a failed one
639
+ * read (a closure, a module variable), and the library cannot tell, so a
640
+ * selected read in any attempt marks the later ones: a threshold or break
641
+ * reason they serve is masked, and such an object keeps its rule when a
642
+ * later attempt writes it under another name. This is the conservative
643
+ * side for redaction (test/lib/engine/security/retry-isolation.test.ts).
644
+ *
515
645
  * No commit is recorded and no observer fires — a discarded attempt is not a
516
646
  * cursor stop, because from shared state's point of view it never happened.
517
647
  */