@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/advanced/index.cjs
CHANGED
|
@@ -3457,6 +3457,9 @@ __export(runner_exports, {
|
|
|
3457
3457
|
function isTerminalStatus(status) {
|
|
3458
3458
|
return status === "blocked" || status === "failed" || status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
3459
3459
|
}
|
|
3460
|
+
function isProtectedFinalStatus(status) {
|
|
3461
|
+
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
3462
|
+
}
|
|
3460
3463
|
function isSuccessfulStatus(status) {
|
|
3461
3464
|
return status !== "blocked" && status !== "failed";
|
|
3462
3465
|
}
|
|
@@ -3554,6 +3557,9 @@ function normalizeTerminalMetadata(input) {
|
|
|
3554
3557
|
pr_state: prState,
|
|
3555
3558
|
marked_ready: markedReady,
|
|
3556
3559
|
left_draft: leftDraft,
|
|
3560
|
+
ship_held: firstBoolean(riddleState.ship_held, result.ship_held, result.shipHeld, details.ship_held, details.shipHeld, shipReport.ship_held, shipReport.shipHeld),
|
|
3561
|
+
shipping_disabled: firstBoolean(riddleState.shipping_disabled, result.shipping_disabled, result.shippingDisabled, details.shipping_disabled, details.shippingDisabled, shipReport.shipping_disabled, shipReport.shippingDisabled),
|
|
3562
|
+
ship_authorized: firstBoolean(riddleState.ship_authorized, result.ship_authorized, result.shipAuthorized, details.ship_authorized, details.shipAuthorized, shipReport.ship_authorized, shipReport.shipAuthorized),
|
|
3557
3563
|
ci_status: firstNonEmptyString(riddleState.ci_status, result.ci_status, result.ciStatus, details.ci_status, details.ciStatus, shipReport.ci_status),
|
|
3558
3564
|
ship_commit: firstNonEmptyString(riddleState.ship_commit, result.ship_commit, result.shipCommit, details.ship_commit, details.shipCommit, shipReport.shipped_commit, shipReport.ship_commit),
|
|
3559
3565
|
ship_remote_head: firstNonEmptyString(riddleState.ship_remote_head, result.ship_remote_head, result.shipRemoteHead, details.ship_remote_head, details.shipRemoteHead, shipReport.ship_remote_head),
|
|
@@ -3587,6 +3593,9 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
3587
3593
|
if (prBranch) state.pr_branch = prBranch;
|
|
3588
3594
|
if (typeof metadata.marked_ready === "boolean") state.marked_ready = metadata.marked_ready;
|
|
3589
3595
|
if (typeof metadata.left_draft === "boolean") state.left_draft = metadata.left_draft;
|
|
3596
|
+
if (typeof metadata.ship_held === "boolean") state.ship_held = metadata.ship_held;
|
|
3597
|
+
if (typeof metadata.shipping_disabled === "boolean") state.shipping_disabled = metadata.shipping_disabled;
|
|
3598
|
+
if (typeof metadata.ship_authorized === "boolean") state.ship_authorized = metadata.ship_authorized;
|
|
3590
3599
|
const ciStatus = nonEmptyString(metadata.ci_status);
|
|
3591
3600
|
if (ciStatus) state.ci_status = ciStatus;
|
|
3592
3601
|
const shipCommit = nonEmptyString(metadata.ship_commit);
|
|
@@ -3618,12 +3627,54 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
3618
3627
|
if (typeof metadata.finalized === "boolean") state.finalized = metadata.finalized;
|
|
3619
3628
|
return state;
|
|
3620
3629
|
}
|
|
3630
|
+
function shipControlStateFor(input) {
|
|
3631
|
+
const state = input.state;
|
|
3632
|
+
const status = input.status || state.status;
|
|
3633
|
+
const raw = recordValue(input.raw) || {};
|
|
3634
|
+
const shipReport = recordValue(state.ship_report) || {};
|
|
3635
|
+
const prState = recordValue(state.pr_state) || {};
|
|
3636
|
+
const shippingDisabled = firstBoolean(
|
|
3637
|
+
raw.shipping_disabled,
|
|
3638
|
+
raw.shippingDisabled,
|
|
3639
|
+
state.shipping_disabled,
|
|
3640
|
+
shipReport.shipping_disabled,
|
|
3641
|
+
shipReport.shippingDisabled
|
|
3642
|
+
) ?? state.request?.ship_mode === "none";
|
|
3643
|
+
const explicitAuthorized = firstBoolean(
|
|
3644
|
+
raw.ship_authorized,
|
|
3645
|
+
raw.shipAuthorized,
|
|
3646
|
+
state.ship_authorized,
|
|
3647
|
+
shipReport.ship_authorized,
|
|
3648
|
+
shipReport.shipAuthorized
|
|
3649
|
+
);
|
|
3650
|
+
const authorizationEvidence = Boolean(
|
|
3651
|
+
status === "shipped" || state.marked_ready === true || shipReport.marked_ready === true || prState.status === "merged" || state.merge_commit || state.merged_at
|
|
3652
|
+
);
|
|
3653
|
+
const inferredAuthorized = explicitAuthorized ?? authorizationEvidence;
|
|
3654
|
+
const rawHeld = firstBoolean(raw.ship_held, raw.shipHeld);
|
|
3655
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !inferredAuthorized;
|
|
3656
|
+
const shipHeld = rawHeld ?? (state.ship_held === true || inferredHeld);
|
|
3657
|
+
return {
|
|
3658
|
+
ship_held: shipHeld,
|
|
3659
|
+
shipping_disabled: shippingDisabled,
|
|
3660
|
+
ship_authorized: shipHeld ? false : inferredAuthorized
|
|
3661
|
+
};
|
|
3662
|
+
}
|
|
3663
|
+
function applyShipControlState(state, input = {}) {
|
|
3664
|
+
const control = shipControlStateFor({ state, status: input.status, raw: input.raw });
|
|
3665
|
+
state.ship_held = control.ship_held;
|
|
3666
|
+
state.shipping_disabled = control.shipping_disabled;
|
|
3667
|
+
state.ship_authorized = control.ship_authorized;
|
|
3668
|
+
return state;
|
|
3669
|
+
}
|
|
3621
3670
|
function createRunResult(input) {
|
|
3622
3671
|
const status = input.status || input.state.status;
|
|
3623
3672
|
const ok = isSuccessfulStatus(status);
|
|
3624
3673
|
const state = input.metadata ? applyTerminalMetadata(input.state, input.metadata) : input.state;
|
|
3625
3674
|
state.status = status;
|
|
3626
3675
|
state.ok = ok;
|
|
3676
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
3677
|
+
applyShipControlState(state, { status, raw: input.raw });
|
|
3627
3678
|
return compactRecord({
|
|
3628
3679
|
ok,
|
|
3629
3680
|
status,
|
|
@@ -3641,6 +3692,9 @@ function createRunResult(input) {
|
|
|
3641
3692
|
pr_state: state.pr_state,
|
|
3642
3693
|
marked_ready: state.marked_ready,
|
|
3643
3694
|
left_draft: state.left_draft,
|
|
3695
|
+
ship_held: state.ship_held,
|
|
3696
|
+
shipping_disabled: state.shipping_disabled,
|
|
3697
|
+
ship_authorized: state.ship_authorized,
|
|
3644
3698
|
ci_status: state.ci_status,
|
|
3645
3699
|
ship_commit: state.ship_commit,
|
|
3646
3700
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -4277,6 +4331,8 @@ function checkpointSummaryFromState(state, engineStatePath2) {
|
|
|
4277
4331
|
const packets = history.filter((entry) => entry.packet);
|
|
4278
4332
|
const responses = acceptedCheckpointResponseEntries(state);
|
|
4279
4333
|
const duplicateResponses = events.filter((event) => event.kind === "checkpoint.response.duplicate");
|
|
4334
|
+
const rejectedResponses = events.filter((event) => event.kind === "checkpoint.response.rejected");
|
|
4335
|
+
const ignoredResponses = events.filter((event) => event.kind === "checkpoint.response.ignored");
|
|
4280
4336
|
const latestPacketEntry = [...history].reverse().find((entry) => entry.packet);
|
|
4281
4337
|
const latestResponseEntry = [...responses].reverse().find((entry) => entry.response);
|
|
4282
4338
|
const latestPacket = state.checkpoint_packet || latestPacketEntry?.packet;
|
|
@@ -4292,6 +4348,8 @@ function checkpointSummaryFromState(state, engineStatePath2) {
|
|
|
4292
4348
|
packet_count: packets.length,
|
|
4293
4349
|
response_count: responses.length,
|
|
4294
4350
|
duplicate_response_count: duplicateResponses.length,
|
|
4351
|
+
rejected_response_count: rejectedResponses.length,
|
|
4352
|
+
ignored_response_count: ignoredResponses.length,
|
|
4295
4353
|
latest_checkpoint: state.checkpoint_packet?.checkpoint || latestResponse?.checkpoint || state.last_checkpoint || null,
|
|
4296
4354
|
latest_stage: state.checkpoint_packet?.stage || latestResponse?.continue_with_stage || state.current_stage || null,
|
|
4297
4355
|
latest_kind: state.checkpoint_packet?.kind || latestPacket?.kind || null,
|
|
@@ -4530,6 +4588,7 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
4530
4588
|
const visualDelta = visualDeltaFrom({ fullRiddleState: fullState, runState: state });
|
|
4531
4589
|
const artifacts = artifactsFrom({ fullRiddleState: fullState, runState: state });
|
|
4532
4590
|
const viewportMatrix = viewportMatrixFrom({ fullRiddleState: fullState, runState: state });
|
|
4591
|
+
const shipControl = shipControlStateFor({ state });
|
|
4533
4592
|
return {
|
|
4534
4593
|
version: RIDDLE_PROOF_RUN_CARD_VERSION,
|
|
4535
4594
|
run_id: state.run_id || "unknown",
|
|
@@ -4583,6 +4642,9 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
4583
4642
|
stop_condition: compactRecord({
|
|
4584
4643
|
status: state.status,
|
|
4585
4644
|
terminal: isTerminalStatus(state.status),
|
|
4645
|
+
ship_held: shipControl.ship_held,
|
|
4646
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
4647
|
+
ship_authorized: shipControl.ship_authorized,
|
|
4586
4648
|
blocker_code: state.blocker?.code || null,
|
|
4587
4649
|
blocker_message: state.blocker?.message || null,
|
|
4588
4650
|
proof_decision: state.proof_decision,
|
|
@@ -4743,7 +4805,8 @@ function appendStageHeartbeat(state, input) {
|
|
|
4743
4805
|
function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
4744
4806
|
const latestEvent = state.events[state.events.length - 1];
|
|
4745
4807
|
const runId = state.run_id || "unknown";
|
|
4746
|
-
const
|
|
4808
|
+
const shipControl = shipControlStateFor({ state });
|
|
4809
|
+
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;
|
|
4747
4810
|
const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
|
|
4748
4811
|
return compactRecord({
|
|
4749
4812
|
run_id: runId,
|
|
@@ -4757,6 +4820,9 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
|
4757
4820
|
pr_url: state.pr_url ?? null,
|
|
4758
4821
|
pr_branch: state.pr_branch ?? null,
|
|
4759
4822
|
pr_state: state.pr_state,
|
|
4823
|
+
ship_held: shipControl.ship_held,
|
|
4824
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
4825
|
+
ship_authorized: shipControl.ship_authorized,
|
|
4760
4826
|
ci_status: state.ci_status,
|
|
4761
4827
|
ship_commit: state.ship_commit,
|
|
4762
4828
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -4782,6 +4848,7 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
|
4782
4848
|
function setRunStatus(state, status, at = timestamp2()) {
|
|
4783
4849
|
state.status = status;
|
|
4784
4850
|
state.ok = status !== "blocked" && status !== "failed";
|
|
4851
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
4785
4852
|
state.updated_at = at;
|
|
4786
4853
|
return state;
|
|
4787
4854
|
}
|
|
@@ -5223,7 +5290,7 @@ async function runRiddleProof(input) {
|
|
|
5223
5290
|
status: "ready_to_ship",
|
|
5224
5291
|
last_summary: assessment.summary,
|
|
5225
5292
|
evidence_bundle: evidenceBundle,
|
|
5226
|
-
raw: { implementation, assessment }
|
|
5293
|
+
raw: { implementation, assessment, ship_held: true, shipping_disabled: true, ship_authorized: false }
|
|
5227
5294
|
});
|
|
5228
5295
|
return notifyIfConfigured({ state, result: result2, notification: adapters.notification });
|
|
5229
5296
|
}
|
|
@@ -5355,9 +5422,6 @@ function loadRunState(input) {
|
|
|
5355
5422
|
state_path: statePath
|
|
5356
5423
|
});
|
|
5357
5424
|
}
|
|
5358
|
-
function isProtectedFinalStatus(status) {
|
|
5359
|
-
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
5360
|
-
}
|
|
5361
5425
|
function shouldPreserveFinalizedRunState(filePath, incoming) {
|
|
5362
5426
|
const existing = readJson(filePath);
|
|
5363
5427
|
if (!existing?.finalized || !isProtectedFinalStatus(existing.status)) return false;
|
|
@@ -5548,7 +5612,7 @@ function shipHeldTerminal(state, result) {
|
|
|
5548
5612
|
"ready_to_ship",
|
|
5549
5613
|
result,
|
|
5550
5614
|
result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5551
|
-
{ ship_held: true }
|
|
5615
|
+
{ ship_held: true, shipping_disabled: true, ship_authorized: false }
|
|
5552
5616
|
);
|
|
5553
5617
|
}
|
|
5554
5618
|
function checkpointContinueStage2(result) {
|
|
@@ -5826,6 +5890,7 @@ function terminalResult(state, status, result, summary, raw = {}) {
|
|
|
5826
5890
|
engineResult: result
|
|
5827
5891
|
});
|
|
5828
5892
|
applyTerminalMetadata(state, metadata);
|
|
5893
|
+
applyShipControlState(state, { status, raw });
|
|
5829
5894
|
persist(state);
|
|
5830
5895
|
return createRunResult({
|
|
5831
5896
|
state,
|
|
@@ -5928,19 +5993,38 @@ function appendCheckpointResponse(state, response, input = {}) {
|
|
|
5928
5993
|
setRunStatus(state, "running", at);
|
|
5929
5994
|
persist(state);
|
|
5930
5995
|
}
|
|
5996
|
+
function checkpointResponseRejectedBlocker(state, input) {
|
|
5997
|
+
const packet = input.packet || null;
|
|
5998
|
+
const response = input.response || null;
|
|
5999
|
+
appendRunEvent(state, {
|
|
6000
|
+
kind: "checkpoint.response.rejected",
|
|
6001
|
+
checkpoint: response?.checkpoint || packet?.checkpoint || input.blocker.checkpoint || null,
|
|
6002
|
+
stage: packet?.stage || state.current_stage || "author",
|
|
6003
|
+
summary: input.blocker.message,
|
|
6004
|
+
details: compactRecord({
|
|
6005
|
+
code: input.blocker.code,
|
|
6006
|
+
decision: response?.decision,
|
|
6007
|
+
resume_token: response?.resume_token,
|
|
6008
|
+
packet_id: response?.packet_id,
|
|
6009
|
+
source: response?.source
|
|
6010
|
+
})
|
|
6011
|
+
});
|
|
6012
|
+
return { blocker: input.blocker };
|
|
6013
|
+
}
|
|
5931
6014
|
function checkpointResponseContinuation(state, value) {
|
|
5932
6015
|
if (!value) return {};
|
|
5933
6016
|
const packet = state.checkpoint_packet;
|
|
5934
6017
|
const response = normalizeCheckpointResponse(value);
|
|
5935
6018
|
if (!response) {
|
|
5936
|
-
return {
|
|
6019
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
6020
|
+
packet,
|
|
5937
6021
|
blocker: {
|
|
5938
6022
|
code: "checkpoint_response_invalid",
|
|
5939
6023
|
checkpoint: packet?.checkpoint || state.last_checkpoint || null,
|
|
5940
6024
|
message: "Checkpoint response was not a valid riddle-proof.checkpoint_response.v1 object.",
|
|
5941
6025
|
details: { checkpoint_packet: packet || null, checkpoint_summary: checkpointSummaryFromState(state) }
|
|
5942
6026
|
}
|
|
5943
|
-
};
|
|
6027
|
+
});
|
|
5944
6028
|
}
|
|
5945
6029
|
if (isDuplicateCheckpointResponse(state, response)) {
|
|
5946
6030
|
const stage = packet?.stage || state.current_stage || "author";
|
|
@@ -5971,17 +6055,20 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5971
6055
|
};
|
|
5972
6056
|
}
|
|
5973
6057
|
if (!packet) {
|
|
5974
|
-
return {
|
|
6058
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
6059
|
+
response,
|
|
5975
6060
|
blocker: {
|
|
5976
6061
|
code: "checkpoint_response_without_packet",
|
|
5977
6062
|
checkpoint: response.checkpoint,
|
|
5978
6063
|
message: "A checkpoint response was supplied, but the run state has no pending checkpoint packet.",
|
|
5979
6064
|
details: { response, checkpoint_summary: checkpointSummaryFromState(state) }
|
|
5980
6065
|
}
|
|
5981
|
-
};
|
|
6066
|
+
});
|
|
5982
6067
|
}
|
|
5983
6068
|
if (response.run_id !== packet.run_id || response.checkpoint !== packet.checkpoint) {
|
|
5984
|
-
return {
|
|
6069
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
6070
|
+
packet,
|
|
6071
|
+
response,
|
|
5985
6072
|
blocker: {
|
|
5986
6073
|
code: "checkpoint_response_mismatch",
|
|
5987
6074
|
checkpoint: packet.checkpoint,
|
|
@@ -5992,10 +6079,12 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5992
6079
|
actual: { run_id: response.run_id, checkpoint: response.checkpoint }
|
|
5993
6080
|
}
|
|
5994
6081
|
}
|
|
5995
|
-
};
|
|
6082
|
+
});
|
|
5996
6083
|
}
|
|
5997
6084
|
if (packet.resume_token && response.resume_token !== packet.resume_token) {
|
|
5998
|
-
return {
|
|
6085
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
6086
|
+
packet,
|
|
6087
|
+
response,
|
|
5999
6088
|
blocker: {
|
|
6000
6089
|
code: "checkpoint_response_resume_token_mismatch",
|
|
6001
6090
|
checkpoint: packet.checkpoint,
|
|
@@ -6006,10 +6095,12 @@ function checkpointResponseContinuation(state, value) {
|
|
|
6006
6095
|
actual_resume_token: response.resume_token || null
|
|
6007
6096
|
}
|
|
6008
6097
|
}
|
|
6009
|
-
};
|
|
6098
|
+
});
|
|
6010
6099
|
}
|
|
6011
6100
|
if (packet.packet_id && response.packet_id !== packet.packet_id) {
|
|
6012
|
-
return {
|
|
6101
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
6102
|
+
packet,
|
|
6103
|
+
response,
|
|
6013
6104
|
blocker: {
|
|
6014
6105
|
code: "checkpoint_response_packet_id_mismatch",
|
|
6015
6106
|
checkpoint: packet.checkpoint,
|
|
@@ -6022,10 +6113,12 @@ function checkpointResponseContinuation(state, value) {
|
|
|
6022
6113
|
actual_resume_token: response.resume_token || null
|
|
6023
6114
|
}
|
|
6024
6115
|
}
|
|
6025
|
-
};
|
|
6116
|
+
});
|
|
6026
6117
|
}
|
|
6027
6118
|
if (!packet.allowed_decisions.includes(response.decision)) {
|
|
6028
|
-
return {
|
|
6119
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
6120
|
+
packet,
|
|
6121
|
+
response,
|
|
6029
6122
|
blocker: {
|
|
6030
6123
|
code: "checkpoint_response_decision_not_allowed",
|
|
6031
6124
|
checkpoint: packet.checkpoint,
|
|
@@ -6037,7 +6130,7 @@ function checkpointResponseContinuation(state, value) {
|
|
|
6037
6130
|
response
|
|
6038
6131
|
}
|
|
6039
6132
|
}
|
|
6040
|
-
};
|
|
6133
|
+
});
|
|
6041
6134
|
}
|
|
6042
6135
|
const base = {
|
|
6043
6136
|
action: "run",
|
|
@@ -6047,14 +6140,16 @@ function checkpointResponseContinuation(state, value) {
|
|
|
6047
6140
|
if (response.decision === "author_packet") {
|
|
6048
6141
|
const payload = authorPacketPayloadFromCheckpointResponse(response);
|
|
6049
6142
|
if (!payload) {
|
|
6050
|
-
return {
|
|
6143
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
6144
|
+
packet,
|
|
6145
|
+
response,
|
|
6051
6146
|
blocker: {
|
|
6052
6147
|
code: "checkpoint_author_packet_missing",
|
|
6053
6148
|
checkpoint: packet.checkpoint,
|
|
6054
6149
|
message: "Checkpoint response decision=author_packet did not include a proof_plan and capture_script payload.",
|
|
6055
6150
|
details: { stage: packet.stage, response }
|
|
6056
6151
|
}
|
|
6057
|
-
};
|
|
6152
|
+
});
|
|
6058
6153
|
}
|
|
6059
6154
|
state.proof_contract = proofContractFromAuthorCheckpointResponse(response, packet, payload);
|
|
6060
6155
|
appendCheckpointResponse(state, response);
|
|
@@ -6083,14 +6178,16 @@ function checkpointResponseContinuation(state, value) {
|
|
|
6083
6178
|
const workdir = nonEmptyString(packet.state_excerpt?.after_worktree) || state.worktree_path;
|
|
6084
6179
|
if (workdir) state.worktree_path = workdir;
|
|
6085
6180
|
if (!hasGitDiff(workdir)) {
|
|
6086
|
-
return {
|
|
6181
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
6182
|
+
packet,
|
|
6183
|
+
response,
|
|
6087
6184
|
blocker: {
|
|
6088
6185
|
code: "implementation_diff_missing",
|
|
6089
6186
|
checkpoint: packet.checkpoint,
|
|
6090
6187
|
message: "Checkpoint response claimed implementation_complete, but the after worktree has no detectable git diff.",
|
|
6091
6188
|
details: { stage: packet.stage, worktree_path: workdir || null, response }
|
|
6092
6189
|
}
|
|
6093
|
-
};
|
|
6190
|
+
});
|
|
6094
6191
|
}
|
|
6095
6192
|
appendCheckpointResponse(state, response);
|
|
6096
6193
|
return {
|
|
@@ -6139,7 +6236,13 @@ function checkpointResponseContinuation(state, value) {
|
|
|
6139
6236
|
response,
|
|
6140
6237
|
code: "checkpoint_response_source_not_trusted"
|
|
6141
6238
|
});
|
|
6142
|
-
if (sourceBlocker)
|
|
6239
|
+
if (sourceBlocker) {
|
|
6240
|
+
return checkpointResponseRejectedBlocker(state, {
|
|
6241
|
+
packet,
|
|
6242
|
+
response,
|
|
6243
|
+
blocker: sourceBlocker
|
|
6244
|
+
});
|
|
6245
|
+
}
|
|
6143
6246
|
appendCheckpointResponse(state, response);
|
|
6144
6247
|
if (state.request.ship_mode !== "ship" && proofAssessmentRequestsShip(assessment)) {
|
|
6145
6248
|
const result = {
|
|
@@ -6158,6 +6261,8 @@ function checkpointResponseContinuation(state, value) {
|
|
|
6158
6261
|
response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
6159
6262
|
{
|
|
6160
6263
|
ship_held: true,
|
|
6264
|
+
shipping_disabled: true,
|
|
6265
|
+
ship_authorized: false,
|
|
6161
6266
|
proof_assessment: assessment
|
|
6162
6267
|
}
|
|
6163
6268
|
)
|
|
@@ -6751,6 +6856,8 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
6751
6856
|
assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
6752
6857
|
{
|
|
6753
6858
|
ship_held: true,
|
|
6859
|
+
shipping_disabled: true,
|
|
6860
|
+
ship_authorized: false,
|
|
6754
6861
|
proof_assessment: payload
|
|
6755
6862
|
}
|
|
6756
6863
|
)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { b as runner } from '../runner-4LJ5z0D-.cjs';
|
|
2
2
|
export { l as engineHarness } from '../engine-harness-LBfqbFSe.cjs';
|
|
3
3
|
export { p as proofRunCore } from '../proof-run-core-7Dqm7RKM.cjs';
|
|
4
|
-
export { p as proofRunEngine } from '../proof-run-engine-
|
|
4
|
+
export { p as proofRunEngine } from '../proof-run-engine-DpChFR5H.cjs';
|
|
5
5
|
import '../types.cjs';
|
package/dist/advanced/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { b as runner } from '../runner-BdQpOkZD.js';
|
|
2
2
|
export { l as engineHarness } from '../engine-harness-CMACHP6A.js';
|
|
3
3
|
export { p as proofRunCore } from '../proof-run-core-7Dqm7RKM.js';
|
|
4
|
-
export { p as proofRunEngine } from '../proof-run-engine-
|
|
4
|
+
export { p as proofRunEngine } from '../proof-run-engine-BqRoA3Do.js';
|
|
5
5
|
import '../types.js';
|
package/dist/advanced/index.js
CHANGED
|
@@ -3,17 +3,17 @@ import {
|
|
|
3
3
|
} from "../chunk-VYJD6XYF.js";
|
|
4
4
|
import {
|
|
5
5
|
runner_exports
|
|
6
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-JLOZTVXU.js";
|
|
7
7
|
import {
|
|
8
8
|
engine_harness_exports
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-GHBNDHG7.js";
|
|
10
|
+
import "../chunk-UZIX7M7D.js";
|
|
11
|
+
import "../chunk-KNPCWWF3.js";
|
|
12
12
|
import {
|
|
13
13
|
proof_run_core_exports
|
|
14
14
|
} from "../chunk-EKZXU6MU.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-MOTQNIZX.js";
|
|
16
|
+
import "../chunk-CUBYSWZT.js";
|
|
17
17
|
import "../chunk-MLKGABMK.js";
|
|
18
18
|
export {
|
|
19
19
|
engine_harness_exports as engineHarness,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-
|
|
1
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-DpChFR5H.cjs';
|
|
2
2
|
import '../proof-run-core-7Dqm7RKM.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-
|
|
1
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-BqRoA3Do.js';
|
|
2
2
|
import '../proof-run-core-7Dqm7RKM.js';
|
package/dist/advanced/runner.cjs
CHANGED
|
@@ -35,6 +35,9 @@ __export(runner_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(runner_exports);
|
|
36
36
|
|
|
37
37
|
// src/result.ts
|
|
38
|
+
function isProtectedFinalStatus(status) {
|
|
39
|
+
return status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
40
|
+
}
|
|
38
41
|
function isSuccessfulStatus(status) {
|
|
39
42
|
return status !== "blocked" && status !== "failed";
|
|
40
43
|
}
|
|
@@ -47,6 +50,12 @@ function nonEmptyString(value) {
|
|
|
47
50
|
function recordValue(value) {
|
|
48
51
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
49
52
|
}
|
|
53
|
+
function firstBoolean(...values) {
|
|
54
|
+
for (const value of values) {
|
|
55
|
+
if (typeof value === "boolean") return value;
|
|
56
|
+
}
|
|
57
|
+
return void 0;
|
|
58
|
+
}
|
|
50
59
|
function applyTerminalMetadata(state, metadata) {
|
|
51
60
|
if (metadata.pr_state) {
|
|
52
61
|
state.pr_state = metadata.pr_state;
|
|
@@ -63,6 +72,9 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
63
72
|
if (prBranch) state.pr_branch = prBranch;
|
|
64
73
|
if (typeof metadata.marked_ready === "boolean") state.marked_ready = metadata.marked_ready;
|
|
65
74
|
if (typeof metadata.left_draft === "boolean") state.left_draft = metadata.left_draft;
|
|
75
|
+
if (typeof metadata.ship_held === "boolean") state.ship_held = metadata.ship_held;
|
|
76
|
+
if (typeof metadata.shipping_disabled === "boolean") state.shipping_disabled = metadata.shipping_disabled;
|
|
77
|
+
if (typeof metadata.ship_authorized === "boolean") state.ship_authorized = metadata.ship_authorized;
|
|
66
78
|
const ciStatus = nonEmptyString(metadata.ci_status);
|
|
67
79
|
if (ciStatus) state.ci_status = ciStatus;
|
|
68
80
|
const shipCommit = nonEmptyString(metadata.ship_commit);
|
|
@@ -94,12 +106,54 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
94
106
|
if (typeof metadata.finalized === "boolean") state.finalized = metadata.finalized;
|
|
95
107
|
return state;
|
|
96
108
|
}
|
|
109
|
+
function shipControlStateFor(input) {
|
|
110
|
+
const state = input.state;
|
|
111
|
+
const status = input.status || state.status;
|
|
112
|
+
const raw = recordValue(input.raw) || {};
|
|
113
|
+
const shipReport = recordValue(state.ship_report) || {};
|
|
114
|
+
const prState = recordValue(state.pr_state) || {};
|
|
115
|
+
const shippingDisabled = firstBoolean(
|
|
116
|
+
raw.shipping_disabled,
|
|
117
|
+
raw.shippingDisabled,
|
|
118
|
+
state.shipping_disabled,
|
|
119
|
+
shipReport.shipping_disabled,
|
|
120
|
+
shipReport.shippingDisabled
|
|
121
|
+
) ?? state.request?.ship_mode === "none";
|
|
122
|
+
const explicitAuthorized = firstBoolean(
|
|
123
|
+
raw.ship_authorized,
|
|
124
|
+
raw.shipAuthorized,
|
|
125
|
+
state.ship_authorized,
|
|
126
|
+
shipReport.ship_authorized,
|
|
127
|
+
shipReport.shipAuthorized
|
|
128
|
+
);
|
|
129
|
+
const authorizationEvidence = Boolean(
|
|
130
|
+
status === "shipped" || state.marked_ready === true || shipReport.marked_ready === true || prState.status === "merged" || state.merge_commit || state.merged_at
|
|
131
|
+
);
|
|
132
|
+
const inferredAuthorized = explicitAuthorized ?? authorizationEvidence;
|
|
133
|
+
const rawHeld = firstBoolean(raw.ship_held, raw.shipHeld);
|
|
134
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !inferredAuthorized;
|
|
135
|
+
const shipHeld = rawHeld ?? (state.ship_held === true || inferredHeld);
|
|
136
|
+
return {
|
|
137
|
+
ship_held: shipHeld,
|
|
138
|
+
shipping_disabled: shippingDisabled,
|
|
139
|
+
ship_authorized: shipHeld ? false : inferredAuthorized
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function applyShipControlState(state, input = {}) {
|
|
143
|
+
const control = shipControlStateFor({ state, status: input.status, raw: input.raw });
|
|
144
|
+
state.ship_held = control.ship_held;
|
|
145
|
+
state.shipping_disabled = control.shipping_disabled;
|
|
146
|
+
state.ship_authorized = control.ship_authorized;
|
|
147
|
+
return state;
|
|
148
|
+
}
|
|
97
149
|
function createRunResult(input) {
|
|
98
150
|
const status = input.status || input.state.status;
|
|
99
151
|
const ok = isSuccessfulStatus(status);
|
|
100
152
|
const state = input.metadata ? applyTerminalMetadata(input.state, input.metadata) : input.state;
|
|
101
153
|
state.status = status;
|
|
102
154
|
state.ok = ok;
|
|
155
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
156
|
+
applyShipControlState(state, { status, raw: input.raw });
|
|
103
157
|
return compactRecord({
|
|
104
158
|
ok,
|
|
105
159
|
status,
|
|
@@ -117,6 +171,9 @@ function createRunResult(input) {
|
|
|
117
171
|
pr_state: state.pr_state,
|
|
118
172
|
marked_ready: state.marked_ready,
|
|
119
173
|
left_draft: state.left_draft,
|
|
174
|
+
ship_held: state.ship_held,
|
|
175
|
+
shipping_disabled: state.shipping_disabled,
|
|
176
|
+
ship_authorized: state.ship_authorized,
|
|
120
177
|
ci_status: state.ci_status,
|
|
121
178
|
ship_commit: state.ship_commit,
|
|
122
179
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -295,6 +352,7 @@ function appendStageHeartbeat(state, input) {
|
|
|
295
352
|
function setRunStatus(state, status, at = timestamp()) {
|
|
296
353
|
state.status = status;
|
|
297
354
|
state.ok = status !== "blocked" && status !== "failed";
|
|
355
|
+
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
298
356
|
state.updated_at = at;
|
|
299
357
|
return state;
|
|
300
358
|
}
|
|
@@ -770,7 +828,7 @@ async function runRiddleProof(input) {
|
|
|
770
828
|
status: "ready_to_ship",
|
|
771
829
|
last_summary: assessment.summary,
|
|
772
830
|
evidence_bundle: evidenceBundle,
|
|
773
|
-
raw: { implementation, assessment }
|
|
831
|
+
raw: { implementation, assessment, ship_held: true, shipping_disabled: true, ship_authorized: false }
|
|
774
832
|
});
|
|
775
833
|
return notifyIfConfigured({ state, result: result2, notification: adapters.notification });
|
|
776
834
|
}
|
package/dist/advanced/runner.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runRiddleProof
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-JLOZTVXU.js";
|
|
4
|
+
import "../chunk-UZIX7M7D.js";
|
|
5
|
+
import "../chunk-KNPCWWF3.js";
|
|
6
6
|
import "../chunk-EKZXU6MU.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-MOTQNIZX.js";
|
|
8
|
+
import "../chunk-CUBYSWZT.js";
|
|
9
9
|
import "../chunk-MLKGABMK.js";
|
|
10
10
|
export {
|
|
11
11
|
runRiddleProof
|
package/dist/checkpoint.cjs
CHANGED
|
@@ -757,6 +757,8 @@ function checkpointSummaryFromState(state, engineStatePath) {
|
|
|
757
757
|
const packets = history.filter((entry) => entry.packet);
|
|
758
758
|
const responses = acceptedCheckpointResponseEntries(state);
|
|
759
759
|
const duplicateResponses = events.filter((event) => event.kind === "checkpoint.response.duplicate");
|
|
760
|
+
const rejectedResponses = events.filter((event) => event.kind === "checkpoint.response.rejected");
|
|
761
|
+
const ignoredResponses = events.filter((event) => event.kind === "checkpoint.response.ignored");
|
|
760
762
|
const latestPacketEntry = [...history].reverse().find((entry) => entry.packet);
|
|
761
763
|
const latestResponseEntry = [...responses].reverse().find((entry) => entry.response);
|
|
762
764
|
const latestPacket = state.checkpoint_packet || latestPacketEntry?.packet;
|
|
@@ -772,6 +774,8 @@ function checkpointSummaryFromState(state, engineStatePath) {
|
|
|
772
774
|
packet_count: packets.length,
|
|
773
775
|
response_count: responses.length,
|
|
774
776
|
duplicate_response_count: duplicateResponses.length,
|
|
777
|
+
rejected_response_count: rejectedResponses.length,
|
|
778
|
+
ignored_response_count: ignoredResponses.length,
|
|
775
779
|
latest_checkpoint: state.checkpoint_packet?.checkpoint || latestResponse?.checkpoint || state.last_checkpoint || null,
|
|
776
780
|
latest_stage: state.checkpoint_packet?.stage || latestResponse?.continue_with_stage || state.current_stage || null,
|
|
777
781
|
latest_kind: state.checkpoint_packet?.kind || latestPacket?.kind || null,
|
package/dist/checkpoint.js
CHANGED
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
normalizeCheckpointResponse,
|
|
15
15
|
proofContractFromAuthorCheckpointResponse,
|
|
16
16
|
statePathsForRunState
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-MOTQNIZX.js";
|
|
18
|
+
import "./chunk-CUBYSWZT.js";
|
|
19
19
|
import "./chunk-MLKGABMK.js";
|
|
20
20
|
export {
|
|
21
21
|
RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
@@ -28,14 +28,14 @@ import {
|
|
|
28
28
|
createDisabledRiddleProofAgentAdapter,
|
|
29
29
|
readRiddleProofRunStatus,
|
|
30
30
|
runRiddleProofEngineHarness
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-GHBNDHG7.js";
|
|
32
32
|
import {
|
|
33
33
|
createCheckpointResponseTemplate
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-MOTQNIZX.js";
|
|
35
35
|
import {
|
|
36
36
|
createCodexExecAgentAdapter,
|
|
37
37
|
runCodexExecAgentDoctor
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-RS4HJLJQ.js";
|
|
39
39
|
|
|
40
40
|
// src/cli.ts
|
|
41
41
|
import { spawnSync } from "child_process";
|