@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
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
createCodexExecAgentAdapter,
|
|
4
4
|
createCodexExecJsonRunner,
|
|
5
5
|
runCodexExecAgentDoctor
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-RS4HJLJQ.js";
|
|
7
|
+
import "../chunk-CUBYSWZT.js";
|
|
8
8
|
import "../chunk-MLKGABMK.js";
|
|
9
9
|
export {
|
|
10
10
|
createCodexExecAgentAdapter,
|
package/dist/adapters/codex.js
CHANGED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
createCodexExecAgentAdapter,
|
|
4
4
|
createCodexExecJsonRunner,
|
|
5
5
|
runCodexExecAgentDoctor
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-RS4HJLJQ.js";
|
|
7
|
+
import "../chunk-CUBYSWZT.js";
|
|
8
8
|
import "../chunk-MLKGABMK.js";
|
|
9
9
|
export {
|
|
10
10
|
createCodexExecAgentAdapter,
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
createCodexExecAgentAdapter,
|
|
4
4
|
createCodexExecJsonRunner,
|
|
5
5
|
runCodexExecAgentDoctor
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-RS4HJLJQ.js";
|
|
7
|
+
import "../chunk-CUBYSWZT.js";
|
|
8
8
|
import "../chunk-MLKGABMK.js";
|
|
9
9
|
export {
|
|
10
10
|
createCodexExecAgentAdapter as createLocalAgentAdapter,
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
parseOpenClawAssertions,
|
|
4
4
|
parseOpenClawJsonObjectOrArray,
|
|
5
5
|
toRiddleProofRunParams
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-TTB3ZAVX.js";
|
|
7
|
+
import "../chunk-UZIX7M7D.js";
|
|
8
|
+
import "../chunk-KNPCWWF3.js";
|
|
9
|
+
import "../chunk-MOTQNIZX.js";
|
|
10
|
+
import "../chunk-CUBYSWZT.js";
|
|
11
11
|
import "../chunk-MLKGABMK.js";
|
|
12
12
|
export {
|
|
13
13
|
openClawIntegrationContext,
|
|
@@ -3423,6 +3423,9 @@ var import_node_crypto3 = __toESM(require("crypto"), 1);
|
|
|
3423
3423
|
function isTerminalStatus(status) {
|
|
3424
3424
|
return status === "blocked" || status === "failed" || status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
3425
3425
|
}
|
|
3426
|
+
function isProtectedFinalStatus(status) {
|
|
3427
|
+
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
3428
|
+
}
|
|
3426
3429
|
function isSuccessfulStatus(status) {
|
|
3427
3430
|
return status !== "blocked" && status !== "failed";
|
|
3428
3431
|
}
|
|
@@ -3520,6 +3523,9 @@ function normalizeTerminalMetadata(input) {
|
|
|
3520
3523
|
pr_state: prState,
|
|
3521
3524
|
marked_ready: markedReady,
|
|
3522
3525
|
left_draft: leftDraft,
|
|
3526
|
+
ship_held: firstBoolean(riddleState.ship_held, result.ship_held, result.shipHeld, details.ship_held, details.shipHeld, shipReport.ship_held, shipReport.shipHeld),
|
|
3527
|
+
shipping_disabled: firstBoolean(riddleState.shipping_disabled, result.shipping_disabled, result.shippingDisabled, details.shipping_disabled, details.shippingDisabled, shipReport.shipping_disabled, shipReport.shippingDisabled),
|
|
3528
|
+
ship_authorized: firstBoolean(riddleState.ship_authorized, result.ship_authorized, result.shipAuthorized, details.ship_authorized, details.shipAuthorized, shipReport.ship_authorized, shipReport.shipAuthorized),
|
|
3523
3529
|
ci_status: firstNonEmptyString(riddleState.ci_status, result.ci_status, result.ciStatus, details.ci_status, details.ciStatus, shipReport.ci_status),
|
|
3524
3530
|
ship_commit: firstNonEmptyString(riddleState.ship_commit, result.ship_commit, result.shipCommit, details.ship_commit, details.shipCommit, shipReport.shipped_commit, shipReport.ship_commit),
|
|
3525
3531
|
ship_remote_head: firstNonEmptyString(riddleState.ship_remote_head, result.ship_remote_head, result.shipRemoteHead, details.ship_remote_head, details.shipRemoteHead, shipReport.ship_remote_head),
|
|
@@ -3553,6 +3559,9 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
3553
3559
|
if (prBranch) state.pr_branch = prBranch;
|
|
3554
3560
|
if (typeof metadata.marked_ready === "boolean") state.marked_ready = metadata.marked_ready;
|
|
3555
3561
|
if (typeof metadata.left_draft === "boolean") state.left_draft = metadata.left_draft;
|
|
3562
|
+
if (typeof metadata.ship_held === "boolean") state.ship_held = metadata.ship_held;
|
|
3563
|
+
if (typeof metadata.shipping_disabled === "boolean") state.shipping_disabled = metadata.shipping_disabled;
|
|
3564
|
+
if (typeof metadata.ship_authorized === "boolean") state.ship_authorized = metadata.ship_authorized;
|
|
3556
3565
|
const ciStatus = nonEmptyString(metadata.ci_status);
|
|
3557
3566
|
if (ciStatus) state.ci_status = ciStatus;
|
|
3558
3567
|
const shipCommit = nonEmptyString(metadata.ship_commit);
|
|
@@ -3584,12 +3593,54 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
3584
3593
|
if (typeof metadata.finalized === "boolean") state.finalized = metadata.finalized;
|
|
3585
3594
|
return state;
|
|
3586
3595
|
}
|
|
3596
|
+
function shipControlStateFor(input) {
|
|
3597
|
+
const state = input.state;
|
|
3598
|
+
const status = input.status || state.status;
|
|
3599
|
+
const raw = recordValue(input.raw) || {};
|
|
3600
|
+
const shipReport = recordValue(state.ship_report) || {};
|
|
3601
|
+
const prState = recordValue(state.pr_state) || {};
|
|
3602
|
+
const shippingDisabled = firstBoolean(
|
|
3603
|
+
raw.shipping_disabled,
|
|
3604
|
+
raw.shippingDisabled,
|
|
3605
|
+
state.shipping_disabled,
|
|
3606
|
+
shipReport.shipping_disabled,
|
|
3607
|
+
shipReport.shippingDisabled
|
|
3608
|
+
) ?? state.request?.ship_mode === "none";
|
|
3609
|
+
const explicitAuthorized = firstBoolean(
|
|
3610
|
+
raw.ship_authorized,
|
|
3611
|
+
raw.shipAuthorized,
|
|
3612
|
+
state.ship_authorized,
|
|
3613
|
+
shipReport.ship_authorized,
|
|
3614
|
+
shipReport.shipAuthorized
|
|
3615
|
+
);
|
|
3616
|
+
const authorizationEvidence = Boolean(
|
|
3617
|
+
status === "shipped" || state.marked_ready === true || shipReport.marked_ready === true || prState.status === "merged" || state.merge_commit || state.merged_at
|
|
3618
|
+
);
|
|
3619
|
+
const inferredAuthorized = explicitAuthorized ?? authorizationEvidence;
|
|
3620
|
+
const rawHeld = firstBoolean(raw.ship_held, raw.shipHeld);
|
|
3621
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !inferredAuthorized;
|
|
3622
|
+
const shipHeld = rawHeld ?? (state.ship_held === true || inferredHeld);
|
|
3623
|
+
return {
|
|
3624
|
+
ship_held: shipHeld,
|
|
3625
|
+
shipping_disabled: shippingDisabled,
|
|
3626
|
+
ship_authorized: shipHeld ? false : inferredAuthorized
|
|
3627
|
+
};
|
|
3628
|
+
}
|
|
3629
|
+
function applyShipControlState(state, input = {}) {
|
|
3630
|
+
const control = shipControlStateFor({ state, status: input.status, raw: input.raw });
|
|
3631
|
+
state.ship_held = control.ship_held;
|
|
3632
|
+
state.shipping_disabled = control.shipping_disabled;
|
|
3633
|
+
state.ship_authorized = control.ship_authorized;
|
|
3634
|
+
return state;
|
|
3635
|
+
}
|
|
3587
3636
|
function createRunResult(input) {
|
|
3588
3637
|
const status = input.status || input.state.status;
|
|
3589
3638
|
const ok = isSuccessfulStatus(status);
|
|
3590
3639
|
const state = input.metadata ? applyTerminalMetadata(input.state, input.metadata) : input.state;
|
|
3591
3640
|
state.status = status;
|
|
3592
3641
|
state.ok = ok;
|
|
3642
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
3643
|
+
applyShipControlState(state, { status, raw: input.raw });
|
|
3593
3644
|
return compactRecord({
|
|
3594
3645
|
ok,
|
|
3595
3646
|
status,
|
|
@@ -3607,6 +3658,9 @@ function createRunResult(input) {
|
|
|
3607
3658
|
pr_state: state.pr_state,
|
|
3608
3659
|
marked_ready: state.marked_ready,
|
|
3609
3660
|
left_draft: state.left_draft,
|
|
3661
|
+
ship_held: state.ship_held,
|
|
3662
|
+
shipping_disabled: state.shipping_disabled,
|
|
3663
|
+
ship_authorized: state.ship_authorized,
|
|
3610
3664
|
ci_status: state.ci_status,
|
|
3611
3665
|
ship_commit: state.ship_commit,
|
|
3612
3666
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -4243,6 +4297,8 @@ function checkpointSummaryFromState(state, engineStatePath2) {
|
|
|
4243
4297
|
const packets = history.filter((entry) => entry.packet);
|
|
4244
4298
|
const responses = acceptedCheckpointResponseEntries(state);
|
|
4245
4299
|
const duplicateResponses = events.filter((event) => event.kind === "checkpoint.response.duplicate");
|
|
4300
|
+
const rejectedResponses = events.filter((event) => event.kind === "checkpoint.response.rejected");
|
|
4301
|
+
const ignoredResponses = events.filter((event) => event.kind === "checkpoint.response.ignored");
|
|
4246
4302
|
const latestPacketEntry = [...history].reverse().find((entry) => entry.packet);
|
|
4247
4303
|
const latestResponseEntry = [...responses].reverse().find((entry) => entry.response);
|
|
4248
4304
|
const latestPacket = state.checkpoint_packet || latestPacketEntry?.packet;
|
|
@@ -4258,6 +4314,8 @@ function checkpointSummaryFromState(state, engineStatePath2) {
|
|
|
4258
4314
|
packet_count: packets.length,
|
|
4259
4315
|
response_count: responses.length,
|
|
4260
4316
|
duplicate_response_count: duplicateResponses.length,
|
|
4317
|
+
rejected_response_count: rejectedResponses.length,
|
|
4318
|
+
ignored_response_count: ignoredResponses.length,
|
|
4261
4319
|
latest_checkpoint: state.checkpoint_packet?.checkpoint || latestResponse?.checkpoint || state.last_checkpoint || null,
|
|
4262
4320
|
latest_stage: state.checkpoint_packet?.stage || latestResponse?.continue_with_stage || state.current_stage || null,
|
|
4263
4321
|
latest_kind: state.checkpoint_packet?.kind || latestPacket?.kind || null,
|
|
@@ -4496,6 +4554,7 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
4496
4554
|
const visualDelta = visualDeltaFrom({ fullRiddleState: fullState, runState: state });
|
|
4497
4555
|
const artifacts = artifactsFrom({ fullRiddleState: fullState, runState: state });
|
|
4498
4556
|
const viewportMatrix = viewportMatrixFrom({ fullRiddleState: fullState, runState: state });
|
|
4557
|
+
const shipControl = shipControlStateFor({ state });
|
|
4499
4558
|
return {
|
|
4500
4559
|
version: RIDDLE_PROOF_RUN_CARD_VERSION,
|
|
4501
4560
|
run_id: state.run_id || "unknown",
|
|
@@ -4549,6 +4608,9 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
4549
4608
|
stop_condition: compactRecord({
|
|
4550
4609
|
status: state.status,
|
|
4551
4610
|
terminal: isTerminalStatus(state.status),
|
|
4611
|
+
ship_held: shipControl.ship_held,
|
|
4612
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
4613
|
+
ship_authorized: shipControl.ship_authorized,
|
|
4552
4614
|
blocker_code: state.blocker?.code || null,
|
|
4553
4615
|
blocker_message: state.blocker?.message || null,
|
|
4554
4616
|
proof_decision: state.proof_decision,
|
|
@@ -4709,7 +4771,8 @@ function appendStageHeartbeat(state, input) {
|
|
|
4709
4771
|
function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
4710
4772
|
const latestEvent = state.events[state.events.length - 1];
|
|
4711
4773
|
const runId = state.run_id || "unknown";
|
|
4712
|
-
const
|
|
4774
|
+
const shipControl = shipControlStateFor({ state });
|
|
4775
|
+
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;
|
|
4713
4776
|
const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
|
|
4714
4777
|
return compactRecord({
|
|
4715
4778
|
run_id: runId,
|
|
@@ -4723,6 +4786,9 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
|
4723
4786
|
pr_url: state.pr_url ?? null,
|
|
4724
4787
|
pr_branch: state.pr_branch ?? null,
|
|
4725
4788
|
pr_state: state.pr_state,
|
|
4789
|
+
ship_held: shipControl.ship_held,
|
|
4790
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
4791
|
+
ship_authorized: shipControl.ship_authorized,
|
|
4726
4792
|
ci_status: state.ci_status,
|
|
4727
4793
|
ship_commit: state.ship_commit,
|
|
4728
4794
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -4748,6 +4814,7 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
|
4748
4814
|
function setRunStatus(state, status, at = timestamp2()) {
|
|
4749
4815
|
state.status = status;
|
|
4750
4816
|
state.ok = status !== "blocked" && status !== "failed";
|
|
4817
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
4751
4818
|
state.updated_at = at;
|
|
4752
4819
|
return state;
|
|
4753
4820
|
}
|
|
@@ -4816,9 +4883,6 @@ function loadRunState(input) {
|
|
|
4816
4883
|
state_path: statePath
|
|
4817
4884
|
});
|
|
4818
4885
|
}
|
|
4819
|
-
function isProtectedFinalStatus(status) {
|
|
4820
|
-
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
4821
|
-
}
|
|
4822
4886
|
function shouldPreserveFinalizedRunState(filePath, incoming) {
|
|
4823
4887
|
const existing = readJson(filePath);
|
|
4824
4888
|
if (!existing?.finalized || !isProtectedFinalStatus(existing.status)) return false;
|
|
@@ -5009,7 +5073,7 @@ function shipHeldTerminal(state, result) {
|
|
|
5009
5073
|
"ready_to_ship",
|
|
5010
5074
|
result,
|
|
5011
5075
|
result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5012
|
-
{ ship_held: true }
|
|
5076
|
+
{ ship_held: true, shipping_disabled: true, ship_authorized: false }
|
|
5013
5077
|
);
|
|
5014
5078
|
}
|
|
5015
5079
|
function checkpointContinueStage2(result) {
|
|
@@ -5287,6 +5351,7 @@ function terminalResult(state, status, result, summary, raw = {}) {
|
|
|
5287
5351
|
engineResult: result
|
|
5288
5352
|
});
|
|
5289
5353
|
applyTerminalMetadata(state, metadata);
|
|
5354
|
+
applyShipControlState(state, { status, raw });
|
|
5290
5355
|
persist(state);
|
|
5291
5356
|
return createRunResult({
|
|
5292
5357
|
state,
|
|
@@ -5389,19 +5454,38 @@ function appendCheckpointResponse(state, response, input = {}) {
|
|
|
5389
5454
|
setRunStatus(state, "running", at);
|
|
5390
5455
|
persist(state);
|
|
5391
5456
|
}
|
|
5457
|
+
function checkpointResponseRejectedBlocker(state, input) {
|
|
5458
|
+
const packet = input.packet || null;
|
|
5459
|
+
const response = input.response || null;
|
|
5460
|
+
appendRunEvent(state, {
|
|
5461
|
+
kind: "checkpoint.response.rejected",
|
|
5462
|
+
checkpoint: response?.checkpoint || packet?.checkpoint || input.blocker.checkpoint || null,
|
|
5463
|
+
stage: packet?.stage || state.current_stage || "author",
|
|
5464
|
+
summary: input.blocker.message,
|
|
5465
|
+
details: compactRecord({
|
|
5466
|
+
code: input.blocker.code,
|
|
5467
|
+
decision: response?.decision,
|
|
5468
|
+
resume_token: response?.resume_token,
|
|
5469
|
+
packet_id: response?.packet_id,
|
|
5470
|
+
source: response?.source
|
|
5471
|
+
})
|
|
5472
|
+
});
|
|
5473
|
+
return { blocker: input.blocker };
|
|
5474
|
+
}
|
|
5392
5475
|
function checkpointResponseContinuation(state, value) {
|
|
5393
5476
|
if (!value) return {};
|
|
5394
5477
|
const packet = state.checkpoint_packet;
|
|
5395
5478
|
const response = normalizeCheckpointResponse(value);
|
|
5396
5479
|
if (!response) {
|
|
5397
|
-
return {
|
|
5480
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
5481
|
+
packet,
|
|
5398
5482
|
blocker: {
|
|
5399
5483
|
code: "checkpoint_response_invalid",
|
|
5400
5484
|
checkpoint: packet?.checkpoint || state.last_checkpoint || null,
|
|
5401
5485
|
message: "Checkpoint response was not a valid riddle-proof.checkpoint_response.v1 object.",
|
|
5402
5486
|
details: { checkpoint_packet: packet || null, checkpoint_summary: checkpointSummaryFromState(state) }
|
|
5403
5487
|
}
|
|
5404
|
-
};
|
|
5488
|
+
});
|
|
5405
5489
|
}
|
|
5406
5490
|
if (isDuplicateCheckpointResponse(state, response)) {
|
|
5407
5491
|
const stage = packet?.stage || state.current_stage || "author";
|
|
@@ -5432,17 +5516,20 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5432
5516
|
};
|
|
5433
5517
|
}
|
|
5434
5518
|
if (!packet) {
|
|
5435
|
-
return {
|
|
5519
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
5520
|
+
response,
|
|
5436
5521
|
blocker: {
|
|
5437
5522
|
code: "checkpoint_response_without_packet",
|
|
5438
5523
|
checkpoint: response.checkpoint,
|
|
5439
5524
|
message: "A checkpoint response was supplied, but the run state has no pending checkpoint packet.",
|
|
5440
5525
|
details: { response, checkpoint_summary: checkpointSummaryFromState(state) }
|
|
5441
5526
|
}
|
|
5442
|
-
};
|
|
5527
|
+
});
|
|
5443
5528
|
}
|
|
5444
5529
|
if (response.run_id !== packet.run_id || response.checkpoint !== packet.checkpoint) {
|
|
5445
|
-
return {
|
|
5530
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
5531
|
+
packet,
|
|
5532
|
+
response,
|
|
5446
5533
|
blocker: {
|
|
5447
5534
|
code: "checkpoint_response_mismatch",
|
|
5448
5535
|
checkpoint: packet.checkpoint,
|
|
@@ -5453,10 +5540,12 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5453
5540
|
actual: { run_id: response.run_id, checkpoint: response.checkpoint }
|
|
5454
5541
|
}
|
|
5455
5542
|
}
|
|
5456
|
-
};
|
|
5543
|
+
});
|
|
5457
5544
|
}
|
|
5458
5545
|
if (packet.resume_token && response.resume_token !== packet.resume_token) {
|
|
5459
|
-
return {
|
|
5546
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
5547
|
+
packet,
|
|
5548
|
+
response,
|
|
5460
5549
|
blocker: {
|
|
5461
5550
|
code: "checkpoint_response_resume_token_mismatch",
|
|
5462
5551
|
checkpoint: packet.checkpoint,
|
|
@@ -5467,10 +5556,12 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5467
5556
|
actual_resume_token: response.resume_token || null
|
|
5468
5557
|
}
|
|
5469
5558
|
}
|
|
5470
|
-
};
|
|
5559
|
+
});
|
|
5471
5560
|
}
|
|
5472
5561
|
if (packet.packet_id && response.packet_id !== packet.packet_id) {
|
|
5473
|
-
return {
|
|
5562
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
5563
|
+
packet,
|
|
5564
|
+
response,
|
|
5474
5565
|
blocker: {
|
|
5475
5566
|
code: "checkpoint_response_packet_id_mismatch",
|
|
5476
5567
|
checkpoint: packet.checkpoint,
|
|
@@ -5483,10 +5574,12 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5483
5574
|
actual_resume_token: response.resume_token || null
|
|
5484
5575
|
}
|
|
5485
5576
|
}
|
|
5486
|
-
};
|
|
5577
|
+
});
|
|
5487
5578
|
}
|
|
5488
5579
|
if (!packet.allowed_decisions.includes(response.decision)) {
|
|
5489
|
-
return {
|
|
5580
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
5581
|
+
packet,
|
|
5582
|
+
response,
|
|
5490
5583
|
blocker: {
|
|
5491
5584
|
code: "checkpoint_response_decision_not_allowed",
|
|
5492
5585
|
checkpoint: packet.checkpoint,
|
|
@@ -5498,7 +5591,7 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5498
5591
|
response
|
|
5499
5592
|
}
|
|
5500
5593
|
}
|
|
5501
|
-
};
|
|
5594
|
+
});
|
|
5502
5595
|
}
|
|
5503
5596
|
const base = {
|
|
5504
5597
|
action: "run",
|
|
@@ -5508,14 +5601,16 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5508
5601
|
if (response.decision === "author_packet") {
|
|
5509
5602
|
const payload = authorPacketPayloadFromCheckpointResponse(response);
|
|
5510
5603
|
if (!payload) {
|
|
5511
|
-
return {
|
|
5604
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
5605
|
+
packet,
|
|
5606
|
+
response,
|
|
5512
5607
|
blocker: {
|
|
5513
5608
|
code: "checkpoint_author_packet_missing",
|
|
5514
5609
|
checkpoint: packet.checkpoint,
|
|
5515
5610
|
message: "Checkpoint response decision=author_packet did not include a proof_plan and capture_script payload.",
|
|
5516
5611
|
details: { stage: packet.stage, response }
|
|
5517
5612
|
}
|
|
5518
|
-
};
|
|
5613
|
+
});
|
|
5519
5614
|
}
|
|
5520
5615
|
state.proof_contract = proofContractFromAuthorCheckpointResponse(response, packet, payload);
|
|
5521
5616
|
appendCheckpointResponse(state, response);
|
|
@@ -5544,14 +5639,16 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5544
5639
|
const workdir = nonEmptyString(packet.state_excerpt?.after_worktree) || state.worktree_path;
|
|
5545
5640
|
if (workdir) state.worktree_path = workdir;
|
|
5546
5641
|
if (!hasGitDiff(workdir)) {
|
|
5547
|
-
return {
|
|
5642
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
5643
|
+
packet,
|
|
5644
|
+
response,
|
|
5548
5645
|
blocker: {
|
|
5549
5646
|
code: "implementation_diff_missing",
|
|
5550
5647
|
checkpoint: packet.checkpoint,
|
|
5551
5648
|
message: "Checkpoint response claimed implementation_complete, but the after worktree has no detectable git diff.",
|
|
5552
5649
|
details: { stage: packet.stage, worktree_path: workdir || null, response }
|
|
5553
5650
|
}
|
|
5554
|
-
};
|
|
5651
|
+
});
|
|
5555
5652
|
}
|
|
5556
5653
|
appendCheckpointResponse(state, response);
|
|
5557
5654
|
return {
|
|
@@ -5600,7 +5697,13 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5600
5697
|
response,
|
|
5601
5698
|
code: "checkpoint_response_source_not_trusted"
|
|
5602
5699
|
});
|
|
5603
|
-
if (sourceBlocker)
|
|
5700
|
+
if (sourceBlocker) {
|
|
5701
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
5702
|
+
packet,
|
|
5703
|
+
response,
|
|
5704
|
+
blocker: sourceBlocker
|
|
5705
|
+
});
|
|
5706
|
+
}
|
|
5604
5707
|
appendCheckpointResponse(state, response);
|
|
5605
5708
|
if (state.request.ship_mode !== "ship" && proofAssessmentRequestsShip(assessment)) {
|
|
5606
5709
|
const result = {
|
|
@@ -5619,6 +5722,8 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5619
5722
|
response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5620
5723
|
{
|
|
5621
5724
|
ship_held: true,
|
|
5725
|
+
shipping_disabled: true,
|
|
5726
|
+
ship_authorized: false,
|
|
5622
5727
|
proof_assessment: assessment
|
|
5623
5728
|
}
|
|
5624
5729
|
)
|
|
@@ -6212,6 +6317,8 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
6212
6317
|
assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
6213
6318
|
{
|
|
6214
6319
|
ship_held: true,
|
|
6320
|
+
shipping_disabled: true,
|
|
6321
|
+
ship_authorized: false,
|
|
6215
6322
|
proof_assessment: payload
|
|
6216
6323
|
}
|
|
6217
6324
|
)
|
|
@@ -2,12 +2,12 @@ import {
|
|
|
2
2
|
createDisabledRiddleProofAgentAdapter,
|
|
3
3
|
readRiddleProofRunStatus,
|
|
4
4
|
runRiddleProofEngineHarness
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-GHBNDHG7.js";
|
|
6
|
+
import "../chunk-UZIX7M7D.js";
|
|
7
|
+
import "../chunk-KNPCWWF3.js";
|
|
8
8
|
import "../chunk-EKZXU6MU.js";
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-MOTQNIZX.js";
|
|
10
|
+
import "../chunk-CUBYSWZT.js";
|
|
11
11
|
import "../chunk-MLKGABMK.js";
|
|
12
12
|
export {
|
|
13
13
|
createDisabledRiddleProofAgentAdapter,
|