@riddledc/riddle-proof 0.8.1 → 0.8.3

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 (63) hide show
  1. package/dist/adapters/openclaw.js +4 -4
  2. package/dist/advanced/engine-harness.cjs +25 -4
  3. package/dist/advanced/engine-harness.js +5 -5
  4. package/dist/advanced/index.cjs +25 -4
  5. package/dist/advanced/index.d.cts +1 -1
  6. package/dist/advanced/index.d.ts +1 -1
  7. package/dist/advanced/index.js +7 -7
  8. package/dist/advanced/proof-run-core.cjs +12 -0
  9. package/dist/advanced/proof-run-core.js +1 -1
  10. package/dist/advanced/proof-run-engine.cjs +19 -0
  11. package/dist/advanced/proof-run-engine.d.cts +1 -1
  12. package/dist/advanced/proof-run-engine.d.ts +1 -1
  13. package/dist/advanced/proof-run-engine.js +2 -2
  14. package/dist/advanced/runner.js +5 -5
  15. package/dist/checkpoint.cjs +3 -1
  16. package/dist/checkpoint.js +1 -1
  17. package/dist/{chunk-VZD5LH7U.js → chunk-OIFHYMHP.js} +2 -2
  18. package/dist/{chunk-TJ63IE65.js → chunk-RV6LK7HU.js} +12 -0
  19. package/dist/{chunk-2CFVREFI.js → chunk-SKIAZTQ7.js} +3 -1
  20. package/dist/{chunk-BTN76IGW.js → chunk-SMBZT46I.js} +1 -1
  21. package/dist/{chunk-OHJQRDST.js → chunk-TNCDVE5O.js} +1 -1
  22. package/dist/{chunk-BHL4JSGM.js → chunk-TZ3YMCDM.js} +8 -1
  23. package/dist/{chunk-Y2KTBACQ.js → chunk-U4FUFBSH.js} +1 -1
  24. package/dist/{chunk-IWLQQ5S5.js → chunk-YB5ACBZE.js} +7 -7
  25. package/dist/{chunk-COERZX63.js → chunk-ZX45XGDJ.js} +2 -2
  26. package/dist/cli/index.js +6 -6
  27. package/dist/cli.cjs +25 -4
  28. package/dist/cli.js +6 -6
  29. package/dist/engine-harness.cjs +25 -4
  30. package/dist/engine-harness.js +5 -5
  31. package/dist/index.cjs +25 -4
  32. package/dist/index.js +6 -6
  33. package/dist/openclaw.js +4 -4
  34. package/dist/proof-run-core.cjs +12 -0
  35. package/dist/proof-run-core.js +1 -1
  36. package/dist/{proof-run-engine-CSSc0mNn.d.ts → proof-run-engine-DxWW1VX1.d.ts} +3 -3
  37. package/dist/{proof-run-engine-HSRpUeBi.d.cts → proof-run-engine-Rkd_hXB-.d.cts} +3 -3
  38. package/dist/proof-run-engine.cjs +19 -0
  39. package/dist/proof-run-engine.d.cts +1 -1
  40. package/dist/proof-run-engine.d.ts +1 -1
  41. package/dist/proof-run-engine.js +2 -2
  42. package/dist/run-card.js +2 -2
  43. package/dist/runner.js +5 -5
  44. package/dist/spec/checkpoint.cjs +3 -1
  45. package/dist/spec/checkpoint.js +1 -1
  46. package/dist/spec/index.cjs +3 -1
  47. package/dist/spec/index.js +3 -3
  48. package/dist/spec/run-card.js +2 -2
  49. package/dist/spec/state.js +3 -3
  50. package/dist/state.js +3 -3
  51. package/dist/types.d.cts +1 -0
  52. package/dist/types.d.ts +1 -0
  53. package/package.json +1 -1
  54. package/runtime/lib/author.py +32 -0
  55. package/runtime/lib/setup.py +3 -0
  56. package/runtime/lib/verify.py +247 -8
  57. package/runtime/pipelines/riddle-proof-author.lobster +2 -1
  58. package/runtime/pipelines/riddle-proof-implement.lobster +2 -1
  59. package/runtime/pipelines/riddle-proof-recon.lobster +2 -1
  60. package/runtime/pipelines/riddle-proof-setup.lobster +4 -2
  61. package/runtime/pipelines/riddle-proof-ship.lobster +2 -1
  62. package/runtime/pipelines/riddle-proof-verify.lobster +2 -1
  63. package/runtime/tests/recon_verify_smoke.py +306 -8
