Skip to content

Commit 92277a5

Browse files
committed
docs(run-engine): trim narration and history references from comments
1 parent 485147d commit 92277a5

3 files changed

Lines changed: 5 additions & 12 deletions

File tree

internal-packages/run-engine/src/engine/systems/executionSnapshotSystem.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,8 @@ export class ExecutionSnapshotSystem {
327327
}
328328

329329
/**
330-
* Pure Postgres mutation — safe inside a transaction. Inserts the snapshot row and
331-
* returns the enhanced result. Direct callers MUST call `scheduleSnapshotSideEffects()`
332-
* with the result after the surrounding transaction commits.
330+
* Pure Postgres mutation — safe inside a transaction. Direct callers MUST call
331+
* `scheduleSnapshotSideEffects()` with the result after the surrounding transaction commits.
333332
*/
334333
public async createExecutionSnapshotMutation(
335334
prisma: PrismaClientOrTransaction,
@@ -441,8 +440,7 @@ export class ExecutionSnapshotSystem {
441440
}
442441
}
443442

444-
// Destructure off the wrapper-only fields so the emitted payload matches the
445-
// pre-split shape (raw snapshot row fields + completedWaitpointIds only).
443+
// The emitted payload must contain only raw snapshot row fields (+ completedWaitpointIds).
446444
const { friendlyId: _fid, runFriendlyId: _rfid, ...snapshotRow } = snapshot;
447445

448446
this.$.eventBus.emit("executionSnapshotCreated", {

internal-packages/run-engine/src/engine/systems/runAttemptSystem.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,6 @@ export class RunAttemptSystem {
851851
},
852852
});
853853

854-
// Post-commit side effects of the waitpoint completion
855854
if (completedWaitpoint) {
856855
await this.waitpointSystem.scheduleWaitpointContinuations(completedWaitpoint);
857856
}

internal-packages/run-engine/src/engine/systems/waitpointSystem.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -864,8 +864,7 @@ export class WaitpointSystem {
864864
completedWaitpoints: completedWaitpointArgs,
865865
});
866866

867-
// Remove the blocking waitpoints in the same transaction, so the
868-
// new snapshot and the unblock are atomic.
867+
// Deleted in the same transaction so the snapshot and unblock are atomic.
869868
if (blockingWaitpoints.length > 0) {
870869
await tx.taskRunWaitpoint.deleteMany({
871870
where: {
@@ -897,8 +896,7 @@ export class WaitpointSystem {
897896
throw new Error(`continueRunIfUnblocked: failed to unblock run: ${runId}`);
898897
}
899898

900-
// Schedule side effects (heartbeat + eventBus) AFTER the transaction has
901-
// committed, so they always reference a durable snapshot row.
899+
// Side effects must only run against a durably committed snapshot row.
902900
await this.executionSnapshotSystem.scheduleSnapshotSideEffects({
903901
snapshot: newSnapshot,
904902
runId,
@@ -928,8 +926,6 @@ export class WaitpointSystem {
928926
// Unlike EXECUTING_WITH_WAITPOINTS above, this case is deliberately NOT
929927
// wrapped in a single transaction: enqueueRun performs Redis queue work
930928
// internally, which must never run inside an open Postgres transaction.
931-
// Its snapshot insert and the post-switch waitpoint deletion below stay
932-
// separate statements, as they were before the transactional refactor.
933929
case "SUSPENDED": {
934930
if (!snapshot.checkpointId) {
935931
// A run canceled mid-suspend has its checkpoint cleared by the

0 commit comments

Comments
 (0)