@riddledc/riddle-proof 0.8.54 → 0.8.56
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/codex-exec-agent.js +2 -2
- package/dist/adapters/codex.js +2 -2
- package/dist/adapters/local-agent.js +2 -2
- package/dist/adapters/openclaw.js +5 -5
- package/dist/advanced/engine-harness.cjs +129 -22
- package/dist/advanced/engine-harness.js +5 -5
- package/dist/advanced/index.cjs +130 -23
- package/dist/advanced/index.d.cts +1 -1
- package/dist/advanced/index.d.ts +1 -1
- package/dist/advanced/index.js +6 -6
- package/dist/advanced/proof-run-engine.d.cts +1 -1
- package/dist/advanced/proof-run-engine.d.ts +1 -1
- package/dist/advanced/runner.cjs +59 -1
- package/dist/advanced/runner.js +5 -5
- package/dist/checkpoint.cjs +4 -0
- package/dist/checkpoint.js +2 -2
- package/dist/{chunk-ECLGGGAI.js → chunk-54DIEDR3.js} +3 -3
- package/dist/{chunk-VY4Y5U57.js → chunk-CUBYSWZT.js} +57 -0
- package/dist/{chunk-IV4DVWPR.js → chunk-GHBNDHG7.js} +67 -25
- package/dist/{chunk-S5DX7Z6X.js → chunk-JLOZTVXU.js} +3 -3
- package/dist/{chunk-JJ4IWRMJ.js → chunk-KNPCWWF3.js} +8 -3
- package/dist/{chunk-BLM5EIBA.js → chunk-MOTQNIZX.js} +5 -1
- package/dist/{chunk-73EBR3YL.js → chunk-RS4HJLJQ.js} +1 -1
- package/dist/{chunk-LNWJAHAQ.js → chunk-TTB3ZAVX.js} +2 -2
- package/dist/{chunk-WDIKPIMB.js → chunk-UZIX7M7D.js} +11 -4
- package/dist/cli/index.js +7 -7
- package/dist/cli.cjs +129 -22
- package/dist/cli.js +7 -7
- package/dist/codex-exec-agent.js +2 -2
- package/dist/engine-harness.cjs +129 -22
- package/dist/engine-harness.js +5 -5
- package/dist/index.cjs +136 -23
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -8
- package/dist/local-agent.js +2 -2
- package/dist/openclaw.js +5 -5
- package/dist/{proof-run-engine-MiKZt9oY.d.ts → proof-run-engine-BqRoA3Do.d.ts} +3 -3
- package/dist/{proof-run-engine-Baiv6l3A.d.cts → proof-run-engine-DpChFR5H.d.cts} +3 -3
- package/dist/proof-run-engine.d.cts +1 -1
- package/dist/proof-run-engine.d.ts +1 -1
- package/dist/result.cjs +62 -2
- package/dist/result.d.cts +17 -2
- package/dist/result.d.ts +17 -2
- package/dist/result.js +9 -3
- package/dist/run-card.cjs +43 -0
- package/dist/run-card.js +3 -3
- package/dist/runner.cjs +59 -1
- package/dist/runner.js +5 -5
- package/dist/spec/checkpoint.cjs +4 -0
- package/dist/spec/checkpoint.js +2 -2
- package/dist/spec/index.cjs +74 -1
- package/dist/spec/index.d.cts +1 -1
- package/dist/spec/index.d.ts +1 -1
- package/dist/spec/index.js +11 -5
- package/dist/spec/result.cjs +62 -2
- package/dist/spec/result.d.cts +1 -1
- package/dist/spec/result.d.ts +1 -1
- package/dist/spec/result.js +9 -3
- package/dist/spec/run-card.cjs +43 -0
- package/dist/spec/run-card.js +3 -3
- package/dist/spec/state.cjs +52 -1
- package/dist/spec/state.js +4 -4
- package/dist/state.cjs +52 -1
- package/dist/state.js +4 -4
- package/dist/types.d.cts +17 -0
- package/dist/types.d.ts +17 -0
- package/package.json +1 -1
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
function isTerminalStatus(status) {
|
|
3
3
|
return status === "blocked" || status === "failed" || status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
4
4
|
}
|
|
5
|
+
function isProtectedFinalStatus(status) {
|
|
6
|
+
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
7
|
+
}
|
|
5
8
|
function isSuccessfulStatus(status) {
|
|
6
9
|
return status !== "blocked" && status !== "failed";
|
|
7
10
|
}
|
|
@@ -99,6 +102,9 @@ function normalizeTerminalMetadata(input) {
|
|
|
99
102
|
pr_state: prState,
|
|
100
103
|
marked_ready: markedReady,
|
|
101
104
|
left_draft: leftDraft,
|
|
105
|
+
ship_held: firstBoolean(riddleState.ship_held, result.ship_held, result.shipHeld, details.ship_held, details.shipHeld, shipReport.ship_held, shipReport.shipHeld),
|
|
106
|
+
shipping_disabled: firstBoolean(riddleState.shipping_disabled, result.shipping_disabled, result.shippingDisabled, details.shipping_disabled, details.shippingDisabled, shipReport.shipping_disabled, shipReport.shippingDisabled),
|
|
107
|
+
ship_authorized: firstBoolean(riddleState.ship_authorized, result.ship_authorized, result.shipAuthorized, details.ship_authorized, details.shipAuthorized, shipReport.ship_authorized, shipReport.shipAuthorized),
|
|
102
108
|
ci_status: firstNonEmptyString(riddleState.ci_status, result.ci_status, result.ciStatus, details.ci_status, details.ciStatus, shipReport.ci_status),
|
|
103
109
|
ship_commit: firstNonEmptyString(riddleState.ship_commit, result.ship_commit, result.shipCommit, details.ship_commit, details.shipCommit, shipReport.shipped_commit, shipReport.ship_commit),
|
|
104
110
|
ship_remote_head: firstNonEmptyString(riddleState.ship_remote_head, result.ship_remote_head, result.shipRemoteHead, details.ship_remote_head, details.shipRemoteHead, shipReport.ship_remote_head),
|
|
@@ -132,6 +138,9 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
132
138
|
if (prBranch) state.pr_branch = prBranch;
|
|
133
139
|
if (typeof metadata.marked_ready === "boolean") state.marked_ready = metadata.marked_ready;
|
|
134
140
|
if (typeof metadata.left_draft === "boolean") state.left_draft = metadata.left_draft;
|
|
141
|
+
if (typeof metadata.ship_held === "boolean") state.ship_held = metadata.ship_held;
|
|
142
|
+
if (typeof metadata.shipping_disabled === "boolean") state.shipping_disabled = metadata.shipping_disabled;
|
|
143
|
+
if (typeof metadata.ship_authorized === "boolean") state.ship_authorized = metadata.ship_authorized;
|
|
135
144
|
const ciStatus = nonEmptyString(metadata.ci_status);
|
|
136
145
|
if (ciStatus) state.ci_status = ciStatus;
|
|
137
146
|
const shipCommit = nonEmptyString(metadata.ship_commit);
|
|
@@ -163,12 +172,54 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
163
172
|
if (typeof metadata.finalized === "boolean") state.finalized = metadata.finalized;
|
|
164
173
|
return state;
|
|
165
174
|
}
|
|
175
|
+
function shipControlStateFor(input) {
|
|
176
|
+
const state = input.state;
|
|
177
|
+
const status = input.status || state.status;
|
|
178
|
+
const raw = recordValue(input.raw) || {};
|
|
179
|
+
const shipReport = recordValue(state.ship_report) || {};
|
|
180
|
+
const prState = recordValue(state.pr_state) || {};
|
|
181
|
+
const shippingDisabled = firstBoolean(
|
|
182
|
+
raw.shipping_disabled,
|
|
183
|
+
raw.shippingDisabled,
|
|
184
|
+
state.shipping_disabled,
|
|
185
|
+
shipReport.shipping_disabled,
|
|
186
|
+
shipReport.shippingDisabled
|
|
187
|
+
) ?? state.request?.ship_mode === "none";
|
|
188
|
+
const explicitAuthorized = firstBoolean(
|
|
189
|
+
raw.ship_authorized,
|
|
190
|
+
raw.shipAuthorized,
|
|
191
|
+
state.ship_authorized,
|
|
192
|
+
shipReport.ship_authorized,
|
|
193
|
+
shipReport.shipAuthorized
|
|
194
|
+
);
|
|
195
|
+
const authorizationEvidence = Boolean(
|
|
196
|
+
status === "shipped" || state.marked_ready === true || shipReport.marked_ready === true || prState.status === "merged" || state.merge_commit || state.merged_at
|
|
197
|
+
);
|
|
198
|
+
const inferredAuthorized = explicitAuthorized ?? authorizationEvidence;
|
|
199
|
+
const rawHeld = firstBoolean(raw.ship_held, raw.shipHeld);
|
|
200
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !inferredAuthorized;
|
|
201
|
+
const shipHeld = rawHeld ?? (state.ship_held === true || inferredHeld);
|
|
202
|
+
return {
|
|
203
|
+
ship_held: shipHeld,
|
|
204
|
+
shipping_disabled: shippingDisabled,
|
|
205
|
+
ship_authorized: shipHeld ? false : inferredAuthorized
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function applyShipControlState(state, input = {}) {
|
|
209
|
+
const control = shipControlStateFor({ state, status: input.status, raw: input.raw });
|
|
210
|
+
state.ship_held = control.ship_held;
|
|
211
|
+
state.shipping_disabled = control.shipping_disabled;
|
|
212
|
+
state.ship_authorized = control.ship_authorized;
|
|
213
|
+
return state;
|
|
214
|
+
}
|
|
166
215
|
function createRunResult(input) {
|
|
167
216
|
const status = input.status || input.state.status;
|
|
168
217
|
const ok = isSuccessfulStatus(status);
|
|
169
218
|
const state = input.metadata ? applyTerminalMetadata(input.state, input.metadata) : input.state;
|
|
170
219
|
state.status = status;
|
|
171
220
|
state.ok = ok;
|
|
221
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
222
|
+
applyShipControlState(state, { status, raw: input.raw });
|
|
172
223
|
return compactRecord({
|
|
173
224
|
ok,
|
|
174
225
|
status,
|
|
@@ -186,6 +237,9 @@ function createRunResult(input) {
|
|
|
186
237
|
pr_state: state.pr_state,
|
|
187
238
|
marked_ready: state.marked_ready,
|
|
188
239
|
left_draft: state.left_draft,
|
|
240
|
+
ship_held: state.ship_held,
|
|
241
|
+
shipping_disabled: state.shipping_disabled,
|
|
242
|
+
ship_authorized: state.ship_authorized,
|
|
189
243
|
ci_status: state.ci_status,
|
|
190
244
|
ship_commit: state.ship_commit,
|
|
191
245
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -216,11 +270,14 @@ function createRunResult(input) {
|
|
|
216
270
|
|
|
217
271
|
export {
|
|
218
272
|
isTerminalStatus,
|
|
273
|
+
isProtectedFinalStatus,
|
|
219
274
|
isSuccessfulStatus,
|
|
220
275
|
compactRecord,
|
|
221
276
|
nonEmptyString,
|
|
222
277
|
recordValue,
|
|
223
278
|
normalizeTerminalMetadata,
|
|
224
279
|
applyTerminalMetadata,
|
|
280
|
+
shipControlStateFor,
|
|
281
|
+
applyShipControlState,
|
|
225
282
|
createRunResult
|
|
226
283
|
};
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
createRunStatusSnapshot,
|
|
6
6
|
normalizeRunParams,
|
|
7
7
|
setRunStatus
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UZIX7M7D.js";
|
|
9
9
|
import {
|
|
10
10
|
createRiddleProofRunCard
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-KNPCWWF3.js";
|
|
12
12
|
import {
|
|
13
13
|
canonicalProofAssessmentStageForDecision,
|
|
14
14
|
noImplementationModeFor,
|
|
@@ -27,15 +27,17 @@ import {
|
|
|
27
27
|
normalizeCheckpointResponse,
|
|
28
28
|
proofContractFromAuthorCheckpointResponse,
|
|
29
29
|
statePathsForRunState
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-MOTQNIZX.js";
|
|
31
31
|
import {
|
|
32
|
+
applyShipControlState,
|
|
32
33
|
applyTerminalMetadata,
|
|
33
34
|
compactRecord,
|
|
34
35
|
createRunResult,
|
|
36
|
+
isProtectedFinalStatus,
|
|
35
37
|
nonEmptyString,
|
|
36
38
|
normalizeTerminalMetadata,
|
|
37
39
|
recordValue
|
|
38
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-CUBYSWZT.js";
|
|
39
41
|
import {
|
|
40
42
|
__export
|
|
41
43
|
} from "./chunk-MLKGABMK.js";
|
|
@@ -120,9 +122,6 @@ function loadRunState(input) {
|
|
|
120
122
|
state_path: statePath
|
|
121
123
|
});
|
|
122
124
|
}
|
|
123
|
-
function isProtectedFinalStatus(status) {
|
|
124
|
-
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
125
|
-
}
|
|
126
125
|
function shouldPreserveFinalizedRunState(filePath, incoming) {
|
|
127
126
|
const existing = readJson(filePath);
|
|
128
127
|
if (!existing?.finalized || !isProtectedFinalStatus(existing.status)) return false;
|
|
@@ -313,7 +312,7 @@ function shipHeldTerminal(state, result) {
|
|
|
313
312
|
"ready_to_ship",
|
|
314
313
|
result,
|
|
315
314
|
result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
316
|
-
{ ship_held: true }
|
|
315
|
+
{ ship_held: true, shipping_disabled: true, ship_authorized: false }
|
|
317
316
|
);
|
|
318
317
|
}
|
|
319
318
|
function checkpointContinueStage(result) {
|
|
@@ -591,6 +590,7 @@ function terminalResult(state, status, result, summary, raw = {}) {
|
|
|
591
590
|
engineResult: result
|
|
592
591
|
});
|
|
593
592
|
applyTerminalMetadata(state, metadata);
|
|
593
|
+
applyShipControlState(state, { status, raw });
|
|
594
594
|
persist(state);
|
|
595
595
|
return createRunResult({
|
|
596
596
|
state,
|
|
@@ -693,19 +693,38 @@ function appendCheckpointResponse(state, response, input = {}) {
|
|
|
693
693
|
setRunStatus(state, "running", at);
|
|
694
694
|
persist(state);
|
|
695
695
|
}
|
|
696
|
+
function checkpointResponseRejectedBlocker(state, input) {
|
|
697
|
+
const packet = input.packet || null;
|
|
698
|
+
const response = input.response || null;
|
|
699
|
+
appendRunEvent(state, {
|
|
700
|
+
kind: "checkpoint.response.rejected",
|
|
701
|
+
checkpoint: response?.checkpoint || packet?.checkpoint || input.blocker.checkpoint || null,
|
|
702
|
+
stage: packet?.stage || state.current_stage || "author",
|
|
703
|
+
summary: input.blocker.message,
|
|
704
|
+
details: compactRecord({
|
|
705
|
+
code: input.blocker.code,
|
|
706
|
+
decision: response?.decision,
|
|
707
|
+
resume_token: response?.resume_token,
|
|
708
|
+
packet_id: response?.packet_id,
|
|
709
|
+
source: response?.source
|
|
710
|
+
})
|
|
711
|
+
});
|
|
712
|
+
return { blocker: input.blocker };
|
|
713
|
+
}
|
|
696
714
|
function checkpointResponseContinuation(state, value) {
|
|
697
715
|
if (!value) return {};
|
|
698
716
|
const packet = state.checkpoint_packet;
|
|
699
717
|
const response = normalizeCheckpointResponse(value);
|
|
700
718
|
if (!response) {
|
|
701
|
-
return {
|
|
719
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
720
|
+
packet,
|
|
702
721
|
blocker: {
|
|
703
722
|
code: "checkpoint_response_invalid",
|
|
704
723
|
checkpoint: packet?.checkpoint || state.last_checkpoint || null,
|
|
705
724
|
message: "Checkpoint response was not a valid riddle-proof.checkpoint_response.v1 object.",
|
|
706
725
|
details: { checkpoint_packet: packet || null, checkpoint_summary: checkpointSummaryFromState(state) }
|
|
707
726
|
}
|
|
708
|
-
};
|
|
727
|
+
});
|
|
709
728
|
}
|
|
710
729
|
if (isDuplicateCheckpointResponse(state, response)) {
|
|
711
730
|
const stage = packet?.stage || state.current_stage || "author";
|
|
@@ -736,17 +755,20 @@ function checkpointResponseContinuation(state, value) {
|
|
|
736
755
|
};
|
|
737
756
|
}
|
|
738
757
|
if (!packet) {
|
|
739
|
-
return {
|
|
758
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
759
|
+
response,
|
|
740
760
|
blocker: {
|
|
741
761
|
code: "checkpoint_response_without_packet",
|
|
742
762
|
checkpoint: response.checkpoint,
|
|
743
763
|
message: "A checkpoint response was supplied, but the run state has no pending checkpoint packet.",
|
|
744
764
|
details: { response, checkpoint_summary: checkpointSummaryFromState(state) }
|
|
745
765
|
}
|
|
746
|
-
};
|
|
766
|
+
});
|
|
747
767
|
}
|
|
748
768
|
if (response.run_id !== packet.run_id || response.checkpoint !== packet.checkpoint) {
|
|
749
|
-
return {
|
|
769
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
770
|
+
packet,
|
|
771
|
+
response,
|
|
750
772
|
blocker: {
|
|
751
773
|
code: "checkpoint_response_mismatch",
|
|
752
774
|
checkpoint: packet.checkpoint,
|
|
@@ -757,10 +779,12 @@ function checkpointResponseContinuation(state, value) {
|
|
|
757
779
|
actual: { run_id: response.run_id, checkpoint: response.checkpoint }
|
|
758
780
|
}
|
|
759
781
|
}
|
|
760
|
-
};
|
|
782
|
+
});
|
|
761
783
|
}
|
|
762
784
|
if (packet.resume_token && response.resume_token !== packet.resume_token) {
|
|
763
|
-
return {
|
|
785
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
786
|
+
packet,
|
|
787
|
+
response,
|
|
764
788
|
blocker: {
|
|
765
789
|
code: "checkpoint_response_resume_token_mismatch",
|
|
766
790
|
checkpoint: packet.checkpoint,
|
|
@@ -771,10 +795,12 @@ function checkpointResponseContinuation(state, value) {
|
|
|
771
795
|
actual_resume_token: response.resume_token || null
|
|
772
796
|
}
|
|
773
797
|
}
|
|
774
|
-
};
|
|
798
|
+
});
|
|
775
799
|
}
|
|
776
800
|
if (packet.packet_id && response.packet_id !== packet.packet_id) {
|
|
777
|
-
return {
|
|
801
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
802
|
+
packet,
|
|
803
|
+
response,
|
|
778
804
|
blocker: {
|
|
779
805
|
code: "checkpoint_response_packet_id_mismatch",
|
|
780
806
|
checkpoint: packet.checkpoint,
|
|
@@ -787,10 +813,12 @@ function checkpointResponseContinuation(state, value) {
|
|
|
787
813
|
actual_resume_token: response.resume_token || null
|
|
788
814
|
}
|
|
789
815
|
}
|
|
790
|
-
};
|
|
816
|
+
});
|
|
791
817
|
}
|
|
792
818
|
if (!packet.allowed_decisions.includes(response.decision)) {
|
|
793
|
-
return {
|
|
819
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
820
|
+
packet,
|
|
821
|
+
response,
|
|
794
822
|
blocker: {
|
|
795
823
|
code: "checkpoint_response_decision_not_allowed",
|
|
796
824
|
checkpoint: packet.checkpoint,
|
|
@@ -802,7 +830,7 @@ function checkpointResponseContinuation(state, value) {
|
|
|
802
830
|
response
|
|
803
831
|
}
|
|
804
832
|
}
|
|
805
|
-
};
|
|
833
|
+
});
|
|
806
834
|
}
|
|
807
835
|
const base = {
|
|
808
836
|
action: "run",
|
|
@@ -812,14 +840,16 @@ function checkpointResponseContinuation(state, value) {
|
|
|
812
840
|
if (response.decision === "author_packet") {
|
|
813
841
|
const payload = authorPacketPayloadFromCheckpointResponse(response);
|
|
814
842
|
if (!payload) {
|
|
815
|
-
return {
|
|
843
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
844
|
+
packet,
|
|
845
|
+
response,
|
|
816
846
|
blocker: {
|
|
817
847
|
code: "checkpoint_author_packet_missing",
|
|
818
848
|
checkpoint: packet.checkpoint,
|
|
819
849
|
message: "Checkpoint response decision=author_packet did not include a proof_plan and capture_script payload.",
|
|
820
850
|
details: { stage: packet.stage, response }
|
|
821
851
|
}
|
|
822
|
-
};
|
|
852
|
+
});
|
|
823
853
|
}
|
|
824
854
|
state.proof_contract = proofContractFromAuthorCheckpointResponse(response, packet, payload);
|
|
825
855
|
appendCheckpointResponse(state, response);
|
|
@@ -848,14 +878,16 @@ function checkpointResponseContinuation(state, value) {
|
|
|
848
878
|
const workdir = nonEmptyString(packet.state_excerpt?.after_worktree) || state.worktree_path;
|
|
849
879
|
if (workdir) state.worktree_path = workdir;
|
|
850
880
|
if (!hasGitDiff(workdir)) {
|
|
851
|
-
return {
|
|
881
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
882
|
+
packet,
|
|
883
|
+
response,
|
|
852
884
|
blocker: {
|
|
853
885
|
code: "implementation_diff_missing",
|
|
854
886
|
checkpoint: packet.checkpoint,
|
|
855
887
|
message: "Checkpoint response claimed implementation_complete, but the after worktree has no detectable git diff.",
|
|
856
888
|
details: { stage: packet.stage, worktree_path: workdir || null, response }
|
|
857
889
|
}
|
|
858
|
-
};
|
|
890
|
+
});
|
|
859
891
|
}
|
|
860
892
|
appendCheckpointResponse(state, response);
|
|
861
893
|
return {
|
|
@@ -904,7 +936,13 @@ function checkpointResponseContinuation(state, value) {
|
|
|
904
936
|
response,
|
|
905
937
|
code: "checkpoint_response_source_not_trusted"
|
|
906
938
|
});
|
|
907
|
-
if (sourceBlocker)
|
|
939
|
+
if (sourceBlocker) {
|
|
940
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
941
|
+
packet,
|
|
942
|
+
response,
|
|
943
|
+
blocker: sourceBlocker
|
|
944
|
+
});
|
|
945
|
+
}
|
|
908
946
|
appendCheckpointResponse(state, response);
|
|
909
947
|
if (state.request.ship_mode !== "ship" && proofAssessmentRequestsShip(assessment)) {
|
|
910
948
|
const result = {
|
|
@@ -923,6 +961,8 @@ function checkpointResponseContinuation(state, value) {
|
|
|
923
961
|
response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
924
962
|
{
|
|
925
963
|
ship_held: true,
|
|
964
|
+
shipping_disabled: true,
|
|
965
|
+
ship_authorized: false,
|
|
926
966
|
proof_assessment: assessment
|
|
927
967
|
}
|
|
928
968
|
)
|
|
@@ -1516,6 +1556,8 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
1516
1556
|
assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
1517
1557
|
{
|
|
1518
1558
|
ship_held: true,
|
|
1559
|
+
shipping_disabled: true,
|
|
1560
|
+
ship_authorized: false,
|
|
1519
1561
|
proof_assessment: payload
|
|
1520
1562
|
}
|
|
1521
1563
|
)
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
appendStageHeartbeat,
|
|
4
4
|
createRunState,
|
|
5
5
|
setRunStatus
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UZIX7M7D.js";
|
|
7
7
|
import {
|
|
8
8
|
noImplementationModeFor
|
|
9
9
|
} from "./chunk-EKZXU6MU.js";
|
|
10
10
|
import {
|
|
11
11
|
createRunResult
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CUBYSWZT.js";
|
|
13
13
|
import {
|
|
14
14
|
__export
|
|
15
15
|
} from "./chunk-MLKGABMK.js";
|
|
@@ -454,7 +454,7 @@ async function runRiddleProof(input) {
|
|
|
454
454
|
status: "ready_to_ship",
|
|
455
455
|
last_summary: assessment.summary,
|
|
456
456
|
evidence_bundle: evidenceBundle,
|
|
457
|
-
raw: { implementation, assessment }
|
|
457
|
+
raw: { implementation, assessment, ship_held: true, shipping_disabled: true, ship_authorized: false }
|
|
458
458
|
});
|
|
459
459
|
return notifyIfConfigured({ state, result: result2, notification: adapters.notification });
|
|
460
460
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
statePathsForRunState
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MOTQNIZX.js";
|
|
4
4
|
import {
|
|
5
5
|
compactRecord,
|
|
6
6
|
isTerminalStatus,
|
|
7
7
|
nonEmptyString,
|
|
8
|
-
recordValue
|
|
9
|
-
|
|
8
|
+
recordValue,
|
|
9
|
+
shipControlStateFor
|
|
10
|
+
} from "./chunk-CUBYSWZT.js";
|
|
10
11
|
|
|
11
12
|
// src/run-card.ts
|
|
12
13
|
var RIDDLE_PROOF_RUN_CARD_VERSION = "riddle-proof.run-card.v1";
|
|
@@ -167,6 +168,7 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
167
168
|
const visualDelta = visualDeltaFrom({ fullRiddleState: fullState, runState: state });
|
|
168
169
|
const artifacts = artifactsFrom({ fullRiddleState: fullState, runState: state });
|
|
169
170
|
const viewportMatrix = viewportMatrixFrom({ fullRiddleState: fullState, runState: state });
|
|
171
|
+
const shipControl = shipControlStateFor({ state });
|
|
170
172
|
return {
|
|
171
173
|
version: RIDDLE_PROOF_RUN_CARD_VERSION,
|
|
172
174
|
run_id: state.run_id || "unknown",
|
|
@@ -220,6 +222,9 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
220
222
|
stop_condition: compactRecord({
|
|
221
223
|
status: state.status,
|
|
222
224
|
terminal: isTerminalStatus(state.status),
|
|
225
|
+
ship_held: shipControl.ship_held,
|
|
226
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
227
|
+
ship_authorized: shipControl.ship_authorized,
|
|
223
228
|
blocker_code: state.blocker?.code || null,
|
|
224
229
|
blocker_message: state.blocker?.message || null,
|
|
225
230
|
proof_decision: state.proof_decision,
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
compactRecord,
|
|
3
3
|
nonEmptyString,
|
|
4
4
|
recordValue
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CUBYSWZT.js";
|
|
6
6
|
|
|
7
7
|
// src/checkpoint.ts
|
|
8
8
|
import crypto from "crypto";
|
|
@@ -702,6 +702,8 @@ function checkpointSummaryFromState(state, engineStatePath) {
|
|
|
702
702
|
const packets = history.filter((entry) => entry.packet);
|
|
703
703
|
const responses = acceptedCheckpointResponseEntries(state);
|
|
704
704
|
const duplicateResponses = events.filter((event) => event.kind === "checkpoint.response.duplicate");
|
|
705
|
+
const rejectedResponses = events.filter((event) => event.kind === "checkpoint.response.rejected");
|
|
706
|
+
const ignoredResponses = events.filter((event) => event.kind === "checkpoint.response.ignored");
|
|
705
707
|
const latestPacketEntry = [...history].reverse().find((entry) => entry.packet);
|
|
706
708
|
const latestResponseEntry = [...responses].reverse().find((entry) => entry.response);
|
|
707
709
|
const latestPacket = state.checkpoint_packet || latestPacketEntry?.packet;
|
|
@@ -717,6 +719,8 @@ function checkpointSummaryFromState(state, engineStatePath) {
|
|
|
717
719
|
packet_count: packets.length,
|
|
718
720
|
response_count: responses.length,
|
|
719
721
|
duplicate_response_count: duplicateResponses.length,
|
|
722
|
+
rejected_response_count: rejectedResponses.length,
|
|
723
|
+
ignored_response_count: ignoredResponses.length,
|
|
720
724
|
latest_checkpoint: state.checkpoint_packet?.checkpoint || latestResponse?.checkpoint || state.last_checkpoint || null,
|
|
721
725
|
latest_stage: state.checkpoint_packet?.stage || latestResponse?.continue_with_stage || state.current_stage || null,
|
|
722
726
|
latest_kind: state.checkpoint_packet?.kind || latestPacket?.kind || null,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
normalizeIntegrationContext,
|
|
3
3
|
normalizeRunParams
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-UZIX7M7D.js";
|
|
5
5
|
import {
|
|
6
6
|
compactRecord
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CUBYSWZT.js";
|
|
8
8
|
|
|
9
9
|
// src/openclaw.ts
|
|
10
10
|
function parseOpenClawAssertions(value) {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRiddleProofRunCard
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KNPCWWF3.js";
|
|
4
4
|
import {
|
|
5
5
|
compactRecord,
|
|
6
|
+
isProtectedFinalStatus,
|
|
6
7
|
isTerminalStatus,
|
|
7
8
|
nonEmptyString,
|
|
8
|
-
recordValue
|
|
9
|
-
|
|
9
|
+
recordValue,
|
|
10
|
+
shipControlStateFor
|
|
11
|
+
} from "./chunk-CUBYSWZT.js";
|
|
10
12
|
|
|
11
13
|
// src/state.ts
|
|
12
14
|
var RIDDLE_PROOF_RUN_STATE_VERSION = "riddle-proof.run-state.v1";
|
|
@@ -188,7 +190,8 @@ function appendStageHeartbeat(state, input) {
|
|
|
188
190
|
function createRunStatusSnapshot(state, at = timestamp()) {
|
|
189
191
|
const latestEvent = state.events[state.events.length - 1];
|
|
190
192
|
const runId = state.run_id || "unknown";
|
|
191
|
-
const
|
|
193
|
+
const shipControl = shipControlStateFor({ state });
|
|
194
|
+
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) && state.run_card.stop_condition?.ship_held === shipControl.ship_held && state.run_card.stop_condition?.shipping_disabled === shipControl.shipping_disabled && state.run_card.stop_condition?.ship_authorized === shipControl.ship_authorized;
|
|
192
195
|
const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
|
|
193
196
|
return compactRecord({
|
|
194
197
|
run_id: runId,
|
|
@@ -202,6 +205,9 @@ function createRunStatusSnapshot(state, at = timestamp()) {
|
|
|
202
205
|
pr_url: state.pr_url ?? null,
|
|
203
206
|
pr_branch: state.pr_branch ?? null,
|
|
204
207
|
pr_state: state.pr_state,
|
|
208
|
+
ship_held: shipControl.ship_held,
|
|
209
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
210
|
+
ship_authorized: shipControl.ship_authorized,
|
|
205
211
|
ci_status: state.ci_status,
|
|
206
212
|
ship_commit: state.ship_commit,
|
|
207
213
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -227,6 +233,7 @@ function createRunStatusSnapshot(state, at = timestamp()) {
|
|
|
227
233
|
function setRunStatus(state, status, at = timestamp()) {
|
|
228
234
|
state.status = status;
|
|
229
235
|
state.ok = status !== "blocked" && status !== "failed";
|
|
236
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
230
237
|
state.updated_at = at;
|
|
231
238
|
return state;
|
|
232
239
|
}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-54DIEDR3.js";
|
|
2
2
|
import "../chunk-DI2XNGEZ.js";
|
|
3
3
|
import "../chunk-6KYXX4OE.js";
|
|
4
4
|
import "../chunk-EX7TO4I5.js";
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-GHBNDHG7.js";
|
|
6
|
+
import "../chunk-UZIX7M7D.js";
|
|
7
|
+
import "../chunk-KNPCWWF3.js";
|
|
8
8
|
import "../chunk-EKZXU6MU.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-MOTQNIZX.js";
|
|
10
10
|
import "../chunk-JFQXAJH2.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-RS4HJLJQ.js";
|
|
12
|
+
import "../chunk-CUBYSWZT.js";
|
|
13
13
|
import "../chunk-MLKGABMK.js";
|