@@ -3,10 +3,10 @@ import {
3
3
  parseOpenClawAssertions,
4
4
  parseOpenClawJsonObjectOrArray,
5
5
  toRiddleProofRunParams
6
- } from "../chunk-BTN76IGW.js";
7
- import "../chunk-OHJQRDST.js";
8
- import "../chunk-Y2KTBACQ.js";
9
- import "../chunk-2CFVREFI.js";
6
+ } from "../chunk-SMBZT46I.js";
7
+ import "../chunk-TNCDVE5O.js";
8
+ import "../chunk-U4FUFBSH.js";
9
+ import "../chunk-SKIAZTQ7.js";
10
10
  import "../chunk-VY4Y5U57.js";
11
11
  import "../chunk-MLKGABMK.js";
12
12
  export {
@@ -645,6 +645,12 @@ function mergeStateFromParams(statePath, params) {
645
645
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
646
646
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
647
647
  }
648
+ if (parsed?.interaction_contract && typeof parsed.interaction_contract === "object") {
649
+ state.interaction_contract = parsed.interaction_contract;
650
+ }
651
+ if (parsed?.proof_contract && typeof parsed.proof_contract === "object") {
652
+ state.proof_contract = parsed.proof_contract;
653
+ }
648
654
  const refined = parsed?.refined_inputs || {};
649
655
  if (typeof refined?.server_path === "string") {
650
656
  state.server_path = normalizeOptionalString(refined.server_path) || "";
@@ -652,6 +658,12 @@ function mergeStateFromParams(statePath, params) {
652
658
  }
653
659
  if (typeof refined?.wait_for_selector === "string") state.wait_for_selector = normalizeOptionalString(refined.wait_for_selector) || "";
654
660
  if (typeof refined?.reference === "string" && refined.reference.trim()) state.reference = refined.reference.trim();
661
+ if (typeof refined?.expected_terminal_path === "string") {
662
+ state.expected_terminal_path = normalizeOptionalString(refined.expected_terminal_path) || "";
663
+ }
664
+ if (typeof parsed?.expected_terminal_path === "string") {
665
+ state.expected_terminal_path = normalizeOptionalString(parsed.expected_terminal_path) || "";
666
+ }
655
667
  if (typeof parsed?.confidence === "string") state.supervisor_author_confidence = normalizeOptionalString(parsed.confidence) || null;
656
668
  if (parsed?.rationale !== void 0) state.supervisor_author_rationale = parsed.rationale;
657
669
  if (typeof parsed?.summary === "string") state.supervisor_author_summary = normalizeOptionalString(parsed.summary) || null;
@@ -1659,6 +1671,13 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
1659
1671
  const args = step === "setup" ? buildSetupArgs(params, config) : {};
1660
1672
  const stepWorkflowFile = workflowFile(config.riddleProofDir, step);
1661
1673
  const timer = beginRuntimeStep(config.statePath, action, step, stepWorkflowFile);
1674
+ if (!(0, import_node_fs2.existsSync)(stepWorkflowFile)) {
1675
+ return finishRuntimeStep(config.statePath, action, {
1676
+ ok: false,
1677
+ step,
1678
+ error: `Riddle Proof workflow file missing for ${step}: ${stepWorkflowFile}`
1679
+ }, timer);
1680
+ }
1662
1681
  let output;
1663
1682
  try {
1664
1683
  if (step === "setup") {
@@ -3781,12 +3800,14 @@ function proofContractFromAuthorCheckpointResponse(response, packet, payload) {
3781
3800
  capture_script: nonEmptyString(payload.capture_script),
3782
3801
  artifact_contract: jsonCloneRecord(payload.artifact_contract),
3783
3802
  assertions: jsonCloneValue(payload.assertions),
3803
+ interaction_contract: jsonCloneRecord(payload.interaction_contract) || jsonCloneRecord(payload.interactionContract),
3784
3804
  baseline_understanding: jsonCloneRecord(payload.baseline_understanding) || jsonCloneRecord(payload.recon_baseline_understanding) || jsonCloneRecord(packet.state_excerpt?.recon_baseline_understanding),
3785
3805
  route_assumptions: compactRecord({
3786
3806
  server_path: nonEmptyString(refinedInputs.server_path) || nonEmptyString(payload.server_path) || nonEmptyString(packet.state_excerpt?.server_path),
3787
3807
  wait_for_selector: nonEmptyString(refinedInputs.wait_for_selector) || nonEmptyString(payload.wait_for_selector) || nonEmptyString(packet.state_excerpt?.wait_for_selector),
3788
3808
  reference: nonEmptyString(refinedInputs.reference) || nonEmptyString(payload.reference),
3789
- expected_path: nonEmptyString(payload.expected_path) || nonEmptyString(refinedInputs.expected_path)
3809
+ expected_path: nonEmptyString(payload.expected_path) || nonEmptyString(refinedInputs.expected_path),
3810
+ expected_terminal_path: nonEmptyString(refinedInputs.expected_terminal_path) || nonEmptyString(payload.expected_terminal_path) || nonEmptyString(refinedInputs.expected_after_path) || nonEmptyString(payload.expected_after_path)
3790
3811
  }),
3791
3812
  stop_condition: nonEmptyString(payload.stop_condition),
3792
3813
  rationale: jsonCloneValue(payload.rationale),
@@ -5251,7 +5272,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
5251
5272
  return { next: { ...baseContinuation(result), ship_after_verify: true } };
5252
5273
  }
5253
5274
  return {
5254
- terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof is ready to ship.", {
5275
+ terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
5255
5276
  ship_held: true
5256
5277
  })
5257
5278
  };
@@ -5474,7 +5495,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
5474
5495
  state,
5475
5496
  "ready_to_ship",
5476
5497
  result,
5477
- assessment.summary || result.summary || "Riddle Proof is ready to ship.",
5498
+ assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
5478
5499
  {
5479
5500
  ship_held: true,
5480
5501
  proof_assessment: payload
@@ -5493,7 +5514,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
5493
5514
  if (next) {
5494
5515
  if (String(next.advance_stage || "") === "ship" && effectiveShipMode(request, input.config) !== "ship") {
5495
5516
  return {
5496
- terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof is ready to ship.", {
5517
+ terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
5497
5518
  ship_held: true
5498
5519
  })
5499
5520
  };
@@ -2,11 +2,11 @@ import {
2
2
  createDisabledRiddleProofAgentAdapter,
3
3
  readRiddleProofRunStatus,
4
4
  runRiddleProofEngineHarness
5
- } from "../chunk-IWLQQ5S5.js";
6
- import "../chunk-OHJQRDST.js";
7
- import "../chunk-Y2KTBACQ.js";
8
- import "../chunk-TJ63IE65.js";
9
- import "../chunk-2CFVREFI.js";
5
+ } from "../chunk-YB5ACBZE.js";
6
+ import "../chunk-TNCDVE5O.js";
7
+ import "../chunk-U4FUFBSH.js";
8
+ import "../chunk-RV6LK7HU.js";
9
+ import "../chunk-SKIAZTQ7.js";
10
10
  import "../chunk-VY4Y5U57.js";
11
11
  import "../chunk-MLKGABMK.js";
12
12
  export {
@@ -675,6 +675,12 @@ function mergeStateFromParams(statePath, params) {
675
675
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
676
676
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
677
677
  }
678
+ if (parsed?.interaction_contract && typeof parsed.interaction_contract === "object") {
679
+ state.interaction_contract = parsed.interaction_contract;
680
+ }
681
+ if (parsed?.proof_contract && typeof parsed.proof_contract === "object") {
682
+ state.proof_contract = parsed.proof_contract;
683
+ }
678
684
  const refined = parsed?.refined_inputs || {};
679
685
  if (typeof refined?.server_path === "string") {
680
686
  state.server_path = normalizeOptionalString(refined.server_path) || "";
@@ -682,6 +688,12 @@ function mergeStateFromParams(statePath, params) {
682
688
  }
683
689
  if (typeof refined?.wait_for_selector === "string") state.wait_for_selector = normalizeOptionalString(refined.wait_for_selector) || "";
684
690
  if (typeof refined?.reference === "string" && refined.reference.trim()) state.reference = refined.reference.trim();
691
+ if (typeof refined?.expected_terminal_path === "string") {
692
+ state.expected_terminal_path = normalizeOptionalString(refined.expected_terminal_path) || "";
693
+ }
694
+ if (typeof parsed?.expected_terminal_path === "string") {
695
+ state.expected_terminal_path = normalizeOptionalString(parsed.expected_terminal_path) || "";
696
+ }
685
697
  if (typeof parsed?.confidence === "string") state.supervisor_author_confidence = normalizeOptionalString(parsed.confidence) || null;
686
698
  if (parsed?.rationale !== void 0) state.supervisor_author_rationale = parsed.rationale;
687
699
  if (typeof parsed?.summary === "string") state.supervisor_author_summary = normalizeOptionalString(parsed.summary) || null;
@@ -1689,6 +1701,13 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
1689
1701
  const args = step === "setup" ? buildSetupArgs(params, config) : {};
1690
1702
  const stepWorkflowFile = workflowFile(config.riddleProofDir, step);
1691
1703
  const timer = beginRuntimeStep(config.statePath, action, step, stepWorkflowFile);
1704
+ if (!(0, import_node_fs2.existsSync)(stepWorkflowFile)) {
1705
+ return finishRuntimeStep(config.statePath, action, {
1706
+ ok: false,
1707
+ step,
1708
+ error: `Riddle Proof workflow file missing for ${step}: ${stepWorkflowFile}`
1709
+ }, timer);
1710
+ }
1692
1711
  let output;
1693
1712
  try {
1694
1713
  if (step === "setup") {
@@ -3812,12 +3831,14 @@ function proofContractFromAuthorCheckpointResponse(response, packet, payload) {
3812
3831
  capture_script: nonEmptyString(payload.capture_script),
3813
3832
  artifact_contract: jsonCloneRecord(payload.artifact_contract),
3814
3833
  assertions: jsonCloneValue(payload.assertions),
3834
+ interaction_contract: jsonCloneRecord(payload.interaction_contract) || jsonCloneRecord(payload.interactionContract),
3815
3835
  baseline_understanding: jsonCloneRecord(payload.baseline_understanding) || jsonCloneRecord(payload.recon_baseline_understanding) || jsonCloneRecord(packet.state_excerpt?.recon_baseline_understanding),
3816
3836
  route_assumptions: compactRecord({
3817
3837
  server_path: nonEmptyString(refinedInputs.server_path) || nonEmptyString(payload.server_path) || nonEmptyString(packet.state_excerpt?.server_path),
3818
3838
  wait_for_selector: nonEmptyString(refinedInputs.wait_for_selector) || nonEmptyString(payload.wait_for_selector) || nonEmptyString(packet.state_excerpt?.wait_for_selector),
3819
3839
  reference: nonEmptyString(refinedInputs.reference) || nonEmptyString(payload.reference),
3820
- expected_path: nonEmptyString(payload.expected_path) || nonEmptyString(refinedInputs.expected_path)
3840
+ expected_path: nonEmptyString(payload.expected_path) || nonEmptyString(refinedInputs.expected_path),
3841
+ expected_terminal_path: nonEmptyString(refinedInputs.expected_terminal_path) || nonEmptyString(payload.expected_terminal_path) || nonEmptyString(refinedInputs.expected_after_path) || nonEmptyString(payload.expected_after_path)
3821
3842
  }),
3822
3843
  stop_condition: nonEmptyString(payload.stop_condition),
3823
3844
  rationale: jsonCloneValue(payload.rationale),
@@ -5787,7 +5808,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
5787
5808
  return { next: { ...baseContinuation(result), ship_after_verify: true } };
5788
5809
  }
5789
5810
  return {
5790
- terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof is ready to ship.", {
5811
+ terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
5791
5812
  ship_held: true
5792
5813
  })
5793
5814
  };
@@ -6010,7 +6031,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
6010
6031
  state,
6011
6032
  "ready_to_ship",
6012
6033
  result,
6013
- assessment.summary || result.summary || "Riddle Proof is ready to ship.",
6034
+ assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
6014
6035
  {
6015
6036
  ship_held: true,
6016
6037
  proof_assessment: payload
@@ -6029,7 +6050,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
6029
6050
  if (next) {
6030
6051
  if (String(next.advance_stage || "") === "ship" && effectiveShipMode(request, input.config) !== "ship") {
6031
6052
  return {
6032
- terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof is ready to ship.", {
6053
+ terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
6033
6054
  ship_held: true
6034
6055
  })
6035
6056
  };
@@ -1,5 +1,5 @@
1
1
  export { b as runner } from '../runner-4LJ5z0D-.cjs';
2
2
  export { l as engineHarness } from '../engine-harness-LBfqbFSe.cjs';
3
3
  export { p as proofRunCore } from '../proof-run-core-CE0jx7wL.cjs';
4
- export { p as proofRunEngine } from '../proof-run-engine-HSRpUeBi.cjs';
4
+ export { p as proofRunEngine } from '../proof-run-engine-Rkd_hXB-.cjs';
5
5
  import '../types.cjs';
@@ -1,5 +1,5 @@
1
1
  export { b as runner } from '../runner-BdQpOkZD.js';
2
2
  export { l as engineHarness } from '../engine-harness-CMACHP6A.js';
3
3
  export { p as proofRunCore } from '../proof-run-core-CE0jx7wL.js';
4
- export { p as proofRunEngine } from '../proof-run-engine-CSSc0mNn.js';
4
+ export { p as proofRunEngine } from '../proof-run-engine-DxWW1VX1.js';
5
5
  import '../types.js';
@@ -1,18 +1,18 @@
1
1
  import {
2
2
  proof_run_engine_exports
3
- } from "../chunk-BHL4JSGM.js";
3
+ } from "../chunk-TZ3YMCDM.js";
4
4
  import {
5
5
  runner_exports
6
- } from "../chunk-COERZX63.js";
6
+ } from "../chunk-ZX45XGDJ.js";
7
7
  import {
8
8
  engine_harness_exports
9
- } from "../chunk-IWLQQ5S5.js";
10
- import "../chunk-OHJQRDST.js";
11
- import "../chunk-Y2KTBACQ.js";
9
+ } from "../chunk-YB5ACBZE.js";
10
+ import "../chunk-TNCDVE5O.js";
11
+ import "../chunk-U4FUFBSH.js";
12
12
  import {
13
13
  proof_run_core_exports
14
- } from "../chunk-TJ63IE65.js";
15
- import "../chunk-2CFVREFI.js";
14
+ } from "../chunk-RV6LK7HU.js";
15
+ import "../chunk-SKIAZTQ7.js";
16
16
  import "../chunk-VY4Y5U57.js";
17
17
  import "../chunk-MLKGABMK.js";
18
18
  export {
@@ -868,6 +868,12 @@ function mergeStateFromParams(statePath, params) {
868
868
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
869
869
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
870
870
  }
871
+ if (parsed?.interaction_contract && typeof parsed.interaction_contract === "object") {
872
+ state.interaction_contract = parsed.interaction_contract;
873
+ }
874
+ if (parsed?.proof_contract && typeof parsed.proof_contract === "object") {
875
+ state.proof_contract = parsed.proof_contract;
876
+ }
871
877
  const refined = parsed?.refined_inputs || {};
872
878
  if (typeof refined?.server_path === "string") {
873
879
  state.server_path = normalizeOptionalString(refined.server_path) || "";
@@ -875,6 +881,12 @@ function mergeStateFromParams(statePath, params) {
875
881
  }
876
882
  if (typeof refined?.wait_for_selector === "string") state.wait_for_selector = normalizeOptionalString(refined.wait_for_selector) || "";
877
883
  if (typeof refined?.reference === "string" && refined.reference.trim()) state.reference = refined.reference.trim();
884
+ if (typeof refined?.expected_terminal_path === "string") {
885
+ state.expected_terminal_path = normalizeOptionalString(refined.expected_terminal_path) || "";
886
+ }
887
+ if (typeof parsed?.expected_terminal_path === "string") {
888
+ state.expected_terminal_path = normalizeOptionalString(parsed.expected_terminal_path) || "";
889
+ }
878
890
  if (typeof parsed?.confidence === "string") state.supervisor_author_confidence = normalizeOptionalString(parsed.confidence) || null;
879
891
  if (parsed?.rationale !== void 0) state.supervisor_author_rationale = parsed.rationale;
880
892
  if (typeof parsed?.summary === "string") state.supervisor_author_summary = normalizeOptionalString(parsed.summary) || null;
@@ -26,7 +26,7 @@ import {
26
26
  visualDeltaShipGateReason,
27
27
  workflowFile,
28
28
  writeState
29
- } from "../chunk-TJ63IE65.js";
29
+ } from "../chunk-RV6LK7HU.js";
30
30
  import "../chunk-MLKGABMK.js";
31
31
  export {
32
32
  BUNDLED_RIDDLE_PROOF_DIR,
@@ -848,6 +848,12 @@ function mergeStateFromParams(statePath, params) {
848
848
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
849
849
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
850
850
  }
851
+ if (parsed?.interaction_contract && typeof parsed.interaction_contract === "object") {
852
+ state.interaction_contract = parsed.interaction_contract;
853
+ }
854
+ if (parsed?.proof_contract && typeof parsed.proof_contract === "object") {
855
+ state.proof_contract = parsed.proof_contract;
856
+ }
851
857
  const refined = parsed?.refined_inputs || {};
852
858
  if (typeof refined?.server_path === "string") {
853
859
  state.server_path = normalizeOptionalString(refined.server_path) || "";
@@ -855,6 +861,12 @@ function mergeStateFromParams(statePath, params) {
855
861
  }
856
862
  if (typeof refined?.wait_for_selector === "string") state.wait_for_selector = normalizeOptionalString(refined.wait_for_selector) || "";
857
863
  if (typeof refined?.reference === "string" && refined.reference.trim()) state.reference = refined.reference.trim();
864
+ if (typeof refined?.expected_terminal_path === "string") {
865
+ state.expected_terminal_path = normalizeOptionalString(refined.expected_terminal_path) || "";
866
+ }
867
+ if (typeof parsed?.expected_terminal_path === "string") {
868
+ state.expected_terminal_path = normalizeOptionalString(parsed.expected_terminal_path) || "";
869
+ }
858
870
  if (typeof parsed?.confidence === "string") state.supervisor_author_confidence = normalizeOptionalString(parsed.confidence) || null;
859
871
  if (parsed?.rationale !== void 0) state.supervisor_author_rationale = parsed.rationale;
860
872
  if (typeof parsed?.summary === "string") state.supervisor_author_summary = normalizeOptionalString(parsed.summary) || null;
@@ -1659,6 +1671,13 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
1659
1671
  const args = step === "setup" ? buildSetupArgs(params, config) : {};
1660
1672
  const stepWorkflowFile = workflowFile(config.riddleProofDir, step);
1661
1673
  const timer = beginRuntimeStep(config.statePath, action, step, stepWorkflowFile);
1674
+ if (!(0, import_node_fs2.existsSync)(stepWorkflowFile)) {
1675
+ return finishRuntimeStep(config.statePath, action, {
1676
+ ok: false,
1677
+ step,
1678
+ error: `Riddle Proof workflow file missing for ${step}: ${stepWorkflowFile}`
1679
+ }, timer);
1680
+ }
1662
1681
  let output;
1663
1682
  try {
1664
1683
  if (step === "setup") {
@@ -1,2 +1,2 @@
1
- export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-HSRpUeBi.cjs';
1
+ export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-Rkd_hXB-.cjs';
2
2
  import '../proof-run-core-CE0jx7wL.cjs';
@@ -1,2 +1,2 @@
1
- export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-CSSc0mNn.js';
1
+ export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-DxWW1VX1.js';
2
2
  import '../proof-run-core-CE0jx7wL.js';
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createRiddleProofEngine,
3
3
  executeWorkflow
4
- } from "../chunk-BHL4JSGM.js";
5
- import "../chunk-TJ63IE65.js";
4
+ } from "../chunk-TZ3YMCDM.js";
5
+ import "../chunk-RV6LK7HU.js";
6
6
  import "../chunk-MLKGABMK.js";
7
7
  export {
8
8
  createRiddleProofEngine,
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "../chunk-COERZX63.js";
4
- import "../chunk-OHJQRDST.js";
5
- import "../chunk-Y2KTBACQ.js";
6
- import "../chunk-TJ63IE65.js";
7
- import "../chunk-2CFVREFI.js";
3
+ } from "../chunk-ZX45XGDJ.js";
4
+ import "../chunk-TNCDVE5O.js";
5
+ import "../chunk-U4FUFBSH.js";
6
+ import "../chunk-RV6LK7HU.js";
7
+ import "../chunk-SKIAZTQ7.js";
8
8
  import "../chunk-VY4Y5U57.js";
9
9
  import "../chunk-MLKGABMK.js";
10
10
  export {
@@ -772,12 +772,14 @@ function proofContractFromAuthorCheckpointResponse(response, packet, payload) {
772
772
  capture_script: nonEmptyString(payload.capture_script),
773
773
  artifact_contract: jsonCloneRecord(payload.artifact_contract),
774
774
  assertions: jsonCloneValue(payload.assertions),
775
+ interaction_contract: jsonCloneRecord(payload.interaction_contract) || jsonCloneRecord(payload.interactionContract),
775
776
  baseline_understanding: jsonCloneRecord(payload.baseline_understanding) || jsonCloneRecord(payload.recon_baseline_understanding) || jsonCloneRecord(packet.state_excerpt?.recon_baseline_understanding),
776
777
  route_assumptions: compactRecord({
777
778
  server_path: nonEmptyString(refinedInputs.server_path) || nonEmptyString(payload.server_path) || nonEmptyString(packet.state_excerpt?.server_path),
778
779
  wait_for_selector: nonEmptyString(refinedInputs.wait_for_selector) || nonEmptyString(payload.wait_for_selector) || nonEmptyString(packet.state_excerpt?.wait_for_selector),
779
780
  reference: nonEmptyString(refinedInputs.reference) || nonEmptyString(payload.reference),
780
- expected_path: nonEmptyString(payload.expected_path) || nonEmptyString(refinedInputs.expected_path)
781
+ expected_path: nonEmptyString(payload.expected_path) || nonEmptyString(refinedInputs.expected_path),
782
+ expected_terminal_path: nonEmptyString(refinedInputs.expected_terminal_path) || nonEmptyString(payload.expected_terminal_path) || nonEmptyString(refinedInputs.expected_after_path) || nonEmptyString(payload.expected_after_path)
781
783
  }),
782
784
  stop_condition: nonEmptyString(payload.stop_condition),
783
785
  rationale: jsonCloneValue(payload.rationale),
@@ -13,7 +13,7 @@ import {
13
13
  normalizeCheckpointResponse,
14
14
  proofContractFromAuthorCheckpointResponse,
15
15
  statePathsForRunState
16
- } from "./chunk-2CFVREFI.js";
16
+ } from "./chunk-SKIAZTQ7.js";
17
17
  import "./chunk-VY4Y5U57.js";
18
18
  import "./chunk-MLKGABMK.js";
19
19
  export {
@@ -22,10 +22,10 @@ import {
22
22
  createDisabledRiddleProofAgentAdapter,
23
23
  readRiddleProofRunStatus,
24
24
  runRiddleProofEngineHarness
25
- } from "./chunk-IWLQQ5S5.js";
25
+ } from "./chunk-YB5ACBZE.js";
26
26
  import {
27
27
  createCheckpointResponseTemplate
28
- } from "./chunk-2CFVREFI.js";
28
+ } from "./chunk-SKIAZTQ7.js";
29
29
  import {
30
30
  createCodexExecAgentAdapter,
31
31
  runCodexExecAgentDoctor
@@ -839,6 +839,12 @@ function mergeStateFromParams(statePath, params) {
839
839
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
840
840
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
841
841
  }
842
+ if (parsed?.interaction_contract && typeof parsed.interaction_contract === "object") {
843
+ state.interaction_contract = parsed.interaction_contract;
844
+ }
845
+ if (parsed?.proof_contract && typeof parsed.proof_contract === "object") {
846
+ state.proof_contract = parsed.proof_contract;
847
+ }
842
848
  const refined = parsed?.refined_inputs || {};
843
849
  if (typeof refined?.server_path === "string") {
844
850
  state.server_path = normalizeOptionalString(refined.server_path) || "";
@@ -846,6 +852,12 @@ function mergeStateFromParams(statePath, params) {
846
852
  }
847
853
  if (typeof refined?.wait_for_selector === "string") state.wait_for_selector = normalizeOptionalString(refined.wait_for_selector) || "";
848
854
  if (typeof refined?.reference === "string" && refined.reference.trim()) state.reference = refined.reference.trim();
855
+ if (typeof refined?.expected_terminal_path === "string") {
856
+ state.expected_terminal_path = normalizeOptionalString(refined.expected_terminal_path) || "";
857
+ }
858
+ if (typeof parsed?.expected_terminal_path === "string") {
859
+ state.expected_terminal_path = normalizeOptionalString(parsed.expected_terminal_path) || "";
860
+ }
849
861
  if (typeof parsed?.confidence === "string") state.supervisor_author_confidence = normalizeOptionalString(parsed.confidence) || null;
850
862
  if (parsed?.rationale !== void 0) state.supervisor_author_rationale = parsed.rationale;
851
863
  if (typeof parsed?.summary === "string") state.supervisor_author_summary = normalizeOptionalString(parsed.summary) || null;
@@ -718,12 +718,14 @@ function proofContractFromAuthorCheckpointResponse(response, packet, payload) {
718
718
  capture_script: nonEmptyString(payload.capture_script),
719
719
  artifact_contract: jsonCloneRecord(payload.artifact_contract),
720
720
  assertions: jsonCloneValue(payload.assertions),
721
+ interaction_contract: jsonCloneRecord(payload.interaction_contract) || jsonCloneRecord(payload.interactionContract),
721
722
  baseline_understanding: jsonCloneRecord(payload.baseline_understanding) || jsonCloneRecord(payload.recon_baseline_understanding) || jsonCloneRecord(packet.state_excerpt?.recon_baseline_understanding),
722
723
  route_assumptions: compactRecord({
723
724
  server_path: nonEmptyString(refinedInputs.server_path) || nonEmptyString(payload.server_path) || nonEmptyString(packet.state_excerpt?.server_path),
724
725
  wait_for_selector: nonEmptyString(refinedInputs.wait_for_selector) || nonEmptyString(payload.wait_for_selector) || nonEmptyString(packet.state_excerpt?.wait_for_selector),
725
726
  reference: nonEmptyString(refinedInputs.reference) || nonEmptyString(payload.reference),
726
- expected_path: nonEmptyString(payload.expected_path) || nonEmptyString(refinedInputs.expected_path)
727
+ expected_path: nonEmptyString(payload.expected_path) || nonEmptyString(refinedInputs.expected_path),
728
+ expected_terminal_path: nonEmptyString(refinedInputs.expected_terminal_path) || nonEmptyString(payload.expected_terminal_path) || nonEmptyString(refinedInputs.expected_after_path) || nonEmptyString(payload.expected_after_path)
727
729
  }),
728
730
  stop_condition: nonEmptyString(payload.stop_condition),
729
731
  rationale: jsonCloneValue(payload.rationale),
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  normalizeIntegrationContext,
3
3
  normalizeRunParams
4
- } from "./chunk-OHJQRDST.js";
4
+ } from "./chunk-TNCDVE5O.js";
5
5
  import {
6
6
  compactRecord
7
7
  } from "./chunk-VY4Y5U57.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createRiddleProofRunCard
3
- } from "./chunk-Y2KTBACQ.js";
3
+ } from "./chunk-U4FUFBSH.js";
4
4
  import {
5
5
  compactRecord,
6
6
  isTerminalStatus,
@@ -15,7 +15,7 @@ import {
15
15
  validateShipGate,
16
16
  workflowFile,
17
17
  writeState
18
- } from "./chunk-TJ63IE65.js";
18
+ } from "./chunk-RV6LK7HU.js";
19
19
  import {
20
20
  __export
21
21
  } from "./chunk-MLKGABMK.js";
@@ -653,6 +653,13 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
653
653
  const args = step === "setup" ? buildSetupArgs(params, config) : {};
654
654
  const stepWorkflowFile = workflowFile(config.riddleProofDir, step);
655
655
  const timer = beginRuntimeStep(config.statePath, action, step, stepWorkflowFile);
656
+ if (!existsSync(stepWorkflowFile)) {
657
+ return finishRuntimeStep(config.statePath, action, {
658
+ ok: false,
659
+ step,
660
+ error: `Riddle Proof workflow file missing for ${step}: ${stepWorkflowFile}`
661
+ }, timer);
662
+ }
656
663
  let output;
657
664
  try {
658
665
  if (step === "setup") {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  statePathsForRunState
3
- } from "./chunk-2CFVREFI.js";
3
+ } from "./chunk-SKIAZTQ7.js";
4
4
  import {
5
5
  compactRecord,
6
6
  isTerminalStatus,
@@ -5,16 +5,16 @@ import {
5
5
  createRunStatusSnapshot,
6
6
  normalizeRunParams,
7
7
  setRunStatus
8
- } from "./chunk-OHJQRDST.js";
8
+ } from "./chunk-TNCDVE5O.js";
9
9
  import {
10
10
  createRiddleProofRunCard
11
- } from "./chunk-Y2KTBACQ.js";
11
+ } from "./chunk-U4FUFBSH.js";
12
12
  import {
13
13
  noImplementationModeFor,
14
14
  visualDeltaForState,
15
15
  visualDeltaRequiredForState,
16
16
  visualDeltaShipGateReason
17
- } from "./chunk-TJ63IE65.js";
17
+ } from "./chunk-RV6LK7HU.js";
18
18
  import {
19
19
  authorPacketPayloadFromCheckpointResponse,
20
20
  buildCheckpointPacketForEngineResult,
@@ -24,7 +24,7 @@ import {
24
24
  normalizeCheckpointResponse,
25
25
  proofContractFromAuthorCheckpointResponse,
26
26
  statePathsForRunState
27
- } from "./chunk-2CFVREFI.js";
27
+ } from "./chunk-SKIAZTQ7.js";
28
28
  import {
29
29
  applyTerminalMetadata,
30
30
  compactRecord,
@@ -1095,7 +1095,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
1095
1095
  return { next: { ...baseContinuation(result), ship_after_verify: true } };
1096
1096
  }
1097
1097
  return {
1098
- terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof is ready to ship.", {
1098
+ terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
1099
1099
  ship_held: true
1100
1100
  })
