@riddledc/riddle-proof 0.8.52 → 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 +54 -11
- package/dist/advanced/engine-harness.js +4 -4
- package/dist/advanced/index.cjs +54 -11
- package/dist/advanced/index.js +5 -5
- package/dist/advanced/runner.js +4 -4
- 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-FWHJN3QG.js → chunk-2ALMXMFZ.js} +3 -2
- package/dist/{chunk-AXWJJ2LC.js → chunk-BLM5EIBA.js} +40 -11
- package/dist/{chunk-RBAU2M4S.js → chunk-JJ4IWRMJ.js} +1 -1
- package/dist/{chunk-OYWZGDTS.js → chunk-LNWJAHAQ.js} +1 -1
- package/dist/{chunk-2CZORYB7.js → chunk-S5DX7Z6X.js} +1 -1
- package/dist/{chunk-M3IE3VNC.js → chunk-WDIKPIMB.js} +1 -1
- package/dist/{chunk-WURLFN72.js → chunk-ZLBOGPUL.js} +19 -3
- package/dist/cli/index.js +5 -5
- package/dist/cli.cjs +56 -11
- package/dist/cli.js +5 -5
- package/dist/engine-harness.cjs +54 -11
- package/dist/engine-harness.js +4 -4
- package/dist/index.cjs +57 -11
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -5
- package/dist/openclaw.js +4 -4
- package/dist/run-card.js +2 -2
- package/dist/runner.js +4 -4
- 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
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
parseOpenClawAssertions,
|
|
4
4
|
parseOpenClawJsonObjectOrArray,
|
|
5
5
|
toRiddleProofRunParams
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-LNWJAHAQ.js";
|
|
7
|
+
import "../chunk-WDIKPIMB.js";
|
|
8
|
+
import "../chunk-JJ4IWRMJ.js";
|
|
9
|
+
import "../chunk-BLM5EIBA.js";
|
|
10
10
|
import "../chunk-VY4Y5U57.js";
|
|
11
11
|
import "../chunk-MLKGABMK.js";
|
|
12
12
|
export {
|
|
@@ -3682,12 +3682,13 @@ function statePathsForRunState(state, engineStatePath2) {
|
|
|
3682
3682
|
function responseSchemaForAuthorPacket() {
|
|
3683
3683
|
return {
|
|
3684
3684
|
type: "object",
|
|
3685
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "payload", "created_at"],
|
|
3685
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "payload", "created_at"],
|
|
3686
3686
|
additionalProperties: false,
|
|
3687
3687
|
properties: {
|
|
3688
3688
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
3689
3689
|
run_id: { type: "string" },
|
|
3690
3690
|
checkpoint: { type: "string" },
|
|
3691
|
+
packet_id: { type: "string" },
|
|
3691
3692
|
resume_token: { type: "string" },
|
|
3692
3693
|
decision: {
|
|
3693
3694
|
type: "string",
|
|
@@ -3715,12 +3716,13 @@ function responseSchemaForAuthorPacket() {
|
|
|
3715
3716
|
function responseSchemaForProofAssessmentPacket() {
|
|
3716
3717
|
return {
|
|
3717
3718
|
type: "object",
|
|
3718
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
3719
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
3719
3720
|
additionalProperties: false,
|
|
3720
3721
|
properties: {
|
|
3721
3722
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
3722
3723
|
run_id: { type: "string" },
|
|
3723
3724
|
checkpoint: { type: "string" },
|
|
3725
|
+
packet_id: { type: "string" },
|
|
3724
3726
|
resume_token: { type: "string" },
|
|
3725
3727
|
decision: {
|
|
3726
3728
|
type: "string",
|
|
@@ -3756,12 +3758,13 @@ function responseSchemaForProofAssessmentPacket() {
|
|
|
3756
3758
|
function responseSchemaForReconPacket() {
|
|
3757
3759
|
return {
|
|
3758
3760
|
type: "object",
|
|
3759
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
3761
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
3760
3762
|
additionalProperties: false,
|
|
3761
3763
|
properties: {
|
|
3762
3764
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
3763
3765
|
run_id: { type: "string" },
|
|
3764
3766
|
checkpoint: { type: "string" },
|
|
3767
|
+
packet_id: { type: "string" },
|
|
3765
3768
|
resume_token: { type: "string" },
|
|
3766
3769
|
decision: {
|
|
3767
3770
|
type: "string",
|
|
@@ -3789,12 +3792,13 @@ function responseSchemaForReconPacket() {
|
|
|
3789
3792
|
function responseSchemaForImplementationPacket() {
|
|
3790
3793
|
return {
|
|
3791
3794
|
type: "object",
|
|
3792
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
3795
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
3793
3796
|
additionalProperties: false,
|
|
3794
3797
|
properties: {
|
|
3795
3798
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
3796
3799
|
run_id: { type: "string" },
|
|
3797
3800
|
checkpoint: { type: "string" },
|
|
3801
|
+
packet_id: { type: "string" },
|
|
3798
3802
|
resume_token: { type: "string" },
|
|
3799
3803
|
decision: {
|
|
3800
3804
|
type: "string",
|
|
@@ -3822,12 +3826,13 @@ function responseSchemaForImplementationPacket() {
|
|
|
3822
3826
|
function responseSchemaForAdvancePacket(stage) {
|
|
3823
3827
|
return {
|
|
3824
3828
|
type: "object",
|
|
3825
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
3829
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
3826
3830
|
additionalProperties: false,
|
|
3827
3831
|
properties: {
|
|
3828
3832
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
3829
3833
|
run_id: { type: "string" },
|
|
3830
3834
|
checkpoint: { type: "string" },
|
|
3835
|
+
packet_id: { type: "string" },
|
|
3831
3836
|
resume_token: { type: "string" },
|
|
3832
3837
|
decision: {
|
|
3833
3838
|
type: "string",
|
|
@@ -3853,6 +3858,20 @@ function resumeTokenFor(input) {
|
|
|
3853
3858
|
const hash = import_node_crypto.default.createHash("sha256").update(JSON.stringify(input)).digest("hex").slice(0, 24);
|
|
3854
3859
|
return `rpchk_${hash}`;
|
|
3855
3860
|
}
|
|
3861
|
+
function packetIdentityPayload(packet) {
|
|
3862
|
+
const { packet_id: _packetId, ...identityPayload } = packet;
|
|
3863
|
+
return identityPayload;
|
|
3864
|
+
}
|
|
3865
|
+
function checkpointPacketIdentity(packet) {
|
|
3866
|
+
const hash = import_node_crypto.default.createHash("sha256").update(stableJson(packetIdentityPayload(packet))).digest("hex").slice(0, 24);
|
|
3867
|
+
return `rppkt_${hash}`;
|
|
3868
|
+
}
|
|
3869
|
+
function withPacketIdentity(packet) {
|
|
3870
|
+
return {
|
|
3871
|
+
...packet,
|
|
3872
|
+
packet_id: checkpointPacketIdentity(packet)
|
|
3873
|
+
};
|
|
3874
|
+
}
|
|
3856
3875
|
function artifactsFromState(state) {
|
|
3857
3876
|
const artifacts = [];
|
|
3858
3877
|
for (const role of ["before", "prod", "after"]) {
|
|
@@ -3925,7 +3944,7 @@ function buildStageCheckpointPacket(input) {
|
|
|
3925
3944
|
const checkpointContract = recordValue(input.engineResult.checkpointContract);
|
|
3926
3945
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.stage_summary) || `${stage} checkpoint needs a supervising decision.`;
|
|
3927
3946
|
const kind = packetKindForStage(stage, checkpoint);
|
|
3928
|
-
return {
|
|
3947
|
+
return withPacketIdentity({
|
|
3929
3948
|
version: RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
3930
3949
|
run_id: runId,
|
|
3931
3950
|
state_path: input.runState.state_path,
|
|
@@ -3974,7 +3993,7 @@ function buildStageCheckpointPacket(input) {
|
|
|
3974
3993
|
stage
|
|
3975
3994
|
}),
|
|
3976
3995
|
created_at: input.created_at || timestamp()
|
|
3977
|
-
};
|
|
3996
|
+
});
|
|
3978
3997
|
}
|
|
3979
3998
|
function buildAuthorCheckpointPacket(input) {
|
|
3980
3999
|
const checkpoint = nonEmptyString(input.engineResult.checkpoint) || "author_supervisor_judgment";
|
|
@@ -3987,7 +4006,7 @@ function buildAuthorCheckpointPacket(input) {
|
|
|
3987
4006
|
const reconResults = recordValue(fullState.recon_results);
|
|
3988
4007
|
const checkpointContract = recordValue(input.engineResult.checkpointContract);
|
|
3989
4008
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.author_summary) || "Author checkpoint needs a supervising proof packet.";
|
|
3990
|
-
return {
|
|
4009
|
+
return withPacketIdentity({
|
|
3991
4010
|
version: RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
3992
4011
|
run_id: runId,
|
|
3993
4012
|
state_path: input.runState.state_path,
|
|
@@ -4036,7 +4055,7 @@ function buildAuthorCheckpointPacket(input) {
|
|
|
4036
4055
|
stage
|
|
4037
4056
|
}),
|
|
4038
4057
|
created_at: input.created_at || timestamp()
|
|
4039
|
-
};
|
|
4058
|
+
});
|
|
4040
4059
|
}
|
|
4041
4060
|
function visualDeltaFromState(fullState) {
|
|
4042
4061
|
const bundle = recordValue(fullState.evidence_bundle);
|
|
@@ -4107,7 +4126,7 @@ function buildProofAssessmentCheckpointPacket(input) {
|
|
|
4107
4126
|
const evidenceIssueCode2 = visualDeltaIssueCode(visualDelta, visualDeltaRequired);
|
|
4108
4127
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.verify_summary) || "Verify captured evidence and needs a supervising proof assessment.";
|
|
4109
4128
|
const recoveryHint = evidenceIssueCode2 ? "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.";
|
|
4110
|
-
return {
|
|
4129
|
+
return withPacketIdentity({
|
|
4111
4130
|
version: RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
4112
4131
|
run_id: runId,
|
|
4113
4132
|
state_path: input.runState.state_path,
|
|
@@ -4167,7 +4186,7 @@ function buildProofAssessmentCheckpointPacket(input) {
|
|
|
4167
4186
|
stage
|
|
4168
4187
|
}),
|
|
4169
4188
|
created_at: input.created_at || timestamp()
|
|
4170
|
-
};
|
|
4189
|
+
});
|
|
4171
4190
|
}
|
|
4172
4191
|
function buildCheckpointPacketForEngineResult(input) {
|
|
4173
4192
|
const checkpoint = nonEmptyString(input.engineResult.checkpoint) || "";
|
|
@@ -4196,6 +4215,7 @@ function normalizeCheckpointResponse(value) {
|
|
|
4196
4215
|
version: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
|
|
4197
4216
|
run_id: runId,
|
|
4198
4217
|
checkpoint,
|
|
4218
|
+
packet_id: nonEmptyString(record.packet_id),
|
|
4199
4219
|
resume_token: nonEmptyString(record.resume_token),
|
|
4200
4220
|
decision,
|
|
4201
4221
|
summary,
|
|
@@ -4227,6 +4247,9 @@ function checkpointSummaryFromState(state, engineStatePath2) {
|
|
|
4227
4247
|
const latestResponseEntry = [...responses].reverse().find((entry) => entry.response);
|
|
4228
4248
|
const latestPacket = state.checkpoint_packet || latestPacketEntry?.packet;
|
|
4229
4249
|
const latestResponse = latestResponseEntry?.response;
|
|
4250
|
+
const latestPacketId = latestPacket?.packet_id || null;
|
|
4251
|
+
const latestResponsePacketId = latestResponse?.packet_id || null;
|
|
4252
|
+
const packetIdMatches = !latestResponse ? null : latestPacketId && latestResponsePacketId ? latestPacketId === latestResponsePacketId : latestPacketId || latestResponsePacketId ? false : null;
|
|
4230
4253
|
const latestResumeToken = latestPacket?.resume_token || null;
|
|
4231
4254
|
const latestResponseToken = latestResponse?.resume_token || null;
|
|
4232
4255
|
const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
|
|
@@ -4241,6 +4264,9 @@ function checkpointSummaryFromState(state, engineStatePath2) {
|
|
|
4241
4264
|
latest_decision: latestResponse?.decision || null,
|
|
4242
4265
|
latest_packet_summary: latestPacket?.summary || null,
|
|
4243
4266
|
latest_response_summary: latestResponse?.summary || null,
|
|
4267
|
+
latest_packet_id: latestPacketId,
|
|
4268
|
+
latest_response_packet_id: latestResponsePacketId,
|
|
4269
|
+
packet_id_matches: packetIdMatches,
|
|
4244
4270
|
latest_resume_token: latestResumeToken,
|
|
4245
4271
|
latest_response_token: latestResponseToken,
|
|
4246
4272
|
token_matches: tokenMatches,
|
|
@@ -4257,6 +4283,7 @@ function checkpointResponseIdentity(response) {
|
|
|
4257
4283
|
const logicalResponse = compactRecord({
|
|
4258
4284
|
run_id: response.run_id,
|
|
4259
4285
|
checkpoint: response.checkpoint,
|
|
4286
|
+
packet_id: response.packet_id,
|
|
4260
4287
|
resume_token: response.resume_token,
|
|
4261
4288
|
decision: response.decision,
|
|
4262
4289
|
summary: response.summary,
|
|
@@ -5407,6 +5434,22 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5407
5434
|
}
|
|
5408
5435
|
};
|
|
5409
5436
|
}
|
|
5437
|
+
if (packet.packet_id && response.packet_id !== packet.packet_id) {
|
|
5438
|
+
return {
|
|
5439
|
+
blocker: {
|
|
5440
|
+
code: "checkpoint_response_packet_id_mismatch",
|
|
5441
|
+
checkpoint: packet.checkpoint,
|
|
5442
|
+
message: "Checkpoint response packet_id does not match the pending checkpoint packet.",
|
|
5443
|
+
details: {
|
|
5444
|
+
stage: packet.stage,
|
|
5445
|
+
expected_packet_id: packet.packet_id,
|
|
5446
|
+
actual_packet_id: response.packet_id || null,
|
|
5447
|
+
expected_resume_token: packet.resume_token || null,
|
|
5448
|
+
actual_resume_token: response.resume_token || null
|
|
5449
|
+
}
|
|
5450
|
+
}
|
|
5451
|
+
};
|
|
5452
|
+
}
|
|
5410
5453
|
if (!packet.allowed_decisions.includes(response.decision)) {
|
|
5411
5454
|
return {
|
|
5412
5455
|
blocker: {
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
createDisabledRiddleProofAgentAdapter,
|
|
3
3
|
readRiddleProofRunStatus,
|
|
4
4
|
runRiddleProofEngineHarness
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-ZLBOGPUL.js";
|
|
6
|
+
import "../chunk-WDIKPIMB.js";
|
|
7
|
+
import "../chunk-JJ4IWRMJ.js";
|
|
8
8
|
import "../chunk-EKZXU6MU.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-BLM5EIBA.js";
|
|
10
10
|
import "../chunk-VY4Y5U57.js";
|
|
11
11
|
import "../chunk-MLKGABMK.js";
|
|
12
12
|
export {
|
package/dist/advanced/index.cjs
CHANGED
|
@@ -3716,12 +3716,13 @@ function statePathsForRunState(state, engineStatePath2) {
|
|
|
3716
3716
|
function responseSchemaForAuthorPacket() {
|
|
3717
3717
|
return {
|
|
3718
3718
|
type: "object",
|
|
3719
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "payload", "created_at"],
|
|
3719
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "payload", "created_at"],
|
|
3720
3720
|
additionalProperties: false,
|
|
3721
3721
|
properties: {
|
|
3722
3722
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
3723
3723
|
run_id: { type: "string" },
|
|
3724
3724
|
checkpoint: { type: "string" },
|
|
3725
|
+
packet_id: { type: "string" },
|
|
3725
3726
|
resume_token: { type: "string" },
|
|
3726
3727
|
decision: {
|
|
3727
3728
|
type: "string",
|
|
@@ -3749,12 +3750,13 @@ function responseSchemaForAuthorPacket() {
|
|
|
3749
3750
|
function responseSchemaForProofAssessmentPacket() {
|
|
3750
3751
|
return {
|
|
3751
3752
|
type: "object",
|
|
3752
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
3753
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
3753
3754
|
additionalProperties: false,
|
|
3754
3755
|
properties: {
|
|
3755
3756
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
3756
3757
|
run_id: { type: "string" },
|
|
3757
3758
|
checkpoint: { type: "string" },
|
|
3759
|
+
packet_id: { type: "string" },
|
|
3758
3760
|
resume_token: { type: "string" },
|
|
3759
3761
|
decision: {
|
|
3760
3762
|
type: "string",
|
|
@@ -3790,12 +3792,13 @@ function responseSchemaForProofAssessmentPacket() {
|
|
|
3790
3792
|
function responseSchemaForReconPacket() {
|
|
3791
3793
|
return {
|
|
3792
3794
|
type: "object",
|
|
3793
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
3795
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
3794
3796
|
additionalProperties: false,
|
|
3795
3797
|
properties: {
|
|
3796
3798
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
3797
3799
|
run_id: { type: "string" },
|
|
3798
3800
|
checkpoint: { type: "string" },
|
|
3801
|
+
packet_id: { type: "string" },
|
|
3799
3802
|
resume_token: { type: "string" },
|
|
3800
3803
|
decision: {
|
|
3801
3804
|
type: "string",
|
|
@@ -3823,12 +3826,13 @@ function responseSchemaForReconPacket() {
|
|
|
3823
3826
|
function responseSchemaForImplementationPacket() {
|
|
3824
3827
|
return {
|
|
3825
3828
|
type: "object",
|
|
3826
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
3829
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
3827
3830
|
additionalProperties: false,
|
|
3828
3831
|
properties: {
|
|
3829
3832
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
3830
3833
|
run_id: { type: "string" },
|
|
3831
3834
|
checkpoint: { type: "string" },
|
|
3835
|
+
packet_id: { type: "string" },
|
|
3832
3836
|
resume_token: { type: "string" },
|
|
3833
3837
|
decision: {
|
|
3834
3838
|
type: "string",
|
|
@@ -3856,12 +3860,13 @@ function responseSchemaForImplementationPacket() {
|
|
|
3856
3860
|
function responseSchemaForAdvancePacket(stage) {
|
|
3857
3861
|
return {
|
|
3858
3862
|
type: "object",
|
|
3859
|
-
required: ["version", "run_id", "checkpoint", "decision", "summary", "created_at"],
|
|
3863
|
+
required: ["version", "run_id", "checkpoint", "packet_id", "decision", "summary", "created_at"],
|
|
3860
3864
|
additionalProperties: false,
|
|
3861
3865
|
properties: {
|
|
3862
3866
|
version: { const: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION },
|
|
3863
3867
|
run_id: { type: "string" },
|
|
3864
3868
|
checkpoint: { type: "string" },
|
|
3869
|
+
packet_id: { type: "string" },
|
|
3865
3870
|
resume_token: { type: "string" },
|
|
3866
3871
|
decision: {
|
|
3867
3872
|
type: "string",
|
|
@@ -3887,6 +3892,20 @@ function resumeTokenFor(input) {
|
|
|
3887
3892
|
const hash = import_node_crypto.default.createHash("sha256").update(JSON.stringify(input)).digest("hex").slice(0, 24);
|
|
3888
3893
|
return `rpchk_${hash}`;
|
|
3889
3894
|
}
|
|
3895
|
+
function packetIdentityPayload(packet) {
|
|
3896
|
+
const { packet_id: _packetId, ...identityPayload } = packet;
|
|
3897
|
+
return identityPayload;
|
|
3898
|
+
}
|
|
3899
|
+
function checkpointPacketIdentity(packet) {
|
|
3900
|
+
const hash = import_node_crypto.default.createHash("sha256").update(stableJson(packetIdentityPayload(packet))).digest("hex").slice(0, 24);
|
|
3901
|
+
return `rppkt_${hash}`;
|
|
3902
|
+
}
|
|
3903
|
+
function withPacketIdentity(packet) {
|
|
3904
|
+
return {
|
|
3905
|
+
...packet,
|
|
3906
|
+
packet_id: checkpointPacketIdentity(packet)
|
|
3907
|
+
};
|
|
3908
|
+
}
|
|
3890
3909
|
function artifactsFromState(state) {
|
|
3891
3910
|
const artifacts = [];
|
|
3892
3911
|
for (const role of ["before", "prod", "after"]) {
|
|
@@ -3959,7 +3978,7 @@ function buildStageCheckpointPacket(input) {
|
|
|
3959
3978
|
const checkpointContract = recordValue(input.engineResult.checkpointContract);
|
|
3960
3979
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.stage_summary) || `${stage} checkpoint needs a supervising decision.`;
|
|
3961
3980
|
const kind = packetKindForStage(stage, checkpoint);
|
|
3962
|
-
return {
|
|
3981
|
+
return withPacketIdentity({
|
|
3963
3982
|
version: RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
3964
3983
|
run_id: runId,
|
|
3965
3984
|
state_path: input.runState.state_path,
|
|
@@ -4008,7 +4027,7 @@ function buildStageCheckpointPacket(input) {
|
|
|
4008
4027
|
stage
|
|
4009
4028
|
}),
|
|
4010
4029
|
created_at: input.created_at || timestamp()
|
|
4011
|
-
};
|
|
4030
|
+
});
|
|
4012
4031
|
}
|
|
4013
4032
|
function buildAuthorCheckpointPacket(input) {
|
|
4014
4033
|
const checkpoint = nonEmptyString(input.engineResult.checkpoint) || "author_supervisor_judgment";
|
|
@@ -4021,7 +4040,7 @@ function buildAuthorCheckpointPacket(input) {
|
|
|
4021
4040
|
const reconResults = recordValue(fullState.recon_results);
|
|
4022
4041
|
const checkpointContract = recordValue(input.engineResult.checkpointContract);
|
|
4023
4042
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.author_summary) || "Author checkpoint needs a supervising proof packet.";
|
|
4024
|
-
return {
|
|
4043
|
+
return withPacketIdentity({
|
|
4025
4044
|
version: RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
4026
4045
|
run_id: runId,
|
|
4027
4046
|
state_path: input.runState.state_path,
|
|
@@ -4070,7 +4089,7 @@ function buildAuthorCheckpointPacket(input) {
|
|
|
4070
4089
|
stage
|
|
4071
4090
|
}),
|
|
4072
4091
|
created_at: input.created_at || timestamp()
|
|
4073
|
-
};
|
|
4092
|
+
});
|
|
4074
4093
|
}
|
|
4075
4094
|
function visualDeltaFromState(fullState) {
|
|
4076
4095
|
const bundle = recordValue(fullState.evidence_bundle);
|
|
@@ -4141,7 +4160,7 @@ function buildProofAssessmentCheckpointPacket(input) {
|
|
|
4141
4160
|
const evidenceIssueCode2 = visualDeltaIssueCode(visualDelta, visualDeltaRequired);
|
|
4142
4161
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.verify_summary) || "Verify captured evidence and needs a supervising proof assessment.";
|
|
4143
4162
|
const recoveryHint = evidenceIssueCode2 ? "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.";
|
|
4144
|
-
return {
|
|
4163
|
+
return withPacketIdentity({
|
|
4145
4164
|
version: RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
4146
4165
|
run_id: runId,
|
|
4147
4166
|
state_path: input.runState.state_path,
|
|
@@ -4201,7 +4220,7 @@ function buildProofAssessmentCheckpointPacket(input) {
|
|
|
4201
4220
|
stage
|
|
4202
4221
|
}),
|
|
4203
4222
|
created_at: input.created_at || timestamp()
|
|
4204
|
-
};
|
|
4223
|
+
});
|
|
4205
4224
|
}
|
|
4206
4225
|
function buildCheckpointPacketForEngineResult(input) {
|
|
4207
4226
|
const checkpoint = nonEmptyString(input.engineResult.checkpoint) || "";
|
|
@@ -4230,6 +4249,7 @@ function normalizeCheckpointResponse(value) {
|
|
|
4230
4249
|
version: RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
|
|
4231
4250
|
run_id: runId,
|
|
4232
4251
|
checkpoint,
|
|
4252
|
+
packet_id: nonEmptyString(record.packet_id),
|
|
4233
4253
|
resume_token: nonEmptyString(record.resume_token),
|
|
4234
4254
|
decision,
|
|
4235
4255
|
summary,
|
|
@@ -4261,6 +4281,9 @@ function checkpointSummaryFromState(state, engineStatePath2) {
|
|
|
4261
4281
|
const latestResponseEntry = [...responses].reverse().find((entry) => entry.response);
|
|
4262
4282
|
const latestPacket = state.checkpoint_packet || latestPacketEntry?.packet;
|
|
4263
4283
|
const latestResponse = latestResponseEntry?.response;
|
|
4284
|
+
const latestPacketId = latestPacket?.packet_id || null;
|
|
4285
|
+
const latestResponsePacketId = latestResponse?.packet_id || null;
|
|
4286
|
+
const packetIdMatches = !latestResponse ? null : latestPacketId && latestResponsePacketId ? latestPacketId === latestResponsePacketId : latestPacketId || latestResponsePacketId ? false : null;
|
|
4264
4287
|
const latestResumeToken = latestPacket?.resume_token || null;
|
|
4265
4288
|
const latestResponseToken = latestResponse?.resume_token || null;
|
|
4266
4289
|
const tokenMatches = !latestResponse ? null : latestResumeToken && latestResponseToken ? latestResumeToken === latestResponseToken : latestResumeToken || latestResponseToken ? false : null;
|
|
@@ -4275,6 +4298,9 @@ function checkpointSummaryFromState(state, engineStatePath2) {
|
|
|
4275
4298
|
latest_decision: latestResponse?.decision || null,
|
|
4276
4299
|
latest_packet_summary: latestPacket?.summary || null,
|
|
4277
4300
|
latest_response_summary: latestResponse?.summary || null,
|
|
4301
|
+
latest_packet_id: latestPacketId,
|
|
4302
|
+
latest_response_packet_id: latestResponsePacketId,
|
|
4303
|
+
packet_id_matches: packetIdMatches,
|
|
4278
4304
|
latest_resume_token: latestResumeToken,
|
|
4279
4305
|
latest_response_token: latestResponseToken,
|
|
4280
4306
|
token_matches: tokenMatches,
|
|
@@ -4291,6 +4317,7 @@ function checkpointResponseIdentity(response) {
|
|
|
4291
4317
|
const logicalResponse = compactRecord({
|
|
4292
4318
|
run_id: response.run_id,
|
|
4293
4319
|
checkpoint: response.checkpoint,
|
|
4320
|
+
packet_id: response.packet_id,
|
|
4294
4321
|
resume_token: response.resume_token,
|
|
4295
4322
|
decision: response.decision,
|
|
4296
4323
|
summary: response.summary,
|
|
@@ -5946,6 +5973,22 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5946
5973
|
}
|
|
5947
5974
|
};
|
|
5948
5975
|
}
|
|
5976
|
+
if (packet.packet_id && response.packet_id !== packet.packet_id) {
|
|
5977
|
+
return {
|
|
5978
|
+
blocker: {
|
|
5979
|
+
code: "checkpoint_response_packet_id_mismatch",
|
|
5980
|
+
checkpoint: packet.checkpoint,
|
|
5981
|
+
message: "Checkpoint response packet_id does not match the pending checkpoint packet.",
|
|
5982
|
+
details: {
|
|
5983
|
+
stage: packet.stage,
|
|
5984
|
+
expected_packet_id: packet.packet_id,
|
|
5985
|
+
actual_packet_id: response.packet_id || null,
|
|
5986
|
+
expected_resume_token: packet.resume_token || null,
|
|
5987
|
+
actual_resume_token: response.resume_token || null
|
|
5988
|
+
}
|
|
5989
|
+
}
|
|
5990
|
+
};
|
|
5991
|
+
}
|
|
5949
5992
|
if (!packet.allowed_decisions.includes(response.decision)) {
|
|
5950
5993
|
return {
|
|
5951
5994
|
blocker: {
|
package/dist/advanced/index.js
CHANGED
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
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
14
|
} from "../chunk-EKZXU6MU.js";
|
|
15
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-BLM5EIBA.js";
|
|
16
16
|
import "../chunk-VY4Y5U57.js";
|
|
17
17
|
import "../chunk-MLKGABMK.js";
|
|
18
18
|
export {
|
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-
|
|
3
|
+
} from "../chunk-S5DX7Z6X.js";
|
|
4
|
+
import "../chunk-WDIKPIMB.js";
|
|
5
|
+
import "../chunk-JJ4IWRMJ.js";
|
|
6
6
|
import "../chunk-EKZXU6MU.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-BLM5EIBA.js";
|
|
8
8
|
import "../chunk-VY4Y5U57.js";
|
|
9
9
|
import "../chunk-MLKGABMK.js";
|
|
10
10
|
export {
|