Skip to content

Commit 26784df

Browse files
committed
Release pure-mock isolated run outputs past the provenance guard
An EMPTY server-synthesized run-from-block snapshot restores no values at all, so there is nothing whose provenance could be untrusted — yet the registry latched restored-provenance-untrusted on it, and the egress projection withheld every pure-mock run_block result from the model (found by the deep-eval lane: the agent ran its isolated unit test, then fished the invisible output out of logs and gave up). The carve-out is exact: only a snapshot with NO block states and NO executed blocks skips the latch; any content-bearing snapshot keeps the guard, and live secret resolutions register normally either way. Claude-Session: https://claude.ai/code/session_01CgaxNAaeD3taGdghbXn17w
1 parent 845a80e commit 26784df

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎apps/sim/lib/workflows/executor/execution-core.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,18 @@ async function executeWorkflowCoreImpl(
591591
const restoredState =
592592
runFromBlock?.sourceSnapshot ?? (resumeFromSnapshot ? snapshot.state : undefined)
593593
const restoreTrusted = resumeFromSnapshot || Boolean(runFromBlock?.sourceExecutionId)
594+
// An EMPTY snapshot (the server-synthesized base for a pure-mock isolated
595+
// block run) restores no values at all, so there is nothing whose provenance
596+
// could be untrusted — latching incomplete here withheld every isolated
597+
// unit-test result from the model. Any snapshot WITH content keeps the guard.
598+
const restoredStateEmpty =
599+
restoredState !== undefined &&
600+
Object.keys(restoredState.blockStates ?? {}).length === 0 &&
601+
(restoredState.executedBlocks ?? []).length === 0
594602
const trustedLargeValueAccess = restoreTrusted
595603
? restoredState?.trustedLargeValueAccess
596604
: undefined
597-
const requireRestoredProvenance = restoredState !== undefined
605+
const requireRestoredProvenance = restoredState !== undefined && !restoredStateEmpty
598606
resolvedSecretTraceRegistry = await createResolvedSecretTraceRegistry({
599607
personalEncrypted,
600608
workspaceEncrypted,
@@ -609,7 +617,7 @@ async function executeWorkflowCoreImpl(
609617
requireRestoredProvenance,
610618
scope: { userId: personalEnvUserId ?? workspaceEnvUserId, workspaceId: providedWorkspaceId },
611619
})
612-
if (restoredState && !restoreTrusted) {
620+
if (restoredState && !restoreTrusted && !restoredStateEmpty) {
613621
resolvedSecretTraceRegistry.markIncomplete('restored-provenance-untrusted')
614622
}
615623
if (options.trustedInitialResolvedSecretTraceProvenance !== undefined) {

0 commit comments

Comments
 (0)