@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
package/dist/state.cjs
CHANGED
|
@@ -47,6 +47,9 @@ module.exports = __toCommonJS(state_exports);
|
|
|
47
47
|
function isTerminalStatus(status) {
|
|
48
48
|
return status === "blocked" || status === "failed" || status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
49
49
|
}
|
|
50
|
+
function isProtectedFinalStatus(status) {
|
|
51
|
+
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
52
|
+
}
|
|
50
53
|
function compactRecord(input) {
|
|
51
54
|
return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0 && value !== null && value !== ""));
|
|
52
55
|
}
|
|
@@ -56,6 +59,45 @@ function nonEmptyString(value) {
|
|
|
56
59
|
function recordValue(value) {
|
|
57
60
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
58
61
|
}
|
|
62
|
+
function firstBoolean(...values) {
|
|
63
|
+
for (const value of values) {
|
|
64
|
+
if (typeof value === "boolean") return value;
|
|
65
|
+
}
|
|
66
|
+
return void 0;
|
|
67
|
+
}
|
|
68
|
+
function shipControlStateFor(input) {
|
|
69
|
+
const state = input.state;
|
|
70
|
+
const status = input.status || state.status;
|
|
71
|
+
const raw = recordValue(input.raw) || {};
|
|
72
|
+
const shipReport = recordValue(state.ship_report) || {};
|
|
73
|
+
const prState = recordValue(state.pr_state) || {};
|
|
74
|
+
const shippingDisabled = firstBoolean(
|
|
75
|
+
raw.shipping_disabled,
|
|
76
|
+
raw.shippingDisabled,
|
|
77
|
+
state.shipping_disabled,
|
|
78
|
+
shipReport.shipping_disabled,
|
|
79
|
+
shipReport.shippingDisabled
|
|
80
|
+
) ?? state.request?.ship_mode === "none";
|
|
81
|
+
const explicitAuthorized = firstBoolean(
|
|
82
|
+
raw.ship_authorized,
|
|
83
|
+
raw.shipAuthorized,
|
|
84
|
+
state.ship_authorized,
|
|
85
|
+
shipReport.ship_authorized,
|
|
86
|
+
shipReport.shipAuthorized
|
|
87
|
+
);
|
|
88
|
+
const authorizationEvidence = Boolean(
|
|
89
|
+
status === "shipped" || state.marked_ready === true || shipReport.marked_ready === true || prState.status === "merged" || state.merge_commit || state.merged_at
|
|
90
|
+
);
|
|
91
|
+
const inferredAuthorized = explicitAuthorized ?? authorizationEvidence;
|
|
92
|
+
const rawHeld = firstBoolean(raw.ship_held, raw.shipHeld);
|
|
93
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !inferredAuthorized;
|
|
94
|
+
const shipHeld = rawHeld ?? (state.ship_held === true || inferredHeld);
|
|
95
|
+
return {
|
|
96
|
+
ship_held: shipHeld,
|
|
97
|
+
shipping_disabled: shippingDisabled,
|
|
98
|
+
ship_authorized: shipHeld ? false : inferredAuthorized
|
|
99
|
+
};
|
|
100
|
+
}
|
|
59
101
|
|
|
60
102
|
// src/checkpoint.ts
|
|
61
103
|
var import_node_crypto = __toESM(require("crypto"), 1);
|
|
@@ -226,6 +268,7 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
226
268
|
const visualDelta = visualDeltaFrom({ fullRiddleState: fullState, runState: state });
|
|
227
269
|
const artifacts = artifactsFrom({ fullRiddleState: fullState, runState: state });
|
|
228
270
|
const viewportMatrix = viewportMatrixFrom({ fullRiddleState: fullState, runState: state });
|
|
271
|
+
const shipControl = shipControlStateFor({ state });
|
|
229
272
|
return {
|
|
230
273
|
version: RIDDLE_PROOF_RUN_CARD_VERSION,
|
|
231
274
|
run_id: state.run_id || "unknown",
|
|
@@ -279,6 +322,9 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
279
322
|
stop_condition: compactRecord({
|
|
280
323
|
status: state.status,
|
|
281
324
|
terminal: isTerminalStatus(state.status),
|
|
325
|
+
ship_held: shipControl.ship_held,
|
|
326
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
327
|
+
ship_authorized: shipControl.ship_authorized,
|
|
282
328
|
blocker_code: state.blocker?.code || null,
|
|
283
329
|
blocker_message: state.blocker?.message || null,
|
|
284
330
|
proof_decision: state.proof_decision,
|
|
@@ -469,7 +515,8 @@ function appendStageHeartbeat(state, input) {
|
|
|
469
515
|
function createRunStatusSnapshot(state, at = timestamp()) {
|
|
470
516
|
const latestEvent = state.events[state.events.length - 1];
|
|
471
517
|
const runId = state.run_id || "unknown";
|
|
472
|
-
const
|
|
518
|
+
const shipControl = shipControlStateFor({ state });
|
|
519
|
+
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;
|
|
473
520
|
const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
|
|
474
521
|
return compactRecord({
|
|
475
522
|
run_id: runId,
|
|
@@ -483,6 +530,9 @@ function createRunStatusSnapshot(state, at = timestamp()) {
|
|
|
483
530
|
pr_url: state.pr_url ?? null,
|
|
484
531
|
pr_branch: state.pr_branch ?? null,
|
|
485
532
|
pr_state: state.pr_state,
|
|
533
|
+
ship_held: shipControl.ship_held,
|
|
534
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
535
|
+
ship_authorized: shipControl.ship_authorized,
|
|
486
536
|
ci_status: state.ci_status,
|
|
487
537
|
ship_commit: state.ship_commit,
|
|
488
538
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -508,6 +558,7 @@ function createRunStatusSnapshot(state, at = timestamp()) {
|
|
|
508
558
|
function setRunStatus(state, status, at = timestamp()) {
|
|
509
559
|
state.status = status;
|
|
510
560
|
state.ok = status !== "blocked" && status !== "failed";
|
|
561
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
511
562
|
state.updated_at = at;
|
|
512
563
|
return state;
|
|
513
564
|
}
|
package/dist/state.js
CHANGED
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
normalizePrLifecycleState,
|
|
10
10
|
normalizeRunParams,
|
|
11
11
|
setRunStatus
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-UZIX7M7D.js";
|
|
13
|
+
import "./chunk-KNPCWWF3.js";
|
|
14
|
+
import "./chunk-MOTQNIZX.js";
|
|
15
|
+
import "./chunk-CUBYSWZT.js";
|
|
16
16
|
import "./chunk-MLKGABMK.js";
|
|
17
17
|
export {
|
|
18
18
|
RIDDLE_PROOF_RUN_STATE_VERSION,
|
package/dist/types.d.cts
CHANGED
|
@@ -136,6 +136,8 @@ interface RiddleProofCheckpointSummary {
|
|
|
136
136
|
packet_count: number;
|
|
137
137
|
response_count: number;
|
|
138
138
|
duplicate_response_count?: number;
|
|
139
|
+
rejected_response_count?: number;
|
|
140
|
+
ignored_response_count?: number;
|
|
139
141
|
latest_checkpoint?: string | null;
|
|
140
142
|
latest_stage?: RiddleProofStage | null;
|
|
141
143
|
latest_kind?: string | null;
|
|
@@ -239,6 +241,9 @@ interface RiddleProofRunCard {
|
|
|
239
241
|
stop_condition: {
|
|
240
242
|
status: RiddleProofStatus;
|
|
241
243
|
terminal?: boolean;
|
|
244
|
+
ship_held?: boolean;
|
|
245
|
+
shipping_disabled?: boolean;
|
|
246
|
+
ship_authorized?: boolean;
|
|
242
247
|
blocker_code?: string | null;
|
|
243
248
|
blocker_message?: string | null;
|
|
244
249
|
proof_decision?: RiddleProofDecision;
|
|
@@ -289,6 +294,9 @@ interface RiddleProofRunState {
|
|
|
289
294
|
pr_state?: RiddleProofPrLifecycleState;
|
|
290
295
|
marked_ready?: boolean;
|
|
291
296
|
left_draft?: boolean;
|
|
297
|
+
ship_held?: boolean;
|
|
298
|
+
shipping_disabled?: boolean;
|
|
299
|
+
ship_authorized?: boolean;
|
|
292
300
|
ci_status?: string;
|
|
293
301
|
ship_commit?: string;
|
|
294
302
|
ship_remote_head?: string;
|
|
@@ -338,6 +346,9 @@ interface RiddleProofRunResult {
|
|
|
338
346
|
pr_state?: RiddleProofPrLifecycleState;
|
|
339
347
|
marked_ready?: boolean;
|
|
340
348
|
left_draft?: boolean;
|
|
349
|
+
ship_held?: boolean;
|
|
350
|
+
shipping_disabled?: boolean;
|
|
351
|
+
ship_authorized?: boolean;
|
|
341
352
|
ci_status?: string;
|
|
342
353
|
ship_commit?: string;
|
|
343
354
|
ship_remote_head?: string;
|
|
@@ -376,6 +387,9 @@ interface RiddleProofRunStatusSnapshot {
|
|
|
376
387
|
pr_url?: string | null;
|
|
377
388
|
pr_branch?: string | null;
|
|
378
389
|
pr_state?: RiddleProofPrLifecycleState;
|
|
390
|
+
ship_held?: boolean;
|
|
391
|
+
shipping_disabled?: boolean;
|
|
392
|
+
ship_authorized?: boolean;
|
|
379
393
|
ci_status?: string;
|
|
380
394
|
ship_commit?: string;
|
|
381
395
|
ship_remote_head?: string;
|
|
@@ -528,6 +542,9 @@ interface RiddleProofTerminalMetadata {
|
|
|
528
542
|
pr_state?: RiddleProofPrLifecycleState;
|
|
529
543
|
marked_ready?: boolean;
|
|
530
544
|
left_draft?: boolean;
|
|
545
|
+
ship_held?: boolean;
|
|
546
|
+
shipping_disabled?: boolean;
|
|
547
|
+
ship_authorized?: boolean;
|
|
531
548
|
ci_status?: string;
|
|
532
549
|
ship_commit?: string;
|
|
533
550
|
ship_remote_head?: string;
|
package/dist/types.d.ts
CHANGED
|
@@ -136,6 +136,8 @@ interface RiddleProofCheckpointSummary {
|
|
|
136
136
|
packet_count: number;
|
|
137
137
|
response_count: number;
|
|
138
138
|
duplicate_response_count?: number;
|
|
139
|
+
rejected_response_count?: number;
|
|
140
|
+
ignored_response_count?: number;
|
|
139
141
|
latest_checkpoint?: string | null;
|
|
140
142
|
latest_stage?: RiddleProofStage | null;
|
|
141
143
|
latest_kind?: string | null;
|
|
@@ -239,6 +241,9 @@ interface RiddleProofRunCard {
|
|
|
239
241
|
stop_condition: {
|
|
240
242
|
status: RiddleProofStatus;
|
|
241
243
|
terminal?: boolean;
|
|
244
|
+
ship_held?: boolean;
|
|
245
|
+
shipping_disabled?: boolean;
|
|
246
|
+
ship_authorized?: boolean;
|
|
242
247
|
blocker_code?: string | null;
|
|
243
248
|
blocker_message?: string | null;
|
|
244
249
|
proof_decision?: RiddleProofDecision;
|
|
@@ -289,6 +294,9 @@ interface RiddleProofRunState {
|
|
|
289
294
|
pr_state?: RiddleProofPrLifecycleState;
|
|
290
295
|
marked_ready?: boolean;
|
|
291
296
|
left_draft?: boolean;
|
|
297
|
+
ship_held?: boolean;
|
|
298
|
+
shipping_disabled?: boolean;
|
|
299
|
+
ship_authorized?: boolean;
|
|
292
300
|
ci_status?: string;
|
|
293
301
|
ship_commit?: string;
|
|
294
302
|
ship_remote_head?: string;
|
|
@@ -338,6 +346,9 @@ interface RiddleProofRunResult {
|
|
|
338
346
|
pr_state?: RiddleProofPrLifecycleState;
|
|
339
347
|
marked_ready?: boolean;
|
|
340
348
|
left_draft?: boolean;
|
|
349
|
+
ship_held?: boolean;
|
|
350
|
+
shipping_disabled?: boolean;
|
|
351
|
+
ship_authorized?: boolean;
|
|
341
352
|
ci_status?: string;
|
|
342
353
|
ship_commit?: string;
|
|
343
354
|
ship_remote_head?: string;
|
|
@@ -376,6 +387,9 @@ interface RiddleProofRunStatusSnapshot {
|
|
|
376
387
|
pr_url?: string | null;
|
|
377
388
|
pr_branch?: string | null;
|
|
378
389
|
pr_state?: RiddleProofPrLifecycleState;
|
|
390
|
+
ship_held?: boolean;
|
|
391
|
+
shipping_disabled?: boolean;
|
|
392
|
+
ship_authorized?: boolean;
|
|
379
393
|
ci_status?: string;
|
|
380
394
|
ship_commit?: string;
|
|
381
395
|
ship_remote_head?: string;
|
|
@@ -528,6 +542,9 @@ interface RiddleProofTerminalMetadata {
|
|
|
528
542
|
pr_state?: RiddleProofPrLifecycleState;
|
|
529
543
|
marked_ready?: boolean;
|
|
530
544
|
left_draft?: boolean;
|
|
545
|
+
ship_held?: boolean;
|
|
546
|
+
shipping_disabled?: boolean;
|
|
547
|
+
ship_authorized?: boolean;
|
|
531
548
|
ci_status?: string;
|
|
532
549
|
ship_commit?: string;
|
|
533
550
|
ship_remote_head?: string;
|