@riddledc/riddle-proof 0.8.30 → 0.8.32

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.
Files changed (49) hide show
  1. package/dist/advanced/engine-harness.cjs +132 -10
  2. package/dist/advanced/engine-harness.js +2 -2
  3. package/dist/advanced/index.cjs +132 -10
  4. package/dist/advanced/index.d.cts +2 -2
  5. package/dist/advanced/index.d.ts +2 -2
  6. package/dist/advanced/index.js +4 -4
  7. package/dist/advanced/proof-run-core.cjs +3 -1
  8. package/dist/advanced/proof-run-core.d.cts +1 -1
  9. package/dist/advanced/proof-run-core.d.ts +1 -1
  10. package/dist/advanced/proof-run-core.js +1 -1
  11. package/dist/advanced/proof-run-engine.cjs +80 -1
  12. package/dist/advanced/proof-run-engine.d.cts +2 -2
  13. package/dist/advanced/proof-run-engine.d.ts +2 -2
  14. package/dist/advanced/proof-run-engine.js +2 -2
  15. package/dist/advanced/runner.js +2 -2
  16. package/dist/{chunk-3OTO7IDH.js → chunk-C2NHHBFV.js} +1 -1
  17. package/dist/{chunk-32RE64IO.js → chunk-IOI6QR3B.js} +78 -1
  18. package/dist/{chunk-XJA2GDVN.js → chunk-U73JPBZW.js} +1 -1
  19. package/dist/{chunk-K6HZUSHH.js → chunk-X7SQTCIQ.js} +3 -1
  20. package/dist/{chunk-UWO4YR7I.js → chunk-ZREWMTFA.js} +53 -10
  21. package/dist/cli/index.js +3 -3
  22. package/dist/cli.cjs +132 -10
  23. package/dist/cli.js +3 -3
  24. package/dist/engine-harness.cjs +132 -10
  25. package/dist/engine-harness.js +2 -2
  26. package/dist/index.cjs +132 -10
  27. package/dist/index.js +3 -3
  28. package/dist/{proof-run-core-C8FDUhle.d.cts → proof-run-core-B1GeqkR8.d.cts} +2 -0
  29. package/dist/{proof-run-core-C8FDUhle.d.ts → proof-run-core-B1GeqkR8.d.ts} +2 -0
  30. package/dist/proof-run-core.cjs +3 -1
  31. package/dist/proof-run-core.d.cts +1 -1
  32. package/dist/proof-run-core.d.ts +1 -1
  33. package/dist/proof-run-core.js +1 -1
  34. package/dist/{proof-run-engine-By7oLsF-.d.ts → proof-run-engine-DYfmd8d7.d.ts} +4 -4
  35. package/dist/{proof-run-engine-D80hVFMf.d.cts → proof-run-engine-DeHxtGnW.d.cts} +4 -4
  36. package/dist/proof-run-engine.cjs +80 -1
  37. package/dist/proof-run-engine.d.cts +2 -2
  38. package/dist/proof-run-engine.d.ts +2 -2
  39. package/dist/proof-run-engine.js +2 -2
  40. package/dist/runner.js +2 -2
  41. package/lib/workspace-core.mjs +62 -7
  42. package/package.json +2 -2
  43. package/runtime/lib/riddle_core_call.mjs +662 -40
  44. package/runtime/lib/ship.py +363 -16
  45. package/runtime/lib/util.py +117 -40
  46. package/runtime/lib/verify.py +4 -3
  47. package/runtime/pipelines/riddle-proof-ship.lobster +11 -1
  48. package/runtime/tests/recon_verify_smoke.py +132 -0
  49. package/runtime/tests/ship_artifact_publication.py +185 -0
