@riddledc/riddle-proof 0.8.54 → 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 +65 -2
- package/dist/advanced/engine-harness.js +5 -5
- package/dist/advanced/index.cjs +66 -3
- package/dist/advanced/index.js +6 -6
- 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-ECLGGGAI.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-IV4DVWPR.js → chunk-QGE3KBRL.js} +11 -5
- 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 +65 -2
- package/dist/cli.js +7 -7
- package/dist/codex-exec-agent.js +2 -2
- package/dist/engine-harness.cjs +65 -2
- package/dist/engine-harness.js +5 -5
- package/dist/index.cjs +70 -3
- 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/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
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRiddleProofRunCard
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NYRMPWJB.js";
|
|
4
4
|
import {
|
|
5
5
|
compactRecord,
|
|
6
6
|
isTerminalStatus,
|
|
7
7
|
nonEmptyString,
|
|
8
|
-
recordValue
|
|
9
|
-
|
|
8
|
+
recordValue,
|
|
9
|
+
shipControlStateFor
|
|
10
|
+
} from "./chunk-W44XEGYW.js";
|
|
10
11
|
|
|
11
12
|
// src/state.ts
|
|
12
13
|
var RIDDLE_PROOF_RUN_STATE_VERSION = "riddle-proof.run-state.v1";
|
|
@@ -188,7 +189,8 @@ function appendStageHeartbeat(state, input) {
|
|
|
188
189
|
function createRunStatusSnapshot(state, at = timestamp()) {
|
|
189
190
|
const latestEvent = state.events[state.events.length - 1];
|
|
190
191
|
const runId = state.run_id || "unknown";
|
|
191
|
-
const
|
|
192
|
+
const shipControl = shipControlStateFor({ state });
|
|
193
|
+
const existingRunCardCurrent = state.run_card?.status === state.status && state.run_card.stop_condition?.status === state.status && state.run_card.stop_condition?.terminal === isTerminalStatus(state.status) && state.run_card.stop_condition?.monitor_should_continue === !isTerminalStatus(state.status) && state.run_card.stop_condition?.ship_held === shipControl.ship_held && state.run_card.stop_condition?.shipping_disabled === shipControl.shipping_disabled && state.run_card.stop_condition?.ship_authorized === shipControl.ship_authorized;
|
|
192
194
|
const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
|
|
193
195
|
return compactRecord({
|
|
194
196
|
run_id: runId,
|
|
@@ -202,6 +204,9 @@ function createRunStatusSnapshot(state, at = timestamp()) {
|
|
|
202
204
|
pr_url: state.pr_url ?? null,
|
|
203
205
|
pr_branch: state.pr_branch ?? null,
|
|
204
206
|
pr_state: state.pr_state,
|
|
207
|
+
ship_held: shipControl.ship_held,
|
|
208
|
+
shipping_disabled: shipControl.shipping_disabled,
|
|
209
|
+
ship_authorized: shipControl.ship_authorized,
|
|
205
210
|
ci_status: state.ci_status,
|
|
206
211
|
ship_commit: state.ship_commit,
|
|
207
212
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
createRunStatusSnapshot,
|
|
6
6
|
normalizeRunParams,
|
|
7
7
|
setRunStatus
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Q5GYD5RG.js";
|
|
9
9
|
import {
|
|
10
10
|
createRiddleProofRunCard
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-NYRMPWJB.js";
|
|
12
12
|
import {
|
|
13
13
|
canonicalProofAssessmentStageForDecision,
|
|
14
14
|
noImplementationModeFor,
|
|
@@ -27,15 +27,16 @@ import {
|
|
|
27
27
|
normalizeCheckpointResponse,
|
|
28
28
|
proofContractFromAuthorCheckpointResponse,
|
|
29
29
|
statePathsForRunState
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-QUK3SG24.js";
|
|
31
31
|
import {
|
|
32
|
+
applyShipControlState,
|
|
32
33
|
applyTerminalMetadata,
|
|
33
34
|
compactRecord,
|
|
34
35
|
createRunResult,
|
|
35
36
|
nonEmptyString,
|
|
36
37
|
normalizeTerminalMetadata,
|
|
37
38
|
recordValue
|
|
38
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-W44XEGYW.js";
|
|
39
40
|
import {
|
|
40
41
|
__export
|
|
41
42
|
} from "./chunk-MLKGABMK.js";
|
|
@@ -313,7 +314,7 @@ function shipHeldTerminal(state, result) {
|
|
|
313
314
|
"ready_to_ship",
|
|
314
315
|
result,
|
|
315
316
|
result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
316
|
-
{ ship_held: true }
|
|
317
|
+
{ ship_held: true, shipping_disabled: true, ship_authorized: false }
|
|
317
318
|
);
|
|
318
319
|
}
|
|
319
320
|
function checkpointContinueStage(result) {
|
|
@@ -591,6 +592,7 @@ function terminalResult(state, status, result, summary, raw = {}) {
|
|
|
591
592
|
engineResult: result
|
|
592
593
|
});
|
|
593
594
|
applyTerminalMetadata(state, metadata);
|
|
595
|
+
applyShipControlState(state, { status, raw });
|
|
594
596
|
persist(state);
|
|
595
597
|
return createRunResult({
|
|
596
598
|
state,
|
|
@@ -923,6 +925,8 @@ function checkpointResponseContinuation(state, value) {
|
|
|
923
925
|
response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
924
926
|
{
|
|
925
927
|
ship_held: true,
|
|
928
|
+
shipping_disabled: true,
|
|
929
|
+
ship_authorized: false,
|
|
926
930
|
proof_assessment: assessment
|
|
927
931
|
}
|
|
928
932
|
)
|
|
@@ -1516,6 +1520,8 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
1516
1520
|
assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
1517
1521
|
{
|
|
1518
1522
|
ship_held: true,
|
|
1523
|
+
shipping_disabled: true,
|
|
1524
|
+
ship_authorized: false,
|
|
1519
1525
|
proof_assessment: payload
|
|
1520
1526
|
}
|
|
1521
1527
|
)
|
|
@@ -99,6 +99,9 @@ function normalizeTerminalMetadata(input) {
|
|
|
99
99
|
pr_state: prState,
|
|
100
100
|
marked_ready: markedReady,
|
|
101
101
|
left_draft: leftDraft,
|
|
102
|
+
ship_held: firstBoolean(riddleState.ship_held, result.ship_held, result.shipHeld, details.ship_held, details.shipHeld, shipReport.ship_held, shipReport.shipHeld),
|
|
103
|
+
shipping_disabled: firstBoolean(riddleState.shipping_disabled, result.shipping_disabled, result.shippingDisabled, details.shipping_disabled, details.shippingDisabled, shipReport.shipping_disabled, shipReport.shippingDisabled),
|
|
104
|
+
ship_authorized: firstBoolean(riddleState.ship_authorized, result.ship_authorized, result.shipAuthorized, details.ship_authorized, details.shipAuthorized, shipReport.ship_authorized, shipReport.shipAuthorized),
|
|
102
105
|
ci_status: firstNonEmptyString(riddleState.ci_status, result.ci_status, result.ciStatus, details.ci_status, details.ciStatus, shipReport.ci_status),
|
|
103
106
|
ship_commit: firstNonEmptyString(riddleState.ship_commit, result.ship_commit, result.shipCommit, details.ship_commit, details.shipCommit, shipReport.shipped_commit, shipReport.ship_commit),
|
|
104
107
|
ship_remote_head: firstNonEmptyString(riddleState.ship_remote_head, result.ship_remote_head, result.shipRemoteHead, details.ship_remote_head, details.shipRemoteHead, shipReport.ship_remote_head),
|
|
@@ -132,6 +135,9 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
132
135
|
if (prBranch) state.pr_branch = prBranch;
|
|
133
136
|
if (typeof metadata.marked_ready === "boolean") state.marked_ready = metadata.marked_ready;
|
|
134
137
|
if (typeof metadata.left_draft === "boolean") state.left_draft = metadata.left_draft;
|
|
138
|
+
if (typeof metadata.ship_held === "boolean") state.ship_held = metadata.ship_held;
|
|
139
|
+
if (typeof metadata.shipping_disabled === "boolean") state.shipping_disabled = metadata.shipping_disabled;
|
|
140
|
+
if (typeof metadata.ship_authorized === "boolean") state.ship_authorized = metadata.ship_authorized;
|
|
135
141
|
const ciStatus = nonEmptyString(metadata.ci_status);
|
|
136
142
|
if (ciStatus) state.ci_status = ciStatus;
|
|
137
143
|
const shipCommit = nonEmptyString(metadata.ship_commit);
|
|
@@ -163,12 +169,53 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
163
169
|
if (typeof metadata.finalized === "boolean") state.finalized = metadata.finalized;
|
|
164
170
|
return state;
|
|
165
171
|
}
|
|
172
|
+
function shipControlStateFor(input) {
|
|
173
|
+
const state = input.state;
|
|
174
|
+
const status = input.status || state.status;
|
|
175
|
+
const raw = recordValue(input.raw) || {};
|
|
176
|
+
const shipReport = recordValue(state.ship_report) || {};
|
|
177
|
+
const prState = recordValue(state.pr_state) || {};
|
|
178
|
+
const shippingDisabled = firstBoolean(
|
|
179
|
+
raw.shipping_disabled,
|
|
180
|
+
raw.shippingDisabled,
|
|
181
|
+
state.shipping_disabled,
|
|
182
|
+
shipReport.shipping_disabled,
|
|
183
|
+
shipReport.shippingDisabled
|
|
184
|
+
) ?? state.request?.ship_mode === "none";
|
|
185
|
+
const explicitAuthorized = firstBoolean(
|
|
186
|
+
raw.ship_authorized,
|
|
187
|
+
raw.shipAuthorized,
|
|
188
|
+
state.ship_authorized,
|
|
189
|
+
shipReport.ship_authorized,
|
|
190
|
+
shipReport.shipAuthorized
|
|
191
|
+
);
|
|
192
|
+
const authorizationEvidence = Boolean(
|
|
193
|
+
status === "shipped" || state.marked_ready === true || shipReport.marked_ready === true || prState.status === "merged" || state.merge_commit || state.merged_at
|
|
194
|
+
);
|
|
195
|
+
const inferredAuthorized = explicitAuthorized ?? authorizationEvidence;
|
|
196
|
+
const rawHeld = firstBoolean(raw.ship_held, raw.shipHeld);
|
|
197
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !inferredAuthorized;
|
|
198
|
+
const shipHeld = rawHeld ?? (state.ship_held === true || inferredHeld);
|
|
199
|
+
return {
|
|
200
|
+
ship_held: shipHeld,
|
|
201
|
+
shipping_disabled: shippingDisabled,
|
|
202
|
+
ship_authorized: shipHeld ? false : inferredAuthorized
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
function applyShipControlState(state, input = {}) {
|
|
206
|
+
const control = shipControlStateFor({ state, status: input.status, raw: input.raw });
|
|
207
|
+
state.ship_held = control.ship_held;
|
|
208
|
+
state.shipping_disabled = control.shipping_disabled;
|
|
209
|
+
state.ship_authorized = control.ship_authorized;
|
|
210
|
+
return state;
|
|
211
|
+
}
|
|
166
212
|
function createRunResult(input) {
|
|
167
213
|
const status = input.status || input.state.status;
|
|
168
214
|
const ok = isSuccessfulStatus(status);
|
|
169
215
|
const state = input.metadata ? applyTerminalMetadata(input.state, input.metadata) : input.state;
|
|
170
216
|
state.status = status;
|
|
171
217
|
state.ok = ok;
|
|
218
|
+
applyShipControlState(state, { status, raw: input.raw });
|
|
172
219
|
return compactRecord({
|
|
173
220
|
ok,
|
|
174
221
|
status,
|
|
@@ -186,6 +233,9 @@ function createRunResult(input) {
|
|
|
186
233
|
pr_state: state.pr_state,
|
|
187
234
|
marked_ready: state.marked_ready,
|
|
188
235
|
left_draft: state.left_draft,
|
|
236
|
+
ship_held: state.ship_held,
|
|
237
|
+
shipping_disabled: state.shipping_disabled,
|
|
238
|
+
ship_authorized: state.ship_authorized,
|
|
189
239
|
ci_status: state.ci_status,
|
|
190
240
|
ship_commit: state.ship_commit,
|
|
191
241
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -222,5 +272,7 @@ export {
|
|
|
222
272
|
recordValue,
|
|
223
273
|
normalizeTerminalMetadata,
|
|
224
274
|
applyTerminalMetadata,
|
|
275
|
+
shipControlStateFor,
|
|
276
|
+
applyShipControlState,
|
|
225
277
|
createRunResult
|
|
226
278
|
};
|
package/dist/cli/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "../chunk-
|
|
1
|
+
import "../chunk-MYMTAVGP.js";
|
|
2
2
|
import "../chunk-DI2XNGEZ.js";
|
|
3
3
|
import "../chunk-6KYXX4OE.js";
|
|
4
4
|
import "../chunk-EX7TO4I5.js";
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
5
|
+
import "../chunk-QGE3KBRL.js";
|
|
6
|
+
import "../chunk-Q5GYD5RG.js";
|
|
7
|
+
import "../chunk-NYRMPWJB.js";
|
|
8
8
|
import "../chunk-EKZXU6MU.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-QUK3SG24.js";
|
|
10
10
|
import "../chunk-JFQXAJH2.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-SONWF3FQ.js";
|
|
12
|
+
import "../chunk-W44XEGYW.js";
|
|
13
13
|
import "../chunk-MLKGABMK.js";
|
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) {
|
|
@@ -5373,6 +5431,7 @@ function terminalResult(state, status, result, summary, raw = {}) {
|
|
|
5373
5431
|
engineResult: result
|
|
5374
5432
|
});
|
|
5375
5433
|
applyTerminalMetadata(state, metadata);
|
|
5434
|
+
applyShipControlState(state, { status, raw });
|
|
5376
5435
|
persist(state);
|
|
5377
5436
|
return createRunResult({
|
|
5378
5437
|
state,
|
|
@@ -5705,6 +5764,8 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5705
5764
|
response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5706
5765
|
{
|
|
5707
5766
|
ship_held: true,
|
|
5767
|
+
shipping_disabled: true,
|
|
5768
|
+
ship_authorized: false,
|
|
5708
5769
|
proof_assessment: assessment
|
|
5709
5770
|
}
|
|
5710
5771
|
)
|
|
@@ -6298,6 +6359,8 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
6298
6359
|
assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
6299
6360
|
{
|
|
6300
6361
|
ship_held: true,
|
|
6362
|
+
shipping_disabled: true,
|
|
6363
|
+
ship_authorized: false,
|
|
6301
6364
|
proof_assessment: payload
|
|
6302
6365
|
}
|
|
6303
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) {
|
|
@@ -5285,6 +5343,7 @@ function terminalResult(state, status, result, summary, raw = {}) {
|
|
|
5285
5343
|
engineResult: result
|
|
5286
5344
|
});
|
|
5287
5345
|
applyTerminalMetadata(state, metadata);
|
|
5346
|
+
applyShipControlState(state, { status, raw });
|
|
5288
5347
|
persist(state);
|
|
5289
5348
|
return createRunResult({
|
|
5290
5349
|
state,
|
|
@@ -5617,6 +5676,8 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5617
5676
|
response.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
5618
5677
|
{
|
|
5619
5678
|
ship_held: true,
|
|
5679
|
+
shipping_disabled: true,
|
|
5680
|
+
ship_authorized: false,
|
|
5620
5681
|
proof_assessment: assessment
|
|
5621
5682
|
}
|
|
5622
5683
|
)
|
|
@@ -6210,6 +6271,8 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
6210
6271
|
assessment.summary || result.summary || "Riddle Proof evidence is approved, but ship_mode=none is holding before PR/ship.",
|
|
6211
6272
|
{
|
|
6212
6273
|
ship_held: true,
|
|
6274
|
+
shipping_disabled: true,
|
|
6275
|
+
ship_authorized: false,
|
|
6213
6276
|
proof_assessment: payload
|
|
6214
6277
|
}
|
|
6215
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,
|