@riddledc/riddle-proof 0.8.46 → 0.8.48

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.
@@ -3,10 +3,10 @@ import {
3
3
  parseOpenClawAssertions,
4
4
  parseOpenClawJsonObjectOrArray,
5
5
  toRiddleProofRunParams
6
- } from "../chunk-73K5UYI2.js";
7
- import "../chunk-Z7BSDAOE.js";
8
- import "../chunk-DZLBYXL3.js";
9
- import "../chunk-4D76AYZW.js";
6
+ } from "../chunk-2PHYFVTY.js";
7
+ import "../chunk-EMWF2575.js";
8
+ import "../chunk-L7U7QZYH.js";
9
+ import "../chunk-U46KE6JZ.js";
10
10
  import "../chunk-VY4Y5U57.js";
11
11
  import "../chunk-MLKGABMK.js";
12
12
  export {
@@ -4199,7 +4199,7 @@ function checkpointSummaryFromState(state, engineStatePath2) {
4199
4199
  const latestResponse = latestResponseEntry?.response;
4200
4200
  const latestResumeToken = latestPacket?.resume_token || null;
4201
4201
  const latestResponseToken = latestResponse?.resume_token || null;
4202
- const tokenMatches = latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
4202
+ const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
4203
4203
  return compactRecord({
4204
4204
  pending: Boolean(state.checkpoint_packet),
4205
4205
  packet_count: packets.length,
@@ -4652,6 +4652,8 @@ function appendStageHeartbeat(state, input) {
4652
4652
  function createRunStatusSnapshot(state, at = timestamp2()) {
4653
4653
  const latestEvent = state.events[state.events.length - 1];
4654
4654
  const runId = state.run_id || "unknown";
4655
+ const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status);
4656
+ const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
4655
4657
  return compactRecord({
4656
4658
  run_id: runId,
4657
4659
  status: state.status,
@@ -4681,7 +4683,7 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
4681
4683
  checkpoint_summary: state.checkpoint_summary,
4682
4684
  state_paths: state.state_paths,
4683
4685
  proof_contract: state.proof_contract,
4684
- run_card: state.run_card || createRiddleProofRunCard(state, { at }),
4686
+ run_card: runCard,
4685
4687
  viewport_matrix_status: state.viewport_matrix_status,
4686
4688
  latest_event: latestEvent
4687
4689
  });
@@ -5383,6 +5385,21 @@ function checkpointResponseContinuation(state, value) {
5383
5385
  }
5384
5386
  };
5385
5387
  }
5388
+ if (!packet.allowed_decisions.includes(response.decision)) {
5389
+ return {
5390
+ blocker: {
5391
+ code: "checkpoint_response_decision_not_allowed",
5392
+ checkpoint: packet.checkpoint,
5393
+ message: "Checkpoint response decision is not advertised by the pending checkpoint packet.",
5394
+ details: {
5395
+ stage: packet.stage,
5396
+ decision: response.decision,
5397
+ allowed_decisions: packet.allowed_decisions,
5398
+ response
5399
+ }
5400
+ }
5401
+ };
5402
+ }
5386
5403
  const base = {
5387
5404
  action: "run",
5388
5405
  state_path: state.request.engine_state_path || packet.state_path || "",
@@ -2,11 +2,11 @@ import {
2
2
  createDisabledRiddleProofAgentAdapter,
3
3
  readRiddleProofRunStatus,
4
4
  runRiddleProofEngineHarness
5
- } from "../chunk-6BFLSCBD.js";
6
- import "../chunk-Z7BSDAOE.js";
7
- import "../chunk-DZLBYXL3.js";
5
+ } from "../chunk-2KEYWZY5.js";
6
+ import "../chunk-EMWF2575.js";
7
+ import "../chunk-L7U7QZYH.js";
8
8
  import "../chunk-X7SQTCIQ.js";
9
- import "../chunk-4D76AYZW.js";
9
+ import "../chunk-U46KE6JZ.js";
10
10
  import "../chunk-VY4Y5U57.js";
11
11
  import "../chunk-MLKGABMK.js";
12
12
  export {
@@ -4231,7 +4231,7 @@ function checkpointSummaryFromState(state, engineStatePath2) {
4231
4231
  const latestResponse = latestResponseEntry?.response;
4232
4232
  const latestResumeToken = latestPacket?.resume_token || null;
4233
4233
  const latestResponseToken = latestResponse?.resume_token || null;
4234
- const tokenMatches = latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
4234
+ const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
4235
4235
  return compactRecord({
4236
4236
  pending: Boolean(state.checkpoint_packet),
4237
4237
  packet_count: packets.length,
@@ -4684,6 +4684,8 @@ function appendStageHeartbeat(state, input) {
4684
4684
  function createRunStatusSnapshot(state, at = timestamp2()) {
4685
4685
  const latestEvent = state.events[state.events.length - 1];
4686
4686
  const runId = state.run_id || "unknown";
4687
+ const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status);
4688
+ const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
4687
4689
  return compactRecord({
4688
4690
  run_id: runId,
4689
4691
  status: state.status,
@@ -4713,7 +4715,7 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
4713
4715
  checkpoint_summary: state.checkpoint_summary,
4714
4716
  state_paths: state.state_paths,
4715
4717
  proof_contract: state.proof_contract,
4716
- run_card: state.run_card || createRiddleProofRunCard(state, { at }),
4718
+ run_card: runCard,
4717
4719
  viewport_matrix_status: state.viewport_matrix_status,
4718
4720
  latest_event: latestEvent
4719
4721
  });
@@ -5920,6 +5922,21 @@ function checkpointResponseContinuation(state, value) {
5920
5922
  }
5921
5923
  };
5922
5924
  }
5925
+ if (!packet.allowed_decisions.includes(response.decision)) {
5926
+ return {
5927
+ blocker: {
5928
+ code: "checkpoint_response_decision_not_allowed",
5929
+ checkpoint: packet.checkpoint,
5930
+ message: "Checkpoint response decision is not advertised by the pending checkpoint packet.",
5931
+ details: {
5932
+ stage: packet.stage,
5933
+ decision: response.decision,
5934
+ allowed_decisions: packet.allowed_decisions,
5935
+ response
5936
+ }
5937
+ }
5938
+ };
5939
+ }
5923
5940
  const base = {
5924
5941
  action: "run",
5925
5942
  state_path: state.request.engine_state_path || packet.state_path || "",
@@ -3,16 +3,16 @@ import {
3
3
  } from "../chunk-IOI6QR3B.js";
4
4
  import {
5
5
  runner_exports
6
- } from "../chunk-HMEYW33D.js";
6
+ } from "../chunk-UKGDVNGI.js";
7
7
  import {
8
8
  engine_harness_exports
9
- } from "../chunk-6BFLSCBD.js";
10
- import "../chunk-Z7BSDAOE.js";
11
- import "../chunk-DZLBYXL3.js";
9
+ } from "../chunk-2KEYWZY5.js";
10
+ import "../chunk-EMWF2575.js";
11
+ import "../chunk-L7U7QZYH.js";
12
12
  import {
13
13
  proof_run_core_exports
14
14
  } from "../chunk-X7SQTCIQ.js";
15
- import "../chunk-4D76AYZW.js";
15
+ import "../chunk-U46KE6JZ.js";
16
16
  import "../chunk-VY4Y5U57.js";
17
17
  import "../chunk-MLKGABMK.js";
18
18
  export {
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "../chunk-HMEYW33D.js";
4
- import "../chunk-Z7BSDAOE.js";
5
- import "../chunk-DZLBYXL3.js";
3
+ } from "../chunk-UKGDVNGI.js";
4
+ import "../chunk-EMWF2575.js";
5
+ import "../chunk-L7U7QZYH.js";
6
6
  import "../chunk-X7SQTCIQ.js";
7
- import "../chunk-4D76AYZW.js";
7
+ import "../chunk-U46KE6JZ.js";
8
8
  import "../chunk-VY4Y5U57.js";
9
9
  import "../chunk-MLKGABMK.js";
10
10
  export {
@@ -729,7 +729,7 @@ function checkpointSummaryFromState(state, engineStatePath) {
729
729
  const latestResponse = latestResponseEntry?.response;
730
730
  const latestResumeToken = latestPacket?.resume_token || null;
731
731
  const latestResponseToken = latestResponse?.resume_token || null;
732
- const tokenMatches = latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
732
+ const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
733
733
  return compactRecord({
734
734
  pending: Boolean(state.checkpoint_packet),
735
735
  packet_count: packets.length,
@@ -13,7 +13,7 @@ import {
13
13
  normalizeCheckpointResponse,
14
14
  proofContractFromAuthorCheckpointResponse,
15
15
  statePathsForRunState
16
- } from "./chunk-4D76AYZW.js";
16
+ } from "./chunk-U46KE6JZ.js";
17
17
  import "./chunk-VY4Y5U57.js";
18
18
  import "./chunk-MLKGABMK.js";
19
19
  export {
@@ -5,10 +5,10 @@ import {
5
5
  createRunStatusSnapshot,
6
6
  normalizeRunParams,
7
7
  setRunStatus
8
- } from "./chunk-Z7BSDAOE.js";
8
+ } from "./chunk-EMWF2575.js";
9
9
  import {
10
10
  createRiddleProofRunCard
11
- } from "./chunk-DZLBYXL3.js";
11
+ } from "./chunk-L7U7QZYH.js";
12
12
  import {
13
13
  noImplementationModeFor,
14
14
  proofAssessmentHardBlockersForState,
@@ -25,7 +25,7 @@ import {
25
25
  normalizeCheckpointResponse,
26
26
  proofContractFromAuthorCheckpointResponse,
27
27
  statePathsForRunState
28
- } from "./chunk-4D76AYZW.js";
28
+ } from "./chunk-U46KE6JZ.js";
29
29
  import {
30
30
  applyTerminalMetadata,
31
31
  compactRecord,
@@ -744,6 +744,21 @@ function checkpointResponseContinuation(state, value) {
744
744
  }
745
745
  };
746
746
  }
747
+ if (!packet.allowed_decisions.includes(response.decision)) {
748
+ return {
749
+ blocker: {
750
+ code: "checkpoint_response_decision_not_allowed",
751
+ checkpoint: packet.checkpoint,
752
+ message: "Checkpoint response decision is not advertised by the pending checkpoint packet.",
753
+ details: {
754
+ stage: packet.stage,
755
+ decision: response.decision,
756
+ allowed_decisions: packet.allowed_decisions,
757
+ response
758
+ }
759
+ }
760
+ };
761
+ }
747
762
  const base = {
748
763
  action: "run",
749
764
  state_path: state.request.engine_state_path || packet.state_path || "",
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  normalizeIntegrationContext,
3
3
  normalizeRunParams
4
- } from "./chunk-Z7BSDAOE.js";
4
+ } from "./chunk-EMWF2575.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-DZLBYXL3.js";
3
+ } from "./chunk-L7U7QZYH.js";
4
4
  import {
5
5
  compactRecord,
6
6
  isTerminalStatus,
@@ -188,6 +188,8 @@ function appendStageHeartbeat(state, input) {
188
188
  function createRunStatusSnapshot(state, at = timestamp()) {
189
189
  const latestEvent = state.events[state.events.length - 1];
190
190
  const runId = state.run_id || "unknown";
191
+ const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status);
192
+ const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
191
193
  return compactRecord({
192
194
  run_id: runId,
193
195
  status: state.status,
@@ -217,7 +219,7 @@ function createRunStatusSnapshot(state, at = timestamp()) {
217
219
  checkpoint_summary: state.checkpoint_summary,
218
220
  state_paths: state.state_paths,
219
221
  proof_contract: state.proof_contract,
220
- run_card: state.run_card || createRiddleProofRunCard(state, { at }),
222
+ run_card: runCard,
221
223
  viewport_matrix_status: state.viewport_matrix_status,
222
224
  latest_event: latestEvent
223
225
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  statePathsForRunState
3
- } from "./chunk-4D76AYZW.js";
3
+ } from "./chunk-U46KE6JZ.js";
4
4
  import {
5
5
  compactRecord,
6
6
  isTerminalStatus,
@@ -28,10 +28,10 @@ import {
28
28
  createDisabledRiddleProofAgentAdapter,
29
29
  readRiddleProofRunStatus,
30
30
  runRiddleProofEngineHarness
31
- } from "./chunk-6BFLSCBD.js";
31
+ } from "./chunk-2KEYWZY5.js";
32
32
  import {
33
33
  createCheckpointResponseTemplate
34
- } from "./chunk-4D76AYZW.js";
34
+ } from "./chunk-U46KE6JZ.js";
35
35
  import {
36
36
  createCodexExecAgentAdapter,
37
37
  runCodexExecAgentDoctor
@@ -675,7 +675,7 @@ function checkpointSummaryFromState(state, engineStatePath) {
675
675
  const latestResponse = latestResponseEntry?.response;
676
676
  const latestResumeToken = latestPacket?.resume_token || null;
677
677
  const latestResponseToken = latestResponse?.resume_token || null;
678
- const tokenMatches = latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
678
+ const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
679
679
  return compactRecord({
680
680
  pending: Boolean(state.checkpoint_packet),
681
681
  packet_count: packets.length,
@@ -3,7 +3,7 @@ import {
3
3
  appendStageHeartbeat,
4
4
  createRunState,
5
5
  setRunStatus
6
- } from "./chunk-Z7BSDAOE.js";
6
+ } from "./chunk-EMWF2575.js";
7
7
  import {
8
8
  noImplementationModeFor
9
9
  } from "./chunk-X7SQTCIQ.js";
package/dist/cli/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import "../chunk-HJ2FNDJ4.js";
1
+ import "../chunk-TO3VKAG2.js";
2
2
  import "../chunk-DI2XNGEZ.js";
3
3
  import "../chunk-6KYXX4OE.js";
4
4
  import "../chunk-EX7TO4I5.js";
5
- import "../chunk-6BFLSCBD.js";
6
- import "../chunk-Z7BSDAOE.js";
7
- import "../chunk-DZLBYXL3.js";
5
+ import "../chunk-2KEYWZY5.js";
6
+ import "../chunk-EMWF2575.js";
7
+ import "../chunk-L7U7QZYH.js";
8
8
  import "../chunk-X7SQTCIQ.js";
9
- import "../chunk-4D76AYZW.js";
9
+ import "../chunk-U46KE6JZ.js";
10
10
  import "../chunk-JFQXAJH2.js";
11
11
  import "../chunk-73EBR3YL.js";
12
12
  import "../chunk-VY4Y5U57.js";
package/dist/cli.cjs CHANGED
@@ -4284,7 +4284,7 @@ function checkpointSummaryFromState(state, engineStatePath2) {
4284
4284
  const latestResponse = latestResponseEntry?.response;
4285
4285
  const latestResumeToken = latestPacket?.resume_token || null;
4286
4286
  const latestResponseToken = latestResponse?.resume_token || null;
4287
- const tokenMatches = latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
4287
+ const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
4288
4288
  return compactRecord({
4289
4289
  pending: Boolean(state.checkpoint_packet),
4290
4290
  packet_count: packets.length,
@@ -4737,6 +4737,8 @@ function appendStageHeartbeat(state, input) {
4737
4737
  function createRunStatusSnapshot(state, at = timestamp2()) {
4738
4738
  const latestEvent = state.events[state.events.length - 1];
4739
4739
  const runId = state.run_id || "unknown";
4740
+ const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status);
4741
+ const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
4740
4742
  return compactRecord({
4741
4743
  run_id: runId,
4742
4744
  status: state.status,
@@ -4766,7 +4768,7 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
4766
4768
  checkpoint_summary: state.checkpoint_summary,
4767
4769
  state_paths: state.state_paths,
4768
4770
  proof_contract: state.proof_contract,
4769
- run_card: state.run_card || createRiddleProofRunCard(state, { at }),
4771
+ run_card: runCard,
4770
4772
  viewport_matrix_status: state.viewport_matrix_status,
4771
4773
  latest_event: latestEvent
4772
4774
  });
@@ -5468,6 +5470,21 @@ function checkpointResponseContinuation(state, value) {
5468
5470
  }
5469
5471
  };
5470
5472
  }
5473
+ if (!packet.allowed_decisions.includes(response.decision)) {
5474
+ return {
5475
+ blocker: {
5476
+ code: "checkpoint_response_decision_not_allowed",
5477
+ checkpoint: packet.checkpoint,
5478
+ message: "Checkpoint response decision is not advertised by the pending checkpoint packet.",
5479
+ details: {
5480
+ stage: packet.stage,
5481
+ decision: response.decision,
5482
+ allowed_decisions: packet.allowed_decisions,
5483
+ response
5484
+ }
5485
+ }
5486
+ };
5487
+ }
5471
5488
  const base = {
5472
5489
  action: "run",
5473
5490
  state_path: state.request.engine_state_path || packet.state_path || "",
package/dist/cli.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-HJ2FNDJ4.js";
2
+ import "./chunk-TO3VKAG2.js";
3
3
  import "./chunk-DI2XNGEZ.js";
4
4
  import "./chunk-6KYXX4OE.js";
5
5
  import "./chunk-EX7TO4I5.js";
6
- import "./chunk-6BFLSCBD.js";
7
- import "./chunk-Z7BSDAOE.js";
8
- import "./chunk-DZLBYXL3.js";
6
+ import "./chunk-2KEYWZY5.js";
7
+ import "./chunk-EMWF2575.js";
8
+ import "./chunk-L7U7QZYH.js";
9
9
  import "./chunk-X7SQTCIQ.js";
10
- import "./chunk-4D76AYZW.js";
10
+ import "./chunk-U46KE6JZ.js";
11
11
  import "./chunk-JFQXAJH2.js";
12
12
  import "./chunk-73EBR3YL.js";
13
13
  import "./chunk-VY4Y5U57.js";
@@ -4197,7 +4197,7 @@ function checkpointSummaryFromState(state, engineStatePath2) {
4197
4197
  const latestResponse = latestResponseEntry?.response;
4198
4198
  const latestResumeToken = latestPacket?.resume_token || null;
4199
4199
  const latestResponseToken = latestResponse?.resume_token || null;
4200
- const tokenMatches = latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
4200
+ const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
4201
4201
  return compactRecord({
4202
4202
  pending: Boolean(state.checkpoint_packet),
4203
4203
  packet_count: packets.length,
@@ -4650,6 +4650,8 @@ function appendStageHeartbeat(state, input) {
4650
4650
  function createRunStatusSnapshot(state, at = timestamp2()) {
4651
4651
  const latestEvent = state.events[state.events.length - 1];
4652
4652
  const runId = state.run_id || "unknown";
4653
+ const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status);
4654
+ const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
4653
4655
  return compactRecord({
4654
4656
  run_id: runId,
4655
4657
  status: state.status,
@@ -4679,7 +4681,7 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
4679
4681
  checkpoint_summary: state.checkpoint_summary,
4680
4682
  state_paths: state.state_paths,
4681
4683
  proof_contract: state.proof_contract,
4682
- run_card: state.run_card || createRiddleProofRunCard(state, { at }),
4684
+ run_card: runCard,
4683
4685
  viewport_matrix_status: state.viewport_matrix_status,
4684
4686
  latest_event: latestEvent
4685
4687
  });
@@ -5381,6 +5383,21 @@ function checkpointResponseContinuation(state, value) {
5381
5383
  }
5382
5384
  };
5383
5385
  }
5386
+ if (!packet.allowed_decisions.includes(response.decision)) {
5387
+ return {
5388
+ blocker: {
5389
+ code: "checkpoint_response_decision_not_allowed",
5390
+ checkpoint: packet.checkpoint,
5391
+ message: "Checkpoint response decision is not advertised by the pending checkpoint packet.",
5392
+ details: {
5393
+ stage: packet.stage,
5394
+ decision: response.decision,
5395
+ allowed_decisions: packet.allowed_decisions,
5396
+ response
5397
+ }
5398
+ }
5399
+ };
5400
+ }
5384
5401
  const base = {
5385
5402
  action: "run",
5386
5403
  state_path: state.request.engine_state_path || packet.state_path || "",
@@ -2,11 +2,11 @@ import {
2
2
  createDisabledRiddleProofAgentAdapter,
3
3
  readRiddleProofRunStatus,
4
4
  runRiddleProofEngineHarness
5
- } from "./chunk-6BFLSCBD.js";
6
- import "./chunk-Z7BSDAOE.js";
7
- import "./chunk-DZLBYXL3.js";
5
+ } from "./chunk-2KEYWZY5.js";
6
+ import "./chunk-EMWF2575.js";
7
+ import "./chunk-L7U7QZYH.js";
8
8
  import "./chunk-X7SQTCIQ.js";
9
- import "./chunk-4D76AYZW.js";
9
+ import "./chunk-U46KE6JZ.js";
10
10
  import "./chunk-VY4Y5U57.js";
11
11
  import "./chunk-MLKGABMK.js";
12
12
  export {
package/dist/index.cjs CHANGED
@@ -4405,7 +4405,7 @@ function checkpointSummaryFromState(state, engineStatePath2) {
4405
4405
  const latestResponse = latestResponseEntry?.response;
4406
4406
  const latestResumeToken = latestPacket?.resume_token || null;
4407
4407
  const latestResponseToken = latestResponse?.resume_token || null;
4408
- const tokenMatches = latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
4408
+ const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
4409
4409
  return compactRecord({
4410
4410
  pending: Boolean(state.checkpoint_packet),
4411
4411
  packet_count: packets.length,
@@ -4888,6 +4888,8 @@ function appendStageHeartbeat(state, input) {
4888
4888
  function createRunStatusSnapshot(state, at = timestamp2()) {
4889
4889
  const latestEvent = state.events[state.events.length - 1];
4890
4890
  const runId = state.run_id || "unknown";
4891
+ const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status);
4892
+ const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
4891
4893
  return compactRecord({
4892
4894
  run_id: runId,
4893
4895
  status: state.status,
@@ -4917,7 +4919,7 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
4917
4919
  checkpoint_summary: state.checkpoint_summary,
4918
4920
  state_paths: state.state_paths,
4919
4921
  proof_contract: state.proof_contract,
4920
- run_card: state.run_card || createRiddleProofRunCard(state, { at }),
4922
+ run_card: runCard,
4921
4923
  viewport_matrix_status: state.viewport_matrix_status,
4922
4924
  latest_event: latestEvent
4923
4925
  });
@@ -6135,6 +6137,21 @@ function checkpointResponseContinuation(state, value) {
6135
6137
  }
6136
6138
  };
6137
6139
  }
6140
+ if (!packet.allowed_decisions.includes(response.decision)) {
6141
+ return {
6142
+ blocker: {
6143
+ code: "checkpoint_response_decision_not_allowed",
6144
+ checkpoint: packet.checkpoint,
6145
+ message: "Checkpoint response decision is not advertised by the pending checkpoint packet.",
6146
+ details: {
6147
+ stage: packet.stage,
6148
+ decision: response.decision,
6149
+ allowed_decisions: packet.allowed_decisions,
6150
+ response
6151
+ }
6152
+ }
6153
+ };
6154
+ }
6138
6155
  const base = {
6139
6156
  action: "run",
6140
6157
  state_path: state.request.engine_state_path || packet.state_path || "",
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "./chunk-HMEYW33D.js";
3
+ } from "./chunk-UKGDVNGI.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
  import {
6
6
  RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION,
@@ -102,7 +102,7 @@ import {
102
102
  createDisabledRiddleProofAgentAdapter,
103
103
  readRiddleProofRunStatus,
104
104
  runRiddleProofEngineHarness
105
- } from "./chunk-6BFLSCBD.js";
105
+ } from "./chunk-2KEYWZY5.js";
106
106
  import {
107
107
  RIDDLE_PROOF_RUN_STATE_VERSION,
108
108
  appendRunEvent,
@@ -114,11 +114,11 @@ import {
114
114
  normalizePrLifecycleState,
115
115
  normalizeRunParams,
116
116
  setRunStatus
117
- } from "./chunk-Z7BSDAOE.js";
117
+ } from "./chunk-EMWF2575.js";
118
118
  import {
119
119
  RIDDLE_PROOF_RUN_CARD_VERSION,
120
120
  createRiddleProofRunCard
121
- } from "./chunk-DZLBYXL3.js";
121
+ } from "./chunk-L7U7QZYH.js";
122
122
  import "./chunk-X7SQTCIQ.js";
123
123
  import {
124
124
  RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
@@ -135,7 +135,7 @@ import {
135
135
  normalizeCheckpointResponse,
136
136
  proofContractFromAuthorCheckpointResponse,
137
137
  statePathsForRunState
138
- } from "./chunk-4D76AYZW.js";
138
+ } from "./chunk-U46KE6JZ.js";
139
139
  import "./chunk-JFQXAJH2.js";
140
140
  import {
141
141
  createCodexExecAgentAdapter,
package/dist/openclaw.js CHANGED
@@ -3,10 +3,10 @@ import {
3
3
  parseOpenClawAssertions,
4
4
  parseOpenClawJsonObjectOrArray,
5
5
  toRiddleProofRunParams
6
- } from "./chunk-73K5UYI2.js";
7
- import "./chunk-Z7BSDAOE.js";
8
- import "./chunk-DZLBYXL3.js";
9
- import "./chunk-4D76AYZW.js";
6
+ } from "./chunk-2PHYFVTY.js";
7
+ import "./chunk-EMWF2575.js";
8
+ import "./chunk-L7U7QZYH.js";
9
+ import "./chunk-U46KE6JZ.js";
10
10
  import "./chunk-VY4Y5U57.js";
11
11
  import "./chunk-MLKGABMK.js";
12
12
  export {
package/dist/run-card.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RIDDLE_PROOF_RUN_CARD_VERSION,
3
3
  createRiddleProofRunCard
4
- } from "./chunk-DZLBYXL3.js";
5
- import "./chunk-4D76AYZW.js";
4
+ } from "./chunk-L7U7QZYH.js";
5
+ import "./chunk-U46KE6JZ.js";
6
6
  import "./chunk-VY4Y5U57.js";
7
7
  import "./chunk-MLKGABMK.js";
8
8
  export {
package/dist/runner.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "./chunk-HMEYW33D.js";
4
- import "./chunk-Z7BSDAOE.js";
5
- import "./chunk-DZLBYXL3.js";
3
+ } from "./chunk-UKGDVNGI.js";
4
+ import "./chunk-EMWF2575.js";
5
+ import "./chunk-L7U7QZYH.js";
6
6
  import "./chunk-X7SQTCIQ.js";
7
- import "./chunk-4D76AYZW.js";
7
+ import "./chunk-U46KE6JZ.js";
8
8
  import "./chunk-VY4Y5U57.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
  export {
@@ -731,7 +731,7 @@ function checkpointSummaryFromState(state, engineStatePath) {
731
731
  const latestResponse = latestResponseEntry?.response;
732
732
  const latestResumeToken = latestPacket?.resume_token || null;
733
733
  const latestResponseToken = latestResponse?.resume_token || null;
734
- const tokenMatches = latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
734
+ const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
735
735
  return compactRecord({
736
736
  pending: Boolean(state.checkpoint_packet),
737
737
  packet_count: packets.length,
@@ -13,7 +13,7 @@ import {
13
13
  normalizeCheckpointResponse,
14
14
  proofContractFromAuthorCheckpointResponse,
15
15
  statePathsForRunState
16
- } from "../chunk-4D76AYZW.js";
16
+ } from "../chunk-U46KE6JZ.js";
17
17
  import "../chunk-VY4Y5U57.js";
18
18
  import "../chunk-MLKGABMK.js";
19
19
  export {
@@ -954,7 +954,7 @@ function checkpointSummaryFromState(state, engineStatePath) {
954
954
  const latestResponse = latestResponseEntry?.response;
955
955
  const latestResumeToken = latestPacket?.resume_token || null;
956
956
  const latestResponseToken = latestResponse?.resume_token || null;
957
- const tokenMatches = latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
957
+ const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
958
958
  return compactRecord({
959
959
  pending: Boolean(state.checkpoint_packet),
960
960
  packet_count: packets.length,
@@ -1437,6 +1437,8 @@ function appendStageHeartbeat(state, input) {
1437
1437
  function createRunStatusSnapshot(state, at = timestamp2()) {
1438
1438
  const latestEvent = state.events[state.events.length - 1];
1439
1439
  const runId = state.run_id || "unknown";
1440
+ const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status);
1441
+ const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
1440
1442
  return compactRecord({
1441
1443
  run_id: runId,
1442
1444
  status: state.status,
@@ -1466,7 +1468,7 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
1466
1468
  checkpoint_summary: state.checkpoint_summary,
1467
1469
  state_paths: state.state_paths,
1468
1470
  proof_contract: state.proof_contract,
1469
- run_card: state.run_card || createRiddleProofRunCard(state, { at }),
1471
+ run_card: runCard,
1470
1472
  viewport_matrix_status: state.viewport_matrix_status,
1471
1473
  latest_event: latestEvent
1472
1474
  });
@@ -10,11 +10,11 @@ import {
10
10
  normalizePrLifecycleState,
11
11
  normalizeRunParams,
12
12
  setRunStatus
13
- } from "../chunk-Z7BSDAOE.js";
13
+ } from "../chunk-EMWF2575.js";
14
14
  import {
15
15
  RIDDLE_PROOF_RUN_CARD_VERSION,
16
16
  createRiddleProofRunCard
17
- } from "../chunk-DZLBYXL3.js";
17
+ } from "../chunk-L7U7QZYH.js";
18
18
  import {
19
19
  RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
20
20
  RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
@@ -30,7 +30,7 @@ import {
30
30
  normalizeCheckpointResponse,
31
31
  proofContractFromAuthorCheckpointResponse,
32
32
  statePathsForRunState
33
- } from "../chunk-4D76AYZW.js";
33
+ } from "../chunk-U46KE6JZ.js";
34
34
  import {
35
35
  applyTerminalMetadata,
36
36
  compactRecord,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RIDDLE_PROOF_RUN_CARD_VERSION,
3
3
  createRiddleProofRunCard
4
- } from "../chunk-DZLBYXL3.js";
5
- import "../chunk-4D76AYZW.js";
4
+ } from "../chunk-L7U7QZYH.js";
5
+ import "../chunk-U46KE6JZ.js";
6
6
  import "../chunk-VY4Y5U57.js";
7
7
  import "../chunk-MLKGABMK.js";
8
8
  export {
@@ -469,6 +469,8 @@ function appendStageHeartbeat(state, input) {
469
469
  function createRunStatusSnapshot(state, at = timestamp()) {
470
470
  const latestEvent = state.events[state.events.length - 1];
471
471
  const runId = state.run_id || "unknown";
472
+ const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status);
473
+ const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
472
474
  return compactRecord({
473
475
  run_id: runId,
474
476
  status: state.status,
@@ -498,7 +500,7 @@ function createRunStatusSnapshot(state, at = timestamp()) {
498
500
  checkpoint_summary: state.checkpoint_summary,
499
501
  state_paths: state.state_paths,
500
502
  proof_contract: state.proof_contract,
501
- run_card: state.run_card || createRiddleProofRunCard(state, { at }),
503
+ run_card: runCard,
502
504
  viewport_matrix_status: state.viewport_matrix_status,
503
505
  latest_event: latestEvent
504
506
  });
@@ -9,9 +9,9 @@ import {
9
9
  normalizePrLifecycleState,
10
10
  normalizeRunParams,
11
11
  setRunStatus
12
- } from "../chunk-Z7BSDAOE.js";
13
- import "../chunk-DZLBYXL3.js";
14
- import "../chunk-4D76AYZW.js";
12
+ } from "../chunk-EMWF2575.js";
13
+ import "../chunk-L7U7QZYH.js";
14
+ import "../chunk-U46KE6JZ.js";
15
15
  import "../chunk-VY4Y5U57.js";
16
16
  import "../chunk-MLKGABMK.js";
17
17
  export {
package/dist/state.cjs CHANGED
@@ -469,6 +469,8 @@ function appendStageHeartbeat(state, input) {
469
469
  function createRunStatusSnapshot(state, at = timestamp()) {
470
470
  const latestEvent = state.events[state.events.length - 1];
471
471
  const runId = state.run_id || "unknown";
472
+ const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status);
473
+ const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
472
474
  return compactRecord({
473
475
  run_id: runId,
474
476
  status: state.status,
@@ -498,7 +500,7 @@ function createRunStatusSnapshot(state, at = timestamp()) {
498
500
  checkpoint_summary: state.checkpoint_summary,
499
501
  state_paths: state.state_paths,
500
502
  proof_contract: state.proof_contract,
501
- run_card: state.run_card || createRiddleProofRunCard(state, { at }),
503
+ run_card: runCard,
502
504
  viewport_matrix_status: state.viewport_matrix_status,
503
505
  latest_event: latestEvent
504
506
  });
package/dist/state.js CHANGED
@@ -9,9 +9,9 @@ import {
9
9
  normalizePrLifecycleState,
10
10
  normalizeRunParams,
11
11
  setRunStatus
12
- } from "./chunk-Z7BSDAOE.js";
13
- import "./chunk-DZLBYXL3.js";
14
- import "./chunk-4D76AYZW.js";
12
+ } from "./chunk-EMWF2575.js";
13
+ import "./chunk-L7U7QZYH.js";
14
+ import "./chunk-U46KE6JZ.js";
15
15
  import "./chunk-VY4Y5U57.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.8.46",
3
+ "version": "0.8.48",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",