@riddledc/riddle-proof 0.5.23 → 0.5.24
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/dist/{chunk-M4MISBQV.js → chunk-46355FJD.js} +14 -1
- package/dist/engine-harness.cjs +14 -1
- package/dist/engine-harness.js +1 -1
- package/dist/index.cjs +14 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -89,8 +89,20 @@ function loadRunState(input) {
|
|
|
89
89
|
state_path: statePath
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
+
function isProtectedFinalStatus(status) {
|
|
93
|
+
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
94
|
+
}
|
|
95
|
+
function shouldPreserveFinalizedRunState(filePath, incoming) {
|
|
96
|
+
const existing = readJson(filePath);
|
|
97
|
+
if (!existing?.finalized || !isProtectedFinalStatus(existing.status)) return false;
|
|
98
|
+
if (!incoming.finalized) return true;
|
|
99
|
+
if (existing.status === incoming.status) return false;
|
|
100
|
+
return !(existing.status === "ready_to_ship" && incoming.status === "shipped");
|
|
101
|
+
}
|
|
92
102
|
function persist(state) {
|
|
93
|
-
if (state.state_path)
|
|
103
|
+
if (!state.state_path) return;
|
|
104
|
+
if (shouldPreserveFinalizedRunState(state.state_path, state)) return;
|
|
105
|
+
writeJson(state.state_path, state);
|
|
94
106
|
}
|
|
95
107
|
function recordEvent(state, event) {
|
|
96
108
|
appendRunEvent(state, event);
|
|
@@ -325,6 +337,7 @@ function engineFailureBlocker(result, checkpoint) {
|
|
|
325
337
|
}
|
|
326
338
|
function terminalResult(state, status, result, summary, raw = {}) {
|
|
327
339
|
setRunStatus(state, status);
|
|
340
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
328
341
|
const metadata = normalizeTerminalMetadata({
|
|
329
342
|
riddleState: result ? fullRiddleState(result, state) : null,
|
|
330
343
|
engineResult: result
|
package/dist/engine-harness.cjs
CHANGED
|
@@ -3091,8 +3091,20 @@ function loadRunState(input) {
|
|
|
3091
3091
|
state_path: statePath
|
|
3092
3092
|
});
|
|
3093
3093
|
}
|
|
3094
|
+
function isProtectedFinalStatus(status) {
|
|
3095
|
+
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
3096
|
+
}
|
|
3097
|
+
function shouldPreserveFinalizedRunState(filePath, incoming) {
|
|
3098
|
+
const existing = readJson(filePath);
|
|
3099
|
+
if (!existing?.finalized || !isProtectedFinalStatus(existing.status)) return false;
|
|
3100
|
+
if (!incoming.finalized) return true;
|
|
3101
|
+
if (existing.status === incoming.status) return false;
|
|
3102
|
+
return !(existing.status === "ready_to_ship" && incoming.status === "shipped");
|
|
3103
|
+
}
|
|
3094
3104
|
function persist(state) {
|
|
3095
|
-
if (state.state_path)
|
|
3105
|
+
if (!state.state_path) return;
|
|
3106
|
+
if (shouldPreserveFinalizedRunState(state.state_path, state)) return;
|
|
3107
|
+
writeJson(state.state_path, state);
|
|
3096
3108
|
}
|
|
3097
3109
|
function recordEvent(state, event) {
|
|
3098
3110
|
appendRunEvent(state, event);
|
|
@@ -3327,6 +3339,7 @@ function engineFailureBlocker(result, checkpoint) {
|
|
|
3327
3339
|
}
|
|
3328
3340
|
function terminalResult(state, status, result, summary, raw = {}) {
|
|
3329
3341
|
setRunStatus(state, status);
|
|
3342
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
3330
3343
|
const metadata = normalizeTerminalMetadata({
|
|
3331
3344
|
riddleState: result ? fullRiddleState(result, state) : null,
|
|
3332
3345
|
engineResult: result
|
package/dist/engine-harness.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -3647,8 +3647,20 @@ function loadRunState(input) {
|
|
|
3647
3647
|
state_path: statePath
|
|
3648
3648
|
});
|
|
3649
3649
|
}
|
|
3650
|
+
function isProtectedFinalStatus(status) {
|
|
3651
|
+
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
3652
|
+
}
|
|
3653
|
+
function shouldPreserveFinalizedRunState(filePath, incoming) {
|
|
3654
|
+
const existing = readJson(filePath);
|
|
3655
|
+
if (!existing?.finalized || !isProtectedFinalStatus(existing.status)) return false;
|
|
3656
|
+
if (!incoming.finalized) return true;
|
|
3657
|
+
if (existing.status === incoming.status) return false;
|
|
3658
|
+
return !(existing.status === "ready_to_ship" && incoming.status === "shipped");
|
|
3659
|
+
}
|
|
3650
3660
|
function persist(state) {
|
|
3651
|
-
if (state.state_path)
|
|
3661
|
+
if (!state.state_path) return;
|
|
3662
|
+
if (shouldPreserveFinalizedRunState(state.state_path, state)) return;
|
|
3663
|
+
writeJson(state.state_path, state);
|
|
3652
3664
|
}
|
|
3653
3665
|
function recordEvent(state, event) {
|
|
3654
3666
|
appendRunEvent(state, event);
|
|
@@ -3883,6 +3895,7 @@ function engineFailureBlocker(result, checkpoint) {
|
|
|
3883
3895
|
}
|
|
3884
3896
|
function terminalResult(state, status, result, summary, raw = {}) {
|
|
3885
3897
|
setRunStatus(state, status);
|
|
3898
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
3886
3899
|
const metadata = normalizeTerminalMetadata({
|
|
3887
3900
|
riddleState: result ? fullRiddleState(result, state) : null,
|
|
3888
3901
|
engineResult: result
|
package/dist/index.js
CHANGED