@riddledc/riddle-proof 0.8.29 → 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 +188 -11
- package/dist/advanced/engine-harness.js +2 -2
- package/dist/advanced/index.cjs +188 -11
- 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 +136 -2
- 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-YC77HZVF.js → chunk-IOI6QR3B.js} +134 -2
- package/dist/{chunk-FJPZZ4JO.js → chunk-U73JPBZW.js} +1 -1
- package/dist/{chunk-K6HZUSHH.js → chunk-X7SQTCIQ.js} +3 -1
- package/dist/{chunk-AM3K5FPW.js → chunk-ZREWMTFA.js} +53 -10
- package/dist/cli/index.js +3 -3
- package/dist/cli.cjs +188 -11
- package/dist/cli.js +3 -3
- package/dist/engine-harness.cjs +188 -11
- package/dist/engine-harness.js +2 -2
- package/dist/index.cjs +188 -11
- 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 +136 -2
- 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 +17 -4
- package/runtime/tests/recon_verify_smoke.py +137 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BUNDLED_RIDDLE_PROOF_DIR, C as CHECKPOINT_CONTRACT_VERSION, b as CheckpointInputContract, P as PluginConfig, R as RIDDLE_PROOF_DIR_CANDIDATES, S as ShipGateValidation, c as WORKFLOW_STAGE_ORDER, d as WorkflowAction, W as WorkflowParams, a as WorkflowStage, e as buildCheckpointContract, f as buildSetupArgs, g as checkpointContinueStage, h as clearStageDecisionRequest, i as ensureAction, j as ensureStageLoopState, k as invalidateVerifyEvidence, m as mergeStateFromParams, n as noImplementationModeFor, l as previewModeFromWorkflowMode, o as proofAssessmentHardBlockersForState, q as readState, s as recordStageAttempt, t as requiredBaselineLabelsForState, r as resolveConfig, u as resolveRiddleProofDir, v as setStageDecisionRequest, w as summarizeState, x as validateShipGate, y as visualDeltaForState, z as visualDeltaRequiredForState, A as visualDeltaShipGateReason, D as workflowFile, E as writeState } from '../proof-run-core-
|
|
1
|
+
export { B as BUNDLED_RIDDLE_PROOF_DIR, C as CHECKPOINT_CONTRACT_VERSION, b as CheckpointInputContract, P as PluginConfig, R as RIDDLE_PROOF_DIR_CANDIDATES, S as ShipGateValidation, c as WORKFLOW_STAGE_ORDER, d as WorkflowAction, W as WorkflowParams, a as WorkflowStage, e as buildCheckpointContract, f as buildSetupArgs, g as checkpointContinueStage, h as clearStageDecisionRequest, i as ensureAction, j as ensureStageLoopState, k as invalidateVerifyEvidence, m as mergeStateFromParams, n as noImplementationModeFor, l as previewModeFromWorkflowMode, o as proofAssessmentHardBlockersForState, q as readState, s as recordStageAttempt, t as requiredBaselineLabelsForState, r as resolveConfig, u as resolveRiddleProofDir, v as setStageDecisionRequest, w as summarizeState, x as validateShipGate, y as visualDeltaForState, z as visualDeltaRequiredForState, A as visualDeltaShipGateReason, D as workflowFile, E as writeState } from '../proof-run-core-B1GeqkR8.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { B as BUNDLED_RIDDLE_PROOF_DIR, C as CHECKPOINT_CONTRACT_VERSION, b as CheckpointInputContract, P as PluginConfig, R as RIDDLE_PROOF_DIR_CANDIDATES, S as ShipGateValidation, c as WORKFLOW_STAGE_ORDER, d as WorkflowAction, W as WorkflowParams, a as WorkflowStage, e as buildCheckpointContract, f as buildSetupArgs, g as checkpointContinueStage, h as clearStageDecisionRequest, i as ensureAction, j as ensureStageLoopState, k as invalidateVerifyEvidence, m as mergeStateFromParams, n as noImplementationModeFor, l as previewModeFromWorkflowMode, o as proofAssessmentHardBlockersForState, q as readState, s as recordStageAttempt, t as requiredBaselineLabelsForState, r as resolveConfig, u as resolveRiddleProofDir, v as setStageDecisionRequest, w as summarizeState, x as validateShipGate, y as visualDeltaForState, z as visualDeltaRequiredForState, A as visualDeltaShipGateReason, D as workflowFile, E as writeState } from '../proof-run-core-
|
|
1
|
+
export { B as BUNDLED_RIDDLE_PROOF_DIR, C as CHECKPOINT_CONTRACT_VERSION, b as CheckpointInputContract, P as PluginConfig, R as RIDDLE_PROOF_DIR_CANDIDATES, S as ShipGateValidation, c as WORKFLOW_STAGE_ORDER, d as WorkflowAction, W as WorkflowParams, a as WorkflowStage, e as buildCheckpointContract, f as buildSetupArgs, g as checkpointContinueStage, h as clearStageDecisionRequest, i as ensureAction, j as ensureStageLoopState, k as invalidateVerifyEvidence, m as mergeStateFromParams, n as noImplementationModeFor, l as previewModeFromWorkflowMode, o as proofAssessmentHardBlockersForState, q as readState, s as recordStageAttempt, t as requiredBaselineLabelsForState, r as resolveConfig, u as resolveRiddleProofDir, v as setStageDecisionRequest, w as summarizeState, x as validateShipGate, y as visualDeltaForState, z as visualDeltaRequiredForState, A as visualDeltaShipGateReason, D as workflowFile, E as writeState } from '../proof-run-core-B1GeqkR8.js';
|
|
@@ -182,6 +182,7 @@ function buildSetupArgs(params, config) {
|
|
|
182
182
|
discord_thread_id: params.discord_thread_id || "",
|
|
183
183
|
discord_message_id: params.discord_message_id || "",
|
|
184
184
|
discord_source_url: params.discord_source_url || "",
|
|
185
|
+
ship_mode: params.ship_mode || "",
|
|
185
186
|
leave_draft: params.leave_draft ? "true" : ""
|
|
186
187
|
};
|
|
187
188
|
}
|
|
@@ -953,7 +954,8 @@ function mergeStateFromParams(statePath, params) {
|
|
|
953
954
|
"auth_headers_json",
|
|
954
955
|
"proof_plan",
|
|
955
956
|
"implementation_notes",
|
|
956
|
-
"implementation_mode"
|
|
957
|
+
"implementation_mode",
|
|
958
|
+
"ship_mode"
|
|
957
959
|
];
|
|
958
960
|
for (const field of stringFields) {
|
|
959
961
|
if (params[field] !== void 0) {
|
|
@@ -1365,6 +1367,72 @@ var RUNTIME_EVENT_LIMIT = 100;
|
|
|
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,
|
|
@@ -2684,6 +2763,60 @@ ${implementRes.stderr || ""}`;
|
|
|
2684
2763
|
verifyRes = runOne("verify");
|
|
2685
2764
|
executed.push(executedStep(verifyRes));
|
|
2686
2765
|
if (!verifyRes.ok || verifyRes.haltedForApproval) {
|
|
2766
|
+
const failedVerifyState = readState(config.statePath);
|
|
2767
|
+
const failedVerifyStatus = failedVerifyState?.verify_status || "";
|
|
2768
|
+
if (!verifyRes.haltedForApproval && (failedVerifyStatus === "capture_incomplete" || failedVerifyStatus === "capture_error")) {
|
|
2769
|
+
const verifyDecisionRequest2 = failedVerifyState?.verify_decision_request || null;
|
|
2770
|
+
const captureQuality = verifyDecisionRequest2?.capture_quality || {};
|
|
2771
|
+
const conclusiveVerifyBlockers2 = proofAssessmentHardBlockersForState({
|
|
2772
|
+
...failedVerifyState,
|
|
2773
|
+
structured_interaction_capture_failure_summary: stringValue(verifyDecisionRequest2?.structured_interaction_capture_failure_summary) || stringValue(failedVerifyState?.structured_interaction_capture_failure_summary) || void 0,
|
|
2774
|
+
structured_interaction_failure_summary: stringValue(verifyDecisionRequest2?.structured_interaction_failure_summary) || stringValue(failedVerifyState?.structured_interaction_failure_summary) || void 0
|
|
2775
|
+
});
|
|
2776
|
+
const structuredInteractionFailureSummary2 = stringValue(verifyDecisionRequest2?.structured_interaction_capture_failure_summary) || stringValue(verifyDecisionRequest2?.structured_interaction_failure_summary) || stringValue(failedVerifyState?.structured_interaction_capture_failure_summary) || stringValue(failedVerifyState?.structured_interaction_failure_summary) || stringValue(conclusiveVerifyBlockers2[0]);
|
|
2777
|
+
const captureTerminalBlocker = failedVerifyStatus === "capture_error" || conclusiveVerifyBlockers2.length > 0 || Boolean(structuredInteractionFailureSummary2) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
|
|
2778
|
+
const terminalCaptureQualitySummary = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true ? stringValue(captureQuality?.summary) : "";
|
|
2779
|
+
const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
|
|
2780
|
+
const summary = terminalCaptureQualitySummary || structuredInteractionFailureSummary2 || stringValue(verifyDecisionRequest2?.summary) || stringValue(failedVerifyState?.verify_summary) || stringValue(failedVerifyState?.proof_summary) || stringValue(verifyRes.error) || "Verify capture failed before the evidence could be judged.";
|
|
2781
|
+
const failedVerifyDetails = {
|
|
2782
|
+
executed,
|
|
2783
|
+
verifyStatus: failedVerifyStatus,
|
|
2784
|
+
verifySummary: failedVerifyState?.verify_summary || failedVerifyState?.proof_summary || null,
|
|
2785
|
+
afterCdn: failedVerifyState?.after_cdn || null,
|
|
2786
|
+
mergeRecommendation: failedVerifyState?.merge_recommendation || null,
|
|
2787
|
+
verifyDecisionRequest: verifyDecisionRequest2,
|
|
2788
|
+
conclusiveVerifyBlockers: conclusiveVerifyBlockers2,
|
|
2789
|
+
verifyError: verifyRes.error || null,
|
|
2790
|
+
verifyStdout: verifyRes.stdout || "",
|
|
2791
|
+
verifyStderr: verifyRes.stderr || ""
|
|
2792
|
+
};
|
|
2793
|
+
recordAttempt("verify", "checkpoint", summary, {
|
|
2794
|
+
autoApproved: verifyRes.autoApproved || false,
|
|
2795
|
+
checkpoint: checkpointName,
|
|
2796
|
+
error: verifyRes.error || null,
|
|
2797
|
+
details: failedVerifyDetails
|
|
2798
|
+
});
|
|
2799
|
+
return checkpoint(
|
|
2800
|
+
"verify",
|
|
2801
|
+
checkpointName,
|
|
2802
|
+
summary,
|
|
2803
|
+
{
|
|
2804
|
+
ok: true,
|
|
2805
|
+
nextActions: captureTerminalBlocker ? ["inspect_after_capture", "report_specific_browser_evidence_blocker", "start_a_new_run_after_the_product_or_script_is_fixed"] : ["inspect_after_capture", "continue_internal_loop_with_checkpoint", "return_to_recon_if_baseline_is_wrong"],
|
|
2806
|
+
advanceOptions: needsImplementation ? ["author", "implement", "ship", "verify", "recon"] : ["author", "verify", "recon"],
|
|
2807
|
+
recommendedAdvanceStage: captureTerminalBlocker ? null : verifyDecisionRequest2?.recommended_stage || verifyDecisionRequest2?.continue_with_stage || "author",
|
|
2808
|
+
continueWithStage: captureTerminalBlocker ? null : verifyDecisionRequest2?.continue_with_stage || verifyDecisionRequest2?.recommended_stage || "author",
|
|
2809
|
+
blocking: captureTerminalBlocker,
|
|
2810
|
+
details: failedVerifyDetails,
|
|
2811
|
+
verifyStatus: failedVerifyStatus,
|
|
2812
|
+
verifySummary: failedVerifyDetails.verifySummary,
|
|
2813
|
+
afterCdn: failedVerifyState?.after_cdn || null,
|
|
2814
|
+
mergeRecommendation: failedVerifyState?.merge_recommendation || null,
|
|
2815
|
+
verifyDecisionRequest: verifyDecisionRequest2,
|
|
2816
|
+
executed
|
|
2817
|
+
}
|
|
2818
|
+
);
|
|
2819
|
+
}
|
|
2687
2820
|
return failedRun("verify", verifyRes.haltedForApproval ? "verify halted for approval" : "verify failed", verifyRes, {
|
|
2688
2821
|
checkpoint: "verify_failed",
|
|
2689
2822
|
details: { executed },
|
|
@@ -2737,8 +2870,9 @@ ${implementRes.stderr || ""}`;
|
|
|
2737
2870
|
});
|
|
2738
2871
|
state = readState(config.statePath);
|
|
2739
2872
|
}
|
|
2873
|
+
const terminalCaptureQualitySummary = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true ? stringValue(captureQuality?.summary) : "";
|
|
2740
2874
|
const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
|
|
2741
|
-
const summary = structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
|
|
2875
|
+
const summary = terminalCaptureQualitySummary || structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
|
|
2742
2876
|
recordAttempt("verify", "checkpoint", summary, {
|
|
2743
2877
|
autoApproved: verifyRes.autoApproved || false,
|
|
2744
2878
|
checkpoint: checkpointName,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-
|
|
2
|
-
import '../proof-run-core-
|
|
1
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-4dM37pEx.cjs';
|
|
2
|
+
import '../proof-run-core-B1GeqkR8.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-
|
|
2
|
-
import '../proof-run-core-
|
|
1
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-BqaeqAze.js';
|
|
2
|
+
import '../proof-run-core-B1GeqkR8.js';
|
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,
|
|
@@ -1476,6 +1553,60 @@ ${implementRes.stderr || ""}`;
|
|
|
1476
1553
|
verifyRes = runOne("verify");
|
|
1477
1554
|
executed.push(executedStep(verifyRes));
|
|
1478
1555
|
if (!verifyRes.ok || verifyRes.haltedForApproval) {
|
|
1556
|
+
const failedVerifyState = readState(config.statePath);
|
|
1557
|
+
const failedVerifyStatus = failedVerifyState?.verify_status || "";
|
|
1558
|
+
if (!verifyRes.haltedForApproval && (failedVerifyStatus === "capture_incomplete" || failedVerifyStatus === "capture_error")) {
|
|
1559
|
+
const verifyDecisionRequest2 = failedVerifyState?.verify_decision_request || null;
|
|
1560
|
+
const captureQuality = verifyDecisionRequest2?.capture_quality || {};
|
|
1561
|
+
const conclusiveVerifyBlockers2 = proofAssessmentHardBlockersForState({
|
|
1562
|
+
...failedVerifyState,
|
|
1563
|
+
structured_interaction_capture_failure_summary: stringValue(verifyDecisionRequest2?.structured_interaction_capture_failure_summary) || stringValue(failedVerifyState?.structured_interaction_capture_failure_summary) || void 0,
|
|
1564
|
+
structured_interaction_failure_summary: stringValue(verifyDecisionRequest2?.structured_interaction_failure_summary) || stringValue(failedVerifyState?.structured_interaction_failure_summary) || void 0
|
|
1565
|
+
});
|
|
1566
|
+
const structuredInteractionFailureSummary2 = stringValue(verifyDecisionRequest2?.structured_interaction_capture_failure_summary) || stringValue(verifyDecisionRequest2?.structured_interaction_failure_summary) || stringValue(failedVerifyState?.structured_interaction_capture_failure_summary) || stringValue(failedVerifyState?.structured_interaction_failure_summary) || stringValue(conclusiveVerifyBlockers2[0]);
|
|
1567
|
+
const captureTerminalBlocker = failedVerifyStatus === "capture_error" || conclusiveVerifyBlockers2.length > 0 || Boolean(structuredInteractionFailureSummary2) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
|
|
1568
|
+
const terminalCaptureQualitySummary = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true ? stringValue(captureQuality?.summary) : "";
|
|
1569
|
+
const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
|
|
1570
|
+
const summary = terminalCaptureQualitySummary || structuredInteractionFailureSummary2 || stringValue(verifyDecisionRequest2?.summary) || stringValue(failedVerifyState?.verify_summary) || stringValue(failedVerifyState?.proof_summary) || stringValue(verifyRes.error) || "Verify capture failed before the evidence could be judged.";
|
|
1571
|
+
const failedVerifyDetails = {
|
|
1572
|
+
executed,
|
|
1573
|
+
verifyStatus: failedVerifyStatus,
|
|
1574
|
+
verifySummary: failedVerifyState?.verify_summary || failedVerifyState?.proof_summary || null,
|
|
1575
|
+
afterCdn: failedVerifyState?.after_cdn || null,
|
|
1576
|
+
mergeRecommendation: failedVerifyState?.merge_recommendation || null,
|
|
1577
|
+
verifyDecisionRequest: verifyDecisionRequest2,
|
|
1578
|
+
conclusiveVerifyBlockers: conclusiveVerifyBlockers2,
|
|
1579
|
+
verifyError: verifyRes.error || null,
|
|
1580
|
+
verifyStdout: verifyRes.stdout || "",
|
|
1581
|
+
verifyStderr: verifyRes.stderr || ""
|
|
1582
|
+
};
|
|
1583
|
+
recordAttempt("verify", "checkpoint", summary, {
|
|
1584
|
+
autoApproved: verifyRes.autoApproved || false,
|
|
1585
|
+
checkpoint: checkpointName,
|
|
1586
|
+
error: verifyRes.error || null,
|
|
1587
|
+
details: failedVerifyDetails
|
|
1588
|
+
});
|
|
1589
|
+
return checkpoint(
|
|
1590
|
+
"verify",
|
|
1591
|
+
checkpointName,
|
|
1592
|
+
summary,
|
|
1593
|
+
{
|
|
1594
|
+
ok: true,
|
|
1595
|
+
nextActions: captureTerminalBlocker ? ["inspect_after_capture", "report_specific_browser_evidence_blocker", "start_a_new_run_after_the_product_or_script_is_fixed"] : ["inspect_after_capture", "continue_internal_loop_with_checkpoint", "return_to_recon_if_baseline_is_wrong"],
|
|
1596
|
+
advanceOptions: needsImplementation ? ["author", "implement", "ship", "verify", "recon"] : ["author", "verify", "recon"],
|
|
1597
|
+
recommendedAdvanceStage: captureTerminalBlocker ? null : verifyDecisionRequest2?.recommended_stage || verifyDecisionRequest2?.continue_with_stage || "author",
|
|
1598
|
+
continueWithStage: captureTerminalBlocker ? null : verifyDecisionRequest2?.continue_with_stage || verifyDecisionRequest2?.recommended_stage || "author",
|
|
1599
|
+
blocking: captureTerminalBlocker,
|
|
1600
|
+
details: failedVerifyDetails,
|
|
1601
|
+
verifyStatus: failedVerifyStatus,
|
|
1602
|
+
verifySummary: failedVerifyDetails.verifySummary,
|
|
1603
|
+
afterCdn: failedVerifyState?.after_cdn || null,
|
|
1604
|
+
mergeRecommendation: failedVerifyState?.merge_recommendation || null,
|
|
1605
|
+
verifyDecisionRequest: verifyDecisionRequest2,
|
|
1606
|
+
executed
|
|
1607
|
+
}
|
|
1608
|
+
);
|
|
1609
|
+
}
|
|
1479
1610
|
return failedRun("verify", verifyRes.haltedForApproval ? "verify halted for approval" : "verify failed", verifyRes, {
|
|
1480
1611
|
checkpoint: "verify_failed",
|
|
1481
1612
|
details: { executed },
|
|
@@ -1529,8 +1660,9 @@ ${implementRes.stderr || ""}`;
|
|
|
1529
1660
|
});
|
|
1530
1661
|
state = readState(config.statePath);
|
|
1531
1662
|
}
|
|
1663
|
+
const terminalCaptureQualitySummary = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true ? stringValue(captureQuality?.summary) : "";
|
|
1532
1664
|
const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
|
|
1533
|
-
const summary = structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
|
|
1665
|
+
const summary = terminalCaptureQualitySummary || structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
|
|
1534
1666
|
recordAttempt("verify", "checkpoint", summary, {
|
|
1535
1667
|
autoApproved: verifyRes.autoApproved || false,
|
|
1536
1668
|
checkpoint: checkpointName,
|
|
@@ -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";
|