@riddledc/riddle-proof 0.8.30 → 0.8.31
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/advanced/engine-harness.cjs +132 -10
- package/dist/advanced/engine-harness.js +2 -2
- package/dist/advanced/index.cjs +132 -10
- package/dist/advanced/index.d.cts +2 -2
- package/dist/advanced/index.d.ts +2 -2
- package/dist/advanced/index.js +4 -4
- package/dist/advanced/proof-run-core.cjs +3 -1
- package/dist/advanced/proof-run-core.d.cts +1 -1
- package/dist/advanced/proof-run-core.d.ts +1 -1
- package/dist/advanced/proof-run-core.js +1 -1
- package/dist/advanced/proof-run-engine.cjs +80 -1
- package/dist/advanced/proof-run-engine.d.cts +2 -2
- package/dist/advanced/proof-run-engine.d.ts +2 -2
- package/dist/advanced/proof-run-engine.js +2 -2
- package/dist/advanced/runner.js +2 -2
- package/dist/{chunk-3OTO7IDH.js → chunk-C2NHHBFV.js} +1 -1
- package/dist/{chunk-32RE64IO.js → chunk-IOI6QR3B.js} +78 -1
- package/dist/{chunk-XJA2GDVN.js → chunk-U73JPBZW.js} +1 -1
- package/dist/{chunk-K6HZUSHH.js → chunk-X7SQTCIQ.js} +3 -1
- package/dist/{chunk-UWO4YR7I.js → chunk-ZREWMTFA.js} +53 -10
- package/dist/cli/index.js +3 -3
- package/dist/cli.cjs +132 -10
- package/dist/cli.js +3 -3
- package/dist/engine-harness.cjs +132 -10
- package/dist/engine-harness.js +2 -2
- package/dist/index.cjs +132 -10
- package/dist/index.js +3 -3
- package/dist/{proof-run-core-C8FDUhle.d.cts → proof-run-core-B1GeqkR8.d.cts} +2 -0
- package/dist/{proof-run-core-C8FDUhle.d.ts → proof-run-core-B1GeqkR8.d.ts} +2 -0
- package/dist/proof-run-core.cjs +3 -1
- package/dist/proof-run-core.d.cts +1 -1
- package/dist/proof-run-core.d.ts +1 -1
- package/dist/proof-run-core.js +1 -1
- package/dist/{proof-run-engine-D80hVFMf.d.cts → proof-run-engine-4dM37pEx.d.cts} +1 -1
- package/dist/{proof-run-engine-By7oLsF-.d.ts → proof-run-engine-BqaeqAze.d.ts} +1 -1
- package/dist/proof-run-engine.cjs +80 -1
- package/dist/proof-run-engine.d.cts +2 -2
- package/dist/proof-run-engine.d.ts +2 -2
- package/dist/proof-run-engine.js +2 -2
- package/dist/runner.js +2 -2
- package/lib/workspace-core.mjs +62 -7
- package/package.json +2 -2
- package/runtime/lib/riddle_core_call.mjs +662 -40
- package/runtime/lib/util.py +117 -40
- package/runtime/lib/verify.py +4 -3
- package/runtime/tests/recon_verify_smoke.py +132 -0
package/dist/advanced/runner.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runRiddleProof
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-C2NHHBFV.js";
|
|
4
4
|
import "../chunk-ZQWVXQKJ.js";
|
|
5
5
|
import "../chunk-RDPG554T.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-X7SQTCIQ.js";
|
|
7
7
|
import "../chunk-OILKSY5J.js";
|
|
8
8
|
import "../chunk-VY4Y5U57.js";
|
|
9
9
|
import "../chunk-MLKGABMK.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
validateShipGate,
|
|
17
17
|
workflowFile,
|
|
18
18
|
writeState
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-X7SQTCIQ.js";
|
|
20
20
|
import {
|
|
21
21
|
__export
|
|
22
22
|
} from "./chunk-MLKGABMK.js";
|
|
@@ -157,6 +157,72 @@ var RUNTIME_EVENT_LIMIT = 100;
|
|
|
157
157
|
function nowIso() {
|
|
158
158
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
159
159
|
}
|
|
160
|
+
function missingExecutableError(error) {
|
|
161
|
+
return error?.code === "ENOENT" || /\bENOENT\b/.test(String(error?.message || error || ""));
|
|
162
|
+
}
|
|
163
|
+
function pythonScriptsForBundledStage(step) {
|
|
164
|
+
if (step === "setup") return ["preflight.py", "setup.py"];
|
|
165
|
+
if (step === "recon") return ["recon.py"];
|
|
166
|
+
if (step === "author") return ["author.py"];
|
|
167
|
+
if (step === "implement") return ["implement.py"];
|
|
168
|
+
if (step === "verify") return ["verify.py"];
|
|
169
|
+
if (step === "ship") return ["ship.py"];
|
|
170
|
+
return [];
|
|
171
|
+
}
|
|
172
|
+
function runBundledPythonStage(step, runtimeDir, env) {
|
|
173
|
+
const scripts = pythonScriptsForBundledStage(step);
|
|
174
|
+
if (!scripts.length) {
|
|
175
|
+
return {
|
|
176
|
+
ok: false,
|
|
177
|
+
error: `No bundled Python fallback is defined for ${step}.`
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
const pythonCommand = process.env.RIDDLE_PROOF_PYTHON_COMMAND || "python3";
|
|
181
|
+
const libDir = path.join(runtimeDir, "lib");
|
|
182
|
+
const stdout = [];
|
|
183
|
+
const stderr = [];
|
|
184
|
+
const executed = [];
|
|
185
|
+
try {
|
|
186
|
+
for (const script of scripts) {
|
|
187
|
+
const scriptPath = path.join(libDir, script);
|
|
188
|
+
if (!existsSync(scriptPath)) {
|
|
189
|
+
return {
|
|
190
|
+
ok: false,
|
|
191
|
+
stdout: stdout.join(""),
|
|
192
|
+
stderr: stderr.join(""),
|
|
193
|
+
error: `Riddle Proof bundled Python fallback missing ${scriptPath}`
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
executed.push(script);
|
|
197
|
+
stdout.push(execFileSync(pythonCommand, [scriptPath], {
|
|
198
|
+
encoding: "utf-8",
|
|
199
|
+
env,
|
|
200
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
203
|
+
} catch (error) {
|
|
204
|
+
return {
|
|
205
|
+
ok: false,
|
|
206
|
+
stdout: `${stdout.join("")}${String(error?.stdout || "")}`,
|
|
207
|
+
stderr: `${stderr.join("")}${String(error?.stderr || "")}`,
|
|
208
|
+
error: error?.message || String(error),
|
|
209
|
+
raw: {
|
|
210
|
+
runner: "bundled_python_fallback",
|
|
211
|
+
scripts: executed
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
return {
|
|
216
|
+
ok: true,
|
|
217
|
+
stdout: stdout.join(""),
|
|
218
|
+
stderr: stderr.join(""),
|
|
219
|
+
raw: {
|
|
220
|
+
ok: true,
|
|
221
|
+
runner: "bundled_python_fallback",
|
|
222
|
+
scripts: executed
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
}
|
|
160
226
|
function appendRuntimeEventToState(state, event) {
|
|
161
227
|
const events = Array.isArray(state.runtime_events) ? state.runtime_events : [];
|
|
162
228
|
state.runtime_events = [...events, event].slice(-RUNTIME_EVENT_LIMIT);
|
|
@@ -723,6 +789,17 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
|
|
|
723
789
|
})
|
|
724
790
|
);
|
|
725
791
|
} catch (error) {
|
|
792
|
+
if (!process.env.RIDDLE_PROOF_LOBSTER_SCRIPT && missingExecutableError(error)) {
|
|
793
|
+
const fallback = runBundledPythonStage(step, config.riddleProofDir, env);
|
|
794
|
+
return finishRuntimeStep(config.statePath, action, {
|
|
795
|
+
ok: fallback.ok,
|
|
796
|
+
step,
|
|
797
|
+
raw: fallback.raw,
|
|
798
|
+
stdout: fallback.stdout,
|
|
799
|
+
stderr: fallback.stderr,
|
|
800
|
+
error: fallback.error
|
|
801
|
+
}, timer);
|
|
802
|
+
}
|
|
726
803
|
return finishRuntimeStep(config.statePath, action, {
|
|
727
804
|
ok: false,
|
|
728
805
|
step,
|
|
@@ -174,6 +174,7 @@ function buildSetupArgs(params, config) {
|
|
|
174
174
|
discord_thread_id: params.discord_thread_id || "",
|
|
175
175
|
discord_message_id: params.discord_message_id || "",
|
|
176
176
|
discord_source_url: params.discord_source_url || "",
|
|
177
|
+
ship_mode: params.ship_mode || "",
|
|
177
178
|
leave_draft: params.leave_draft ? "true" : ""
|
|
178
179
|
};
|
|
179
180
|
}
|
|
@@ -945,7 +946,8 @@ function mergeStateFromParams(statePath, params) {
|
|
|
945
946
|
"auth_headers_json",
|
|
946
947
|
"proof_plan",
|
|
947
948
|
"implementation_notes",
|
|
948
|
-
"implementation_mode"
|
|
949
|
+
"implementation_mode",
|
|
950
|
+
"ship_mode"
|
|
949
951
|
];
|
|
950
952
|
for (const field of stringFields) {
|
|
951
953
|
if (params[field] !== void 0) {
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
visualDeltaForState,
|
|
16
16
|
visualDeltaRequiredForState,
|
|
17
17
|
visualDeltaShipGateReason
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-X7SQTCIQ.js";
|
|
19
19
|
import {
|
|
20
20
|
authorPacketPayloadFromCheckpointResponse,
|
|
21
21
|
buildCheckpointPacketForEngineResult,
|
|
@@ -289,6 +289,7 @@ function initialRunParams(request, input, state) {
|
|
|
289
289
|
auth_headers_json: request.auth_headers_json,
|
|
290
290
|
color_scheme: request.color_scheme,
|
|
291
291
|
wait_for_selector: request.wait_for_selector,
|
|
292
|
+
ship_mode: request.ship_mode,
|
|
292
293
|
leave_draft: request.leave_draft || void 0,
|
|
293
294
|
discord_channel: request.integration_context?.channel_id,
|
|
294
295
|
discord_thread_id: request.integration_context?.thread_id,
|
|
@@ -301,6 +302,18 @@ function initialRunParams(request, input, state) {
|
|
|
301
302
|
function effectiveShipMode(request, config) {
|
|
302
303
|
return request.ship_mode || config?.defaultShipMode || "ship";
|
|
303
304
|
}
|
|
305
|
+
function continuationRequestsShip(next) {
|
|
306
|
+
return Boolean(next && (next.advance_stage === "ship" || next.ship_after_verify === true));
|
|
307
|
+
}
|
|
308
|
+
function shipHeldTerminal(state, result) {
|
|
309
|
+
return terminalResult(
|
|
310
|
+
state,
|
|
311
|
+
"ready_to_ship",
|
|
312
|
+
result,
|
|
313
|
+
result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
314
|
+
{ ship_held: true }
|
|
315
|
+
);
|
|
316
|
+
}
|
|
304
317
|
function checkpointContinueStage(result) {
|
|
305
318
|
const resume = recordValue(result.checkpointContract?.resume);
|
|
306
319
|
return nonEmptyString(resume?.continue_with_stage);
|
|
@@ -825,6 +838,28 @@ function checkpointResponseContinuation(state, value) {
|
|
|
825
838
|
const assessment = proofAssessmentPayloadFromCheckpointResponse(response);
|
|
826
839
|
if (assessment) {
|
|
827
840
|
appendCheckpointResponse(state, response);
|
|
841
|
+
if (state.request.ship_mode !== "ship" && proofAssessmentRequestsShip(assessment)) {
|
|
842
|
+
const result = {
|
|
843
|
+
ok: true,
|
|
844
|
+
state_path: state.request.engine_state_path || packet.state_path || "",
|
|
845
|
+
checkpoint: packet.checkpoint,
|
|
846
|
+
stage: packet.stage,
|
|
847
|
+
summary: response.summary,
|
|
848
|
+
checkpointContract: checkpointContractFromPacket(packet) || null
|
|
849
|
+
};
|
|
850
|
+
return {
|
|
851
|
+
terminal: terminalResult(
|
|
852
|
+
state,
|
|
853
|
+
"ready_to_ship",
|
|
854
|
+
result,
|
|
855
|
+
response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
856
|
+
{
|
|
857
|
+
ship_held: true,
|
|
858
|
+
proof_assessment: assessment
|
|
859
|
+
}
|
|
860
|
+
)
|
|
861
|
+
};
|
|
862
|
+
}
|
|
828
863
|
return { next: { ...base, proof_assessment_json: jsonParam(assessment) } };
|
|
829
864
|
}
|
|
830
865
|
if (response.decision === "blocked" || response.decision === "human_review") {
|
|
@@ -1075,6 +1110,9 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
1075
1110
|
}
|
|
1076
1111
|
const next = stageCheckpointContinuation(result);
|
|
1077
1112
|
if (next) {
|
|
1113
|
+
if (continuationRequestsShip(next) && effectiveShipMode(request, input.config) !== "ship") {
|
|
1114
|
+
return { terminal: shipHeldTerminal(state, result) };
|
|
1115
|
+
}
|
|
1078
1116
|
recordEvent(state, {
|
|
1079
1117
|
kind: "checkpoint.recovery_continuation",
|
|
1080
1118
|
checkpoint,
|
|
@@ -1106,6 +1144,9 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
1106
1144
|
};
|
|
1107
1145
|
}
|
|
1108
1146
|
if (checkpoint === "ship_review") {
|
|
1147
|
+
if (effectiveShipMode(request, input.config) !== "ship") {
|
|
1148
|
+
return { terminal: shipHeldTerminal(state, result) };
|
|
1149
|
+
}
|
|
1109
1150
|
return {
|
|
1110
1151
|
terminal: terminalResult(state, "shipped", result, result.summary || "Riddle Proof shipped.")
|
|
1111
1152
|
};
|
|
@@ -1141,9 +1182,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
1141
1182
|
return { next: { ...baseContinuation(result), ship_after_verify: true } };
|
|
1142
1183
|
}
|
|
1143
1184
|
return {
|
|
1144
|
-
terminal:
|
|
1145
|
-
ship_held: true
|
|
1146
|
-
})
|
|
1185
|
+
terminal: shipHeldTerminal(state, result)
|
|
1147
1186
|
};
|
|
1148
1187
|
}
|
|
1149
1188
|
if (checkpoint === "verify_audit_complete") {
|
|
@@ -1434,18 +1473,19 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
1434
1473
|
const next = recommendedContinuation(result) || defaultAwaitingStageContinuation(result);
|
|
1435
1474
|
if (next) {
|
|
1436
1475
|
if (String(next.advance_stage || "") === "ship" && effectiveShipMode(request, input.config) !== "ship") {
|
|
1437
|
-
return {
|
|
1438
|
-
terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
|
|
1439
|
-
ship_held: true
|
|
1440
|
-
})
|
|
1441
|
-
};
|
|
1476
|
+
return { terminal: shipHeldTerminal(state, result) };
|
|
1442
1477
|
}
|
|
1443
1478
|
return { next };
|
|
1444
1479
|
}
|
|
1445
1480
|
}
|
|
1446
1481
|
if (checkpoint.endsWith("_review")) {
|
|
1447
1482
|
const next = recommendedContinuation(result);
|
|
1448
|
-
if (next)
|
|
1483
|
+
if (next) {
|
|
1484
|
+
if (continuationRequestsShip(next) && effectiveShipMode(request, input.config) !== "ship") {
|
|
1485
|
+
return { terminal: shipHeldTerminal(state, result) };
|
|
1486
|
+
}
|
|
1487
|
+
return { next };
|
|
1488
|
+
}
|
|
1449
1489
|
}
|
|
1450
1490
|
return {
|
|
1451
1491
|
blocker: {
|
|
@@ -1471,6 +1511,9 @@ async function runRiddleProofEngineHarness(input) {
|
|
|
1471
1511
|
if (checkpointContinuation.blocker) {
|
|
1472
1512
|
return blockerResult(state, null, checkpointContinuation.blocker);
|
|
1473
1513
|
}
|
|
1514
|
+
if (checkpointContinuation.terminal) {
|
|
1515
|
+
return checkpointContinuation.terminal;
|
|
1516
|
+
}
|
|
1474
1517
|
const request = state.request;
|
|
1475
1518
|
const agent = input.agent || createDisabledRiddleProofAgentAdapter();
|
|
1476
1519
|
const maxIterations = Math.max(
|
package/dist/cli/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-U73JPBZW.js";
|
|
2
2
|
import "../chunk-PEWAIEER.js";
|
|
3
3
|
import "../chunk-TWTEUS7R.js";
|
|
4
|
-
import "../chunk-
|
|
4
|
+
import "../chunk-ZREWMTFA.js";
|
|
5
5
|
import "../chunk-ZQWVXQKJ.js";
|
|
6
6
|
import "../chunk-RDPG554T.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-X7SQTCIQ.js";
|
|
8
8
|
import "../chunk-OILKSY5J.js";
|
|
9
9
|
import "../chunk-JFQXAJH2.js";
|
|
10
10
|
import "../chunk-73EBR3YL.js";
|
package/dist/cli.cjs
CHANGED
|
@@ -157,6 +157,7 @@ function buildSetupArgs(params, config) {
|
|
|
157
157
|
discord_thread_id: params.discord_thread_id || "",
|
|
158
158
|
discord_message_id: params.discord_message_id || "",
|
|
159
159
|
discord_source_url: params.discord_source_url || "",
|
|
160
|
+
ship_mode: params.ship_mode || "",
|
|
160
161
|
leave_draft: params.leave_draft ? "true" : ""
|
|
161
162
|
};
|
|
162
163
|
}
|
|
@@ -746,7 +747,8 @@ function mergeStateFromParams(statePath, params) {
|
|
|
746
747
|
"auth_headers_json",
|
|
747
748
|
"proof_plan",
|
|
748
749
|
"implementation_notes",
|
|
749
|
-
"implementation_mode"
|
|
750
|
+
"implementation_mode",
|
|
751
|
+
"ship_mode"
|
|
750
752
|
];
|
|
751
753
|
for (const field of stringFields) {
|
|
752
754
|
if (params[field] !== void 0) {
|
|
@@ -1365,6 +1367,72 @@ function updateState(statePath, mutate) {
|
|
|
1365
1367
|
function nowIso() {
|
|
1366
1368
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
1367
1369
|
}
|
|
1370
|
+
function missingExecutableError(error) {
|
|
1371
|
+
return error?.code === "ENOENT" || /\bENOENT\b/.test(String(error?.message || error || ""));
|
|
1372
|
+
}
|
|
1373
|
+
function pythonScriptsForBundledStage(step) {
|
|
1374
|
+
if (step === "setup") return ["preflight.py", "setup.py"];
|
|
1375
|
+
if (step === "recon") return ["recon.py"];
|
|
1376
|
+
if (step === "author") return ["author.py"];
|
|
1377
|
+
if (step === "implement") return ["implement.py"];
|
|
1378
|
+
if (step === "verify") return ["verify.py"];
|
|
1379
|
+
if (step === "ship") return ["ship.py"];
|
|
1380
|
+
return [];
|
|
1381
|
+
}
|
|
1382
|
+
function runBundledPythonStage(step, runtimeDir, env) {
|
|
1383
|
+
const scripts = pythonScriptsForBundledStage(step);
|
|
1384
|
+
if (!scripts.length) {
|
|
1385
|
+
return {
|
|
1386
|
+
ok: false,
|
|
1387
|
+
error: `No bundled Python fallback is defined for ${step}.`
|
|
1388
|
+
};
|
|
1389
|
+
}
|
|
1390
|
+
const pythonCommand = process.env.RIDDLE_PROOF_PYTHON_COMMAND || "python3";
|
|
1391
|
+
const libDir = import_node_path2.default.join(runtimeDir, "lib");
|
|
1392
|
+
const stdout = [];
|
|
1393
|
+
const stderr = [];
|
|
1394
|
+
const executed = [];
|
|
1395
|
+
try {
|
|
1396
|
+
for (const script of scripts) {
|
|
1397
|
+
const scriptPath = import_node_path2.default.join(libDir, script);
|
|
1398
|
+
if (!(0, import_node_fs2.existsSync)(scriptPath)) {
|
|
1399
|
+
return {
|
|
1400
|
+
ok: false,
|
|
1401
|
+
stdout: stdout.join(""),
|
|
1402
|
+
stderr: stderr.join(""),
|
|
1403
|
+
error: `Riddle Proof bundled Python fallback missing ${scriptPath}`
|
|
1404
|
+
};
|
|
1405
|
+
}
|
|
1406
|
+
executed.push(script);
|
|
1407
|
+
stdout.push((0, import_node_child_process.execFileSync)(pythonCommand, [scriptPath], {
|
|
1408
|
+
encoding: "utf-8",
|
|
1409
|
+
env,
|
|
1410
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
1411
|
+
}));
|
|
1412
|
+
}
|
|
1413
|
+
} catch (error) {
|
|
1414
|
+
return {
|
|
1415
|
+
ok: false,
|
|
1416
|
+
stdout: `${stdout.join("")}${String(error?.stdout || "")}`,
|
|
1417
|
+
stderr: `${stderr.join("")}${String(error?.stderr || "")}`,
|
|
1418
|
+
error: error?.message || String(error),
|
|
1419
|
+
raw: {
|
|
1420
|
+
runner: "bundled_python_fallback",
|
|
1421
|
+
scripts: executed
|
|
1422
|
+
}
|
|
1423
|
+
};
|
|
1424
|
+
}
|
|
1425
|
+
return {
|
|
1426
|
+
ok: true,
|
|
1427
|
+
stdout: stdout.join(""),
|
|
1428
|
+
stderr: stderr.join(""),
|
|
1429
|
+
raw: {
|
|
1430
|
+
ok: true,
|
|
1431
|
+
runner: "bundled_python_fallback",
|
|
1432
|
+
scripts: executed
|
|
1433
|
+
}
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1368
1436
|
function appendRuntimeEventToState(state, event) {
|
|
1369
1437
|
const events = Array.isArray(state.runtime_events) ? state.runtime_events : [];
|
|
1370
1438
|
state.runtime_events = [...events, event].slice(-RUNTIME_EVENT_LIMIT);
|
|
@@ -1931,6 +1999,17 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
|
|
|
1931
1999
|
})
|
|
1932
2000
|
);
|
|
1933
2001
|
} catch (error) {
|
|
2002
|
+
if (!process.env.RIDDLE_PROOF_LOBSTER_SCRIPT && missingExecutableError(error)) {
|
|
2003
|
+
const fallback = runBundledPythonStage(step, config.riddleProofDir, env);
|
|
2004
|
+
return finishRuntimeStep(config.statePath, action, {
|
|
2005
|
+
ok: fallback.ok,
|
|
2006
|
+
step,
|
|
2007
|
+
raw: fallback.raw,
|
|
2008
|
+
stdout: fallback.stdout,
|
|
2009
|
+
stderr: fallback.stderr,
|
|
2010
|
+
error: fallback.error
|
|
2011
|
+
}, timer);
|
|
2012
|
+
}
|
|
1934
2013
|
return finishRuntimeStep(config.statePath, action, {
|
|
1935
2014
|
ok: false,
|
|
1936
2015
|
step,
|
|
@@ -4934,6 +5013,7 @@ function initialRunParams(request, input, state) {
|
|
|
4934
5013
|
auth_headers_json: request.auth_headers_json,
|
|
4935
5014
|
color_scheme: request.color_scheme,
|
|
4936
5015
|
wait_for_selector: request.wait_for_selector,
|
|
5016
|
+
ship_mode: request.ship_mode,
|
|
4937
5017
|
leave_draft: request.leave_draft || void 0,
|
|
4938
5018
|
discord_channel: request.integration_context?.channel_id,
|
|
4939
5019
|
discord_thread_id: request.integration_context?.thread_id,
|
|
@@ -4946,6 +5026,18 @@ function initialRunParams(request, input, state) {
|
|
|
4946
5026
|
function effectiveShipMode(request, config) {
|
|
4947
5027
|
return request.ship_mode || config?.defaultShipMode || "ship";
|
|
4948
5028
|
}
|
|
5029
|
+
function continuationRequestsShip(next) {
|
|
5030
|
+
return Boolean(next && (next.advance_stage === "ship" || next.ship_after_verify === true));
|
|
5031
|
+
}
|
|
5032
|
+
function shipHeldTerminal(state, result) {
|
|
5033
|
+
return terminalResult(
|
|
5034
|
+
state,
|
|
5035
|
+
"ready_to_ship",
|
|
5036
|
+
result,
|
|
5037
|
+
result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5038
|
+
{ ship_held: true }
|
|
5039
|
+
);
|
|
5040
|
+
}
|
|
4949
5041
|
function checkpointContinueStage2(result) {
|
|
4950
5042
|
const resume = recordValue(result.checkpointContract?.resume);
|
|
4951
5043
|
return nonEmptyString(resume?.continue_with_stage);
|
|
@@ -5470,6 +5562,28 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5470
5562
|
const assessment = proofAssessmentPayloadFromCheckpointResponse(response);
|
|
5471
5563
|
if (assessment) {
|
|
5472
5564
|
appendCheckpointResponse(state, response);
|
|
5565
|
+
if (state.request.ship_mode !== "ship" && proofAssessmentRequestsShip(assessment)) {
|
|
5566
|
+
const result = {
|
|
5567
|
+
ok: true,
|
|
5568
|
+
state_path: state.request.engine_state_path || packet.state_path || "",
|
|
5569
|
+
checkpoint: packet.checkpoint,
|
|
5570
|
+
stage: packet.stage,
|
|
5571
|
+
summary: response.summary,
|
|
5572
|
+
checkpointContract: checkpointContractFromPacket(packet) || null
|
|
5573
|
+
};
|
|
5574
|
+
return {
|
|
5575
|
+
terminal: terminalResult(
|
|
5576
|
+
state,
|
|
5577
|
+
"ready_to_ship",
|
|
5578
|
+
result,
|
|
5579
|
+
response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5580
|
+
{
|
|
5581
|
+
ship_held: true,
|
|
5582
|
+
proof_assessment: assessment
|
|
5583
|
+
}
|
|
5584
|
+
)
|
|
5585
|
+
};
|
|
5586
|
+
}
|
|
5473
5587
|
return { next: { ...base, proof_assessment_json: jsonParam(assessment) } };
|
|
5474
5588
|
}
|
|
5475
5589
|
if (response.decision === "blocked" || response.decision === "human_review") {
|
|
@@ -5720,6 +5834,9 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5720
5834
|
}
|
|
5721
5835
|
const next = stageCheckpointContinuation(result);
|
|
5722
5836
|
if (next) {
|
|
5837
|
+
if (continuationRequestsShip(next) && effectiveShipMode(request, input.config) !== "ship") {
|
|
5838
|
+
return { terminal: shipHeldTerminal(state, result) };
|
|
5839
|
+
}
|
|
5723
5840
|
recordEvent(state, {
|
|
5724
5841
|
kind: "checkpoint.recovery_continuation",
|
|
5725
5842
|
checkpoint,
|
|
@@ -5751,6 +5868,9 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5751
5868
|
};
|
|
5752
5869
|
}
|
|
5753
5870
|
if (checkpoint === "ship_review") {
|
|
5871
|
+
if (effectiveShipMode(request, input.config) !== "ship") {
|
|
5872
|
+
return { terminal: shipHeldTerminal(state, result) };
|
|
5873
|
+
}
|
|
5754
5874
|
return {
|
|
5755
5875
|
terminal: terminalResult(state, "shipped", result, result.summary || "Riddle Proof shipped.")
|
|
5756
5876
|
};
|
|
@@ -5786,9 +5906,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5786
5906
|
return { next: { ...baseContinuation(result), ship_after_verify: true } };
|
|
5787
5907
|
}
|
|
5788
5908
|
return {
|
|
5789
|
-
terminal:
|
|
5790
|
-
ship_held: true
|
|
5791
|
-
})
|
|
5909
|
+
terminal: shipHeldTerminal(state, result)
|
|
5792
5910
|
};
|
|
5793
5911
|
}
|
|
5794
5912
|
if (checkpoint === "verify_audit_complete") {
|
|
@@ -6079,18 +6197,19 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
6079
6197
|
const next = recommendedContinuation(result) || defaultAwaitingStageContinuation(result);
|
|
6080
6198
|
if (next) {
|
|
6081
6199
|
if (String(next.advance_stage || "") === "ship" && effectiveShipMode(request, input.config) !== "ship") {
|
|
6082
|
-
return {
|
|
6083
|
-
terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
|
|
6084
|
-
ship_held: true
|
|
6085
|
-
})
|
|
6086
|
-
};
|
|
6200
|
+
return { terminal: shipHeldTerminal(state, result) };
|
|
6087
6201
|
}
|
|
6088
6202
|
return { next };
|
|
6089
6203
|
}
|
|
6090
6204
|
}
|
|
6091
6205
|
if (checkpoint.endsWith("_review")) {
|
|
6092
6206
|
const next = recommendedContinuation(result);
|
|
6093
|
-
if (next)
|
|
6207
|
+
if (next) {
|
|
6208
|
+
if (continuationRequestsShip(next) && effectiveShipMode(request, input.config) !== "ship") {
|
|
6209
|
+
return { terminal: shipHeldTerminal(state, result) };
|
|
6210
|
+
}
|
|
6211
|
+
return { next };
|
|
6212
|
+
}
|
|
6094
6213
|
}
|
|
6095
6214
|
return {
|
|
6096
6215
|
blocker: {
|
|
@@ -6116,6 +6235,9 @@ async function runRiddleProofEngineHarness(input) {
|
|
|
6116
6235
|
if (checkpointContinuation.blocker) {
|
|
6117
6236
|
return blockerResult(state, null, checkpointContinuation.blocker);
|
|
6118
6237
|
}
|
|
6238
|
+
if (checkpointContinuation.terminal) {
|
|
6239
|
+
return checkpointContinuation.terminal;
|
|
6240
|
+
}
|
|
6119
6241
|
const request = state.request;
|
|
6120
6242
|
const agent = input.agent || createDisabledRiddleProofAgentAdapter();
|
|
6121
6243
|
const maxIterations = Math.max(
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-U73JPBZW.js";
|
|
3
3
|
import "./chunk-PEWAIEER.js";
|
|
4
4
|
import "./chunk-TWTEUS7R.js";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-ZREWMTFA.js";
|
|
6
6
|
import "./chunk-ZQWVXQKJ.js";
|
|
7
7
|
import "./chunk-RDPG554T.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-X7SQTCIQ.js";
|
|
9
9
|
import "./chunk-OILKSY5J.js";
|
|
10
10
|
import "./chunk-JFQXAJH2.js";
|
|
11
11
|
import "./chunk-73EBR3YL.js";
|