1101
1101
  };
@@ -1318,7 +1318,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
1318
1318
  state,
1319
1319
  "ready_to_ship",
1320
1320
  result,
1321
- assessment.summary || result.summary || "Riddle Proof is ready to ship.",
1321
+ assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
1322
1322
  {
1323
1323
  ship_held: true,
1324
1324
  proof_assessment: payload
@@ -1337,7 +1337,7 @@ async function routeCheckpoint(request, state, result, agent, input) {
1337
1337
  if (next) {
1338
1338
  if (String(next.advance_stage || "") === "ship" && effectiveShipMode(request, input.config) !== "ship") {
1339
1339
  return {
1340
- terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof is ready to ship.", {
1340
+ terminal: terminalResult(state, "ready_to_ship", result, result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.", {
1341
1341
  ship_held: true
1342
1342
  })
1343
1343
  };
@@ -3,10 +3,10 @@ import {
3
3
  appendStageHeartbeat,
4
4
  createRunState,
5
5
  setRunStatus
6
- } from "./chunk-OHJQRDST.js";
6
+ } from "./chunk-TNCDVE5O.js";
7
7
  import {
8
8
  noImplementationModeFor
9
- } from "./chunk-TJ63IE65.js";
9
+ } from "./chunk-RV6LK7HU.js";
10
10
  import {
11
11
  createRunResult
12
12
  } from "./chunk-VY4Y5U57.js";
package/dist/cli/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import "../chunk-VZD5LH7U.js";
1
+ import "../chunk-OIFHYMHP.js";
2
2
  import "../chunk-PEWAIEER.js";
3
3
  import "../chunk-TWTEUS7R.js";
4
- import "../chunk-IWLQQ5S5.js";
5
- import "../chunk-OHJQRDST.js";
6
- import "../chunk-Y2KTBACQ.js";
7
- import "../chunk-TJ63IE65.js";
8
- import "../chunk-2CFVREFI.js";
4
+ import "../chunk-YB5ACBZE.js";
5
+ import "../chunk-TNCDVE5O.js";
6
+ import "../chunk-U4FUFBSH.js";
7
+ import "../chunk-RV6LK7HU.js";
8
+ import "../chunk-SKIAZTQ7.js";
9
9
  import "../chunk-JFQXAJH2.js";
10
10
  import "../chunk-7F5LNUGR.js";
11
11
  import "../chunk-VY4Y5U57.js";