Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

CheckpointReactor.ts

710 lines22.4 KB

1import {
2 CommandId,
3 EventId,
4 MessageId,
5 ProviderSessionId,
6 ThreadId,
7 TurnId,
8 type OrchestrationEvent,
9 type ProviderRuntimeEvent,
10} from "@t3tools/contracts";
11import { Cause, Effect, Layer, Option, Queue, Stream } from "effect";
12​
13import { parseTurnDiffFilesFromUnifiedDiff } from "../../checkpointing/Diffs.ts";
14import {
15 checkpointRefForThreadTurn,
16 resolveThreadWorkspaceCwd,
17} from "../../checkpointing/Utils.ts";
18import { CheckpointStore } from "../../checkpointing/Services/CheckpointStore.ts";
19import { ProviderService } from "../../provider/Services/ProviderService.ts";
20import { CheckpointReactor, type CheckpointReactorShape } from "../Services/CheckpointReactor.ts";
21import { OrchestrationEngineService } from "../Services/OrchestrationEngine.ts";
22import { CheckpointStoreError } from "../../checkpointing/Errors.ts";
23import { OrchestrationDispatchError } from "../Errors.ts";
24​
25type ReactorInput =
26 | {
27 readonly source: "runtime";
28 readonly event: ProviderRuntimeEvent;
29 }
30 | {
31 readonly source: "domain";
32 readonly event: OrchestrationEvent;
33 };
34​
35function toTurnId(value: string | undefined): TurnId | null {
36 return value === undefined ? null : TurnId.makeUnsafe(value);
38​
39function checkpointStatusFromRuntime(status: string | undefined): "ready" | "missing" | "error" {
40 switch (status) {
41 case "failed":
42 return "error";
43 case "cancelled":
44 case "interrupted":
45 return "missing";
46 case "completed":
47 default:
48 return "ready";
49 }
51​
52const serverCommandId = (tag: string): CommandId =>
53 CommandId.makeUnsafe(`server:${tag}:${crypto.randomUUID()}`);
54​
55const make = Effect.gen(function* () {
56 const orchestrationEngine = yield* OrchestrationEngineService;
57 const providerService = yield* ProviderService;
58 const checkpointStore = yield* CheckpointStore;
59​
60 const appendRevertFailureActivity = (input: {
61 readonly threadId: ThreadId;
62 readonly turnCount: number;
63 readonly detail: string;
64 readonly createdAt: string;
65 }) =>
66 orchestrationEngine.dispatch({
67 type: "thread.activity.append",
68 commandId: serverCommandId("checkpoint-revert-failure"),
69 threadId: input.threadId,
70 activity: {
71 id: EventId.makeUnsafe(crypto.randomUUID()),
72 tone: "error",
73 kind: "checkpoint.revert.failed",
74 summary: "Checkpoint revert failed",
75 payload: {
76 turnCount: input.turnCount,
77 detail: input.detail,
78 },
79 turnId: null,
80 createdAt: input.createdAt,
81 },
82 createdAt: input.createdAt,
83 });
84​
85 const appendCaptureFailureActivity = (input: {
86 readonly sessionId: ProviderSessionId;
87 readonly turnId: TurnId | null;
88 readonly detail: string;
89 readonly createdAt: string;
90 }) =>
91 Effect.gen(function* () {
92 const readModel = yield* orchestrationEngine.getReadModel();
93 const thread = readModel.threads.find(
94 (entry) => entry.session?.providerSessionId === input.sessionId,
95 );
96 if (!thread) {
97 return;
98 }
99 yield* orchestrationEngine.dispatch({
100 type: "thread.activity.append",
101 commandId: serverCommandId("checkpoint-capture-failure"),
102 threadId: thread.id,
103 activity: {
104 id: EventId.makeUnsafe(crypto.randomUUID()),
105 tone: "error",
106 kind: "checkpoint.capture.failed",
107 summary: "Checkpoint capture failed",
108 payload: {
109 detail: input.detail,
110 },
111 turnId: input.turnId,
112 createdAt: input.createdAt,
113 },
114 createdAt: input.createdAt,
115 });
116 });
117​
118 const resolveSessionRuntimeForThread = Effect.fnUntraced(function* (
119 threadId: ThreadId,
120 ): Effect.fn.Return<
121 Option.Option<{ readonly sessionId: ProviderSessionId; readonly cwd: string }>
122 > {
123 const readModel = yield* orchestrationEngine.getReadModel();
124 const thread = readModel.threads.find((entry) => entry.id === threadId);
125 const projectedSessionId = thread?.session?.providerSessionId ?? null;
126 const projectedProviderThreadId = thread?.session?.providerThreadId ?? undefined;
127​
128 const sessions = yield* providerService.listSessions();
129​
130 const findSessionWithCwd = (
131 session: (typeof sessions)[number] | undefined,
132 ): Option.Option<{ readonly sessionId: ProviderSessionId; readonly cwd: string }> => {
133 if (!session?.cwd) {
134 return Option.none();
135 }
136 return Option.some({ sessionId: session.sessionId, cwd: session.cwd });
137 };
138​
139 if (projectedSessionId !== null) {
140 const projectedSession = sessions.find((session) => session.sessionId === projectedSessionId);
141 const fromProjected = findSessionWithCwd(projectedSession);
142 if (Option.isSome(fromProjected)) {
143 return fromProjected;
144 }
145 }
146​
147 if (projectedProviderThreadId) {
148 const matchedSession = sessions.find(
149 (session) => session.threadId === projectedProviderThreadId,
150 );
151 const fromProviderThread = findSessionWithCwd(matchedSession);
152 if (Option.isSome(fromProviderThread)) {
153 return fromProviderThread;
154 }
155 }
156​
157 return Option.none();
158 });
159​
160 const captureCheckpointFromTurnCompletion = Effect.fnUntraced(function* (
161 event: Extract<ProviderRuntimeEvent, { type: "turn.completed" }>,
162 ) {
163 const turnId = toTurnId(event.turnId);
164 if (!turnId) {
165 return;
166 }
167​
168 const readModel = yield* orchestrationEngine.getReadModel();
169 const thread = readModel.threads.find(
170 (entry) => entry.session?.providerSessionId === event.sessionId,
171 );
172 if (!thread) {
173 return;
174 }
175​
176 if (thread.checkpoints.some((checkpoint) => checkpoint.turnId === turnId)) {
177 return;
178 }
179​
180 const sessionRuntime = yield* resolveSessionRuntimeForThread(thread.id);
181 const checkpointCwd =
182 Option.match(sessionRuntime, {
183 onNone: () => undefined,
184 onSome: (runtime) => runtime.cwd,
185 }) ??
186 resolveThreadWorkspaceCwd({
187 thread,
188 projects: readModel.projects,
189 });
190 if (!checkpointCwd) {
191 yield* Effect.logWarning("checkpoint capture skipped: no active provider session cwd", {
192 threadId: thread.id,
193 turnId,
194 });
195 return;
196 }
197​
198 const currentTurnCount = thread.checkpoints.reduce(
199 (maxTurnCount, checkpoint) => Math.max(maxTurnCount, checkpoint.checkpointTurnCount),
200 0,
201 );
202 const nextTurnCount = currentTurnCount + 1;
203 const fromTurnCount = Math.max(0, nextTurnCount - 1);
204 const fromCheckpointRef = checkpointRefForThreadTurn(thread.id, fromTurnCount);
205 const targetCheckpointRef = checkpointRefForThreadTurn(thread.id, nextTurnCount);
206​
207 const fromCheckpointExists = yield* checkpointStore.hasCheckpointRef({
208 cwd: checkpointCwd,
209 checkpointRef: fromCheckpointRef,
210 });
211 if (!fromCheckpointExists) {
212 yield* Effect.logWarning("checkpoint completion missing pre-turn baseline", {
213 threadId: thread.id,
214 turnId,
215 fromTurnCount,
216 });
217 }
218​
219 yield* checkpointStore.captureCheckpoint({
220 cwd: checkpointCwd,
221 checkpointRef: targetCheckpointRef,
222 });
223​
224 const files = yield* checkpointStore
225 .diffCheckpoints({
226 cwd: checkpointCwd,
227 fromCheckpointRef,
228 toCheckpointRef: targetCheckpointRef,
229 fallbackFromToHead: false,
230 })
231 .pipe(
232 Effect.map((diff) =>
233 parseTurnDiffFilesFromUnifiedDiff(diff).map((file) => ({
234 path: file.path,
235 kind: "modified" as const,
236 additions: file.additions,
237 deletions: file.deletions,
238 })),
239 ),
240 Effect.tapError((error) =>
241 appendCaptureFailureActivity({
242 sessionId: event.sessionId,
243 turnId,
244 detail: `Checkpoint captured, but turn diff summary is unavailable: ${error.message}`,
245 createdAt: event.createdAt,
246 }),
247 ),
248 Effect.catch((error) =>
249 Effect.logWarning("failed to derive checkpoint file summary", {
250 threadId: thread.id,
251 turnId,
252 turnCount: nextTurnCount,
253 detail: error.message,
254 }).pipe(Effect.as([])),
255 ),
256 );
257​
258 const assistantMessageId =
259 thread.messages
260 .toReversed()
261 .find((entry) => entry.role === "assistant" && entry.turnId === turnId)?.id ??
262 MessageId.makeUnsafe(`assistant:${turnId}`);
263​
264 const now = event.createdAt;
265 yield* orchestrationEngine.dispatch({
266 type: "thread.turn.diff.complete",
267 commandId: serverCommandId("checkpoint-turn-diff-complete"),
268 threadId: thread.id,
269 turnId,
270 completedAt: now,
271 checkpointRef: targetCheckpointRef,
272 status: checkpointStatusFromRuntime(event.status),
273 files,
274 assistantMessageId,
275 checkpointTurnCount: nextTurnCount,
276 createdAt: now,
277 });
278​
279 yield* orchestrationEngine.dispatch({
280 type: "thread.activity.append",
281 commandId: serverCommandId("checkpoint-captured-activity"),
282 threadId: thread.id,
283 activity: {
284 id: EventId.makeUnsafe(crypto.randomUUID()),
285 tone: "info",
286 kind: "checkpoint.captured",
287 summary: "Checkpoint captured",
288 payload: {
289 turnCount: nextTurnCount,
290 ...(event.status !== undefined ? { status: event.status } : {}),
291 },
292 turnId,
293 createdAt: now,
294 },
295 createdAt: now,
296 });
297 });
298​
299 const ensurePreTurnBaselineFromTurnStart = Effect.fnUntraced(function* (
300 event: Extract<ProviderRuntimeEvent, { type: "turn.started" }>,
301 ) {
302 const turnId = toTurnId(event.turnId);
303 if (!turnId) {
304 return;
305 }
306​
307 const readModel = yield* orchestrationEngine.getReadModel();
308 const thread = readModel.threads.find(
309 (entry) => entry.session?.providerSessionId === event.sessionId,
310 );
311 if (!thread) {
312 return;
313 }
314​
315 const checkpointCwdFromThreadOrProject = resolveThreadWorkspaceCwd({
316 thread,
317 projects: readModel.projects,
318 });
319 const checkpointCwd =
320 checkpointCwdFromThreadOrProject ??
321 Option.match(yield* resolveSessionRuntimeForThread(thread.id), {
322 onNone: () => undefined,
323 onSome: (runtime) => runtime.cwd,
324 });
325 if (!checkpointCwd) {
326 yield* Effect.logWarning("checkpoint pre-turn capture skipped: no workspace cwd", {
327 threadId: thread.id,
328 turnId,
329 });
330 return;
331 }
332​
333 const currentTurnCount = thread.checkpoints.reduce(
334 (maxTurnCount, checkpoint) => Math.max(maxTurnCount, checkpoint.checkpointTurnCount),
335 0,
336 );
337 const baselineCheckpointRef = checkpointRefForThreadTurn(thread.id, currentTurnCount);
338 const baselineExists = yield* checkpointStore.hasCheckpointRef({
339 cwd: checkpointCwd,
340 checkpointRef: baselineCheckpointRef,
341 });
342 if (baselineExists) {
343 return;
344 }
345​
346 yield* checkpointStore.captureCheckpoint({
347 cwd: checkpointCwd,
348 checkpointRef: baselineCheckpointRef,
349 });
350 });
351​
352 const ensurePreTurnBaselineFromDomainTurnStart = Effect.fnUntraced(function* (
353 event: Extract<
354 OrchestrationEvent,
355 { type: "thread.turn-start-requested" | "thread.message-sent" }
356 >,
357 ) {
358 if (event.type === "thread.message-sent") {
359 if (
360 event.payload.role !== "user" ||
361 event.payload.streaming ||
362 event.payload.turnId !== null
363 ) {
364 return;
365 }
366 }
367​
368 const threadId = event.payload.threadId;
369 const readModel = yield* orchestrationEngine.getReadModel();
370 const thread = readModel.threads.find((entry) => entry.id === threadId);
371 if (!thread) {
372 return;
373 }
374​
375 const checkpointCwdFromThreadOrProject = resolveThreadWorkspaceCwd({
376 thread,
377 projects: readModel.projects,
378 });
379 const checkpointCwd =
380 checkpointCwdFromThreadOrProject ??
381 Option.match(yield* resolveSessionRuntimeForThread(threadId), {
382 onNone: () => undefined,
383 onSome: (runtime) => runtime.cwd,
384 });
385 if (!checkpointCwd) {
386 yield* Effect.logWarning("checkpoint pre-turn capture skipped: no workspace cwd", {
387 threadId,
388 });
389 return;
390 }
391​
392 const currentTurnCount = thread.checkpoints.reduce(
393 (maxTurnCount, checkpoint) => Math.max(maxTurnCount, checkpoint.checkpointTurnCount),
394 0,
395 );
396 const baselineCheckpointRef = checkpointRefForThreadTurn(threadId, currentTurnCount);
397 const baselineExists = yield* checkpointStore.hasCheckpointRef({
398 cwd: checkpointCwd,
399 checkpointRef: baselineCheckpointRef,
400 });
401 if (baselineExists) {
402 return;
403 }
404​
405 yield* checkpointStore.captureCheckpoint({
406 cwd: checkpointCwd,
407 checkpointRef: baselineCheckpointRef,
408 });
409 });
410​
411 const handleRevertRequested = Effect.fnUntraced(function* (
412 event: Extract<OrchestrationEvent, { type: "thread.checkpoint-revert-requested" }>,
413 ) {
414 const now = new Date().toISOString();
415​
416 const readModel = yield* orchestrationEngine.getReadModel();
417 const thread = readModel.threads.find((entry) => entry.id === event.payload.threadId);
418 if (!thread) {
419 yield* appendRevertFailureActivity({
420 threadId: event.payload.threadId,
421 turnCount: event.payload.turnCount,
422 detail: "Thread was not found in read model.",
423 createdAt: now,
424 }).pipe(Effect.catch(() => Effect.void));
425 return;
426 }
427​
428 const sessionRuntime = yield* resolveSessionRuntimeForThread(event.payload.threadId);
429 if (Option.isNone(sessionRuntime)) {
430 yield* appendRevertFailureActivity({
431 threadId: event.payload.threadId,
432 turnCount: event.payload.turnCount,
433 detail: "No active provider session with workspace cwd is bound to this thread.",
434 createdAt: now,
435 }).pipe(Effect.catch(() => Effect.void));
436 return;
437 }
438​
439 const currentTurnCount = thread.checkpoints.reduce(
440 (maxTurnCount, checkpoint) => Math.max(maxTurnCount, checkpoint.checkpointTurnCount),
441 0,
442 );
443​
444 if (event.payload.turnCount > currentTurnCount) {
445 yield* appendRevertFailureActivity({
446 threadId: event.payload.threadId,
447 turnCount: event.payload.turnCount,
448 detail: `Checkpoint turn count ${event.payload.turnCount} exceeds current turn count ${currentTurnCount}.`,
449 createdAt: now,
450 }).pipe(Effect.catch(() => Effect.void));
451 return;
452 }
453​
454 const targetCheckpointRef =
455 event.payload.turnCount === 0
456 ? checkpointRefForThreadTurn(event.payload.threadId, 0)
457 : thread.checkpoints.find(
458 (checkpoint) => checkpoint.checkpointTurnCount === event.payload.turnCount,
459 )?.checkpointRef;
460​
461 if (!targetCheckpointRef) {
462 yield* appendRevertFailureActivity({
463 threadId: event.payload.threadId,
464 turnCount: event.payload.turnCount,
465 detail: `Checkpoint ref for turn ${event.payload.turnCount} is unavailable in read model.`,
466 createdAt: now,
467 }).pipe(Effect.catch(() => Effect.void));
468 return;
469 }
470​
471 const restored = yield* checkpointStore.restoreCheckpoint({
472 cwd: sessionRuntime.value.cwd,
473 checkpointRef: targetCheckpointRef,
474 fallbackToHead: event.payload.turnCount === 0,
475 });
476 if (!restored) {
477 yield* appendRevertFailureActivity({
478 threadId: event.payload.threadId,
479 turnCount: event.payload.turnCount,
480 detail: `Filesystem checkpoint is unavailable for turn ${event.payload.turnCount}.`,
481 createdAt: now,
482 }).pipe(Effect.catch(() => Effect.void));
483 return;
484 }
485​
486 const rolledBackTurns = Math.max(0, currentTurnCount - event.payload.turnCount);
487 if (rolledBackTurns > 0) {
488 yield* providerService.rollbackConversation({
489 sessionId: sessionRuntime.value.sessionId,
490 numTurns: rolledBackTurns,
491 });
492 }
493​
494 const staleCheckpointRefs = thread.checkpoints
495 .filter((checkpoint) => checkpoint.checkpointTurnCount > event.payload.turnCount)
496 .map((checkpoint) => checkpoint.checkpointRef);
497​
498 if (staleCheckpointRefs.length > 0) {
499 yield* checkpointStore.deleteCheckpointRefs({
500 cwd: sessionRuntime.value.cwd,
501 checkpointRefs: staleCheckpointRefs,
502 });
503 }
504​
505 yield* orchestrationEngine
506 .dispatch({
507 type: "thread.revert.complete",
508 commandId: serverCommandId("checkpoint-revert-complete"),
509 threadId: event.payload.threadId,
510 turnCount: event.payload.turnCount,
511 createdAt: now,
512 })
513 .pipe(
514 Effect.catch((error) =>
515 appendRevertFailureActivity({
516 threadId: event.payload.threadId,
517 turnCount: event.payload.turnCount,
518 detail: error.message,
519 createdAt: now,
520 }),
521 ),
522 Effect.asVoid,
523 );
524 });
525​
526 const processDomainEvent = Effect.fnUntraced(function* (event: OrchestrationEvent) {
527 if (event.type === "thread.turn-start-requested" || event.type === "thread.message-sent") {
528 yield* ensurePreTurnBaselineFromDomainTurnStart(event);
529 return;
530 }
531​
532 if (event.type === "thread.checkpoint-revert-requested") {
533 yield* handleRevertRequested(event).pipe(
534 Effect.catch((error) =>
535 appendRevertFailureActivity({
536 threadId: event.payload.threadId,
537 turnCount: event.payload.turnCount,
538 detail: error.message,
539 createdAt: new Date().toISOString(),
540 }),
541 ),
542 );
543 }
544 });
545​
546 const processRuntimeEvent = Effect.fnUntraced(function* (event: ProviderRuntimeEvent) {
547 if (event.type === "turn.started") {
548 yield* ensurePreTurnBaselineFromTurnStart(event);
549 return;
550 }
551​
552 if (event.type === "turn.completed") {
553 const turnId = toTurnId(event.turnId);
554 yield* captureCheckpointFromTurnCompletion(event).pipe(
555 Effect.catch((error) =>
556 appendCaptureFailureActivity({
557 sessionId: event.sessionId,
558 turnId,
559 detail: error.message,
560 createdAt: new Date().toISOString(),
561 }).pipe(Effect.catch(() => Effect.void)),
562 ),
563 );
564 return;
565 }
566​
567 if (event.type === "checkpoint.captured") {
568 const turnId = toTurnId(event.turnId);
569 if (!turnId) {
570 return;
571 }
572​
573 const readModel = yield* orchestrationEngine.getReadModel();
574 const thread = readModel.threads.find(
575 (entry) => entry.session?.providerSessionId === event.sessionId,
576 );
577 if (!thread) {
578 return;
579 }
580​
581 if (
582 thread.checkpoints.some(
583 (checkpoint) =>
584 checkpoint.turnId === turnId || checkpoint.checkpointTurnCount === event.turnCount,
585 )
586 ) {
587 return;
588 }
589​
590 const sessionRuntime = yield* resolveSessionRuntimeForThread(thread.id);
591 if (Option.isNone(sessionRuntime)) {
592 return;
593 }
594​
595 const fromTurnCount = Math.max(0, event.turnCount - 1);
596 const fromCheckpointRef = checkpointRefForThreadTurn(thread.id, fromTurnCount);
597 const targetCheckpointRef = checkpointRefForThreadTurn(thread.id, event.turnCount);
598​
599 const targetExists = yield* checkpointStore.hasCheckpointRef({
600 cwd: sessionRuntime.value.cwd,
601 checkpointRef: targetCheckpointRef,
602 });
603 if (!targetExists) {
604 yield* checkpointStore.captureCheckpoint({
605 cwd: sessionRuntime.value.cwd,
606 checkpointRef: targetCheckpointRef,
607 });
608 }
609​
610 const files = yield* checkpointStore
611 .diffCheckpoints({
612 cwd: sessionRuntime.value.cwd,
613 fromCheckpointRef,
614 toCheckpointRef: targetCheckpointRef,
615 fallbackFromToHead: false,
616 })
617 .pipe(
618 Effect.map((diff) =>
619 parseTurnDiffFilesFromUnifiedDiff(diff).map((file) => ({
620 path: file.path,
621 kind: "modified" as const,
622 additions: file.additions,
623 deletions: file.deletions,
624 })),
625 ),
626 Effect.catch(() => Effect.succeed([])),
627 );
628​
629 const assistantMessageId =
630 thread.messages
631 .toReversed()
632 .find((entry) => entry.role === "assistant" && entry.turnId === turnId)?.id ??
633 MessageId.makeUnsafe(`assistant:${turnId}`);
634​
635 yield* orchestrationEngine.dispatch({
636 type: "thread.turn.diff.complete",
637 commandId: serverCommandId("checkpoint-runtime-captured-diff-complete"),
638 threadId: thread.id,
639 turnId,
640 completedAt: event.createdAt,
641 checkpointRef: targetCheckpointRef,
642 status: checkpointStatusFromRuntime(event.status),
643 files,
644 assistantMessageId,
645 checkpointTurnCount: event.turnCount,
646 createdAt: event.createdAt,
647 });
648 }
649 });
650​
651 const processInput = (
652 input: ReactorInput,
653 ): Effect.Effect<void, CheckpointStoreError | OrchestrationDispatchError, never> =>
654 input.source === "domain" ? processDomainEvent(input.event) : processRuntimeEvent(input.event);
655​
656 const processInputSafely = (input: ReactorInput) =>
657 processInput(input).pipe(
658 Effect.catchCause((cause) => {
659 if (Cause.hasInterruptsOnly(cause)) {
660 return Effect.failCause(cause);
661 }
662 return Effect.logWarning("checkpoint reactor failed to process input", {
663 source: input.source,
664 eventType: input.event.type,
665 cause: Cause.pretty(cause),
666 });
667 }),
668 );
669​
670 const start: CheckpointReactorShape["start"] = Effect.gen(function* () {
671 const queue = yield* Queue.unbounded<ReactorInput>();
672 yield* Effect.addFinalizer(() => Queue.shutdown(queue).pipe(Effect.asVoid));
673​
674 yield* Effect.forkScoped(
675 Effect.forever(Queue.take(queue).pipe(Effect.flatMap(processInputSafely))),
676 );
677​
678 yield* Effect.forkScoped(
679 Stream.runForEach(orchestrationEngine.streamDomainEvents, (event) => {
680 if (
681 event.type !== "thread.turn-start-requested" &&
682 event.type !== "thread.message-sent" &&
683 event.type !== "thread.checkpoint-revert-requested"
684 ) {
685 return Effect.void;
686 }
687 return Queue.offer(queue, { source: "domain", event }).pipe(Effect.asVoid);
688 }),
689 );
690​
691 yield* Effect.forkScoped(
692 Stream.runForEach(providerService.streamEvents, (event) => {
693 if (
694 event.type !== "turn.started" &&
695 event.type !== "turn.completed" &&
696 event.type !== "checkpoint.captured"
697 ) {
698 return Effect.void;
699 }
700 return Queue.offer(queue, { source: "runtime", event }).pipe(Effect.asVoid);
701 }),
702 );
703 });
704​
705 return {
706 start,
707 } satisfies CheckpointReactorShape;
708});
709​
710export const CheckpointReactorLive = Layer.effect(CheckpointReactor, make);