@@ -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,
@@ -4847,6 +4926,7 @@ function initialRunParams(request, input, state) {
4847
4926
  auth_headers_json: request.auth_headers_json,
4848
4927
  color_scheme: request.color_scheme,
4849
4928
  wait_for_selector: request.wait_for_selector,
4929
+ ship_mode: request.ship_mode,
4850
4930
  leave_draft: request.leave_draft || void 0,
4851
4931
  discord_channel: request.integration_context?.channel_id,
4852
4932
  discord_thread_id: request.integration_context?.thread_id,
@@ -4859,6 +4939,18 @@ function initialRunParams(request, input, state) {
4859
4939
  function effectiveShipMode(request, config) {
4860
4940
  return request.ship_mode || config?.defaultShipMode || "ship";
4861
4941
  }
4942
+ function continuationRequestsShip(next) {
4943
+ return Boolean(next && (next.advance_stage === "ship" || next.ship_after_verify === true));
4944
+ }
4945
+ function shipHeldTerminal(state, result) {
4946
+ return terminalResult(
4947
+ state,
4948
+ "ready_to_ship",
4949
+ result,
4950
+ result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
4951
+ { ship_held: true }
4952
+ );
4953
+ }
4862
4954
  function checkpointContinueStage2(result) {
4863
4955
  const resume = recordValue(result.checkpointContract?.resume);
4864
4956
  return nonEmptyString(resume?.continue_with_stage);
@@ -5383,6 +5475,28 @@ function checkpointResponseContinuation(state, value) {
5383
5475
  const assessment = proofAssessmentPayloadFromCheckpointResponse(response);
5384
5476
  if (assessment) {
5385
5477
  appendCheckpointResponse(state, response);
5478
+ if (state.request.ship_mode !== "ship" && proofAssessmentRequestsShip(assessment)) {
5479
+ const result = {
5480
+ ok: true,
5481
+ state_path: state.request.engine_state_path || packet.state_path || "",
5482
+ checkpoint: packet.checkpoint,
5483
+ stage: packet.stage,
5484
+ summary: response.summary,
5485
+ checkpointContract: checkpointContractFromPacket(packet) || null
5486
+ };
5487
+ return {
5488
+ terminal: terminalResult(
5489
+ state,
5490
+ "ready_to_ship",
5491
+ result,
5492
+ response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
5493
+ {
5494
+ ship_held: true,
5495
+ proof_assessment: assessment
5496
+ }
5497
+ )
5498
+ };
5499
+ }
5386
5500
  return { next: { ...base, proof_assessment_json: jsonParam(assessment) } };
5387
5501
  }
5388
5502
  if (response.decision === "blocked" || response.decision === "human_review") {
@@ -5633,6 +5747,9 @@ async function routeCheckpoint(request, state, result, agent, input) {
5633
5747
  }
5634
5748
  const next = stageCheckpointContinuation(result);
5635
5749
  if (next) {
5750
+ if (continuationRequestsShip(next) && effectiveShipMode(request, input.config) !== "ship") {
5751
+ return { terminal: shipHeldTerminal(state, result) };
5752
+ }
5636
5753
  recordEvent(state, {
5637
5754
  kind: "checkpoint.recovery_continuation",
5638
5755
  checkpoint,
@@ -5664,6 +5781,9 @@ async function routeCheckpoint(request, state, result, agent, input) {
5664
5781
  };
5665
5782
  }
5666
5783
  if (checkpoint === "ship_review") {
5784
+ if (effectiveShipMode(request, input.config) !== "ship") {
5785
+ return { terminal: shipHeldTerminal(state, result) };
5786
+ }
5667
5787
  return {
5668
5788
  terminal: terminalResult(state, "shipped", result, result.summary || "Riddle Proof shipped.")
5669
5789
  };
@@ -5699,9 +5819,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
5699
5819
  return { next: { ...baseContinuation(result), ship_after_verify: true } };
5700
5820
  }
5701
5821
  return {
5702
- terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
5703
- ship_held: true
5704
- })
5822
+ terminal: shipHeldTerminal(state, result)
5705
5823
  };
5706
5824
  }
5707
5825
  if (checkpoint === "verify_audit_complete") {
@@ -5992,18 +6110,19 @@ async function routeCheckpoint(request, state, result, agent, input) {
5992
6110
  const next = recommendedContinuation(result) || defaultAwaitingStageContinuation(result);
5993
6111
  if (next) {
5994
6112
  if (String(next.advance_stage || "") === "ship" && effectiveShipMode(request, input.config) !== "ship") {
5995
- return {
5996
- terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
5997
- ship_held: true
5998
- })
5999
- };
6113
+ return { terminal: shipHeldTerminal(state, result) };
6000
6114
  }
6001
6115
  return { next };
6002
6116
  }
6003
6117
  }
6004
6118
  if (checkpoint.endsWith("_review")) {
6005
6119
  const next = recommendedContinuation(result);
6006
- if (next) return { next };
6120
+ if (next) {
6121
+ if (continuationRequestsShip(next) && effectiveShipMode(request, input.config) !== "ship") {
6122
+ return { terminal: shipHeldTerminal(state, result) };
6123
+ }
6124
+ return { next };
6125
+ }
6007
6126
  }
6008
6127
  return {
6009
6128
  blocker: {
@@ -6029,6 +6148,9 @@ async function runRiddleProofEngineHarness(input) {
6029
6148
  if (checkpointContinuation.blocker) {
6030
6149
  return blockerResult(state, null, checkpointContinuation.blocker);
6031
6150
  }
6151
+ if (checkpointContinuation.terminal) {
6152
+ return checkpointContinuation.terminal;
6153
+ }
6032
6154
  const request = state.request;
6033
6155
  const agent = input.agent || createDisabledRiddleProofAgentAdapter();
6034
6156
  const maxIterations = Math.max(
@@ -2,10 +2,10 @@ import {
2
2
  createDisabledRiddleProofAgentAdapter,
3
3
  readRiddleProofRunStatus,
4
4
  runRiddleProofEngineHarness
5
- } from "./chunk-UWO4YR7I.js";
5
+ } from "./chunk-ZREWMTFA.js";
6
6
  import "./chunk-ZQWVXQKJ.js";
7
7
  import "./chunk-RDPG554T.js";
8
- import "./chunk-K6HZUSHH.js";
8
+ import "./chunk-X7SQTCIQ.js";
9
9
  import "./chunk-OILKSY5J.js";
10
10
  import "./chunk-VY4Y5U57.js";
11
11
  import "./chunk-MLKGABMK.js";
package/dist/index.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,
@@ -5596,6 +5675,7 @@ function initialRunParams(request, input, state) {
5596
5675
  auth_headers_json: request.auth_headers_json,
5597
5676
  color_scheme: request.color_scheme,
5598
5677
  wait_for_selector: request.wait_for_selector,
5678
+ ship_mode: request.ship_mode,
5599
5679
  leave_draft: request.leave_draft || void 0,
5600
5680
  discord_channel: request.integration_context?.channel_id,
5601
5681
  discord_thread_id: request.integration_context?.thread_id,
@@ -5608,6 +5688,18 @@ function initialRunParams(request, input, state) {
5608
5688
  function effectiveShipMode(request, config) {
5609
5689
  return request.ship_mode || config?.defaultShipMode || "ship";
5610
5690
  }
5691
+ function continuationRequestsShip(next) {
5692
+ return Boolean(next && (next.advance_stage === "ship" || next.ship_after_verify === true));
5693
+ }
5694
+ function shipHeldTerminal(state, result) {
5695
+ return terminalResult(
5696
+ state,
5697
+ "ready_to_ship",
5698
+ result,
5699
+ result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
5700
+ { ship_held: true }
5701
+ );
5702
+ }
5611
5703
  function checkpointContinueStage2(result) {
5612
5704
  const resume = recordValue(result.checkpointContract?.resume);
5613
5705
  return nonEmptyString(resume?.continue_with_stage);
@@ -6132,6 +6224,28 @@ function checkpointResponseContinuation(state, value) {
6132
6224
  const assessment = proofAssessmentPayloadFromCheckpointResponse(response);
6133
6225
  if (assessment) {
6134
6226
  appendCheckpointResponse(state, response);
6227
+ if (state.request.ship_mode !== "ship" && proofAssessmentRequestsShip(assessment)) {
6228
+ const result = {
6229
+ ok: true,
6230
+ state_path: state.request.engine_state_path || packet.state_path || "",
6231
+ checkpoint: packet.checkpoint,
6232
+ stage: packet.stage,
6233
+ summary: response.summary,
6234
+ checkpointContract: checkpointContractFromPacket(packet) || null
6235
+ };
6236
+ return {
6237
+ terminal: terminalResult(
6238
+ state,
6239
+ "ready_to_ship",
6240
+ result,
6241
+ response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
6242
+ {
6243
+ ship_held: true,
6244
+ proof_assessment: assessment
6245
+ }
6246
+ )
6247
+ };
6248
+ }
6135
6249
  return { next: { ...base, proof_assessment_json: jsonParam(assessment) } };
6136
6250
  }
6137
6251
  if (response.decision === "blocked" || response.decision === "human_review") {
@@ -6382,6 +6496,9 @@ async function routeCheckpoint(request, state, result, agent, input) {
6382
6496
  }
6383
6497
  const next = stageCheckpointContinuation(result);
6384
6498
  if (next) {
6499
+ if (continuationRequestsShip(next) && effectiveShipMode(request, input.config) !== "ship") {
6500
+ return { terminal: shipHeldTerminal(state, result) };
6501
+ }
6385
6502
  recordEvent(state, {
6386
6503
  kind: "checkpoint.recovery_continuation",
6387
6504
  checkpoint,
@@ -6413,6 +6530,9 @@ async function routeCheckpoint(request, state, result, agent, input) {
6413
6530
  };
6414
6531
  }
6415
6532
  if (checkpoint === "ship_review") {
6533
+ if (effectiveShipMode(request, input.config) !== "ship") {
6534
+ return { terminal: shipHeldTerminal(state, result) };
6535
+ }
6416
6536
  return {
6417
6537
  terminal: terminalResult(state, "shipped", result, result.summary || "Riddle Proof shipped.")
6418
6538
  };
@@ -6448,9 +6568,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
6448
6568
  return { next: { ...baseContinuation(result), ship_after_verify: true } };
6449
6569
  }
6450
6570
  return {
6451
- terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
6452
- ship_held: true
6453
- })
6571
+ terminal: shipHeldTerminal(state, result)
6454
6572
  };
6455
6573
  }
6456
6574
  if (checkpoint === "verify_audit_complete") {
@@ -6741,18 +6859,19 @@ async function routeCheckpoint(request, state, result, agent, input) {
6741
6859
  const next = recommendedContinuation(result) || defaultAwaitingStageContinuation(result);
6742
6860
  if (next) {
6743
6861
  if (String(next.advance_stage || "") === "ship" && effectiveShipMode(request, input.config) !== "ship") {
6744
- return {
6745
- terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
6746
- ship_held: true
6747
- })
6748
- };
6862
+ return { terminal: shipHeldTerminal(state, result) };
6749
6863
  }
6750
6864
  return { next };
6751
6865
  }
6752
6866
  }
6753
6867
  if (checkpoint.endsWith("_review")) {
6754
6868
  const next = recommendedContinuation(result);
6755
- if (next) return { next };
6869
+ if (next) {
6870
+ if (continuationRequestsShip(next) && effectiveShipMode(request, input.config) !== "ship") {
6871
+ return { terminal: shipHeldTerminal(state, result) };
6872
+ }
6873
+ return { next };
6874
+ }
6756
6875
  }
6757
6876
  return {
6758
6877
  blocker: {
@@ -6778,6 +6897,9 @@ async function runRiddleProofEngineHarness(input) {
6778
6897
  if (checkpointContinuation.blocker) {
6779
6898
  return blockerResult(state, null, checkpointContinuation.blocker);
6780
6899
  }
6900
+ if (checkpointContinuation.terminal) {
6901
+ return checkpointContinuation.terminal;
6902
+ }
6781
6903
  const request = state.request;
6782
6904
  const agent = input.agent || createDisabledRiddleProofAgentAdapter();
6783
6905
  const maxIterations = Math.max(
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "./chunk-3OTO7IDH.js";
3
+ } from "./chunk-C2NHHBFV.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
  import {
6
6
  RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION,
@@ -95,7 +95,7 @@ import {
95
95
  createDisabledRiddleProofAgentAdapter,
96
96
  readRiddleProofRunStatus,
97
97
  runRiddleProofEngineHarness
98
- } from "./chunk-UWO4YR7I.js";
98
+ } from "./chunk-ZREWMTFA.js";
99
99
  import {
100
100
  RIDDLE_PROOF_RUN_STATE_VERSION,
101
101
  appendRunEvent,
@@ -112,7 +112,7 @@ import {
112
112
  RIDDLE_PROOF_RUN_CARD_VERSION,
113
113
  createRiddleProofRunCard
114
114
  } from "./chunk-RDPG554T.js";
115
- import "./chunk-K6HZUSHH.js";
115
+ import "./chunk-X7SQTCIQ.js";
116
116
  import {
117
117
  RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
118
118
  RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
@@ -55,6 +55,7 @@ interface WorkflowParams {
55
55
  auto_approve?: boolean;
56
56
  continue_from_checkpoint?: boolean;
57
57
  ship_after_verify?: boolean;
58
+ ship_mode?: "none" | "ship";
58
59
  leave_draft?: boolean;
59
60
  cleanup_merged_pr?: boolean;
60
61
  fetch_base?: boolean;
@@ -148,6 +149,7 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
148
149
  discord_thread_id: string;
149
150
  discord_message_id: string;
150
151
  discord_source_url: string;
152
+ ship_mode: string;
151
153
  leave_draft: string;
152
154
  };
153
155
  declare function readState(statePath: string): any;
@@ -55,6 +55,7 @@ interface WorkflowParams {
55
55
  auto_approve?: boolean;
56
56
  continue_from_checkpoint?: boolean;
57
57
  ship_after_verify?: boolean;
58
+ ship_mode?: "none" | "ship";
58
59
  leave_draft?: boolean;
59
60
  cleanup_merged_pr?: boolean;
60
61
  fetch_base?: boolean;
@@ -148,6 +149,7 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
148
149
  discord_thread_id: string;
149
150
  discord_message_id: string;
150
151
  discord_source_url: string;
152
+ ship_mode: string;
151
153
  leave_draft: string;
152
154
  };
153
155
  declare function readState(statePath: string): any;
@@ -201,6 +201,7 @@ function buildSetupArgs(params, config) {
201
201
  discord_thread_id: params.discord_thread_id || "",
202
202
  discord_message_id: params.discord_message_id || "",
203
203
  discord_source_url: params.discord_source_url || "",
204
+ ship_mode: params.ship_mode || "",
204
205
  leave_draft: params.leave_draft ? "true" : ""
205
206
  };
206
207
  }
@@ -972,7 +973,8 @@ function mergeStateFromParams(statePath, params) {
972
973
  "auth_headers_json",
973
974
  "proof_plan",
974
975
  "implementation_notes",
975
- "implementation_mode"
976
+ "implementation_mode",
977
+ "ship_mode"
976
978
  ];
977
979
  for (const field of stringFields) {
978
980
  if (params[field] !== void 0) {
@@ -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-C8FDUhle.cjs';
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-C8FDUhle.js';
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';
@@ -27,7 +27,7 @@ import {
27
27
  visualDeltaShipGateReason,
28
28
  workflowFile,
29
29
  writeState
30
- } from "./chunk-K6HZUSHH.js";
30
+ } from "./chunk-X7SQTCIQ.js";
31
31
  import "./chunk-MLKGABMK.js";
32
32
  export {
33
33
  BUNDLED_RIDDLE_PROOF_DIR,
@@ -1,4 +1,4 @@
1
- import { W as WorkflowParams, r as resolveConfig, P as PluginConfig, a as WorkflowStage } from './proof-run-core-C8FDUhle.js';
1
+ import { W as WorkflowParams, r as resolveConfig, P as PluginConfig, a as WorkflowStage } from './proof-run-core-B1GeqkR8.js';
2
2
 
3
3
  declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, resolvedConfig?: ReturnType<typeof resolveConfig>): Promise<{
4
4
  ok: boolean;
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup";
662
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -1,4 +1,4 @@
1
- import { W as WorkflowParams, r as resolveConfig, P as PluginConfig, a as WorkflowStage } from './proof-run-core-C8FDUhle.cjs';
1
+ import { W as WorkflowParams, r as resolveConfig, P as PluginConfig, a as WorkflowStage } from './proof-run-core-B1GeqkR8.cjs';
2
2
 
3
3
  declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, resolvedConfig?: ReturnType<typeof resolveConfig>): Promise<{
4
4
  ok: boolean;
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup";
662
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;