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.
- package/AGENTS.md +12 -10
- package/CLAUDE.md +21 -23
- package/README.md +1 -1
- package/dist/advanced.js +71 -128
- package/dist/esm/advanced.d.ts +24 -58
- package/dist/esm/advanced.js +13 -51
- package/dist/esm/index.d.ts +5 -8
- package/dist/esm/index.js +3 -3
- package/dist/esm/lib/builder/FlowChartBuilder.d.ts +1 -1
- package/dist/esm/lib/builder/FlowChartBuilder.js +3 -3
- package/dist/esm/lib/builder/structure/StructureRecorder.d.ts +1 -1
- package/dist/esm/lib/builder/structure/StructureRecorder.js +1 -1
- package/dist/esm/lib/capture/index.d.ts +0 -1
- package/dist/esm/lib/capture/index.js +1 -2
- package/dist/esm/lib/engine/graph/prefixNodeTree.js +2 -2
- package/dist/esm/lib/engine/handlers/ResumeEntry.d.ts +3 -3
- package/dist/esm/lib/engine/handlers/ResumeEntry.js +4 -4
- package/dist/esm/lib/engine/handlers/SubflowExecutor.d.ts +1 -2
- package/dist/esm/lib/engine/handlers/SubflowExecutor.js +4 -8
- package/dist/esm/lib/engine/index.d.ts +1 -1
- package/dist/esm/lib/engine/index.js +1 -1
- package/dist/esm/lib/engine/narrative/CombinedNarrativeRecorder.d.ts +4 -4
- package/dist/esm/lib/engine/narrative/CombinedNarrativeRecorder.js +1 -1
- package/dist/esm/lib/engine/narrative/index.d.ts +1 -1
- package/dist/esm/lib/engine/narrative/index.js +1 -1
- package/dist/esm/lib/engine/narrative/narrativeTypes.d.ts +1 -11
- package/dist/esm/lib/engine/narrative/narrativeTypes.js +1 -1
- package/dist/esm/lib/engine/traversal/FlowchartTraverser.d.ts +2 -10
- package/dist/esm/lib/engine/traversal/FlowchartTraverser.js +4 -6
- package/dist/esm/lib/engine/traversalContext.d.ts +1 -1
- package/dist/esm/lib/engine/traversalContext.js +2 -2
- package/dist/esm/lib/engine/types.d.ts +2 -10
- package/dist/esm/lib/engine/types.js +1 -1
- package/dist/esm/lib/engine/walkSubflowSpec.js +2 -2
- package/dist/esm/lib/ids/reservedIds.js +2 -2
- package/dist/esm/lib/memory/DiagnosticCollector.js +2 -2
- package/dist/esm/lib/memory/StageContext.d.ts +2 -4
- package/dist/esm/lib/memory/StageContext.js +2 -2
- package/dist/esm/lib/memory/borrowedMutation.js +2 -2
- package/dist/esm/lib/memory/index.d.ts +6 -21
- package/dist/esm/lib/memory/index.js +4 -22
- package/dist/esm/lib/memory/redaction.d.ts +1 -1
- package/dist/esm/lib/memory/redaction.js +2 -2
- package/dist/esm/lib/memory/runPolicy.d.ts +3 -2
- package/dist/esm/lib/memory/runPolicy.js +1 -1
- package/dist/esm/lib/reactive/createTypedScope.js +2 -2
- package/dist/esm/lib/reactive/writeTraps.js +2 -2
- package/dist/esm/lib/recorder/ControlDepRecorder.d.ts +3 -2
- package/dist/esm/lib/recorder/ControlDepRecorder.js +3 -2
- package/dist/esm/lib/recorder/EmitRecorder.d.ts +1 -1
- package/dist/esm/lib/recorder/EmitRecorder.js +1 -1
- package/dist/esm/lib/recorder/InOutRecorder.js +2 -2
- package/dist/esm/lib/recorder/qualityTrace.d.ts +1 -1
- package/dist/esm/lib/recorder/qualityTrace.js +2 -2
- package/dist/esm/lib/runner/DeferredObserverTier.js +2 -2
- package/dist/esm/lib/runner/ExecutionRuntime.d.ts +4 -5
- package/dist/esm/lib/runner/ExecutionRuntime.js +2 -5
- package/dist/esm/lib/runner/FlowChartExecutor.d.ts +1 -1
- package/dist/esm/lib/runner/FlowChartExecutor.js +1 -1
- package/dist/esm/lib/runner/getSubtreeSnapshot.d.ts +1 -1
- package/dist/esm/lib/runner/getSubtreeSnapshot.js +4 -4
- package/dist/esm/lib/runner/resume.js +2 -2
- package/dist/esm/lib/runner/snapshot.js +3 -2
- package/dist/esm/lib/scope/ScopeFacade.js +2 -2
- package/dist/esm/lib/scope/state/zod/scopeFactory.js +2 -2
- package/dist/esm/recorders.d.ts +2 -3
- package/dist/esm/recorders.js +1 -1
- package/dist/esm/trace.d.ts +11 -57
- package/dist/esm/trace.js +10 -68
- package/dist/index.js +3 -3
- package/dist/lib/builder/FlowChartBuilder.js +5 -5
- package/dist/lib/builder/structure/StructureRecorder.js +1 -1
- package/dist/lib/capture/index.js +2 -4
- package/dist/lib/engine/graph/prefixNodeTree.js +5 -5
- package/dist/lib/engine/handlers/ResumeEntry.js +4 -4
- package/dist/lib/engine/handlers/SubflowExecutor.js +5 -9
- package/dist/lib/engine/index.js +1 -1
- package/dist/lib/engine/narrative/CombinedNarrativeRecorder.js +1 -1
- package/dist/lib/engine/narrative/index.js +1 -1
- package/dist/lib/engine/narrative/narrativeTypes.js +1 -1
- package/dist/lib/engine/traversal/FlowchartTraverser.js +8 -10
- package/dist/lib/engine/traversalContext.js +4 -4
- package/dist/lib/engine/types.js +1 -1
- package/dist/lib/engine/walkSubflowSpec.js +3 -3
- package/dist/lib/ids/reservedIds.js +5 -5
- package/dist/lib/memory/DiagnosticCollector.js +3 -3
- package/dist/lib/memory/StageContext.js +3 -3
- package/dist/lib/memory/borrowedMutation.js +3 -3
- package/dist/lib/memory/index.js +7 -42
- package/dist/lib/memory/redaction.js +3 -3
- package/dist/lib/memory/runPolicy.js +1 -1
- package/dist/lib/reactive/createTypedScope.js +3 -3
- package/dist/lib/reactive/writeTraps.js +4 -4
- package/dist/lib/recorder/ControlDepRecorder.js +3 -2
- package/dist/lib/recorder/EmitRecorder.js +1 -1
- package/dist/lib/recorder/InOutRecorder.js +3 -3
- package/dist/lib/recorder/qualityTrace.js +4 -4
- package/dist/lib/runner/DeferredObserverTier.js +3 -3
- package/dist/lib/runner/ExecutionRuntime.js +6 -9
- package/dist/lib/runner/FlowChartExecutor.js +1 -1
- package/dist/lib/runner/getSubtreeSnapshot.js +6 -6
- package/dist/lib/runner/resume.js +3 -3
- package/dist/lib/runner/snapshot.js +6 -5
- package/dist/lib/scope/ScopeFacade.js +3 -3
- package/dist/lib/scope/state/zod/scopeFactory.js +4 -4
- package/dist/recorders.js +1 -1
- package/dist/trace.js +18 -120
- package/dist/types/advanced.d.ts +24 -58
- package/dist/types/index.d.ts +5 -8
- package/dist/types/lib/builder/FlowChartBuilder.d.ts +1 -1
- package/dist/types/lib/builder/structure/StructureRecorder.d.ts +1 -1
- package/dist/types/lib/capture/index.d.ts +0 -1
- package/dist/types/lib/engine/handlers/ResumeEntry.d.ts +3 -3
- package/dist/types/lib/engine/handlers/SubflowExecutor.d.ts +1 -2
- package/dist/types/lib/engine/index.d.ts +1 -1
- package/dist/types/lib/engine/narrative/CombinedNarrativeRecorder.d.ts +4 -4
- package/dist/types/lib/engine/narrative/index.d.ts +1 -1
- package/dist/types/lib/engine/narrative/narrativeTypes.d.ts +1 -11
- package/dist/types/lib/engine/traversal/FlowchartTraverser.d.ts +2 -10
- package/dist/types/lib/engine/traversalContext.d.ts +1 -1
- package/dist/types/lib/engine/types.d.ts +2 -10
- package/dist/types/lib/memory/StageContext.d.ts +2 -4
- package/dist/types/lib/memory/index.d.ts +6 -21
- package/dist/types/lib/memory/redaction.d.ts +1 -1
- package/dist/types/lib/memory/runPolicy.d.ts +3 -2
- package/dist/types/lib/recorder/ControlDepRecorder.d.ts +3 -2
- package/dist/types/lib/recorder/EmitRecorder.d.ts +1 -1
- package/dist/types/lib/recorder/qualityTrace.d.ts +1 -1
- package/dist/types/lib/runner/ExecutionRuntime.d.ts +4 -5
- package/dist/types/lib/runner/FlowChartExecutor.d.ts +1 -1
- package/dist/types/lib/runner/getSubtreeSnapshot.d.ts +1 -1
- package/dist/types/recorders.d.ts +2 -3
- package/dist/types/trace.d.ts +11 -57
- package/package.json +6 -15
- package/dist/esm/lib/capture/freeze.d.ts +0 -91
- package/dist/esm/lib/capture/freeze.js +0 -314
- package/dist/esm/lib/capture/ownData.d.ts +0 -7
- package/dist/esm/lib/capture/ownData.js +0 -15
- package/dist/esm/lib/capture/valueKinds.d.ts +0 -57
- package/dist/esm/lib/capture/valueKinds.js +0 -142
- package/dist/esm/lib/ids/runtimeStageId.d.ts +0 -173
- package/dist/esm/lib/ids/runtimeStageId.js +0 -194
- package/dist/esm/lib/memory/EventLog.d.ts +0 -105
- package/dist/esm/lib/memory/EventLog.js +0 -148
- package/dist/esm/lib/memory/RecordFrame.d.ts +0 -232
- package/dist/esm/lib/memory/RecordFrame.js +0 -296
- package/dist/esm/lib/memory/SharedMemory.d.ts +0 -46
- package/dist/esm/lib/memory/SharedMemory.js +0 -88
- package/dist/esm/lib/memory/TransactionBuffer.d.ts +0 -521
- package/dist/esm/lib/memory/TransactionBuffer.js +0 -946
- package/dist/esm/lib/memory/admission.d.ts +0 -81
- package/dist/esm/lib/memory/admission.js +0 -153
- package/dist/esm/lib/memory/backtrack.d.ts +0 -286
- package/dist/esm/lib/memory/backtrack.js +0 -457
- package/dist/esm/lib/memory/commitLogUtils.d.ts +0 -217
- package/dist/esm/lib/memory/commitLogUtils.js +0 -384
- package/dist/esm/lib/memory/deltaEncoding.d.ts +0 -66
- package/dist/esm/lib/memory/deltaEncoding.js +0 -122
- package/dist/esm/lib/memory/equality.d.ts +0 -93
- package/dist/esm/lib/memory/equality.js +0 -262
- package/dist/esm/lib/memory/eventPosition.d.ts +0 -18
- package/dist/esm/lib/memory/eventPosition.js +0 -2
- package/dist/esm/lib/memory/honesty.d.ts +0 -93
- package/dist/esm/lib/memory/honesty.js +0 -92
- package/dist/esm/lib/memory/keyPaths.d.ts +0 -125
- package/dist/esm/lib/memory/keyPaths.js +0 -227
- package/dist/esm/lib/memory/logModel.d.ts +0 -76
- package/dist/esm/lib/memory/logModel.js +0 -364
- package/dist/esm/lib/memory/merge.d.ts +0 -26
- package/dist/esm/lib/memory/merge.js +0 -60
- package/dist/esm/lib/memory/pathOps.d.ts +0 -115
- package/dist/esm/lib/memory/pathOps.js +0 -290
- package/dist/esm/lib/memory/paths.d.ts +0 -52
- package/dist/esm/lib/memory/paths.js +0 -57
- package/dist/esm/lib/memory/placeholders.d.ts +0 -39
- package/dist/esm/lib/memory/placeholders.js +0 -40
- package/dist/esm/lib/memory/recordCommit.d.ts +0 -45
- package/dist/esm/lib/memory/recordCommit.js +0 -61
- package/dist/esm/lib/memory/scrub.d.ts +0 -53
- package/dist/esm/lib/memory/scrub.js +0 -74
- package/dist/esm/lib/memory/types.d.ts +0 -209
- package/dist/esm/lib/memory/types.js +0 -10
- package/dist/esm/lib/memory/utils.d.ts +0 -73
- package/dist/esm/lib/memory/utils.js +0 -159
- package/dist/esm/lib/memory/verbs.d.ts +0 -333
- package/dist/esm/lib/memory/verbs.js +0 -427
- package/dist/esm/lib/recorder/CommitRangeIndex.d.ts +0 -147
- package/dist/esm/lib/recorder/CommitRangeIndex.js +0 -207
- package/dist/esm/lib/scope/detectCircular.d.ts +0 -13
- package/dist/esm/lib/scope/detectCircular.js +0 -14
- package/dist/esm/lib/scope/recorders/summarizeValue.d.ts +0 -5
- package/dist/esm/lib/scope/recorders/summarizeValue.js +0 -6
- package/dist/esm/lib/slice/elementProvenance.d.ts +0 -81
- package/dist/esm/lib/slice/elementProvenance.js +0 -190
- package/dist/esm/lib/slice/forwardSliceForKey.d.ts +0 -88
- package/dist/esm/lib/slice/forwardSliceForKey.js +0 -243
- package/dist/esm/lib/slice/index.d.ts +0 -25
- package/dist/esm/lib/slice/index.js +0 -25
- package/dist/esm/lib/slice/keyIndex.d.ts +0 -137
- package/dist/esm/lib/slice/keyIndex.js +0 -293
- package/dist/esm/lib/slice/keyTimeline.d.ts +0 -49
- package/dist/esm/lib/slice/keyTimeline.js +0 -113
- package/dist/esm/lib/slice/keysReadSources.d.ts +0 -51
- package/dist/esm/lib/slice/keysReadSources.js +0 -95
- package/dist/esm/lib/slice/serialize.d.ts +0 -78
- package/dist/esm/lib/slice/serialize.js +0 -278
- package/dist/esm/lib/slice/sliceForKey.d.ts +0 -47
- package/dist/esm/lib/slice/sliceForKey.js +0 -88
- package/dist/esm/lib/slice/types.d.ts +0 -567
- package/dist/esm/lib/slice/types.js +0 -25
- package/dist/esm/lib/time-travel/axis.d.ts +0 -119
- package/dist/esm/lib/time-travel/axis.js +0 -179
- package/dist/esm/lib/time-travel/bundles.d.ts +0 -77
- package/dist/esm/lib/time-travel/bundles.js +0 -136
- package/dist/esm/lib/time-travel/chain.d.ts +0 -93
- package/dist/esm/lib/time-travel/chain.js +0 -188
- package/dist/esm/lib/time-travel/commitStops.d.ts +0 -55
- package/dist/esm/lib/time-travel/commitStops.js +0 -202
- package/dist/esm/lib/time-travel/index.d.ts +0 -22
- package/dist/esm/lib/time-travel/index.js +0 -21
- package/dist/esm/lib/time-travel/stateAt.d.ts +0 -102
- package/dist/esm/lib/time-travel/stateAt.js +0 -153
- package/dist/esm/lib/time-travel/tagStops.d.ts +0 -72
- package/dist/esm/lib/time-travel/tagStops.js +0 -102
- package/dist/esm/lib/time-travel/timeTravel.d.ts +0 -70
- package/dist/esm/lib/time-travel/timeTravel.js +0 -360
- package/dist/esm/lib/time-travel/types.d.ts +0 -470
- package/dist/esm/lib/time-travel/types.js +0 -23
- package/dist/esm/write.d.ts +0 -47
- package/dist/esm/write.js +0 -46
- package/dist/lib/capture/freeze.js +0 -320
- package/dist/lib/capture/ownData.js +0 -19
- package/dist/lib/capture/valueKinds.js +0 -146
- package/dist/lib/ids/runtimeStageId.js +0 -210
- package/dist/lib/memory/EventLog.js +0 -152
- package/dist/lib/memory/RecordFrame.js +0 -300
- package/dist/lib/memory/SharedMemory.js +0 -92
- package/dist/lib/memory/TransactionBuffer.js +0 -950
- package/dist/lib/memory/admission.js +0 -159
- package/dist/lib/memory/backtrack.js +0 -463
- package/dist/lib/memory/commitLogUtils.js +0 -399
- package/dist/lib/memory/deltaEncoding.js +0 -128
- package/dist/lib/memory/equality.js +0 -266
- package/dist/lib/memory/eventPosition.js +0 -3
- package/dist/lib/memory/honesty.js +0 -95
- package/dist/lib/memory/keyPaths.js +0 -243
- package/dist/lib/memory/logModel.js +0 -372
- package/dist/lib/memory/merge.js +0 -64
- package/dist/lib/memory/pathOps.js +0 -306
- package/dist/lib/memory/paths.js +0 -62
- package/dist/lib/memory/placeholders.js +0 -43
- package/dist/lib/memory/recordCommit.js +0 -65
- package/dist/lib/memory/scrub.js +0 -79
- package/dist/lib/memory/types.js +0 -11
- package/dist/lib/memory/utils.js +0 -178
- package/dist/lib/memory/verbs.js +0 -444
- package/dist/lib/recorder/CommitRangeIndex.js +0 -211
- package/dist/lib/scope/detectCircular.js +0 -21
- package/dist/lib/scope/recorders/summarizeValue.js +0 -10
- package/dist/lib/slice/elementProvenance.js +0 -195
- package/dist/lib/slice/forwardSliceForKey.js +0 -247
- package/dist/lib/slice/index.js +0 -42
- package/dist/lib/slice/keyIndex.js +0 -313
- package/dist/lib/slice/keyTimeline.js +0 -117
- package/dist/lib/slice/keysReadSources.js +0 -101
- package/dist/lib/slice/serialize.js +0 -286
- package/dist/lib/slice/sliceForKey.js +0 -93
- package/dist/lib/slice/types.js +0 -26
- package/dist/lib/time-travel/axis.js +0 -184
- package/dist/lib/time-travel/bundles.js +0 -144
- package/dist/lib/time-travel/chain.js +0 -193
- package/dist/lib/time-travel/commitStops.js +0 -206
- package/dist/lib/time-travel/index.js +0 -32
- package/dist/lib/time-travel/stateAt.js +0 -160
- package/dist/lib/time-travel/tagStops.js +0 -106
- package/dist/lib/time-travel/timeTravel.js +0 -364
- package/dist/lib/time-travel/types.js +0 -24
- package/dist/types/lib/capture/freeze.d.ts +0 -91
- package/dist/types/lib/capture/ownData.d.ts +0 -7
- package/dist/types/lib/capture/valueKinds.d.ts +0 -57
- package/dist/types/lib/ids/runtimeStageId.d.ts +0 -173
- package/dist/types/lib/memory/EventLog.d.ts +0 -105
- package/dist/types/lib/memory/RecordFrame.d.ts +0 -232
- package/dist/types/lib/memory/SharedMemory.d.ts +0 -46
- package/dist/types/lib/memory/TransactionBuffer.d.ts +0 -521
- package/dist/types/lib/memory/admission.d.ts +0 -81
- package/dist/types/lib/memory/backtrack.d.ts +0 -286
- package/dist/types/lib/memory/commitLogUtils.d.ts +0 -217
- package/dist/types/lib/memory/deltaEncoding.d.ts +0 -66
- package/dist/types/lib/memory/equality.d.ts +0 -93
- package/dist/types/lib/memory/eventPosition.d.ts +0 -18
- package/dist/types/lib/memory/honesty.d.ts +0 -93
- package/dist/types/lib/memory/keyPaths.d.ts +0 -125
- package/dist/types/lib/memory/logModel.d.ts +0 -76
- package/dist/types/lib/memory/merge.d.ts +0 -26
- package/dist/types/lib/memory/pathOps.d.ts +0 -115
- package/dist/types/lib/memory/paths.d.ts +0 -52
- package/dist/types/lib/memory/placeholders.d.ts +0 -39
- package/dist/types/lib/memory/recordCommit.d.ts +0 -45
- package/dist/types/lib/memory/scrub.d.ts +0 -53
- package/dist/types/lib/memory/types.d.ts +0 -209
- package/dist/types/lib/memory/utils.d.ts +0 -73
- package/dist/types/lib/memory/verbs.d.ts +0 -333
- package/dist/types/lib/recorder/CommitRangeIndex.d.ts +0 -147
- package/dist/types/lib/scope/detectCircular.d.ts +0 -13
- package/dist/types/lib/scope/recorders/summarizeValue.d.ts +0 -5
- package/dist/types/lib/slice/elementProvenance.d.ts +0 -81
- package/dist/types/lib/slice/forwardSliceForKey.d.ts +0 -88
- package/dist/types/lib/slice/index.d.ts +0 -25
- package/dist/types/lib/slice/keyIndex.d.ts +0 -137
- package/dist/types/lib/slice/keyTimeline.d.ts +0 -49
- package/dist/types/lib/slice/keysReadSources.d.ts +0 -51
- package/dist/types/lib/slice/serialize.d.ts +0 -78
- package/dist/types/lib/slice/sliceForKey.d.ts +0 -47
- package/dist/types/lib/slice/types.d.ts +0 -567
- package/dist/types/lib/time-travel/axis.d.ts +0 -119
- package/dist/types/lib/time-travel/bundles.d.ts +0 -77
- package/dist/types/lib/time-travel/chain.d.ts +0 -93
- package/dist/types/lib/time-travel/commitStops.d.ts +0 -55
- package/dist/types/lib/time-travel/index.d.ts +0 -22
- package/dist/types/lib/time-travel/stateAt.d.ts +0 -102
- package/dist/types/lib/time-travel/tagStops.d.ts +0 -72
- package/dist/types/lib/time-travel/timeTravel.d.ts +0 -70
- package/dist/types/lib/time-travel/types.d.ts +0 -470
- package/dist/types/write.d.ts +0 -47
- 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;
|