@memberjunction/task-graph 6.1.0-edge.2 → 6.1.0-edge.3
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/LICENSE +180 -4
- package/README.md +30 -1
- package/dist/TaskClaimStore.d.ts +376 -4
- package/dist/TaskClaimStore.d.ts.map +1 -1
- package/dist/TaskClaimStore.js +600 -20
- package/dist/TaskClaimStore.js.map +1 -1
- package/dist/TaskGraphDispatcher.d.ts +326 -25
- package/dist/TaskGraphDispatcher.d.ts.map +1 -1
- package/dist/TaskGraphDispatcher.js +1604 -286
- package/dist/TaskGraphDispatcher.js.map +1 -1
- package/dist/TaskGraphService.d.ts +255 -5
- package/dist/TaskGraphService.d.ts.map +1 -1
- package/dist/TaskGraphService.js +583 -26
- package/dist/TaskGraphService.js.map +1 -1
- package/dist/TaskGraphSubmitterImpl.d.ts.map +1 -1
- package/dist/TaskGraphSubmitterImpl.js +5 -0
- package/dist/TaskGraphSubmitterImpl.js.map +1 -1
- package/dist/condition-gate.d.ts +128 -0
- package/dist/condition-gate.d.ts.map +1 -0
- package/dist/condition-gate.js +257 -0
- package/dist/condition-gate.js.map +1 -0
- package/dist/debug-state.d.ts +102 -0
- package/dist/debug-state.d.ts.map +1 -0
- package/dist/debug-state.js +135 -0
- package/dist/debug-state.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/operations/TaskGraphDebugOperations.d.ts +99 -0
- package/dist/operations/TaskGraphDebugOperations.d.ts.map +1 -0
- package/dist/operations/TaskGraphDebugOperations.js +310 -0
- package/dist/operations/TaskGraphDebugOperations.js.map +1 -0
- package/dist/operations/TaskGraphOperations.d.ts +20 -2
- package/dist/operations/TaskGraphOperations.d.ts.map +1 -1
- package/dist/operations/TaskGraphOperations.js +47 -8
- package/dist/operations/TaskGraphOperations.js.map +1 -1
- package/dist/settlement-rescue.d.ts +85 -0
- package/dist/settlement-rescue.d.ts.map +1 -0
- package/dist/settlement-rescue.js +119 -0
- package/dist/settlement-rescue.js.map +1 -0
- package/dist/task-graph-kick.d.ts +3 -0
- package/dist/task-graph-kick.d.ts.map +1 -0
- package/dist/task-graph-kick.js +17 -0
- package/dist/task-graph-kick.js.map +1 -0
- package/dist/task-predicates.d.ts +77 -0
- package/dist/task-predicates.d.ts.map +1 -0
- package/dist/task-predicates.js +75 -0
- package/dist/task-predicates.js.map +1 -0
- package/dist/types.d.ts +110 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +12 -11
|
@@ -17,7 +17,19 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { IMetadataProvider, UserInfo } from '@memberjunction/core';
|
|
19
19
|
import { type MJTaskEntity_ITaskStepConfiguration } from '@memberjunction/core-entities';
|
|
20
|
-
import { type TaskGraphSpec, type TaskGraphSpecNode, type ForEachOperation, type WhileOperation } from '@memberjunction/ai-core-plus';
|
|
20
|
+
import { type TaskGraphInvocationEnvelope, type TaskGraphSpec, type TaskGraphSpecNode, type ForEachOperation, type WhileOperation } from '@memberjunction/ai-core-plus';
|
|
21
|
+
import { type EdgeOverrideVerdict, type StepTarget, type TaskGraphDebugState } from './debug-state.js';
|
|
22
|
+
/**
|
|
23
|
+
* Normalizes a caller-supplied reinvoke depth to a safe cap seed.
|
|
24
|
+
*
|
|
25
|
+
* The runaway-loop cap is a signed comparison over a persisted-verbatim seed, and the remote Submit
|
|
26
|
+
* operation is the one seam where the seed is caller-supplied rather than computed by the engine —
|
|
27
|
+
* a negative value would BUY hops (`-1000` turns a 5-hop cap into 1005). Clamped rather than
|
|
28
|
+
* refused so a stale client sending zero-adjacent noise keeps working, and no accepted value can
|
|
29
|
+
* ever weaken the cap. Exported pure because a boundary rule that cannot be tested directly is a
|
|
30
|
+
* boundary nobody will notice moving.
|
|
31
|
+
*/
|
|
32
|
+
export declare function ClampReinvokeDepth(value: unknown): number | undefined;
|
|
21
33
|
/** Context a submission carries beyond the graph itself. */
|
|
22
34
|
export type TaskGraphSubmitContext = {
|
|
23
35
|
/** Environment the tasks belong to. */
|
|
@@ -35,6 +47,16 @@ export type TaskGraphSubmitContext = {
|
|
|
35
47
|
* re-invoked by a finished graph carries its parent's depth + 1.
|
|
36
48
|
*/
|
|
37
49
|
ReinvokeDepth?: number;
|
|
50
|
+
/**
|
|
51
|
+
* The invocation's runtime parameters, for the flow dialect's `data`/`context` roots (R3-3).
|
|
52
|
+
* Persisted on the parent because the instance evaluating a condition is routinely not the
|
|
53
|
+
* process that accepted the graph.
|
|
54
|
+
*/
|
|
55
|
+
Invocation?: TaskGraphInvocationEnvelope;
|
|
56
|
+
/** Seed `$.debug` on the parent at insert. See `TaskGraphStartDebug`. */
|
|
57
|
+
Debug?: {
|
|
58
|
+
paused?: boolean;
|
|
59
|
+
};
|
|
38
60
|
};
|
|
39
61
|
/**
|
|
40
62
|
* What the parent Task row remembers about the graph beyond its tasks.
|
|
@@ -75,6 +97,36 @@ export type TaskGraphParentMetadata = {
|
|
|
75
97
|
* racing the same completion produce one winner rather than two notifications.
|
|
76
98
|
*/
|
|
77
99
|
continuationDeliveredAt?: string;
|
|
100
|
+
/**
|
|
101
|
+
* HOW it was delivered — written by the same compare-and-swap that sets the timestamp.
|
|
102
|
+
*
|
|
103
|
+
* `'expired'` means the settlement was found after its delivery window, so the run and its cost
|
|
104
|
+
* were corrected but nothing was announced: posting a week-old "your workflow finished" into a
|
|
105
|
+
* live conversation, or starting a fresh billed turn for it, is worse than staying quiet. The
|
|
106
|
+
* distinction has to survive in the row, or an expired settlement is indistinguishable from a
|
|
107
|
+
* delivered one the moment anybody looks afterwards.
|
|
108
|
+
*/
|
|
109
|
+
continuationDeliveredAs?: 'delivered' | 'expired' | 'cancelled';
|
|
110
|
+
/**
|
|
111
|
+
* Set, once and durably, when a step declares the workflow finished before its remaining steps.
|
|
112
|
+
*
|
|
113
|
+
* Read by `loadGraphState` so every instance's claim filter knows the remaining steps are about
|
|
114
|
+
* to be skipped. Without it the decision lives only in the deciding instance's memory, and a
|
|
115
|
+
* concurrent poll — including that same instance's, since task execution is not awaited — can
|
|
116
|
+
* claim and start a step the early finish is in the middle of skipping.
|
|
117
|
+
*/
|
|
118
|
+
earlyFinishedAt?: string;
|
|
119
|
+
/**
|
|
120
|
+
* The invocation's `data` and `context`, as the flow dialect's roots of the same names (R3-3).
|
|
121
|
+
*
|
|
122
|
+
* Absent for a graph submitted without them, in which case those roots resolve to the same
|
|
123
|
+
* empty-but-readable value any absent data does — a condition on them reads false rather than
|
|
124
|
+
* throwing, exactly as the walker's would on a missing key.
|
|
125
|
+
*/
|
|
126
|
+
invocation?: {
|
|
127
|
+
data?: unknown;
|
|
128
|
+
context?: unknown;
|
|
129
|
+
};
|
|
78
130
|
};
|
|
79
131
|
/**
|
|
80
132
|
* Continuation chains are bounded separately from graph nesting.
|
|
@@ -98,6 +150,33 @@ export declare const MAX_REINVOKE_DEPTH = 5;
|
|
|
98
150
|
* graph wanted" is still to tell the user their work finished.
|
|
99
151
|
*/
|
|
100
152
|
export declare function ParseTaskGraphParentMetadata(raw: string | null | undefined): TaskGraphParentMetadata;
|
|
153
|
+
/**
|
|
154
|
+
* The JSON bag `persistParent` writes. Exported so start-paused is testable without a database —
|
|
155
|
+
* Pause-after-submit races the first dispatcher poll, so this bag is the only place `paused: true`
|
|
156
|
+
* is guaranteed to land before anyone claims.
|
|
157
|
+
*/
|
|
158
|
+
export declare function BuildTaskGraphParentInputPayload(args: {
|
|
159
|
+
continuation: TaskGraphParentMetadata['continuation'];
|
|
160
|
+
reinvokeDepth: number;
|
|
161
|
+
failureSemantics: NonNullable<TaskGraphParentMetadata['failureSemantics']>;
|
|
162
|
+
submittedByAgentRunID: string | null;
|
|
163
|
+
submittedByUserID: string | null;
|
|
164
|
+
invocation?: {
|
|
165
|
+
data?: unknown;
|
|
166
|
+
context?: unknown;
|
|
167
|
+
} | null;
|
|
168
|
+
startPaused?: boolean;
|
|
169
|
+
}): Record<string, unknown>;
|
|
170
|
+
/** What a cancellation actually managed to do. */
|
|
171
|
+
export type TaskGraphCancelResult = {
|
|
172
|
+
/** False when anything the caller asked to stop is still running. */
|
|
173
|
+
Success: boolean;
|
|
174
|
+
/** True only when every non-terminal task in the graph — and its descendants — is Cancelled. */
|
|
175
|
+
Cancelled: boolean;
|
|
176
|
+
/** Named so the caller can say which parts of the workflow are still going. */
|
|
177
|
+
UncancelledTaskNames: string[];
|
|
178
|
+
ErrorMessage?: string;
|
|
179
|
+
};
|
|
101
180
|
/** True when a continuation chain has gone as far as it may. */
|
|
102
181
|
export declare function IsReinvokeCapReached(meta: TaskGraphParentMetadata): boolean;
|
|
103
182
|
export type TaskGraphSubmitResult = {
|
|
@@ -108,6 +187,8 @@ export type TaskGraphSubmitResult = {
|
|
|
108
187
|
TaskIDMap?: Map<string, string>;
|
|
109
188
|
ErrorMessage?: string;
|
|
110
189
|
};
|
|
190
|
+
/** Name of the task type used for agent-orchestrated graphs. */
|
|
191
|
+
export declare const TASK_TYPE_NAME = "AI Workflow";
|
|
111
192
|
/**
|
|
112
193
|
* Reports the node kinds this dispatcher cannot execute, or `null` when the graph is fully runnable.
|
|
113
194
|
*
|
|
@@ -162,6 +243,14 @@ export declare function FindUnrunnableKinds(spec: TaskGraphSpec): string | null;
|
|
|
162
243
|
*/
|
|
163
244
|
export declare function FindCrossUserAssignments(spec: TaskGraphSpec, submitterUserID: string): string | null;
|
|
164
245
|
export declare class TaskGraphService {
|
|
246
|
+
/**
|
|
247
|
+
* Guarded single-statement writes, shared with the dispatcher.
|
|
248
|
+
*
|
|
249
|
+
* The instance id is descriptive only — this service never CLAIMS anything, it only issues
|
|
250
|
+
* guarded transitions whose predicates are about the row's own status rather than about who
|
|
251
|
+
* holds it.
|
|
252
|
+
*/
|
|
253
|
+
private readonly claims;
|
|
165
254
|
/**
|
|
166
255
|
* Validates and persists a task graph, returning as soon as it is durable.
|
|
167
256
|
*
|
|
@@ -172,13 +261,44 @@ export declare class TaskGraphService {
|
|
|
172
261
|
*/
|
|
173
262
|
Submit(spec: TaskGraphSpec, context: TaskGraphSubmitContext): Promise<TaskGraphSubmitResult>;
|
|
174
263
|
/**
|
|
175
|
-
* Cancels a graph
|
|
264
|
+
* Cancels a graph, everything in it that has not already settled, and everything it started.
|
|
176
265
|
*
|
|
177
266
|
* Cancels children first: a parent marked `Cancelled` while children are still `Pending` would
|
|
178
267
|
* leave the dispatcher free to pick those children up, which is the opposite of what the caller
|
|
179
268
|
* asked for.
|
|
269
|
+
*
|
|
270
|
+
* **The verdict is the outcome, not the attempt** (R2-9). This returned `true` unconditionally
|
|
271
|
+
* while logging each child that failed to cancel — so one failed save left that child `Pending`,
|
|
272
|
+
* told the caller cancellation had succeeded, and let the dispatcher run the child afterwards.
|
|
273
|
+
* The graph could then settle `Complete` and ANNOUNCE ITS COMPLETION into the conversation of a
|
|
274
|
+
* workflow the user had cancelled. A partial cancel now says so and names what survived; the
|
|
275
|
+
* graph stays active, so retrying is meaningful rather than cosmetic.
|
|
276
|
+
*/
|
|
277
|
+
Cancel(parentTaskID: string, context: TaskGraphSubmitContext): Promise<TaskGraphCancelResult>;
|
|
278
|
+
/**
|
|
279
|
+
* `Cancel`, carrying the recursion state the public entry point does not expose.
|
|
280
|
+
*
|
|
281
|
+
* **The depth cap was dead code** (R3-10): `Cancel` passed a literal 0, and the recursion
|
|
282
|
+
* re-entered through `this.Cancel`, which restarted at 0 — so the check could never fire and
|
|
283
|
+
* the "bounded by the reinvoke depth cap" promise was false. A hand-edited `AgentRunID` cycle
|
|
284
|
+
* recursed to stack overflow mid-cancel.
|
|
285
|
+
*
|
|
286
|
+
* The visited set is cheap armour on top: the cap bounds how DEEP a legitimate chain goes, and
|
|
287
|
+
* a cycle is not deep, it is circular. Arithmetic alone would eventually stop it; a visited set
|
|
288
|
+
* stops it immediately and covers linkage shapes the arithmetic does not anticipate.
|
|
289
|
+
*/
|
|
290
|
+
private cancelWithDepth;
|
|
291
|
+
/**
|
|
292
|
+
* Cancels the graphs that this graph's own steps submitted, one level at a time.
|
|
293
|
+
*
|
|
294
|
+
* The linkage is `child task → AgentRunID → the graphs that run submitted`, which is exactly how
|
|
295
|
+
* the continuation chain finds its way back up; walking it downward is the same relation read the
|
|
296
|
+
* other way. Depth-capped by the same constant that caps reinvocation, so a self-referencing
|
|
297
|
+
* workflow cannot make cancellation recurse further than it could have spawned.
|
|
298
|
+
*
|
|
299
|
+
* @returns names of tasks in descendant graphs that could not be cancelled
|
|
180
300
|
*/
|
|
181
|
-
|
|
301
|
+
private cancelNestedGraphs;
|
|
182
302
|
/**
|
|
183
303
|
* Closes the still-open requests raised for a set of tasks.
|
|
184
304
|
*
|
|
@@ -199,7 +319,114 @@ export declare class TaskGraphService {
|
|
|
199
319
|
* leaving them blocked would make the retry pointless, as the graph still could not progress
|
|
200
320
|
* past this node.
|
|
201
321
|
*/
|
|
202
|
-
Retry(taskID: string, context: TaskGraphSubmitContext): Promise<boolean>;
|
|
322
|
+
Retry(taskID: string, context: TaskGraphSubmitContext, inputPayload?: unknown): Promise<boolean>;
|
|
323
|
+
/**
|
|
324
|
+
* Store for the guarded JSON_MODIFY writes. The instance identity and TTL are claim-protocol
|
|
325
|
+
* concerns this class never exercises — the debug writes are instance-free.
|
|
326
|
+
*/
|
|
327
|
+
private readonly debugWrites;
|
|
328
|
+
/** Result shape shared by the control verbs: what happened, and the state that now holds. */
|
|
329
|
+
private controlResult;
|
|
330
|
+
/**
|
|
331
|
+
* Loads a graph parent and proves it IS a workflow graph before any debug write.
|
|
332
|
+
*
|
|
333
|
+
* Read with `BypassCache` for the same reason the dispatcher reads rows that way: the debug bag
|
|
334
|
+
* is written by direct `JSON_MODIFY` statements that fire no cache invalidation, so a cached
|
|
335
|
+
* read here could merge new state over a stale copy and silently resurrect a cleared flag.
|
|
336
|
+
*/
|
|
337
|
+
private loadWorkflowParent;
|
|
338
|
+
/**
|
|
339
|
+
* Writes the debug-bag fields a verb OWNS, and reports the state that results.
|
|
340
|
+
*
|
|
341
|
+
* Field-scoped on purpose — see {@link TaskClaimStore.TryWriteDebugFields}. A verb declares the
|
|
342
|
+
* paths it is responsible for; everything else in the bag is left exactly as the database has
|
|
343
|
+
* it, so a concurrent step-consume, breakpoint edit, or override cannot be undone by a verb that
|
|
344
|
+
* was not talking about them.
|
|
345
|
+
*
|
|
346
|
+
* The returned state is this instance's best view (read + the fields just written) and is
|
|
347
|
+
* advisory — the same posture the console takes toward frames.
|
|
348
|
+
*/
|
|
349
|
+
private writeDebugFields;
|
|
350
|
+
/**
|
|
351
|
+
* Pauses a graph: nothing new is claimed until it is resumed. In-flight steps finish naturally
|
|
352
|
+
* and their completions land — a pause gates claiming and never touches a live claim, which is
|
|
353
|
+
* why there is no "what happens to the claim" question to answer.
|
|
354
|
+
*/
|
|
355
|
+
PauseGraph(parentTaskID: string, context: TaskGraphSubmitContext, pausedByUserID?: string | null): Promise<{
|
|
356
|
+
Success: boolean;
|
|
357
|
+
Debug?: TaskGraphDebugState;
|
|
358
|
+
ErrorMessage?: string;
|
|
359
|
+
}>;
|
|
360
|
+
/** Resumes a paused graph. Breakpoints and edge overrides survive — only the pause clears. */
|
|
361
|
+
ResumeGraph(parentTaskID: string, context: TaskGraphSubmitContext): Promise<{
|
|
362
|
+
Success: boolean;
|
|
363
|
+
Debug?: TaskGraphDebugState;
|
|
364
|
+
ErrorMessage?: string;
|
|
365
|
+
}>;
|
|
366
|
+
/**
|
|
367
|
+
* Arms a one-shot step allowance on a paused graph: `'one'` releases the next eligible task,
|
|
368
|
+
* `'wave'` releases the current frontier, a task ID releases exactly that task. The dispatcher
|
|
369
|
+
* consumes the allowance CAS-style, so two instances stepping the same graph release work once.
|
|
370
|
+
*/
|
|
371
|
+
StepGraph(parentTaskID: string, target: StepTarget, context: TaskGraphSubmitContext): Promise<{
|
|
372
|
+
Success: boolean;
|
|
373
|
+
Debug?: TaskGraphDebugState;
|
|
374
|
+
ErrorMessage?: string;
|
|
375
|
+
}>;
|
|
376
|
+
/**
|
|
377
|
+
* Replaces the graph's breakpoint set. Every ID must name a child of this graph — a breakpoint
|
|
378
|
+
* on a task in some other graph would gate nothing and silently lie to the person who set it.
|
|
379
|
+
*/
|
|
380
|
+
SetBreakpoints(parentTaskID: string, taskIDs: string[], context: TaskGraphSubmitContext): Promise<{
|
|
381
|
+
Success: boolean;
|
|
382
|
+
Debug?: TaskGraphDebugState;
|
|
383
|
+
ErrorMessage?: string;
|
|
384
|
+
}>;
|
|
385
|
+
/**
|
|
386
|
+
* Overrides one edge's condition verdict — the operator's answer for a path the engine cannot
|
|
387
|
+
* decide (a held graph) or decided wrongly (a broken guard). `'false'` reads as "branch not
|
|
388
|
+
* taken" and cascades skips; `'true'` opens the gate; `null` removes the override.
|
|
389
|
+
*/
|
|
390
|
+
SetEdgeOverride(parentTaskID: string, edgeID: string, verdict: EdgeOverrideVerdict | null, context: TaskGraphSubmitContext): Promise<{
|
|
391
|
+
Success: boolean;
|
|
392
|
+
Debug?: TaskGraphDebugState;
|
|
393
|
+
ErrorMessage?: string;
|
|
394
|
+
}>;
|
|
395
|
+
/**
|
|
396
|
+
* Declares a Pending step not-taken. Downstream dependents proceed — `Skipped` satisfies a
|
|
397
|
+
* prerequisite — and any open human request for the step is withdrawn so nobody keeps seeing an
|
|
398
|
+
* ask for work the operator decided against.
|
|
399
|
+
*/
|
|
400
|
+
SkipTask(taskID: string, context: TaskGraphSubmitContext): Promise<{
|
|
401
|
+
Success: boolean;
|
|
402
|
+
ErrorMessage?: string;
|
|
403
|
+
}>;
|
|
404
|
+
/**
|
|
405
|
+
* Marks a step Complete with an operator-supplied output.
|
|
406
|
+
*
|
|
407
|
+
* Human steps are refused here on purpose: they already have a first-class completion path
|
|
408
|
+
* (`TaskGraph.CompleteTask`) with the assignee/elevation check, and this verb must not become
|
|
409
|
+
* the door that bypasses it.
|
|
410
|
+
*/
|
|
411
|
+
ForceCompleteTask(taskID: string, outputPayload: unknown, context: TaskGraphSubmitContext): Promise<{
|
|
412
|
+
Success: boolean;
|
|
413
|
+
ErrorMessage?: string;
|
|
414
|
+
}>;
|
|
415
|
+
/**
|
|
416
|
+
* Replaces a Pending step's input — the "edit the brief before stepping" move at a breakpoint.
|
|
417
|
+
* Applies to this run only; the step must not have started.
|
|
418
|
+
*
|
|
419
|
+
* **A guarded statement, not load-check-save.** The in-memory `Status === 'Pending'` check plus
|
|
420
|
+
* `task.Save()` is an unconditional full-row UPDATE: a task claimed in the window between the
|
|
421
|
+
* load and the save has its claim columns reverted to the pre-claim snapshot *while its body
|
|
422
|
+
* runs*, and a second instance then claims it again — the step executes twice. See
|
|
423
|
+
* {@link TaskClaimStore.TryUpdateInputPayload}, which makes the check and the write one atomic
|
|
424
|
+
* operation whose rowcount is the answer.
|
|
425
|
+
*/
|
|
426
|
+
UpdateTaskInput(taskID: string, inputPayload: unknown, context: TaskGraphSubmitContext): Promise<{
|
|
427
|
+
Success: boolean;
|
|
428
|
+
ErrorMessage?: string;
|
|
429
|
+
}>;
|
|
203
430
|
/** Maps every referenced agent name to its ID, or reports all unresolvable names at once. */
|
|
204
431
|
private resolveAgents;
|
|
205
432
|
/**
|
|
@@ -217,8 +444,31 @@ export declare class TaskGraphService {
|
|
|
217
444
|
*/
|
|
218
445
|
private resolvePrompts;
|
|
219
446
|
private resolveActions;
|
|
220
|
-
/**
|
|
447
|
+
/**
|
|
448
|
+
* Finds or creates the task type used for orchestrated graphs — exactly one of it, ever.
|
|
449
|
+
*
|
|
450
|
+
* **This resolves the engine's discriminator, not a label** (R2-7). Round 1 scoped every sweep
|
|
451
|
+
* arm and both payload-writing guards to this type, so a second row sharing the name lets
|
|
452
|
+
* different processes bind different IDs — and a graph stamped with the other one is invisible
|
|
453
|
+
* to the sweep, never claimed, never settled, its submitting run `Paused` forever, with no
|
|
454
|
+
* error anywhere.
|
|
455
|
+
*
|
|
456
|
+
* Race-safe by INSERT-then-reselect rather than by checking harder. Two concurrent first-ever
|
|
457
|
+
* submissions both read "not there" and both insert; the unique index added in this round makes
|
|
458
|
+
* the loser's insert fail, and the loser then re-reads and finds the winner's row. Checking
|
|
459
|
+
* first is what created the window, so the fix cannot be a better check.
|
|
460
|
+
*/
|
|
221
461
|
private ensureTaskType;
|
|
462
|
+
/**
|
|
463
|
+
* The `AI Workflow` task type's ID, resolved deterministically.
|
|
464
|
+
*
|
|
465
|
+
* `ORDER BY` is not decoration: two rows sharing the name come back in whatever order the engine
|
|
466
|
+
* chooses, so an unordered `MaxRows: 1` lets two processes bind different IDs from the same
|
|
467
|
+
* data. The index this round adds makes duplicates impossible going forward; the ordering makes
|
|
468
|
+
* the resolution deterministic on a database that still has some, and the warning makes the
|
|
469
|
+
* situation visible rather than merely survivable.
|
|
470
|
+
*/
|
|
471
|
+
private findTaskTypeID;
|
|
222
472
|
/** Writes the parent task that represents the graph as a whole. */
|
|
223
473
|
private persistParent;
|
|
224
474
|
/** Writes each child task, returning the tempId -> real ID mapping edges will need. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskGraphService.d.ts","sourceRoot":"","sources":["../src/TaskGraphService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACH,iBAAiB,EAKjB,QAAQ,EAEX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKH,KAAK,mCAAmC,EAC3C,MAAM,+BAA+B,CAAC;AACvC,OAAO,
|
|
1
|
+
{"version":3,"file":"TaskGraphService.d.ts","sourceRoot":"","sources":["../src/TaskGraphService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACH,iBAAiB,EAKjB,QAAQ,EAEX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKH,KAAK,mCAAmC,EAC3C,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAMH,KAAK,2BAA2B,EAChC,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EAEtB,MAAM,8BA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