@riddledc/riddle-proof 0.8.53 → 0.8.55
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 +128 -3
- package/dist/advanced/engine-harness.js +5 -5
- package/dist/advanced/index.cjs +129 -4
- 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 +54 -1
- package/dist/advanced/runner.js +5 -5
- package/dist/checkpoint.js +2 -2
- package/dist/{chunk-S5DX7Z6X.js → chunk-F65S5LT2.js} +3 -3
- package/dist/{chunk-LNWJAHAQ.js → chunk-J2ZNL3H3.js} +2 -2
- package/dist/{chunk-2ALMXMFZ.js → chunk-MYMTAVGP.js} +3 -3
- package/dist/{chunk-JJ4IWRMJ.js → chunk-NYRMPWJB.js} +8 -3
- package/dist/{chunk-WDIKPIMB.js → chunk-Q5GYD5RG.js} +9 -4
- package/dist/{chunk-ZLBOGPUL.js → chunk-QGE3KBRL.js} +74 -6
- package/dist/{chunk-BLM5EIBA.js → chunk-QUK3SG24.js} +1 -1
- package/dist/{chunk-73EBR3YL.js → chunk-SONWF3FQ.js} +1 -1
- package/dist/{chunk-VY4Y5U57.js → chunk-W44XEGYW.js} +52 -0
- package/dist/cli/index.js +7 -7
- package/dist/cli.cjs +128 -3
- package/dist/cli.js +7 -7
- package/dist/codex-exec-agent.js +2 -2
- package/dist/engine-harness.cjs +128 -3
- package/dist/engine-harness.js +5 -5
- package/dist/index.cjs +133 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -8
- package/dist/local-agent.js +2 -2
- package/dist/openclaw.js +5 -5
- package/dist/{proof-run-engine-DpChFR5H.d.cts → proof-run-engine-Baiv6l3A.d.cts} +3 -3
- package/dist/{proof-run-engine-BqRoA3Do.d.ts → proof-run-engine-MiKZt9oY.d.ts} +3 -3
- package/dist/proof-run-engine.d.cts +1 -1
- package/dist/proof-run-engine.d.ts +1 -1
- package/dist/result.cjs +56 -2
- package/dist/result.d.cts +16 -2
- package/dist/result.d.ts +16 -2
- package/dist/result.js +7 -3
- package/dist/run-card.cjs +43 -0
- package/dist/run-card.js +3 -3
- package/dist/runner.cjs +54 -1
- package/dist/runner.js +5 -5
- package/dist/spec/checkpoint.js +2 -2
- package/dist/spec/index.cjs +63 -1
- package/dist/spec/index.d.cts +1 -1
- package/dist/spec/index.d.ts +1 -1
- package/dist/spec/index.js +9 -5
- package/dist/spec/result.cjs +56 -2
- package/dist/spec/result.d.cts +1 -1
- package/dist/spec/result.d.ts +1 -1
- package/dist/spec/result.js +7 -3
- package/dist/spec/run-card.cjs +43 -0
- package/dist/spec/run-card.js +3 -3
- package/dist/spec/state.cjs +48 -1
- package/dist/spec/state.js +4 -4
- package/dist/state.cjs +48 -1
- package/dist/state.js +4 -4
- package/dist/types.d.cts +15 -0
- package/dist/types.d.ts +15 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -3516,6 +3516,9 @@ function normalizeTerminalMetadata(input) {
|
|
|
3516
3516
|
pr_state: prState,
|
|
3517
3517
|
marked_ready: markedReady,
|
|
3518
3518
|
left_draft: leftDraft,
|
|
3519
|
+
ship_held: firstBoolean(riddleState.ship_held, result.ship_held, result.shipHeld, details.ship_held, details.shipHeld, shipReport.ship_held, shipReport.shipHeld),
|
|
3520
|
+
shipping_disabled: firstBoolean(riddleState.shipping_disabled, result.shipping_disabled, result.shippingDisabled, details.shipping_disabled, details.shippingDisabled, shipReport.shipping_disabled, shipReport.shippingDisabled),
|
|
3521
|
+
ship_authorized: firstBoolean(riddleState.ship_authorized, result.ship_authorized, result.shipAuthorized, details.ship_authorized, details.shipAuthorized, shipReport.ship_authorized, shipReport.shipAuthorized),
|
|
3519
3522
|
ci_status: firstNonEmptyString(riddleState.ci_status, result.ci_status, result.ciStatus, details.ci_status, details.ciStatus, shipReport.ci_status),
|
|
3520
3523
|
ship_commit: firstNonEmptyString(riddleState.ship_commit, result.ship_commit, result.shipCommit, details.ship_commit, details.shipCommit, shipReport.shipped_commit, shipReport.ship_commit),
|
|
3521
3524
|
ship_remote_head: firstNonEmptyString(riddleState.ship_remote_head, result.ship_remote_head, result.shipRemoteHead, details.ship_remote_head, details.shipRemoteHead, shipReport.ship_remote_head),
|
|
@@ -3549,6 +3552,9 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
3549
3552
|
if (prBranch) state.pr_branch = prBranch;
|
|
3550
3553
|
if (typeof metadata.marked_ready === "boolean") state.marked_ready = metadata.marked_ready;
|
|
3551
3554
|
if (typeof metadata.left_draft === "boolean") state.left_draft = metadata.left_draft;
|
|
3555
|
+
if (typeof metadata.ship_held === "boolean") state.ship_held = metadata.ship_held;
|
|
3556
|
+
if (typeof metadata.shipping_disabled === "boolean") state.shipping_disabled = metadata.shipping_disabled;
|
|
3557
|
+
if (typeof metadata.ship_authorized === "boolean") state.ship_authorized = metadata.ship_authorized;
|
|
3552
3558
|
const ciStatus = nonEmptyString(metadata.ci_status);
|
|
3553
3559
|
if (ciStatus) state.ci_status = ciStatus;
|
|
3554
3560
|
const shipCommit = nonEmptyString(metadata.ship_commit);
|
|
@@ -3580,12 +3586,53 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
3580
3586
|
if (typeof metadata.finalized === "boolean") state.finalized = metadata.finalized;
|
|
3581
3587
|
return state;
|
|
3582
3588
|
}
|
|
3589
|
+
function shipControlStateFor(input) {
|
|
3590
|
+
const state = input.state;
|
|
3591
|
+
const status = input.status || state.status;
|
|
3592
|
+
const raw = recordValue(input.raw) || {};
|
|
3593
|
+
const shipReport = recordValue(state.ship_report) || {};
|
|
3594
|
+
const prState = recordValue(state.pr_state) || {};
|
|
3595
|
+
const shippingDisabled = firstBoolean(
|
|
3596
|
+
raw.shipping_disabled,
|
|
3597
|
+
raw.shippingDisabled,
|
|
3598
|
+
state.shipping_disabled,
|
|
3599
|
+
shipReport.shipping_disabled,
|
|
3600
|
+
shipReport.shippingDisabled
|
|
3601
|
+
) ?? state.request?.ship_mode === "none";
|
|
3602
|
+
const explicitAuthorized = firstBoolean(
|
|
3603
|
+
raw.ship_authorized,
|
|
3604
|
+
raw.shipAuthorized,
|
|
3605
|
+
state.ship_authorized,
|
|
3606
|
+
shipReport.ship_authorized,
|
|
3607
|
+
shipReport.shipAuthorized
|
|
3608
|
+
);
|
|
3609
|
+
const authorizationEvidence = Boolean(
|
|
3610
|
+
status === "shipped" || state.marked_ready === true || shipReport.marked_ready === true || prState.status === "merged" || state.merge_commit || state.merged_at
|
|
3611
|
+
);
|
|
3612
|
+
const inferredAuthorized = explicitAuthorized ?? authorizationEvidence;
|
|
3613
|
+
const rawHeld = firstBoolean(raw.ship_held, raw.shipHeld);
|
|
3614
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !inferredAuthorized;
|
|
3615
|
+
const shipHeld = rawHeld ?? (state.ship_held === true || inferredHeld);
|
|
3616
|
+
return {
|
|
3617
|
+
ship_held: shipHeld,
|
|
3618
|
+
shipping_disabled: shippingDisabled,
|
|
3619
|
+
ship_authorized: shipHeld ? false : inferredAuthorized
|
|
3620
|
+
};
|
|
3621
|
+
}
|
|
3622
|
+
function applyShipControlState(state, input = {}) {
|
|
3623
|
+
const control = shipControlStateFor({ state, status: input.status, raw: input.raw });
|
|
3624
|
+
state.ship_held = control.ship_held;
|
|
3625
|
+
state.shipping_disabled = control.shipping_disabled;
|
|
3626
|
+
state.ship_authorized = control.ship_authorized;
|
|
3627
|
+
return state;
|
|
3628
|
+
}
|
|
3583
3629
|
function createRunResult(input) {
|
|
3584
3630
|
const status = input.status || input.state.status;
|
|
3585
3631
|
const ok = isSuccessfulStatus(status);
|
|
3586
3632
|
const state = input.metadata ? applyTerminalMetadata(input.state, input.metadata) : input.state;
|
|
3587
3633
|
state.status = status;
|
|
3588
3634
|
state.ok = ok;
|
|
3635
|
+
applyShipControlState(state, { status, raw: input.raw });
|
|
3589
3636
|
return compactRecord({
|
|
3590
3637
|
ok,
|
|
3591
3638
|
status,
|
|
@@ -3603,6 +3650,9 @@ function createRunResult(input) {
|
|
|
3603
3650
|
pr_state: state.pr_state,
|
|
3604
3651
|
marked_ready: state.marked_ready,
|
|
3605
3652
|
left_draft: state.left_draft,
|
|
3653
|
+
ship_held: state.ship_held,
|
|
3654
|
+
shipping_disabled: state.shipping_disabled,
|
|
3655
|
+
ship_authorized: state.ship_authorized,
|
|
3606
3656
|
ci_status: state.ci_status,
|
|
3607
3657
|
ship_commit: state.ship_commit,
|
|
3608
3658
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -4582,6 +4632,7 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
4582
4632
|
const visualDelta = visualDeltaFrom({ fullRiddleState: fullState, runState: state });
|
|
4583
4633
|
const artifacts = artifactsFrom({ fullRiddleState: fullState, runState: state });
|
|
4584
4634
|
const viewportMatrix = viewportMatrixFrom({ fullRiddleState: fullState, runState: state });
|
|
4635
|
+
const shipControl = shipControlStateFor({ state });
|
|
4585
4636
|
return {
|
|
4586
4637
|
version: RIDDLE_PROOF_RUN_CARD_VERSION,
|
|
4587
4638
|
run_id: state.run_id || "unknown",
|
|
@@ -4635,6 +4686,9 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
4635
4686
|
stop_condition: compactRecord({
|
|
4636
4687
|
status: state.status,
|
|
4637
4688
|
terminal: isTerminalStatus(state.status),
|
|
4689
|
+
ship_held: shipControl.ship_held,
|
|
4690
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
4691
|
+
ship_authorized: shipControl.ship_authorized,
|
|
4638
4692
|
blocker_code: state.blocker?.code || null,
|
|
4639
4693
|
blocker_message: state.blocker?.message || null,
|
|
4640
4694
|
proof_decision: state.proof_decision,
|
|
@@ -4795,7 +4849,8 @@ function appendStageHeartbeat(state, input) {
|
|
|
4795
4849
|
function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
4796
4850
|
const latestEvent = state.events[state.events.length - 1];
|
|
4797
4851
|
const runId = state.run_id || "unknown";
|
|
4798
|
-
const
|
|
4852
|
+
const shipControl = shipControlStateFor({ state });
|
|
4853
|
+
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;
|
|
4799
4854
|
const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
|
|
4800
4855
|
return compactRecord({
|
|
4801
4856
|
run_id: runId,
|
|
@@ -4809,6 +4864,9 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
|
4809
4864
|
pr_url: state.pr_url ?? null,
|
|
4810
4865
|
pr_branch: state.pr_branch ?? null,
|
|
4811
4866
|
pr_state: state.pr_state,
|
|
4867
|
+
ship_held: shipControl.ship_held,
|
|
4868
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
4869
|
+
ship_authorized: shipControl.ship_authorized,
|
|
4812
4870
|
ci_status: state.ci_status,
|
|
4813
4871
|
ship_commit: state.ship_commit,
|
|
4814
4872
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -5095,7 +5153,7 @@ function shipHeldTerminal(state, result) {
|
|
|
5095
5153
|
"ready_to_ship",
|
|
5096
5154
|
result,
|
|
5097
5155
|
result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5098
|
-
{ ship_held: true }
|
|
5156
|
+
{ ship_held: true, shipping_disabled: true, ship_authorized: false }
|
|
5099
5157
|
);
|
|
5100
5158
|
}
|
|
5101
5159
|
function checkpointContinueStage2(result) {
|
|
@@ -5143,6 +5201,32 @@ function isReadyShipGate(result) {
|
|
|
5143
5201
|
function proofAssessmentRequestsShip(payload) {
|
|
5144
5202
|
return String(payload.decision || "").trim() === "ready_to_ship";
|
|
5145
5203
|
}
|
|
5204
|
+
var TRUSTED_PROOF_ASSESSMENT_READY_SOURCES = /* @__PURE__ */ new Set([
|
|
5205
|
+
"supervising_agent",
|
|
5206
|
+
"supervisor",
|
|
5207
|
+
"openclaw_auto_ship_mode_none"
|
|
5208
|
+
]);
|
|
5209
|
+
function proofAssessmentSourceTrustedForShip(payload) {
|
|
5210
|
+
const source = nonEmptyString(payload.source)?.toLowerCase();
|
|
5211
|
+
if (!source) return true;
|
|
5212
|
+
return TRUSTED_PROOF_ASSESSMENT_READY_SOURCES.has(source);
|
|
5213
|
+
}
|
|
5214
|
+
function proofAssessmentSourceBlocker(input) {
|
|
5215
|
+
if (!proofAssessmentRequestsShip(input.payload)) return null;
|
|
5216
|
+
if (proofAssessmentSourceTrustedForShip(input.payload)) return null;
|
|
5217
|
+
const source = nonEmptyString(input.payload.source) || "unknown";
|
|
5218
|
+
return {
|
|
5219
|
+
code: input.code || "proof_assessment_source_not_trusted",
|
|
5220
|
+
checkpoint: input.checkpoint || null,
|
|
5221
|
+
message: `Riddle Proof cannot mark ready_to_ship from untrusted proof assessment source: ${source}.`,
|
|
5222
|
+
details: compactRecord({
|
|
5223
|
+
stage: input.stage || null,
|
|
5224
|
+
proofAssessment: input.payload,
|
|
5225
|
+
checkpoint_response_source: input.response?.source || null,
|
|
5226
|
+
response: input.response || null
|
|
5227
|
+
})
|
|
5228
|
+
};
|
|
5229
|
+
}
|
|
5146
5230
|
function proofAssessmentHardBlockers(state, payload) {
|
|
5147
5231
|
const blockers = proofAssessmentHardBlockersForState(state || {});
|
|
5148
5232
|
if (Array.isArray(payload.hard_blockers)) {
|
|
@@ -5173,6 +5257,15 @@ function stageFromCheckpointResponse(response, packet) {
|
|
|
5173
5257
|
const stage = response.continue_with_stage || nonEmptyString(payload.continue_with_stage) || nonEmptyString(payload.recommended_stage) || nonEmptyString(resume?.continue_with_stage) || (response.decision === "retry_stage" ? packet.stage : "");
|
|
5174
5258
|
return stage ? stage : null;
|
|
5175
5259
|
}
|
|
5260
|
+
function proofAssessmentSourceFromCheckpointResponse(response) {
|
|
5261
|
+
const kind = nonEmptyString(response.source?.kind)?.toLowerCase();
|
|
5262
|
+
if (!kind) return "supervising_agent";
|
|
5263
|
+
if (kind === "human") return "supervisor";
|
|
5264
|
+
if (kind === "codex" || kind === "openclaw-main" || kind === "claude-code") {
|
|
5265
|
+
return "supervising_agent";
|
|
5266
|
+
}
|
|
5267
|
+
return `checkpoint_response:${kind}`;
|
|
5268
|
+
}
|
|
5176
5269
|
function proofAssessmentPayloadFromCheckpointResponse(response) {
|
|
5177
5270
|
if (![
|
|
5178
5271
|
"ready_to_ship",
|
|
@@ -5193,7 +5286,7 @@ function proofAssessmentPayloadFromCheckpointResponse(response) {
|
|
|
5193
5286
|
continue_with_stage: stage || void 0,
|
|
5194
5287
|
escalation_target: nonEmptyString(payload.escalation_target) || "agent",
|
|
5195
5288
|
reasons: Array.isArray(response.reasons) ? response.reasons : Array.isArray(payload.reasons) ? payload.reasons : [],
|
|
5196
|
-
source:
|
|
5289
|
+
source: proofAssessmentSourceFromCheckpointResponse(response),
|
|
5197
5290
|
checkpoint_response_source: response.source || null,
|
|
5198
5291
|
checkpoint_response_created_at: response.created_at
|
|
5199
5292
|
}));
|
|
@@ -5338,6 +5431,7 @@ function terminalResult(state, status, result, summary, raw = {}) {
|
|
|
5338
5431
|
engineResult: result
|
|
5339
5432
|
});
|
|
5340
5433
|
applyTerminalMetadata(state, metadata);
|
|
5434
|
+
applyShipControlState(state, { status, raw });
|
|
5341
5435
|
persist(state);
|
|
5342
5436
|
return createRunResult({
|
|
5343
5437
|
state,
|
|
@@ -5644,6 +5738,14 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5644
5738
|
if (packet.kind === "assess_proof" || packet.kind === "recover_evidence" || packet.stage === "verify") {
|
|
5645
5739
|
const assessment = proofAssessmentPayloadFromCheckpointResponse(response);
|
|
5646
5740
|
if (assessment) {
|
|
5741
|
+
const sourceBlocker = proofAssessmentSourceBlocker({
|
|
5742
|
+
checkpoint: packet.checkpoint,
|
|
5743
|
+
stage: packet.stage,
|
|
5744
|
+
payload: assessment,
|
|
5745
|
+
response,
|
|
5746
|
+
code: "checkpoint_response_source_not_trusted"
|
|
5747
|
+
});
|
|
5748
|
+
if (sourceBlocker) return { blocker: sourceBlocker };
|
|
5647
5749
|
appendCheckpointResponse(state, response);
|
|
5648
5750
|
if (state.request.ship_mode !== "ship" && proofAssessmentRequestsShip(assessment)) {
|
|
5649
5751
|
const result = {
|
|
@@ -5662,6 +5764,8 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5662
5764
|
response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5663
5765
|
{
|
|
5664
5766
|
ship_held: true,
|
|
5767
|
+
shipping_disabled: true,
|
|
5768
|
+
ship_authorized: false,
|
|
5665
5769
|
proof_assessment: assessment
|
|
5666
5770
|
}
|
|
5667
5771
|
)
|
|
@@ -6202,6 +6306,25 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
6202
6306
|
}
|
|
6203
6307
|
};
|
|
6204
6308
|
}
|
|
6309
|
+
const sourceBlocker = proofAssessmentSourceBlocker({
|
|
6310
|
+
checkpoint,
|
|
6311
|
+
stage: "verify",
|
|
6312
|
+
payload,
|
|
6313
|
+
code: "proof_assessment_source_not_trusted"
|
|
6314
|
+
});
|
|
6315
|
+
if (sourceBlocker) {
|
|
6316
|
+
recordEvent(state, {
|
|
6317
|
+
kind: "agent.proof_assessment.source_blocked",
|
|
6318
|
+
checkpoint,
|
|
6319
|
+
stage: "verify",
|
|
6320
|
+
summary: sourceBlocker.message,
|
|
6321
|
+
details: compactRecord({
|
|
6322
|
+
proof_assessment: payload,
|
|
6323
|
+
agent_duration_ms: durationMs
|
|
6324
|
+
})
|
|
6325
|
+
});
|
|
6326
|
+
return { blocker: sourceBlocker };
|
|
6327
|
+
}
|
|
6205
6328
|
const visualBlocker = proofAssessmentVisualBlocker({
|
|
6206
6329
|
...context.fullRiddleState || {},
|
|
6207
6330
|
verification_mode: context.fullRiddleState?.verification_mode || request.verification_mode
|
|
@@ -6236,6 +6359,8 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
6236
6359
|
assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
6237
6360
|
{
|
|
6238
6361
|
ship_held: true,
|
|
6362
|
+
shipping_disabled: true,
|
|
6363
|
+
ship_authorized: false,
|
|
6239
6364
|
proof_assessment: payload
|
|
6240
6365
|
}
|
|
6241
6366
|
)
|
package/dist/cli.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-MYMTAVGP.js";
|
|
3
3
|
import "./chunk-DI2XNGEZ.js";
|
|
4
4
|
import "./chunk-6KYXX4OE.js";
|
|
5
5
|
import "./chunk-EX7TO4I5.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-QGE3KBRL.js";
|
|
7
|
+
import "./chunk-Q5GYD5RG.js";
|
|
8
|
+
import "./chunk-NYRMPWJB.js";
|
|
9
9
|
import "./chunk-EKZXU6MU.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-QUK3SG24.js";
|
|
11
11
|
import "./chunk-JFQXAJH2.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-SONWF3FQ.js";
|
|
13
|
+
import "./chunk-W44XEGYW.js";
|
|
14
14
|
import "./chunk-MLKGABMK.js";
|
package/dist/codex-exec-agent.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
createCodexExecAgentAdapter,
|
|
3
3
|
createCodexExecJsonRunner,
|
|
4
4
|
runCodexExecAgentDoctor
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-SONWF3FQ.js";
|
|
6
|
+
import "./chunk-W44XEGYW.js";
|
|
7
7
|
import "./chunk-MLKGABMK.js";
|
|
8
8
|
export {
|
|
9
9
|
createCodexExecAgentAdapter,
|
package/dist/engine-harness.cjs
CHANGED
|
@@ -3518,6 +3518,9 @@ function normalizeTerminalMetadata(input) {
|
|
|
3518
3518
|
pr_state: prState,
|
|
3519
3519
|
marked_ready: markedReady,
|
|
3520
3520
|
left_draft: leftDraft,
|
|
3521
|
+
ship_held: firstBoolean(riddleState.ship_held, result.ship_held, result.shipHeld, details.ship_held, details.shipHeld, shipReport.ship_held, shipReport.shipHeld),
|
|
3522
|
+
shipping_disabled: firstBoolean(riddleState.shipping_disabled, result.shipping_disabled, result.shippingDisabled, details.shipping_disabled, details.shippingDisabled, shipReport.shipping_disabled, shipReport.shippingDisabled),
|
|
3523
|
+
ship_authorized: firstBoolean(riddleState.ship_authorized, result.ship_authorized, result.shipAuthorized, details.ship_authorized, details.shipAuthorized, shipReport.ship_authorized, shipReport.shipAuthorized),
|
|
3521
3524
|
ci_status: firstNonEmptyString(riddleState.ci_status, result.ci_status, result.ciStatus, details.ci_status, details.ciStatus, shipReport.ci_status),
|
|
3522
3525
|
ship_commit: firstNonEmptyString(riddleState.ship_commit, result.ship_commit, result.shipCommit, details.ship_commit, details.shipCommit, shipReport.shipped_commit, shipReport.ship_commit),
|
|
3523
3526
|
ship_remote_head: firstNonEmptyString(riddleState.ship_remote_head, result.ship_remote_head, result.shipRemoteHead, details.ship_remote_head, details.shipRemoteHead, shipReport.ship_remote_head),
|
|
@@ -3551,6 +3554,9 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
3551
3554
|
if (prBranch) state.pr_branch = prBranch;
|
|
3552
3555
|
if (typeof metadata.marked_ready === "boolean") state.marked_ready = metadata.marked_ready;
|
|
3553
3556
|
if (typeof metadata.left_draft === "boolean") state.left_draft = metadata.left_draft;
|
|
3557
|
+
if (typeof metadata.ship_held === "boolean") state.ship_held = metadata.ship_held;
|
|
3558
|
+
if (typeof metadata.shipping_disabled === "boolean") state.shipping_disabled = metadata.shipping_disabled;
|
|
3559
|
+
if (typeof metadata.ship_authorized === "boolean") state.ship_authorized = metadata.ship_authorized;
|
|
3554
3560
|
const ciStatus = nonEmptyString(metadata.ci_status);
|
|
3555
3561
|
if (ciStatus) state.ci_status = ciStatus;
|
|
3556
3562
|
const shipCommit = nonEmptyString(metadata.ship_commit);
|
|
@@ -3582,12 +3588,53 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
3582
3588
|
if (typeof metadata.finalized === "boolean") state.finalized = metadata.finalized;
|
|
3583
3589
|
return state;
|
|
3584
3590
|
}
|
|
3591
|
+
function shipControlStateFor(input) {
|
|
3592
|
+
const state = input.state;
|
|
3593
|
+
const status = input.status || state.status;
|
|
3594
|
+
const raw = recordValue(input.raw) || {};
|
|
3595
|
+
const shipReport = recordValue(state.ship_report) || {};
|
|
3596
|
+
const prState = recordValue(state.pr_state) || {};
|
|
3597
|
+
const shippingDisabled = firstBoolean(
|
|
3598
|
+
raw.shipping_disabled,
|
|
3599
|
+
raw.shippingDisabled,
|
|
3600
|
+
state.shipping_disabled,
|
|
3601
|
+
shipReport.shipping_disabled,
|
|
3602
|
+
shipReport.shippingDisabled
|
|
3603
|
+
) ?? state.request?.ship_mode === "none";
|
|
3604
|
+
const explicitAuthorized = firstBoolean(
|
|
3605
|
+
raw.ship_authorized,
|
|
3606
|
+
raw.shipAuthorized,
|
|
3607
|
+
state.ship_authorized,
|
|
3608
|
+
shipReport.ship_authorized,
|
|
3609
|
+
shipReport.shipAuthorized
|
|
3610
|
+
);
|
|
3611
|
+
const authorizationEvidence = Boolean(
|
|
3612
|
+
status === "shipped" || state.marked_ready === true || shipReport.marked_ready === true || prState.status === "merged" || state.merge_commit || state.merged_at
|
|
3613
|
+
);
|
|
3614
|
+
const inferredAuthorized = explicitAuthorized ?? authorizationEvidence;
|
|
3615
|
+
const rawHeld = firstBoolean(raw.ship_held, raw.shipHeld);
|
|
3616
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !inferredAuthorized;
|
|
3617
|
+
const shipHeld = rawHeld ?? (state.ship_held === true || inferredHeld);
|
|
3618
|
+
return {
|
|
3619
|
+
ship_held: shipHeld,
|
|
3620
|
+
shipping_disabled: shippingDisabled,
|
|
3621
|
+
ship_authorized: shipHeld ? false : inferredAuthorized
|
|
3622
|
+
};
|
|
3623
|
+
}
|
|
3624
|
+
function applyShipControlState(state, input = {}) {
|
|
3625
|
+
const control = shipControlStateFor({ state, status: input.status, raw: input.raw });
|
|
3626
|
+
state.ship_held = control.ship_held;
|
|
3627
|
+
state.shipping_disabled = control.shipping_disabled;
|
|
3628
|
+
state.ship_authorized = control.ship_authorized;
|
|
3629
|
+
return state;
|
|
3630
|
+
}
|
|
3585
3631
|
function createRunResult(input) {
|
|
3586
3632
|
const status = input.status || input.state.status;
|
|
3587
3633
|
const ok = isSuccessfulStatus(status);
|
|
3588
3634
|
const state = input.metadata ? applyTerminalMetadata(input.state, input.metadata) : input.state;
|
|
3589
3635
|
state.status = status;
|
|
3590
3636
|
state.ok = ok;
|
|
3637
|
+
applyShipControlState(state, { status, raw: input.raw });
|
|
3591
3638
|
return compactRecord({
|
|
3592
3639
|
ok,
|
|
3593
3640
|
status,
|
|
@@ -3605,6 +3652,9 @@ function createRunResult(input) {
|
|
|
3605
3652
|
pr_state: state.pr_state,
|
|
3606
3653
|
marked_ready: state.marked_ready,
|
|
3607
3654
|
left_draft: state.left_draft,
|
|
3655
|
+
ship_held: state.ship_held,
|
|
3656
|
+
shipping_disabled: state.shipping_disabled,
|
|
3657
|
+
ship_authorized: state.ship_authorized,
|
|
3608
3658
|
ci_status: state.ci_status,
|
|
3609
3659
|
ship_commit: state.ship_commit,
|
|
3610
3660
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -4494,6 +4544,7 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
4494
4544
|
const visualDelta = visualDeltaFrom({ fullRiddleState: fullState, runState: state });
|
|
4495
4545
|
const artifacts = artifactsFrom({ fullRiddleState: fullState, runState: state });
|
|
4496
4546
|
const viewportMatrix = viewportMatrixFrom({ fullRiddleState: fullState, runState: state });
|
|
4547
|
+
const shipControl = shipControlStateFor({ state });
|
|
4497
4548
|
return {
|
|
4498
4549
|
version: RIDDLE_PROOF_RUN_CARD_VERSION,
|
|
4499
4550
|
run_id: state.run_id || "unknown",
|
|
@@ -4547,6 +4598,9 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
4547
4598
|
stop_condition: compactRecord({
|
|
4548
4599
|
status: state.status,
|
|
4549
4600
|
terminal: isTerminalStatus(state.status),
|
|
4601
|
+
ship_held: shipControl.ship_held,
|
|
4602
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
4603
|
+
ship_authorized: shipControl.ship_authorized,
|
|
4550
4604
|
blocker_code: state.blocker?.code || null,
|
|
4551
4605
|
blocker_message: state.blocker?.message || null,
|
|
4552
4606
|
proof_decision: state.proof_decision,
|
|
@@ -4707,7 +4761,8 @@ function appendStageHeartbeat(state, input) {
|
|
|
4707
4761
|
function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
4708
4762
|
const latestEvent = state.events[state.events.length - 1];
|
|
4709
4763
|
const runId = state.run_id || "unknown";
|
|
4710
|
-
const
|
|
4764
|
+
const shipControl = shipControlStateFor({ state });
|
|
4765
|
+
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;
|
|
4711
4766
|
const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
|
|
4712
4767
|
return compactRecord({
|
|
4713
4768
|
run_id: runId,
|
|
@@ -4721,6 +4776,9 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
|
4721
4776
|
pr_url: state.pr_url ?? null,
|
|
4722
4777
|
pr_branch: state.pr_branch ?? null,
|
|
4723
4778
|
pr_state: state.pr_state,
|
|
4779
|
+
ship_held: shipControl.ship_held,
|
|
4780
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
4781
|
+
ship_authorized: shipControl.ship_authorized,
|
|
4724
4782
|
ci_status: state.ci_status,
|
|
4725
4783
|
ship_commit: state.ship_commit,
|
|
4726
4784
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -5007,7 +5065,7 @@ function shipHeldTerminal(state, result) {
|
|
|
5007
5065
|
"ready_to_ship",
|
|
5008
5066
|
result,
|
|
5009
5067
|
result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5010
|
-
{ ship_held: true }
|
|
5068
|
+
{ ship_held: true, shipping_disabled: true, ship_authorized: false }
|
|
5011
5069
|
);
|
|
5012
5070
|
}
|
|
5013
5071
|
function checkpointContinueStage2(result) {
|
|
@@ -5055,6 +5113,32 @@ function isReadyShipGate(result) {
|
|
|
5055
5113
|
function proofAssessmentRequestsShip(payload) {
|
|
5056
5114
|
return String(payload.decision || "").trim() === "ready_to_ship";
|
|
5057
5115
|
}
|
|
5116
|
+
var TRUSTED_PROOF_ASSESSMENT_READY_SOURCES = /* @__PURE__ */ new Set([
|
|
5117
|
+
"supervising_agent",
|
|
5118
|
+
"supervisor",
|
|
5119
|
+
"openclaw_auto_ship_mode_none"
|
|
5120
|
+
]);
|
|
5121
|
+
function proofAssessmentSourceTrustedForShip(payload) {
|
|
5122
|
+
const source = nonEmptyString(payload.source)?.toLowerCase();
|
|
5123
|
+
if (!source) return true;
|
|
5124
|
+
return TRUSTED_PROOF_ASSESSMENT_READY_SOURCES.has(source);
|
|
5125
|
+
}
|
|
5126
|
+
function proofAssessmentSourceBlocker(input) {
|
|
5127
|
+
if (!proofAssessmentRequestsShip(input.payload)) return null;
|
|
5128
|
+
if (proofAssessmentSourceTrustedForShip(input.payload)) return null;
|
|
5129
|
+
const source = nonEmptyString(input.payload.source) || "unknown";
|
|
5130
|
+
return {
|
|
5131
|
+
code: input.code || "proof_assessment_source_not_trusted",
|
|
5132
|
+
checkpoint: input.checkpoint || null,
|
|
5133
|
+
message: `Riddle Proof cannot mark ready_to_ship from untrusted proof assessment source: ${source}.`,
|
|
5134
|
+
details: compactRecord({
|
|
5135
|
+
stage: input.stage || null,
|
|
5136
|
+
proofAssessment: input.payload,
|
|
5137
|
+
checkpoint_response_source: input.response?.source || null,
|
|
5138
|
+
response: input.response || null
|
|
5139
|
+
})
|
|
5140
|
+
};
|
|
5141
|
+
}
|
|
5058
5142
|
function proofAssessmentHardBlockers(state, payload) {
|
|
5059
5143
|
const blockers = proofAssessmentHardBlockersForState(state || {});
|
|
5060
5144
|
if (Array.isArray(payload.hard_blockers)) {
|
|
@@ -5085,6 +5169,15 @@ function stageFromCheckpointResponse(response, packet) {
|
|
|
5085
5169
|
const stage = response.continue_with_stage || nonEmptyString(payload.continue_with_stage) || nonEmptyString(payload.recommended_stage) || nonEmptyString(resume?.continue_with_stage) || (response.decision === "retry_stage" ? packet.stage : "");
|
|
5086
5170
|
return stage ? stage : null;
|
|
5087
5171
|
}
|
|
5172
|
+
function proofAssessmentSourceFromCheckpointResponse(response) {
|
|
5173
|
+
const kind = nonEmptyString(response.source?.kind)?.toLowerCase();
|
|
5174
|
+
if (!kind) return "supervising_agent";
|
|
5175
|
+
if (kind === "human") return "supervisor";
|
|
5176
|
+
if (kind === "codex" || kind === "openclaw-main" || kind === "claude-code") {
|
|
5177
|
+
return "supervising_agent";
|
|
5178
|
+
}
|
|
5179
|
+
return `checkpoint_response:${kind}`;
|
|
5180
|
+
}
|
|
5088
5181
|
function proofAssessmentPayloadFromCheckpointResponse(response) {
|
|
5089
5182
|
if (![
|
|
5090
5183
|
"ready_to_ship",
|
|
@@ -5105,7 +5198,7 @@ function proofAssessmentPayloadFromCheckpointResponse(response) {
|
|
|
5105
5198
|
continue_with_stage: stage || void 0,
|
|
5106
5199
|
escalation_target: nonEmptyString(payload.escalation_target) || "agent",
|
|
5107
5200
|
reasons: Array.isArray(response.reasons) ? response.reasons : Array.isArray(payload.reasons) ? payload.reasons : [],
|
|
5108
|
-
source:
|
|
5201
|
+
source: proofAssessmentSourceFromCheckpointResponse(response),
|
|
5109
5202
|
checkpoint_response_source: response.source || null,
|
|
5110
5203
|
checkpoint_response_created_at: response.created_at
|
|
5111
5204
|
}));
|
|
@@ -5250,6 +5343,7 @@ function terminalResult(state, status, result, summary, raw = {}) {
|
|
|
5250
5343
|
engineResult: result
|
|
5251
5344
|
});
|
|
5252
5345
|
applyTerminalMetadata(state, metadata);
|
|
5346
|
+
applyShipControlState(state, { status, raw });
|
|
5253
5347
|
persist(state);
|
|
5254
5348
|
return createRunResult({
|
|
5255
5349
|
state,
|
|
@@ -5556,6 +5650,14 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5556
5650
|
if (packet.kind === "assess_proof" || packet.kind === "recover_evidence" || packet.stage === "verify") {
|
|
5557
5651
|
const assessment = proofAssessmentPayloadFromCheckpointResponse(response);
|
|
5558
5652
|
if (assessment) {
|
|
5653
|
+
const sourceBlocker = proofAssessmentSourceBlocker({
|
|
5654
|
+
checkpoint: packet.checkpoint,
|
|
5655
|
+
stage: packet.stage,
|
|
5656
|
+
payload: assessment,
|
|
5657
|
+
response,
|
|
5658
|
+
code: "checkpoint_response_source_not_trusted"
|
|
5659
|
+
});
|
|
5660
|
+
if (sourceBlocker) return { blocker: sourceBlocker };
|
|
5559
5661
|
appendCheckpointResponse(state, response);
|
|
5560
5662
|
if (state.request.ship_mode !== "ship" && proofAssessmentRequestsShip(assessment)) {
|
|
5561
5663
|
const result = {
|
|
@@ -5574,6 +5676,8 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5574
5676
|
response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5575
5677
|
{
|
|
5576
5678
|
ship_held: true,
|
|
5679
|
+
shipping_disabled: true,
|
|
5680
|
+
ship_authorized: false,
|
|
5577
5681
|
proof_assessment: assessment
|
|
5578
5682
|
}
|
|
5579
5683
|
)
|
|
@@ -6114,6 +6218,25 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
6114
6218
|
}
|
|
6115
6219
|
};
|
|
6116
6220
|
}
|
|
6221
|
+
const sourceBlocker = proofAssessmentSourceBlocker({
|
|
6222
|
+
checkpoint,
|
|
6223
|
+
stage: "verify",
|
|
6224
|
+
payload,
|
|
6225
|
+
code: "proof_assessment_source_not_trusted"
|
|
6226
|
+
});
|
|
6227
|
+
if (sourceBlocker) {
|
|
6228
|
+
recordEvent(state, {
|
|
6229
|
+
kind: "agent.proof_assessment.source_blocked",
|
|
6230
|
+
checkpoint,
|
|
6231
|
+
stage: "verify",
|
|
6232
|
+
summary: sourceBlocker.message,
|
|
6233
|
+
details: compactRecord({
|
|
6234
|
+
proof_assessment: payload,
|
|
6235
|
+
agent_duration_ms: durationMs
|
|
6236
|
+
})
|
|
6237
|
+
});
|
|
6238
|
+
return { blocker: sourceBlocker };
|
|
6239
|
+
}
|
|
6117
6240
|
const visualBlocker = proofAssessmentVisualBlocker({
|
|
6118
6241
|
...context.fullRiddleState || {},
|
|
6119
6242
|
verification_mode: context.fullRiddleState?.verification_mode || request.verification_mode
|
|
@@ -6148,6 +6271,8 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
6148
6271
|
assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
6149
6272
|
{
|
|
6150
6273
|
ship_held: true,
|
|
6274
|
+
shipping_disabled: true,
|
|
6275
|
+
ship_authorized: false,
|
|
6151
6276
|
proof_assessment: payload
|
|
6152
6277
|
}
|
|
6153
6278
|
)
|
package/dist/engine-harness.js
CHANGED
|
@@ -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-QGE3KBRL.js";
|
|
6
|
+
import "./chunk-Q5GYD5RG.js";
|
|
7
|
+
import "./chunk-NYRMPWJB.js";
|
|
8
8
|
import "./chunk-EKZXU6MU.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-QUK3SG24.js";
|
|
10
|
+
import "./chunk-W44XEGYW.js";
|
|
11
11
|
import "./chunk-MLKGABMK.js";
|
|
12
12
|
export {
|
|
13
13
|
createDisabledRiddleProofAgentAdapter,
|