@riddledc/riddle-proof 0.8.51 → 0.8.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/openclaw.js +4 -4
- package/dist/advanced/engine-harness.cjs +79 -26
- package/dist/advanced/engine-harness.js +5 -5
- package/dist/advanced/index.cjs +81 -26
- package/dist/advanced/index.d.cts +2 -2
- package/dist/advanced/index.d.ts +2 -2
- package/dist/advanced/index.js +7 -7
- package/dist/advanced/proof-run-core.cjs +24 -2
- package/dist/advanced/proof-run-core.d.cts +1 -1
- package/dist/advanced/proof-run-core.d.ts +1 -1
- package/dist/advanced/proof-run-core.js +5 -1
- package/dist/advanced/proof-run-engine.cjs +20 -2
- package/dist/advanced/proof-run-engine.d.cts +2 -2
- package/dist/advanced/proof-run-engine.d.ts +2 -2
- package/dist/advanced/proof-run-engine.js +2 -2
- package/dist/advanced/runner.js +5 -5
- package/dist/checkpoint.cjs +41 -11
- package/dist/checkpoint.d.cts +2 -1
- package/dist/checkpoint.d.ts +2 -1
- package/dist/checkpoint.js +3 -1
- package/dist/{chunk-AWM2BKDF.js → chunk-2ALMXMFZ.js} +3 -2
- package/dist/{chunk-AXWJJ2LC.js → chunk-BLM5EIBA.js} +40 -11
- package/dist/{chunk-X7SQTCIQ.js → chunk-EKZXU6MU.js} +24 -2
- package/dist/{chunk-RBAU2M4S.js → chunk-JJ4IWRMJ.js} +1 -1
- package/dist/{chunk-OYWZGDTS.js → chunk-LNWJAHAQ.js} +1 -1
- package/dist/{chunk-DFQBQGSD.js → chunk-S5DX7Z6X.js} +2 -2
- package/dist/{chunk-IOI6QR3B.js → chunk-VYJD6XYF.js} +1 -1
- package/dist/{chunk-M3IE3VNC.js → chunk-WDIKPIMB.js} +1 -1
- package/dist/{chunk-ZHTJEZH5.js → chunk-ZLBOGPUL.js} +27 -17
- package/dist/cli/index.js +6 -6
- package/dist/cli.cjs +81 -26
- package/dist/cli.js +6 -6
- package/dist/engine-harness.cjs +79 -26
- package/dist/engine-harness.js +5 -5
- package/dist/index.cjs +82 -26
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -6
- package/dist/openclaw.js +4 -4
- package/dist/{proof-run-core-B1GeqkR8.d.ts → proof-run-core-7Dqm7RKM.d.cts} +6 -2
- package/dist/{proof-run-core-B1GeqkR8.d.cts → proof-run-core-7Dqm7RKM.d.ts} +6 -2
- package/dist/proof-run-core.cjs +24 -2
- package/dist/proof-run-core.d.cts +1 -1
- package/dist/proof-run-core.d.ts +1 -1
- package/dist/proof-run-core.js +5 -1
- package/dist/{proof-run-engine-BqaeqAze.d.ts → proof-run-engine-BqRoA3Do.d.ts} +1 -1
- package/dist/{proof-run-engine-4dM37pEx.d.cts → proof-run-engine-DpChFR5H.d.cts} +1 -1
- package/dist/proof-run-engine.cjs +20 -2
- package/dist/proof-run-engine.d.cts +2 -2
- package/dist/proof-run-engine.d.ts +2 -2
- package/dist/proof-run-engine.js +2 -2
- package/dist/run-card.js +2 -2
- package/dist/runner.js +5 -5
- package/dist/spec/checkpoint.cjs +41 -11
- package/dist/spec/checkpoint.d.cts +1 -1
- package/dist/spec/checkpoint.d.ts +1 -1
- package/dist/spec/checkpoint.js +3 -1
- package/dist/spec/index.cjs +41 -11
- package/dist/spec/index.d.cts +1 -1
- package/dist/spec/index.d.ts +1 -1
- package/dist/spec/index.js +5 -3
- package/dist/spec/run-card.js +2 -2
- package/dist/spec/state.js +3 -3
- package/dist/state.js +3 -3
- package/dist/types.d.cts +5 -0
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/advanced/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
proof_run_engine_exports
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-VYJD6XYF.js";
|
|
4
4
|
import {
|
|
5
5
|
runner_exports
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-S5DX7Z6X.js";
|
|
7
7
|
import {
|
|
8
8
|
engine_harness_exports
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-ZLBOGPUL.js";
|
|
10
|
+
import "../chunk-WDIKPIMB.js";
|
|
11
|
+
import "../chunk-JJ4IWRMJ.js";
|
|
12
12
|
import {
|
|
13
13
|
proof_run_core_exports
|
|
14
|
-
} from "../chunk-
|
|
15
|
-
import "../chunk-
|
|
14
|
+
} from "../chunk-EKZXU6MU.js";
|
|
15
|
+
import "../chunk-BLM5EIBA.js";
|
|
16
16
|
import "../chunk-VY4Y5U57.js";
|
|
17
17
|
import "../chunk-MLKGABMK.js";
|
|
18
18
|
export {
|
|
@@ -36,6 +36,7 @@ __export(proof_run_core_exports, {
|
|
|
36
36
|
WORKFLOW_STAGE_ORDER: () => WORKFLOW_STAGE_ORDER,
|
|
37
37
|
buildCheckpointContract: () => buildCheckpointContract,
|
|
38
38
|
buildSetupArgs: () => buildSetupArgs,
|
|
39
|
+
canonicalProofAssessmentStageForDecision: () => canonicalProofAssessmentStageForDecision,
|
|
39
40
|
checkpointContinueStage: () => checkpointContinueStage,
|
|
40
41
|
clearStageDecisionRequest: () => clearStageDecisionRequest,
|
|
41
42
|
ensureAction: () => ensureAction,
|
|
@@ -43,6 +44,7 @@ __export(proof_run_core_exports, {
|
|
|
43
44
|
invalidateVerifyEvidence: () => invalidateVerifyEvidence,
|
|
44
45
|
mergeStateFromParams: () => mergeStateFromParams,
|
|
45
46
|
noImplementationModeFor: () => noImplementationModeFor,
|
|
47
|
+
normalizeProofAssessmentStageFields: () => normalizeProofAssessmentStageFields,
|
|
46
48
|
previewModeFromWorkflowMode: () => previewModeFromWorkflowMode,
|
|
47
49
|
proofAssessmentHardBlockersForState: () => proofAssessmentHardBlockersForState,
|
|
48
50
|
readState: () => readState,
|
|
@@ -68,6 +70,24 @@ var import_node_path = __toESM(require("path"), 1);
|
|
|
68
70
|
var import_node_url = require("url");
|
|
69
71
|
var import_meta = {};
|
|
70
72
|
var WORKFLOW_STAGE_ORDER = ["setup", "recon", "author", "implement", "verify", "ship"];
|
|
73
|
+
function canonicalProofAssessmentStageForDecision(decision) {
|
|
74
|
+
const normalized = typeof decision === "string" ? decision.trim() : "";
|
|
75
|
+
if (normalized === "ready_to_ship") return "ship";
|
|
76
|
+
if (normalized === "needs_richer_proof") return "author";
|
|
77
|
+
if (normalized === "revise_capture") return "verify";
|
|
78
|
+
if (normalized === "needs_recon") return "recon";
|
|
79
|
+
if (normalized === "needs_implementation") return "implement";
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
function normalizeProofAssessmentStageFields(assessment) {
|
|
83
|
+
const canonicalStage = canonicalProofAssessmentStageForDecision(assessment.decision);
|
|
84
|
+
if (!canonicalStage) return assessment;
|
|
85
|
+
return {
|
|
86
|
+
...assessment,
|
|
87
|
+
recommended_stage: canonicalStage,
|
|
88
|
+
continue_with_stage: canonicalStage
|
|
89
|
+
};
|
|
90
|
+
}
|
|
71
91
|
function normalizedMode(value) {
|
|
72
92
|
return typeof value === "string" ? value.trim().toLowerCase() : "";
|
|
73
93
|
}
|
|
@@ -1094,10 +1114,10 @@ function mergeStateFromParams(statePath, params) {
|
|
|
1094
1114
|
state.proof_assessment_source = null;
|
|
1095
1115
|
} else {
|
|
1096
1116
|
const parsed = JSON.parse(raw);
|
|
1097
|
-
const assessment = {
|
|
1117
|
+
const assessment = normalizeProofAssessmentStageFields({
|
|
1098
1118
|
...parsed,
|
|
1099
1119
|
source: (parsed?.source || "supervising_agent").toString()
|
|
1100
|
-
};
|
|
1120
|
+
});
|
|
1101
1121
|
const readyBlocker = assessment?.decision === "ready_to_ship" ? visualDeltaShipGateReason({ ...state, proof_assessment: assessment, proof_assessment_source: assessment.source }) : null;
|
|
1102
1122
|
if (readyBlocker) {
|
|
1103
1123
|
assessment.blocked_decision = assessment.decision;
|
|
@@ -1267,6 +1287,7 @@ function summarizeState(state) {
|
|
|
1267
1287
|
WORKFLOW_STAGE_ORDER,
|
|
1268
1288
|
buildCheckpointContract,
|
|
1269
1289
|
buildSetupArgs,
|
|
1290
|
+
canonicalProofAssessmentStageForDecision,
|
|
1270
1291
|
checkpointContinueStage,
|
|
1271
1292
|
clearStageDecisionRequest,
|
|
1272
1293
|
ensureAction,
|
|
@@ -1274,6 +1295,7 @@ function summarizeState(state) {
|
|
|
1274
1295
|
invalidateVerifyEvidence,
|
|
1275
1296
|
mergeStateFromParams,
|
|
1276
1297
|
noImplementationModeFor,
|
|
1298
|
+
normalizeProofAssessmentStageFields,
|
|
1277
1299
|
previewModeFromWorkflowMode,
|
|
1278
1300
|
proofAssessmentHardBlockersForState,
|
|
1279
1301
|
readState,
|
|
@@ -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
|
|
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 canonicalProofAssessmentStageForDecision, h as checkpointContinueStage, i as clearStageDecisionRequest, j as ensureAction, k as ensureStageLoopState, l as invalidateVerifyEvidence, m as mergeStateFromParams, n as noImplementationModeFor, o as normalizeProofAssessmentStageFields, q as previewModeFromWorkflowMode, s as proofAssessmentHardBlockersForState, t as readState, u as recordStageAttempt, v as requiredBaselineLabelsForState, r as resolveConfig, w as resolveRiddleProofDir, x as setStageDecisionRequest, y as summarizeState, z as validateShipGate, A as visualDeltaForState, D as visualDeltaRequiredForState, E as visualDeltaShipGateReason, F as workflowFile, G as writeState } from '../proof-run-core-7Dqm7RKM.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
|
|
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 canonicalProofAssessmentStageForDecision, h as checkpointContinueStage, i as clearStageDecisionRequest, j as ensureAction, k as ensureStageLoopState, l as invalidateVerifyEvidence, m as mergeStateFromParams, n as noImplementationModeFor, o as normalizeProofAssessmentStageFields, q as previewModeFromWorkflowMode, s as proofAssessmentHardBlockersForState, t as readState, u as recordStageAttempt, v as requiredBaselineLabelsForState, r as resolveConfig, w as resolveRiddleProofDir, x as setStageDecisionRequest, y as summarizeState, z as validateShipGate, A as visualDeltaForState, D as visualDeltaRequiredForState, E as visualDeltaShipGateReason, F as workflowFile, G as writeState } from '../proof-run-core-7Dqm7RKM.js';
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
WORKFLOW_STAGE_ORDER,
|
|
6
6
|
buildCheckpointContract,
|
|
7
7
|
buildSetupArgs,
|
|
8
|
+
canonicalProofAssessmentStageForDecision,
|
|
8
9
|
checkpointContinueStage,
|
|
9
10
|
clearStageDecisionRequest,
|
|
10
11
|
ensureAction,
|
|
@@ -12,6 +13,7 @@ import {
|
|
|
12
13
|
invalidateVerifyEvidence,
|
|
13
14
|
mergeStateFromParams,
|
|
14
15
|
noImplementationModeFor,
|
|
16
|
+
normalizeProofAssessmentStageFields,
|
|
15
17
|
previewModeFromWorkflowMode,
|
|
16
18
|
proofAssessmentHardBlockersForState,
|
|
17
19
|
readState,
|
|
@@ -27,7 +29,7 @@ import {
|
|
|
27
29
|
visualDeltaShipGateReason,
|
|
28
30
|
workflowFile,
|
|
29
31
|
writeState
|
|
30
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-EKZXU6MU.js";
|
|
31
33
|
import "../chunk-MLKGABMK.js";
|
|
32
34
|
export {
|
|
33
35
|
BUNDLED_RIDDLE_PROOF_DIR,
|
|
@@ -36,6 +38,7 @@ export {
|
|
|
36
38
|
WORKFLOW_STAGE_ORDER,
|
|
37
39
|
buildCheckpointContract,
|
|
38
40
|
buildSetupArgs,
|
|
41
|
+
canonicalProofAssessmentStageForDecision,
|
|
39
42
|
checkpointContinueStage,
|
|
40
43
|
clearStageDecisionRequest,
|
|
41
44
|
ensureAction,
|
|
@@ -43,6 +46,7 @@ export {
|
|
|
43
46
|
invalidateVerifyEvidence,
|
|
44
47
|
mergeStateFromParams,
|
|
45
48
|
noImplementationModeFor,
|
|
49
|
+
normalizeProofAssessmentStageFields,
|
|
46
50
|
previewModeFromWorkflowMode,
|
|
47
51
|
proofAssessmentHardBlockersForState,
|
|
48
52
|
readState,
|
|
@@ -47,6 +47,24 @@ var import_node_path = __toESM(require("path"), 1);
|
|
|
47
47
|
var import_node_url = require("url");
|
|
48
48
|
var import_meta = {};
|
|
49
49
|
var WORKFLOW_STAGE_ORDER = ["setup", "recon", "author", "implement", "verify", "ship"];
|
|
50
|
+
function canonicalProofAssessmentStageForDecision(decision) {
|
|
51
|
+
const normalized = typeof decision === "string" ? decision.trim() : "";
|
|
52
|
+
if (normalized === "ready_to_ship") return "ship";
|
|
53
|
+
if (normalized === "needs_richer_proof") return "author";
|
|
54
|
+
if (normalized === "revise_capture") return "verify";
|
|
55
|
+
if (normalized === "needs_recon") return "recon";
|
|
56
|
+
if (normalized === "needs_implementation") return "implement";
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
function normalizeProofAssessmentStageFields(assessment) {
|
|
60
|
+
const canonicalStage = canonicalProofAssessmentStageForDecision(assessment.decision);
|
|
61
|
+
if (!canonicalStage) return assessment;
|
|
62
|
+
return {
|
|
63
|
+
...assessment,
|
|
64
|
+
recommended_stage: canonicalStage,
|
|
65
|
+
continue_with_stage: canonicalStage
|
|
66
|
+
};
|
|
67
|
+
}
|
|
50
68
|
function normalizedMode(value) {
|
|
51
69
|
return typeof value === "string" ? value.trim().toLowerCase() : "";
|
|
52
70
|
}
|
|
@@ -1073,10 +1091,10 @@ function mergeStateFromParams(statePath, params) {
|
|
|
1073
1091
|
state.proof_assessment_source = null;
|
|
1074
1092
|
} else {
|
|
1075
1093
|
const parsed = JSON.parse(raw);
|
|
1076
|
-
const assessment = {
|
|
1094
|
+
const assessment = normalizeProofAssessmentStageFields({
|
|
1077
1095
|
...parsed,
|
|
1078
1096
|
source: (parsed?.source || "supervising_agent").toString()
|
|
1079
|
-
};
|
|
1097
|
+
});
|
|
1080
1098
|
const readyBlocker = assessment?.decision === "ready_to_ship" ? visualDeltaShipGateReason({ ...state, proof_assessment: assessment, proof_assessment_source: assessment.source }) : null;
|
|
1081
1099
|
if (readyBlocker) {
|
|
1082
1100
|
assessment.blocked_decision = assessment.decision;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-
|
|
2
|
-
import '../proof-run-core-
|
|
1
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-DpChFR5H.cjs';
|
|
2
|
+
import '../proof-run-core-7Dqm7RKM.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-
|
|
2
|
-
import '../proof-run-core-
|
|
1
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-BqRoA3Do.js';
|
|
2
|
+
import '../proof-run-core-7Dqm7RKM.js';
|
package/dist/advanced/runner.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runRiddleProof
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-S5DX7Z6X.js";
|
|
4
|
+
import "../chunk-WDIKPIMB.js";
|
|
5
|
+
import "../chunk-JJ4IWRMJ.js";
|
|
6
|
+
import "../chunk-EKZXU6MU.js";
|
|
7
|
+
import "../chunk-BLM5EIBA.js";
|
|
8
8
|
import "../chunk-VY4Y5U57.js";
|
|
9
9
|
import "../chunk-MLKGABMK.js";
|
|
10
10
|
export {
|
package/dist/checkpoint.cjs
CHANGED
|
@@ -37,6 +37,7 @@ __export(checkpoint_exports, {
|
|
|
37
37
|
buildCheckpointPacketForEngineResult: () => buildCheckpointPacketForEngineResult,
|
|
38
38
|
buildProofAssessmentCheckpointPacket: () => buildProofAssessmentCheckpointPacket,
|
|
39
39
|
buildStageCheckpointPacket: () => buildStageCheckpointPacket,
|
|
40
|
+
checkpointPacketIdentity: () => checkpointPacketIdentity,
|
|
40
41
|
checkpointResponseIdentity: () => checkpointResponseIdentity,
|
|
41
42
|
checkpointSummaryFromState: () => checkpointSummaryFromState,
|
|
42
43
|
createCheckpointResponseTemplate: () => createCheckpointResponseTemplate,
|
|
@@ -105,12 +106,13 @@ function statePathsForRunState(state, engineStatePath) {
|
|
|
105
106
|
function responseSchemaForAuthorPacket() {
|
|
106
107
|
return {
|
|
107
108
|
type: "object",
|
|
108
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "payload", "created_at"],
|
|
109
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "payload", "created_at"],
|
|
109
110
|
additionalProperties: false,
|
|
110
111
|
properties: {
|
|
111
112
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
112
113
|
run_id: { type: "string" },
|
|
113
114
|
checkpoint: { type: "string" },
|
|
115
|
+
packet_id: { type: "string" },
|
|
114
116
|
resume_token: { type: "string" },
|
|
115
117
|
decision: {
|
|
116
118
|
type: "string",
|
|
@@ -138,12 +140,13 @@ function responseSchemaForAuthorPacket() {
|
|
|
138
140
|
function responseSchemaForProofAssessmentPacket() {
|
|
139
141
|
return {
|
|
140
142
|
type: "object",
|
|
141
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
143
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
142
144
|
additionalProperties: false,
|
|
143
145
|
properties: {
|
|
144
146
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
145
147
|
run_id: { type: "string" },
|
|
146
148
|
checkpoint: { type: "string" },
|
|
149
|
+
packet_id: { type: "string" },
|
|
147
150
|
resume_token: { type: "string" },
|
|
148
151
|
decision: {
|
|
149
152
|
type: "string",
|
|
@@ -179,12 +182,13 @@ function responseSchemaForProofAssessmentPacket() {
|
|
|
179
182
|
function responseSchemaForReconPacket() {
|
|
180
183
|
return {
|
|
181
184
|
type: "object",
|
|
182
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
185
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
183
186
|
additionalProperties: false,
|
|
184
187
|
properties: {
|
|
185
188
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
186
189
|
run_id: { type: "string" },
|
|
187
190
|
checkpoint: { type: "string" },
|
|
191
|
+
packet_id: { type: "string" },
|
|
188
192
|
resume_token: { type: "string" },
|
|
189
193
|
decision: {
|
|
190
194
|
type: "string",
|
|
@@ -212,12 +216,13 @@ function responseSchemaForReconPacket() {
|
|
|
212
216
|
function responseSchemaForImplementationPacket() {
|
|
213
217
|
return {
|
|
214
218
|
type: "object",
|
|
215
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
219
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
216
220
|
additionalProperties: false,
|
|
217
221
|
properties: {
|
|
218
222
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
219
223
|
run_id: { type: "string" },
|
|
220
224
|
checkpoint: { type: "string" },
|
|
225
|
+
packet_id: { type: "string" },
|
|
221
226
|
resume_token: { type: "string" },
|
|
222
227
|
decision: {
|
|
223
228
|
type: "string",
|
|
@@ -245,12 +250,13 @@ function responseSchemaForImplementationPacket() {
|
|
|
245
250
|
function responseSchemaForAdvancePacket(stage) {
|
|
246
251
|
return {
|
|
247
252
|
type: "object",
|
|
248
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
253
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
249
254
|
additionalProperties: false,
|
|
250
255
|
properties: {
|
|
251
256
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
252
257
|
run_id: { type: "string" },
|
|
253
258
|
checkpoint: { type: "string" },
|
|
259
|
+
packet_id: { type: "string" },
|
|
254
260
|
resume_token: { type: "string" },
|
|
255
261
|
decision: {
|
|
256
262
|
type: "string",
|
|
@@ -276,6 +282,20 @@ function resumeTokenFor(input) {
|
|
|
276
282
|
const hash = import_node_crypto.default.createHash("sha256").update(JSON.stringify(input)).digest("hex").slice(0, 24);
|
|
277
283
|
return `rpchk_${hash}`;
|
|
278
284
|
}
|
|
285
|
+
function packetIdentityPayload(packet) {
|
|
286
|
+
const { packet_id: _packetId, ...identityPayload } = packet;
|
|
287
|
+
return identityPayload;
|
|
288
|
+
}
|
|
289
|
+
function checkpointPacketIdentity(packet) {
|
|
290
|
+
const hash = import_node_crypto.default.createHash("sha256").update(stableJson(packetIdentityPayload(packet))).digest("hex").slice(0, 24);
|
|
291
|
+
return `rppkt_${hash}`;
|
|
292
|
+
}
|
|
293
|
+
function withPacketIdentity(packet) {
|
|
294
|
+
return {
|
|
295
|
+
...packet,
|
|
296
|
+
packet_id: checkpointPacketIdentity(packet)
|
|
297
|
+
};
|
|
298
|
+
}
|
|
279
299
|
function artifactsFromState(state) {
|
|
280
300
|
const artifacts = [];
|
|
281
301
|
for (const role of ["before", "prod", "after"]) {
|
|
@@ -348,7 +368,7 @@ function buildStageCheckpointPacket(input) {
|
|
|
348
368
|
const checkpointContract = recordValue(input.engineResult.checkpointContract);
|
|
349
369
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.stage_summary) || `${stage} checkpoint needs a supervising decision.`;
|
|
350
370
|
const kind = packetKindForStage(stage, checkpoint);
|
|
351
|
-
return {
|
|
371
|
+
return withPacketIdentity({
|
|
352
372
|
version: RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
353
373
|
run_id: runId,
|
|
354
374
|
state_path: input.runState.state_path,
|
|
@@ -397,7 +417,7 @@ function buildStageCheckpointPacket(input) {
|
|
|
397
417
|
stage
|
|
398
418
|
}),
|
|
399
419
|
created_at: input.created_at || timestamp()
|
|
400
|
-
};
|
|
420
|
+
});
|
|
401
421
|
}
|
|
402
422
|
function buildAuthorCheckpointPacket(input) {
|
|
403
423
|
const checkpoint = nonEmptyString(input.engineResult.checkpoint) || "author_supervisor_judgment";
|
|
@@ -410,7 +430,7 @@ function buildAuthorCheckpointPacket(input) {
|
|
|
410
430
|
const reconResults = recordValue(fullState.recon_results);
|
|
411
431
|
const checkpointContract = recordValue(input.engineResult.checkpointContract);
|
|
412
432
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.author_summary) || "Author checkpoint needs a supervising proof packet.";
|
|
413
|
-
return {
|
|
433
|
+
return withPacketIdentity({
|
|
414
434
|
version: RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
415
435
|
run_id: runId,
|
|
416
436
|
state_path: input.runState.state_path,
|
|
@@ -459,7 +479,7 @@ function buildAuthorCheckpointPacket(input) {
|
|
|
459
479
|
stage
|
|
460
480
|
}),
|
|
461
481
|
created_at: input.created_at || timestamp()
|
|
462
|
-
};
|
|
482
|
+
});
|
|
463
483
|
}
|
|
464
484
|
function visualDeltaFromState(fullState) {
|
|
465
485
|
const bundle = recordValue(fullState.evidence_bundle);
|
|
@@ -530,7 +550,7 @@ function buildProofAssessmentCheckpointPacket(input) {
|
|
|
530
550
|
const evidenceIssueCode = visualDeltaIssueCode(visualDelta, visualDeltaRequired);
|
|
531
551
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.verify_summary) || "Verify captured evidence and needs a supervising proof assessment.";
|
|
532
552
|
const recoveryHint = evidenceIssueCode ? "Required visual_delta evidence is incomplete. Keep this same run in verify/evidence recovery with decision=revise_capture and continue_with_stage=verify unless the evidence proves an implementation or recon problem." : "Assess whether the current artifacts prove the requested change, then choose the next stage.";
|
|
533
|
-
return {
|
|
553
|
+
return withPacketIdentity({
|
|
534
554
|
version: RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
535
555
|
run_id: runId,
|
|
536
556
|
state_path: input.runState.state_path,
|
|
@@ -590,7 +610,7 @@ function buildProofAssessmentCheckpointPacket(input) {
|
|
|
590
610
|
stage
|
|
591
611
|
}),
|
|
592
612
|
created_at: input.created_at || timestamp()
|
|
593
|
-
};
|
|
613
|
+
});
|
|
594
614
|
}
|
|
595
615
|
function buildCheckpointPacketForEngineResult(input) {
|
|
596
616
|
const checkpoint = nonEmptyString(input.engineResult.checkpoint) || "";
|
|
@@ -619,6 +639,7 @@ function normalizeCheckpointResponse(value) {
|
|
|
619
639
|
version: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
|
|
620
640
|
run_id: runId,
|
|
621
641
|
checkpoint,
|
|
642
|
+
packet_id: nonEmptyString(record.packet_id),
|
|
622
643
|
resume_token: nonEmptyString(record.resume_token),
|
|
623
644
|
decision,
|
|
624
645
|
summary,
|
|
@@ -706,6 +727,7 @@ function createCheckpointResponseTemplate(packet, input = {}) {
|
|
|
706
727
|
version: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
|
|
707
728
|
run_id: packet.run_id,
|
|
708
729
|
checkpoint: packet.checkpoint,
|
|
730
|
+
packet_id: packet.packet_id,
|
|
709
731
|
resume_token: packet.resume_token,
|
|
710
732
|
decision,
|
|
711
733
|
summary: input.summary || `TODO: explain checkpoint decision ${decision}.`,
|
|
@@ -739,6 +761,9 @@ function checkpointSummaryFromState(state, engineStatePath) {
|
|
|
739
761
|
const latestResponseEntry = [...responses].reverse().find((entry) => entry.response);
|
|
740
762
|
const latestPacket = state.checkpoint_packet || latestPacketEntry?.packet;
|
|
741
763
|
const latestResponse = latestResponseEntry?.response;
|
|
764
|
+
const latestPacketId = latestPacket?.packet_id || null;
|
|
765
|
+
const latestResponsePacketId = latestResponse?.packet_id || null;
|
|
766
|
+
const packetIdMatches = !latestResponse ? null : latestPacketId && latestResponsePacketId ? latestPacketId === latestResponsePacketId : latestPacketId || latestResponsePacketId ? false : null;
|
|
742
767
|
const latestResumeToken = latestPacket?.resume_token || null;
|
|
743
768
|
const latestResponseToken = latestResponse?.resume_token || null;
|
|
744
769
|
const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
|
|
@@ -753,6 +778,9 @@ function checkpointSummaryFromState(state, engineStatePath) {
|
|
|
753
778
|
latest_decision: latestResponse?.decision || null,
|
|
754
779
|
latest_packet_summary: latestPacket?.summary || null,
|
|
755
780
|
latest_response_summary: latestResponse?.summary || null,
|
|
781
|
+
latest_packet_id: latestPacketId,
|
|
782
|
+
latest_response_packet_id: latestResponsePacketId,
|
|
783
|
+
packet_id_matches: packetIdMatches,
|
|
756
784
|
latest_resume_token: latestResumeToken,
|
|
757
785
|
latest_response_token: latestResponseToken,
|
|
758
786
|
token_matches: tokenMatches,
|
|
@@ -769,6 +797,7 @@ function checkpointResponseIdentity(response) {
|
|
|
769
797
|
const logicalResponse = compactRecord({
|
|
770
798
|
run_id: response.run_id,
|
|
771
799
|
checkpoint: response.checkpoint,
|
|
800
|
+
packet_id: response.packet_id,
|
|
772
801
|
resume_token: response.resume_token,
|
|
773
802
|
decision: response.decision,
|
|
774
803
|
summary: response.summary,
|
|
@@ -830,6 +859,7 @@ function proofContractFromAuthorCheckpointResponse(response, packet, payload) {
|
|
|
830
859
|
buildCheckpointPacketForEngineResult,
|
|
831
860
|
buildProofAssessmentCheckpointPacket,
|
|
832
861
|
buildStageCheckpointPacket,
|
|
862
|
+
checkpointPacketIdentity,
|
|
833
863
|
checkpointResponseIdentity,
|
|
834
864
|
checkpointSummaryFromState,
|
|
835
865
|
createCheckpointResponseTemplate,
|
package/dist/checkpoint.d.cts
CHANGED
|
@@ -3,6 +3,7 @@ import { RiddleProofCheckpointResponse, RiddleProofRunParams, RiddleProofRunStat
|
|
|
3
3
|
declare const RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION: "riddle-proof.checkpoint.v1";
|
|
4
4
|
declare const RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION: "riddle-proof.checkpoint_response.v1";
|
|
5
5
|
declare function statePathsForRunState(state: RiddleProofRunState, engineStatePath?: string | null): RiddleProofStatePaths;
|
|
6
|
+
declare function checkpointPacketIdentity(packet: RiddleProofCheckpointPacket): string;
|
|
6
7
|
declare function buildStageCheckpointPacket(input: {
|
|
7
8
|
request: RiddleProofRunParams;
|
|
8
9
|
runState: RiddleProofRunState;
|
|
@@ -76,4 +77,4 @@ declare function checkpointResponseIdentity(response: RiddleProofCheckpointRespo
|
|
|
76
77
|
declare function authorPacketPayloadFromCheckpointResponse(response: RiddleProofCheckpointResponse): Record<string, unknown> | null;
|
|
77
78
|
declare function proofContractFromAuthorCheckpointResponse(response: RiddleProofCheckpointResponse, packet: RiddleProofCheckpointPacket, payload: Record<string, unknown>): RiddleProofProofContract;
|
|
78
79
|
|
|
79
|
-
export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION, authorPacketPayloadFromCheckpointResponse, buildAuthorCheckpointPacket, buildCheckpointPacketForEngineResult, buildProofAssessmentCheckpointPacket, buildStageCheckpointPacket, checkpointResponseIdentity, checkpointSummaryFromState, createCheckpointResponseTemplate, isDuplicateCheckpointResponse, normalizeCheckpointResponse, proofContractFromAuthorCheckpointResponse, statePathsForRunState };
|
|
80
|
+
export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION, authorPacketPayloadFromCheckpointResponse, buildAuthorCheckpointPacket, buildCheckpointPacketForEngineResult, buildProofAssessmentCheckpointPacket, buildStageCheckpointPacket, checkpointPacketIdentity, checkpointResponseIdentity, checkpointSummaryFromState, createCheckpointResponseTemplate, isDuplicateCheckpointResponse, normalizeCheckpointResponse, proofContractFromAuthorCheckpointResponse, statePathsForRunState };
|
package/dist/checkpoint.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { RiddleProofCheckpointResponse, RiddleProofRunParams, RiddleProofRunStat
|
|
|
3
3
|
declare const RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION: "riddle-proof.checkpoint.v1";
|
|
4
4
|
declare const RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION: "riddle-proof.checkpoint_response.v1";
|
|
5
5
|
declare function statePathsForRunState(state: RiddleProofRunState, engineStatePath?: string | null): RiddleProofStatePaths;
|
|
6
|
+
declare function checkpointPacketIdentity(packet: RiddleProofCheckpointPacket): string;
|
|
6
7
|
declare function buildStageCheckpointPacket(input: {
|
|
7
8
|
request: RiddleProofRunParams;
|
|
8
9
|
runState: RiddleProofRunState;
|
|
@@ -76,4 +77,4 @@ declare function checkpointResponseIdentity(response: RiddleProofCheckpointRespo
|
|
|
76
77
|
declare function authorPacketPayloadFromCheckpointResponse(response: RiddleProofCheckpointResponse): Record<string, unknown> | null;
|
|
77
78
|
declare function proofContractFromAuthorCheckpointResponse(response: RiddleProofCheckpointResponse, packet: RiddleProofCheckpointPacket, payload: Record<string, unknown>): RiddleProofProofContract;
|
|
78
79
|
|
|
79
|
-
export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION, authorPacketPayloadFromCheckpointResponse, buildAuthorCheckpointPacket, buildCheckpointPacketForEngineResult, buildProofAssessmentCheckpointPacket, buildStageCheckpointPacket, checkpointResponseIdentity, checkpointSummaryFromState, createCheckpointResponseTemplate, isDuplicateCheckpointResponse, normalizeCheckpointResponse, proofContractFromAuthorCheckpointResponse, statePathsForRunState };
|
|
80
|
+
export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION, authorPacketPayloadFromCheckpointResponse, buildAuthorCheckpointPacket, buildCheckpointPacketForEngineResult, buildProofAssessmentCheckpointPacket, buildStageCheckpointPacket, checkpointPacketIdentity, checkpointResponseIdentity, checkpointSummaryFromState, createCheckpointResponseTemplate, isDuplicateCheckpointResponse, normalizeCheckpointResponse, proofContractFromAuthorCheckpointResponse, statePathsForRunState };
|
package/dist/checkpoint.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
buildCheckpointPacketForEngineResult,
|
|
7
7
|
buildProofAssessmentCheckpointPacket,
|
|
8
8
|
buildStageCheckpointPacket,
|
|
9
|
+
checkpointPacketIdentity,
|
|
9
10
|
checkpointResponseIdentity,
|
|
10
11
|
checkpointSummaryFromState,
|
|
11
12
|
createCheckpointResponseTemplate,
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
normalizeCheckpointResponse,
|
|
14
15
|
proofContractFromAuthorCheckpointResponse,
|
|
15
16
|
statePathsForRunState
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-BLM5EIBA.js";
|
|
17
18
|
import "./chunk-VY4Y5U57.js";
|
|
18
19
|
import "./chunk-MLKGABMK.js";
|
|
19
20
|
export {
|
|
@@ -24,6 +25,7 @@ export {
|
|
|
24
25
|
buildCheckpointPacketForEngineResult,
|
|
25
26
|
buildProofAssessmentCheckpointPacket,
|
|
26
27
|
buildStageCheckpointPacket,
|
|
28
|
+
checkpointPacketIdentity,
|
|
27
29
|
checkpointResponseIdentity,
|
|
28
30
|
checkpointSummaryFromState,
|
|
29
31
|
createCheckpointResponseTemplate,
|
|
@@ -28,10 +28,10 @@ import {
|
|
|
28
28
|
createDisabledRiddleProofAgentAdapter,
|
|
29
29
|
readRiddleProofRunStatus,
|
|
30
30
|
runRiddleProofEngineHarness
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ZLBOGPUL.js";
|
|
32
32
|
import {
|
|
33
33
|
createCheckpointResponseTemplate
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-BLM5EIBA.js";
|
|
35
35
|
import {
|
|
36
36
|
createCodexExecAgentAdapter,
|
|
37
37
|
runCodexExecAgentDoctor
|
|
@@ -1088,6 +1088,7 @@ function formatCheckpointMarkdown(input) {
|
|
|
1088
1088
|
`Status: ${input.status || "awaiting_checkpoint"}`,
|
|
1089
1089
|
`Stage: ${packet.stage}`,
|
|
1090
1090
|
`Checkpoint: ${packet.checkpoint}`,
|
|
1091
|
+
`Packet ID: ${packet.packet_id || "legacy"}`,
|
|
1091
1092
|
`Kind: ${packet.kind}`,
|
|
1092
1093
|
"",
|
|
1093
1094
|
"## Goal",
|