@riddledc/riddle-proof 0.8.59 → 0.8.61
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.d.cts +1 -0
- package/dist/adapters/codex-exec-agent.d.ts +1 -0
- package/dist/adapters/codex-exec-agent.js +3 -2
- package/dist/adapters/codex.d.cts +1 -0
- package/dist/adapters/codex.d.ts +1 -0
- package/dist/adapters/codex.js +3 -2
- package/dist/adapters/local-agent.d.cts +1 -0
- package/dist/adapters/local-agent.d.ts +1 -0
- package/dist/adapters/local-agent.js +3 -2
- package/dist/adapters/openclaw.d.cts +1 -0
- package/dist/adapters/openclaw.d.ts +1 -0
- package/dist/adapters/openclaw.js +6 -5
- package/dist/advanced/engine-harness.cjs +299 -43
- package/dist/advanced/engine-harness.d.cts +1 -0
- package/dist/advanced/engine-harness.d.ts +1 -0
- package/dist/advanced/engine-harness.js +6 -5
- package/dist/advanced/index.cjs +299 -43
- package/dist/advanced/index.d.cts +1 -0
- package/dist/advanced/index.d.ts +1 -0
- package/dist/advanced/index.js +7 -6
- package/dist/advanced/runner.cjs +202 -4
- package/dist/advanced/runner.d.cts +1 -0
- package/dist/advanced/runner.d.ts +1 -0
- package/dist/advanced/runner.js +6 -5
- package/dist/checkpoint.d.cts +1 -0
- package/dist/checkpoint.d.ts +1 -0
- package/dist/checkpoint.js +3 -2
- package/dist/{chunk-TTB3ZAVX.js → chunk-3FK5HZHK.js} +2 -2
- package/dist/{chunk-MOTQNIZX.js → chunk-FX2CB4MG.js} +1 -1
- package/dist/{chunk-GHBNDHG7.js → chunk-HD46EEUV.js} +50 -4
- package/dist/{chunk-2PKBTYOA.js → chunk-K6VYKOIM.js} +9 -4
- package/dist/{chunk-XSNMMAPJ.js → chunk-NQ5HPAZD.js} +4 -4
- package/dist/{chunk-KNPCWWF3.js → chunk-NXEAFQYZ.js} +16 -10
- package/dist/{chunk-CUBYSWZT.js → chunk-QGMSN34W.js} +51 -4
- package/dist/{chunk-RS4HJLJQ.js → chunk-QPKY767W.js} +1 -1
- package/dist/{chunk-UZIX7M7D.js → chunk-UEY5SJG5.js} +13 -9
- package/dist/{chunk-KG64Y5MC.js → chunk-WKIIJX3O.js} +12 -0
- package/dist/{chunk-JLOZTVXU.js → chunk-XKNJ5OE4.js} +2 -2
- package/dist/cli/index.js +9 -9
- package/dist/cli.cjs +512 -405
- package/dist/cli.js +9 -9
- package/dist/codex-exec-agent.d.cts +1 -0
- package/dist/codex-exec-agent.d.ts +1 -0
- package/dist/codex-exec-agent.js +3 -2
- package/dist/diagnostics.d.cts +1 -0
- package/dist/diagnostics.d.ts +1 -0
- package/dist/engine-harness.cjs +299 -43
- package/dist/engine-harness.d.cts +1 -0
- package/dist/engine-harness.d.ts +1 -0
- package/dist/engine-harness.js +6 -5
- package/dist/index.cjs +287 -170
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +21 -11
- package/dist/local-agent.d.cts +1 -0
- package/dist/local-agent.d.ts +1 -0
- package/dist/local-agent.js +3 -2
- package/dist/openclaw.d.cts +1 -0
- package/dist/openclaw.d.ts +1 -0
- package/dist/openclaw.js +6 -5
- package/dist/pr-comment.cjs +15 -3
- package/dist/pr-comment.js +2 -2
- package/dist/profile/index.d.cts +1 -0
- package/dist/profile/index.d.ts +1 -0
- package/dist/profile.d.cts +1 -0
- package/dist/profile.d.ts +1 -0
- package/dist/proof-session.d.cts +1 -0
- package/dist/proof-session.d.ts +1 -0
- package/dist/public-state.cjs +15 -0
- package/dist/public-state.d.cts +4 -1
- package/dist/public-state.d.ts +4 -1
- package/dist/public-state.js +7 -1
- package/dist/result.cjs +211 -4
- package/dist/result.d.cts +12 -1
- package/dist/result.d.ts +12 -1
- package/dist/result.js +6 -1
- package/dist/run-card.cjs +198 -40
- package/dist/run-card.d.cts +1 -0
- package/dist/run-card.d.ts +1 -0
- package/dist/run-card.js +4 -3
- package/dist/runner.cjs +202 -4
- package/dist/runner.d.cts +1 -0
- package/dist/runner.d.ts +1 -0
- package/dist/runner.js +6 -5
- package/dist/spec/checkpoint.d.cts +1 -0
- package/dist/spec/checkpoint.d.ts +1 -0
- package/dist/spec/checkpoint.js +3 -2
- package/dist/spec/index.cjs +235 -167
- package/dist/spec/index.d.cts +2 -2
- package/dist/spec/index.d.ts +2 -2
- package/dist/spec/index.js +17 -7
- package/dist/spec/public-state.cjs +15 -0
- package/dist/spec/public-state.d.cts +1 -1
- package/dist/spec/public-state.d.ts +1 -1
- package/dist/spec/public-state.js +7 -1
- package/dist/spec/result.cjs +209 -4
- package/dist/spec/result.d.cts +2 -1
- package/dist/spec/result.d.ts +2 -1
- package/dist/spec/result.js +6 -1
- package/dist/spec/run-card.cjs +198 -40
- package/dist/spec/run-card.d.cts +1 -0
- package/dist/spec/run-card.d.ts +1 -0
- package/dist/spec/run-card.js +4 -3
- package/dist/spec/state.cjs +207 -45
- package/dist/spec/state.d.cts +1 -0
- package/dist/spec/state.d.ts +1 -0
- package/dist/spec/state.js +5 -4
- package/dist/spec/types.d.cts +1 -0
- package/dist/spec/types.d.ts +1 -0
- package/dist/state.cjs +207 -45
- package/dist/state.d.cts +1 -0
- package/dist/state.d.ts +1 -0
- package/dist/state.js +5 -4
- package/dist/types.d.cts +14 -0
- package/dist/types.d.ts +14 -0
- package/package.json +1 -1
package/dist/spec/index.cjs
CHANGED
|
@@ -64,7 +64,12 @@ __export(spec_exports, {
|
|
|
64
64
|
normalizeRunParams: () => normalizeRunParams,
|
|
65
65
|
normalizeTerminalMetadata: () => normalizeTerminalMetadata,
|
|
66
66
|
proofContractFromAuthorCheckpointResponse: () => proofContractFromAuthorCheckpointResponse,
|
|
67
|
+
publicMergeRecommendationForRunState: () => publicMergeRecommendationForRunState,
|
|
68
|
+
publicStateForRunState: () => publicStateForRunState,
|
|
67
69
|
recordValue: () => recordValue,
|
|
70
|
+
riddleProofPublicStateAllowsClaim: () => riddleProofPublicStateAllowsClaim,
|
|
71
|
+
riddleProofPublicStateAllowsMergeRecommendation: () => riddleProofPublicStateAllowsMergeRecommendation,
|
|
72
|
+
riddleProofPublicStateMergeRecommendation: () => riddleProofPublicStateMergeRecommendation,
|
|
68
73
|
setRunStatus: () => setRunStatus,
|
|
69
74
|
shipControlStateFor: () => shipControlStateFor,
|
|
70
75
|
statePathsForRunState: () => statePathsForRunState,
|
|
@@ -72,6 +77,167 @@ __export(spec_exports, {
|
|
|
72
77
|
});
|
|
73
78
|
module.exports = __toCommonJS(spec_exports);
|
|
74
79
|
|
|
80
|
+
// src/public-state.ts
|
|
81
|
+
function riddleProofPublicStateAllowsClaim(summary, claim) {
|
|
82
|
+
return !summary?.prohibited_claims.includes(claim);
|
|
83
|
+
}
|
|
84
|
+
function riddleProofPublicStateAllowsMergeRecommendation(summary) {
|
|
85
|
+
return riddleProofPublicStateAllowsClaim(summary, "merge_ready") && riddleProofPublicStateAllowsClaim(summary, "sync_allowed");
|
|
86
|
+
}
|
|
87
|
+
function riddleProofPublicStateMergeRecommendation(summary, recommendation) {
|
|
88
|
+
return recommendation && riddleProofPublicStateAllowsMergeRecommendation(summary) ? recommendation : void 0;
|
|
89
|
+
}
|
|
90
|
+
function asRecord(value) {
|
|
91
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
92
|
+
}
|
|
93
|
+
function stringValue(value) {
|
|
94
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
95
|
+
}
|
|
96
|
+
function booleanValue(value) {
|
|
97
|
+
return typeof value === "boolean" ? value : void 0;
|
|
98
|
+
}
|
|
99
|
+
function numberValue(value) {
|
|
100
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
101
|
+
}
|
|
102
|
+
function firstStringValue(...values) {
|
|
103
|
+
for (const value of values) {
|
|
104
|
+
const text = stringValue(value);
|
|
105
|
+
if (text) return text;
|
|
106
|
+
}
|
|
107
|
+
return void 0;
|
|
108
|
+
}
|
|
109
|
+
function firstBooleanValue(...values) {
|
|
110
|
+
for (const value of values) {
|
|
111
|
+
const bool = booleanValue(value);
|
|
112
|
+
if (typeof bool === "boolean") return bool;
|
|
113
|
+
}
|
|
114
|
+
return void 0;
|
|
115
|
+
}
|
|
116
|
+
function firstRecordValue(...values) {
|
|
117
|
+
for (const value of values) {
|
|
118
|
+
const record = asRecord(value);
|
|
119
|
+
if (Object.keys(record).length) return record;
|
|
120
|
+
}
|
|
121
|
+
return void 0;
|
|
122
|
+
}
|
|
123
|
+
function countValue(value) {
|
|
124
|
+
const number = numberValue(value);
|
|
125
|
+
return typeof number === "number" && number > 0 ? Math.trunc(number) : 0;
|
|
126
|
+
}
|
|
127
|
+
function checkpointSummaryFrom(...values) {
|
|
128
|
+
const record = firstRecordValue(...values);
|
|
129
|
+
if (!record) return void 0;
|
|
130
|
+
const accepted = countValue(record.response_count);
|
|
131
|
+
const rejected = countValue(record.rejected_response_count);
|
|
132
|
+
const ignored = countValue(record.ignored_response_count);
|
|
133
|
+
const duplicate = countValue(record.duplicate_response_count);
|
|
134
|
+
const summary = {
|
|
135
|
+
pending: booleanValue(record.pending),
|
|
136
|
+
accepted_response_count: accepted,
|
|
137
|
+
rejected_response_count: rejected,
|
|
138
|
+
ignored_response_count: ignored,
|
|
139
|
+
duplicate_response_count: duplicate,
|
|
140
|
+
latest_decision: stringValue(record.latest_decision),
|
|
141
|
+
audit_disclosure_required: rejected > 0 || ignored > 0 || duplicate > 0
|
|
142
|
+
};
|
|
143
|
+
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
144
|
+
}
|
|
145
|
+
function uniqueStrings(values) {
|
|
146
|
+
return [...new Set(values.filter(Boolean))];
|
|
147
|
+
}
|
|
148
|
+
function summarizeRiddleProofPublicState(input) {
|
|
149
|
+
const record = asRecord(input);
|
|
150
|
+
const runCard = asRecord(record.run_card);
|
|
151
|
+
const stopCondition = asRecord(runCard.stop_condition);
|
|
152
|
+
const raw = asRecord(record.raw);
|
|
153
|
+
const request = asRecord(record.request);
|
|
154
|
+
const requestMetadata = asRecord(record.request_metadata);
|
|
155
|
+
const prState = asRecord(record.pr_state);
|
|
156
|
+
const handoff = asRecord(record.pr_handoff_policy);
|
|
157
|
+
const handoffState = stringValue(handoff.state);
|
|
158
|
+
const status = firstStringValue(record.status, stopCondition.status);
|
|
159
|
+
const ok = booleanValue(record.ok) ?? null;
|
|
160
|
+
const shipMode = firstStringValue(request.ship_mode, requestMetadata.ship_mode, record.ship_mode, handoff.ship_mode);
|
|
161
|
+
const explicitShippingDisabled = firstBooleanValue(
|
|
162
|
+
record.shipping_disabled,
|
|
163
|
+
stopCondition.shipping_disabled,
|
|
164
|
+
raw.shipping_disabled,
|
|
165
|
+
handoff.shipping_disabled
|
|
166
|
+
);
|
|
167
|
+
const shippingDisabled = explicitShippingDisabled === true || shipMode === "none" || handoffState === "proof_complete_ship_disabled";
|
|
168
|
+
const explicitShipAuthorized = firstBooleanValue(
|
|
169
|
+
record.ship_authorized,
|
|
170
|
+
stopCondition.ship_authorized,
|
|
171
|
+
raw.ship_authorized
|
|
172
|
+
);
|
|
173
|
+
const authorizationEvidence = Boolean(
|
|
174
|
+
status === "shipped" || record.marked_ready === true || stringValue(prState.status) === "merged" || record.merge_commit || record.merged_at
|
|
175
|
+
);
|
|
176
|
+
const shipAuthorizedBeforeHold = explicitShipAuthorized ?? authorizationEvidence;
|
|
177
|
+
const explicitShipHeld = firstBooleanValue(record.ship_held, stopCondition.ship_held, raw.ship_held);
|
|
178
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !shipAuthorizedBeforeHold;
|
|
179
|
+
const shipHeld = explicitShipHeld === true || inferredHeld;
|
|
180
|
+
const shipAuthorized = shipHeld ? false : shipAuthorizedBeforeHold === true;
|
|
181
|
+
const proofComplete = Boolean(
|
|
182
|
+
status === "ready_to_ship" || status === "shipped" || status === "completed" || status === "passed" || ok === true || handoff.proof_complete === true
|
|
183
|
+
);
|
|
184
|
+
const checkpointSummary = checkpointSummaryFrom(
|
|
185
|
+
record.checkpoint_summary,
|
|
186
|
+
stopCondition.checkpoint_summary,
|
|
187
|
+
asRecord(record.details).checkpoint_summary,
|
|
188
|
+
asRecord(raw.details).checkpoint_summary
|
|
189
|
+
);
|
|
190
|
+
const blockedOrWaiting = status === "blocked" || status === "failed" || status === "awaiting_checkpoint" || handoffState === "proof_blocked" || handoffState === "proof_review_required" || handoffState === "proof_failed" || handoffState === "proof_checkpoint_required";
|
|
191
|
+
const proofPassed = Boolean(proofComplete && !blockedOrWaiting);
|
|
192
|
+
const explicitMergeReady = firstBooleanValue(record.merge_ready, stopCondition.merge_ready, raw.merge_ready, handoff.merge_ready);
|
|
193
|
+
const normalPrAllowed = firstBooleanValue(record.normal_pr_allowed, raw.normal_pr_allowed, handoff.normal_pr_allowed);
|
|
194
|
+
const baseHandoffAllowed = !blockedOrWaiting && !shipHeld && !shippingDisabled;
|
|
195
|
+
const mergeReady = baseHandoffAllowed && normalPrAllowed !== false && (explicitMergeReady ?? shipAuthorized);
|
|
196
|
+
const syncAllowed = mergeReady;
|
|
197
|
+
let policyState = "unknown";
|
|
198
|
+
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") policyState = "awaiting_checkpoint";
|
|
199
|
+
else if (status === "failed" || handoffState === "proof_failed") policyState = "proof_failed";
|
|
200
|
+
else if (status === "blocked" || handoffState === "proof_blocked" || handoffState === "proof_review_required") policyState = "proof_blocked";
|
|
201
|
+
else if (handoffState === "proof_complete_ship_disabled") policyState = "proof_complete_ship_disabled";
|
|
202
|
+
else if (proofComplete && shipHeld && !shipAuthorized) policyState = "proof_passed_ship_held";
|
|
203
|
+
else if (proofComplete && shippingDisabled && !shipAuthorized) policyState = "proof_complete_ship_disabled";
|
|
204
|
+
else if (shipAuthorized) policyState = "ship_authorized";
|
|
205
|
+
else if (proofPassed) policyState = "proof_passed";
|
|
206
|
+
else if (status === "running") policyState = "proof_in_progress";
|
|
207
|
+
const requiredDisclosures = [];
|
|
208
|
+
if (shipHeld) requiredDisclosures.push("ship_held");
|
|
209
|
+
if (shippingDisabled) requiredDisclosures.push("shipping_disabled");
|
|
210
|
+
if (checkpointSummary?.audit_disclosure_required) requiredDisclosures.push("checkpoint_audit_counters");
|
|
211
|
+
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") requiredDisclosures.push("checkpoint_required");
|
|
212
|
+
const prohibitedClaims = [];
|
|
213
|
+
if (!shipAuthorized || shipHeld || shippingDisabled) prohibitedClaims.push("ship_authorized", "shipped");
|
|
214
|
+
if (!mergeReady) prohibitedClaims.push("merge_ready");
|
|
215
|
+
if (!syncAllowed) prohibitedClaims.push("sync_allowed");
|
|
216
|
+
if (blockedOrWaiting) {
|
|
217
|
+
prohibitedClaims.push("proof_passed", "ready_to_ship");
|
|
218
|
+
}
|
|
219
|
+
if (checkpointSummary?.audit_disclosure_required) {
|
|
220
|
+
prohibitedClaims.push("all_checkpoint_responses_accepted");
|
|
221
|
+
}
|
|
222
|
+
const resultLabel = policyState === "awaiting_checkpoint" ? "checkpoint required" : policyState === "proof_blocked" ? "blocked" : policyState === "proof_failed" ? "failed" : policyState === "proof_complete_ship_disabled" ? "proof complete; shipping disabled" : policyState === "proof_passed_ship_held" ? "proof passed; ship held" : policyState === "ship_authorized" ? status === "shipped" ? "shipped" : "ship authorized" : policyState === "proof_passed" ? "passed" : policyState === "proof_in_progress" ? "running" : status || "recorded";
|
|
223
|
+
return {
|
|
224
|
+
status,
|
|
225
|
+
ok,
|
|
226
|
+
policy_state: policyState,
|
|
227
|
+
result_label: resultLabel,
|
|
228
|
+
proof_complete: proofComplete,
|
|
229
|
+
proof_passed: proofPassed,
|
|
230
|
+
ship_held: shipHeld,
|
|
231
|
+
shipping_disabled: shippingDisabled,
|
|
232
|
+
ship_authorized: shipAuthorized,
|
|
233
|
+
merge_ready: mergeReady,
|
|
234
|
+
sync_allowed: syncAllowed,
|
|
235
|
+
checkpoint_summary: checkpointSummary,
|
|
236
|
+
required_disclosures: uniqueStrings(requiredDisclosures),
|
|
237
|
+
prohibited_claims: uniqueStrings(prohibitedClaims)
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
75
241
|
// src/result.ts
|
|
76
242
|
function isTerminalStatus(status) {
|
|
77
243
|
return status === "blocked" || status === "failed" || status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
@@ -246,6 +412,37 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
246
412
|
if (typeof metadata.finalized === "boolean") state.finalized = metadata.finalized;
|
|
247
413
|
return state;
|
|
248
414
|
}
|
|
415
|
+
function publicStateForRunState(input) {
|
|
416
|
+
const state = input.state;
|
|
417
|
+
const status = input.status || state.status;
|
|
418
|
+
const raw = recordValue(input.raw) || {};
|
|
419
|
+
const extendedState = state;
|
|
420
|
+
const terminalOk = isTerminalStatus(status) ? state.ok : void 0;
|
|
421
|
+
return summarizeRiddleProofPublicState(compactRecord({
|
|
422
|
+
status,
|
|
423
|
+
ok: terminalOk,
|
|
424
|
+
request: state.request,
|
|
425
|
+
pr_state: state.pr_state,
|
|
426
|
+
marked_ready: state.marked_ready,
|
|
427
|
+
ship_held: state.ship_held,
|
|
428
|
+
shipping_disabled: state.shipping_disabled,
|
|
429
|
+
ship_authorized: state.ship_authorized,
|
|
430
|
+
ship_mode: state.request?.ship_mode,
|
|
431
|
+
merge_commit: state.merge_commit,
|
|
432
|
+
merged_at: state.merged_at,
|
|
433
|
+
checkpoint_summary: state.checkpoint_summary,
|
|
434
|
+
pr_handoff_policy: recordValue(extendedState.pr_handoff_policy),
|
|
435
|
+
merge_ready: extendedState.merge_ready,
|
|
436
|
+
normal_pr_allowed: extendedState.normal_pr_allowed,
|
|
437
|
+
raw: Object.keys(raw).length ? raw : void 0
|
|
438
|
+
}));
|
|
439
|
+
}
|
|
440
|
+
function publicMergeRecommendationForRunState(input) {
|
|
441
|
+
return riddleProofPublicStateMergeRecommendation(
|
|
442
|
+
publicStateForRunState(input),
|
|
443
|
+
input.state.merge_recommendation
|
|
444
|
+
);
|
|
445
|
+
}
|
|
249
446
|
function shipControlStateFor(input) {
|
|
250
447
|
const state = input.state;
|
|
251
448
|
const status = input.status || state.status;
|
|
@@ -294,6 +491,11 @@ function createRunResult(input) {
|
|
|
294
491
|
state.ok = ok;
|
|
295
492
|
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
296
493
|
applyShipControlState(state, { status, raw: input.raw });
|
|
494
|
+
const publicState = publicStateForRunState({ state, status, raw: input.raw });
|
|
495
|
+
const publicMergeRecommendation = riddleProofPublicStateMergeRecommendation(
|
|
496
|
+
publicState,
|
|
497
|
+
state.merge_recommendation
|
|
498
|
+
);
|
|
297
499
|
return compactRecord({
|
|
298
500
|
ok,
|
|
299
501
|
status,
|
|
@@ -311,9 +513,12 @@ function createRunResult(input) {
|
|
|
311
513
|
pr_state: state.pr_state,
|
|
312
514
|
marked_ready: state.marked_ready,
|
|
313
515
|
left_draft: state.left_draft,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
516
|
+
result_label: publicState.result_label,
|
|
517
|
+
ship_held: publicState.ship_held,
|
|
518
|
+
shipping_disabled: publicState.shipping_disabled,
|
|
519
|
+
ship_authorized: publicState.ship_authorized,
|
|
520
|
+
merge_ready: publicState.merge_ready,
|
|
521
|
+
sync_allowed: publicState.sync_allowed,
|
|
317
522
|
ci_status: state.ci_status,
|
|
318
523
|
ship_commit: state.ship_commit,
|
|
319
524
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -327,7 +532,8 @@ function createRunResult(input) {
|
|
|
327
532
|
cleanup_report: state.cleanup_report,
|
|
328
533
|
notification: state.notification,
|
|
329
534
|
proof_decision: state.proof_decision,
|
|
330
|
-
merge_recommendation:
|
|
535
|
+
merge_recommendation: publicMergeRecommendation,
|
|
536
|
+
public_state: publicState,
|
|
331
537
|
finalized: state.finalized,
|
|
332
538
|
blocker: state.blocker,
|
|
333
539
|
checkpoint_packet: state.checkpoint_packet,
|
|
@@ -1297,7 +1503,8 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
1297
1503
|
const visualDelta = visualDeltaFrom({ fullRiddleState: fullState, runState: state });
|
|
1298
1504
|
const artifacts = artifactsFrom({ fullRiddleState: fullState, runState: state });
|
|
1299
1505
|
const viewportMatrix = viewportMatrixFrom({ fullRiddleState: fullState, runState: state });
|
|
1300
|
-
const
|
|
1506
|
+
const publicState = publicStateForRunState({ state, status: state.status });
|
|
1507
|
+
const publicMergeRecommendation = publicMergeRecommendationForRunState({ state, status: state.status });
|
|
1301
1508
|
return {
|
|
1302
1509
|
version: RIDDLE_PROOF_RUN_CARD_VERSION,
|
|
1303
1510
|
run_id: state.run_id || "unknown",
|
|
@@ -1351,14 +1558,18 @@ function createRiddleProofRunCard(state, input = {}) {
|
|
|
1351
1558
|
stop_condition: compactRecord({
|
|
1352
1559
|
status: state.status,
|
|
1353
1560
|
terminal: isTerminalStatus(state.status),
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1561
|
+
result_label: publicState.result_label,
|
|
1562
|
+
ship_held: publicState.ship_held,
|
|
1563
|
+
shipping_disabled: publicState.shipping_disabled,
|
|
1564
|
+
ship_authorized: publicState.ship_authorized,
|
|
1565
|
+
merge_ready: publicState.merge_ready,
|
|
1566
|
+
sync_allowed: publicState.sync_allowed,
|
|
1357
1567
|
blocker_code: state.blocker?.code || null,
|
|
1358
1568
|
blocker_message: state.blocker?.message || null,
|
|
1359
1569
|
proof_decision: state.proof_decision,
|
|
1360
|
-
merge_recommendation:
|
|
1361
|
-
monitor_should_continue: !isTerminalStatus(state.status)
|
|
1570
|
+
merge_recommendation: publicMergeRecommendation,
|
|
1571
|
+
monitor_should_continue: !isTerminalStatus(state.status),
|
|
1572
|
+
public_state: publicState
|
|
1362
1573
|
}),
|
|
1363
1574
|
updated_at: state.updated_at
|
|
1364
1575
|
};
|
|
@@ -1544,8 +1755,8 @@ function appendStageHeartbeat(state, input) {
|
|
|
1544
1755
|
function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
1545
1756
|
const latestEvent = state.events[state.events.length - 1];
|
|
1546
1757
|
const runId = state.run_id || "unknown";
|
|
1547
|
-
const
|
|
1548
|
-
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 ===
|
|
1758
|
+
const publicState = publicStateForRunState({ state, status: state.status });
|
|
1759
|
+
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 === publicState.ship_held && state.run_card.stop_condition?.shipping_disabled === publicState.shipping_disabled && state.run_card.stop_condition?.ship_authorized === publicState.ship_authorized && state.run_card.stop_condition?.merge_ready === publicState.merge_ready && state.run_card.stop_condition?.sync_allowed === publicState.sync_allowed && state.run_card.stop_condition?.result_label === publicState.result_label;
|
|
1549
1760
|
const runCard = existingRunCardCurrent ? state.run_card : createRiddleProofRunCard(state, { at });
|
|
1550
1761
|
return compactRecord({
|
|
1551
1762
|
run_id: runId,
|
|
@@ -1559,9 +1770,13 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
|
1559
1770
|
pr_url: state.pr_url ?? null,
|
|
1560
1771
|
pr_branch: state.pr_branch ?? null,
|
|
1561
1772
|
pr_state: state.pr_state,
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1773
|
+
result_label: publicState.result_label,
|
|
1774
|
+
ship_held: publicState.ship_held,
|
|
1775
|
+
shipping_disabled: publicState.shipping_disabled,
|
|
1776
|
+
ship_authorized: publicState.ship_authorized,
|
|
1777
|
+
merge_ready: publicState.merge_ready,
|
|
1778
|
+
sync_allowed: publicState.sync_allowed,
|
|
1779
|
+
public_state: publicState,
|
|
1565
1780
|
ci_status: state.ci_status,
|
|
1566
1781
|
ship_commit: state.ship_commit,
|
|
1567
1782
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -1608,158 +1823,6 @@ function applyPrLifecycleState(state, input, at = timestamp2()) {
|
|
|
1608
1823
|
state.updated_at = at;
|
|
1609
1824
|
return state;
|
|
1610
1825
|
}
|
|
1611
|
-
|
|
1612
|
-
// src/public-state.ts
|
|
1613
|
-
function asRecord(value) {
|
|
1614
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
1615
|
-
}
|
|
1616
|
-
function stringValue(value) {
|
|
1617
|
-
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
1618
|
-
}
|
|
1619
|
-
function booleanValue(value) {
|
|
1620
|
-
return typeof value === "boolean" ? value : void 0;
|
|
1621
|
-
}
|
|
1622
|
-
function numberValue(value) {
|
|
1623
|
-
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
1624
|
-
}
|
|
1625
|
-
function firstStringValue(...values) {
|
|
1626
|
-
for (const value of values) {
|
|
1627
|
-
const text = stringValue(value);
|
|
1628
|
-
if (text) return text;
|
|
1629
|
-
}
|
|
1630
|
-
return void 0;
|
|
1631
|
-
}
|
|
1632
|
-
function firstBooleanValue(...values) {
|
|
1633
|
-
for (const value of values) {
|
|
1634
|
-
const bool = booleanValue(value);
|
|
1635
|
-
if (typeof bool === "boolean") return bool;
|
|
1636
|
-
}
|
|
1637
|
-
return void 0;
|
|
1638
|
-
}
|
|
1639
|
-
function firstRecordValue(...values) {
|
|
1640
|
-
for (const value of values) {
|
|
1641
|
-
const record = asRecord(value);
|
|
1642
|
-
if (Object.keys(record).length) return record;
|
|
1643
|
-
}
|
|
1644
|
-
return void 0;
|
|
1645
|
-
}
|
|
1646
|
-
function countValue(value) {
|
|
1647
|
-
const number = numberValue(value);
|
|
1648
|
-
return typeof number === "number" && number > 0 ? Math.trunc(number) : 0;
|
|
1649
|
-
}
|
|
1650
|
-
function checkpointSummaryFrom(...values) {
|
|
1651
|
-
const record = firstRecordValue(...values);
|
|
1652
|
-
if (!record) return void 0;
|
|
1653
|
-
const accepted = countValue(record.response_count);
|
|
1654
|
-
const rejected = countValue(record.rejected_response_count);
|
|
1655
|
-
const ignored = countValue(record.ignored_response_count);
|
|
1656
|
-
const duplicate = countValue(record.duplicate_response_count);
|
|
1657
|
-
const summary = {
|
|
1658
|
-
pending: booleanValue(record.pending),
|
|
1659
|
-
accepted_response_count: accepted,
|
|
1660
|
-
rejected_response_count: rejected,
|
|
1661
|
-
ignored_response_count: ignored,
|
|
1662
|
-
duplicate_response_count: duplicate,
|
|
1663
|
-
latest_decision: stringValue(record.latest_decision),
|
|
1664
|
-
audit_disclosure_required: rejected > 0 || ignored > 0 || duplicate > 0
|
|
1665
|
-
};
|
|
1666
|
-
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
1667
|
-
}
|
|
1668
|
-
function uniqueStrings(values) {
|
|
1669
|
-
return [...new Set(values.filter(Boolean))];
|
|
1670
|
-
}
|
|
1671
|
-
function summarizeRiddleProofPublicState(input) {
|
|
1672
|
-
const record = asRecord(input);
|
|
1673
|
-
const runCard = asRecord(record.run_card);
|
|
1674
|
-
const stopCondition = asRecord(runCard.stop_condition);
|
|
1675
|
-
const raw = asRecord(record.raw);
|
|
1676
|
-
const request = asRecord(record.request);
|
|
1677
|
-
const requestMetadata = asRecord(record.request_metadata);
|
|
1678
|
-
const prState = asRecord(record.pr_state);
|
|
1679
|
-
const handoff = asRecord(record.pr_handoff_policy);
|
|
1680
|
-
const handoffState = stringValue(handoff.state);
|
|
1681
|
-
const status = firstStringValue(record.status, stopCondition.status);
|
|
1682
|
-
const ok = booleanValue(record.ok) ?? null;
|
|
1683
|
-
const shipMode = firstStringValue(request.ship_mode, requestMetadata.ship_mode, record.ship_mode, handoff.ship_mode);
|
|
1684
|
-
const explicitShippingDisabled = firstBooleanValue(
|
|
1685
|
-
record.shipping_disabled,
|
|
1686
|
-
stopCondition.shipping_disabled,
|
|
1687
|
-
raw.shipping_disabled,
|
|
1688
|
-
handoff.shipping_disabled
|
|
1689
|
-
);
|
|
1690
|
-
const shippingDisabled = explicitShippingDisabled === true || shipMode === "none" || handoffState === "proof_complete_ship_disabled";
|
|
1691
|
-
const explicitShipAuthorized = firstBooleanValue(
|
|
1692
|
-
record.ship_authorized,
|
|
1693
|
-
stopCondition.ship_authorized,
|
|
1694
|
-
raw.ship_authorized
|
|
1695
|
-
);
|
|
1696
|
-
const authorizationEvidence = Boolean(
|
|
1697
|
-
status === "shipped" || record.marked_ready === true || stringValue(prState.status) === "merged" || record.merge_commit || record.merged_at
|
|
1698
|
-
);
|
|
1699
|
-
const shipAuthorizedBeforeHold = explicitShipAuthorized ?? authorizationEvidence;
|
|
1700
|
-
const explicitShipHeld = firstBooleanValue(record.ship_held, stopCondition.ship_held, raw.ship_held);
|
|
1701
|
-
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !shipAuthorizedBeforeHold;
|
|
1702
|
-
const shipHeld = explicitShipHeld === true || inferredHeld;
|
|
1703
|
-
const shipAuthorized = shipHeld ? false : shipAuthorizedBeforeHold === true;
|
|
1704
|
-
const proofComplete = Boolean(
|
|
1705
|
-
status === "ready_to_ship" || status === "shipped" || status === "completed" || status === "passed" || ok === true || handoff.proof_complete === true
|
|
1706
|
-
);
|
|
1707
|
-
const checkpointSummary = checkpointSummaryFrom(
|
|
1708
|
-
record.checkpoint_summary,
|
|
1709
|
-
stopCondition.checkpoint_summary,
|
|
1710
|
-
asRecord(record.details).checkpoint_summary,
|
|
1711
|
-
asRecord(raw.details).checkpoint_summary
|
|
1712
|
-
);
|
|
1713
|
-
const blockedOrWaiting = status === "blocked" || status === "failed" || status === "awaiting_checkpoint" || handoffState === "proof_blocked" || handoffState === "proof_review_required" || handoffState === "proof_failed" || handoffState === "proof_checkpoint_required";
|
|
1714
|
-
const proofPassed = Boolean(proofComplete && !blockedOrWaiting);
|
|
1715
|
-
const explicitMergeReady = firstBooleanValue(record.merge_ready, stopCondition.merge_ready, raw.merge_ready, handoff.merge_ready);
|
|
1716
|
-
const normalPrAllowed = firstBooleanValue(record.normal_pr_allowed, raw.normal_pr_allowed, handoff.normal_pr_allowed);
|
|
1717
|
-
const baseHandoffAllowed = !blockedOrWaiting && !shipHeld && !shippingDisabled;
|
|
1718
|
-
const mergeReady = baseHandoffAllowed && normalPrAllowed !== false && (explicitMergeReady ?? shipAuthorized);
|
|
1719
|
-
const syncAllowed = mergeReady;
|
|
1720
|
-
let policyState = "unknown";
|
|
1721
|
-
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") policyState = "awaiting_checkpoint";
|
|
1722
|
-
else if (status === "failed" || handoffState === "proof_failed") policyState = "proof_failed";
|
|
1723
|
-
else if (status === "blocked" || handoffState === "proof_blocked" || handoffState === "proof_review_required") policyState = "proof_blocked";
|
|
1724
|
-
else if (handoffState === "proof_complete_ship_disabled") policyState = "proof_complete_ship_disabled";
|
|
1725
|
-
else if (proofComplete && shipHeld && !shipAuthorized) policyState = "proof_passed_ship_held";
|
|
1726
|
-
else if (proofComplete && shippingDisabled && !shipAuthorized) policyState = "proof_complete_ship_disabled";
|
|
1727
|
-
else if (shipAuthorized) policyState = "ship_authorized";
|
|
1728
|
-
else if (proofPassed) policyState = "proof_passed";
|
|
1729
|
-
else if (status === "running") policyState = "proof_in_progress";
|
|
1730
|
-
const requiredDisclosures = [];
|
|
1731
|
-
if (shipHeld) requiredDisclosures.push("ship_held");
|
|
1732
|
-
if (shippingDisabled) requiredDisclosures.push("shipping_disabled");
|
|
1733
|
-
if (checkpointSummary?.audit_disclosure_required) requiredDisclosures.push("checkpoint_audit_counters");
|
|
1734
|
-
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") requiredDisclosures.push("checkpoint_required");
|
|
1735
|
-
const prohibitedClaims = [];
|
|
1736
|
-
if (!shipAuthorized || shipHeld || shippingDisabled) prohibitedClaims.push("ship_authorized", "shipped");
|
|
1737
|
-
if (!mergeReady) prohibitedClaims.push("merge_ready");
|
|
1738
|
-
if (!syncAllowed) prohibitedClaims.push("sync_allowed");
|
|
1739
|
-
if (blockedOrWaiting) {
|
|
1740
|
-
prohibitedClaims.push("proof_passed", "ready_to_ship");
|
|
1741
|
-
}
|
|
1742
|
-
if (checkpointSummary?.audit_disclosure_required) {
|
|
1743
|
-
prohibitedClaims.push("all_checkpoint_responses_accepted");
|
|
1744
|
-
}
|
|
1745
|
-
const resultLabel = policyState === "awaiting_checkpoint" ? "checkpoint required" : policyState === "proof_blocked" ? "blocked" : policyState === "proof_failed" ? "failed" : policyState === "proof_complete_ship_disabled" ? "proof complete; shipping disabled" : policyState === "proof_passed_ship_held" ? "proof passed; ship held" : policyState === "ship_authorized" ? status === "shipped" ? "shipped" : "ship authorized" : policyState === "proof_passed" ? "passed" : policyState === "proof_in_progress" ? "running" : status || "recorded";
|
|
1746
|
-
return {
|
|
1747
|
-
status,
|
|
1748
|
-
ok,
|
|
1749
|
-
policy_state: policyState,
|
|
1750
|
-
result_label: resultLabel,
|
|
1751
|
-
proof_complete: proofComplete,
|
|
1752
|
-
proof_passed: proofPassed,
|
|
1753
|
-
ship_held: shipHeld,
|
|
1754
|
-
shipping_disabled: shippingDisabled,
|
|
1755
|
-
ship_authorized: shipAuthorized,
|
|
1756
|
-
merge_ready: mergeReady,
|
|
1757
|
-
sync_allowed: syncAllowed,
|
|
1758
|
-
checkpoint_summary: checkpointSummary,
|
|
1759
|
-
required_disclosures: uniqueStrings(requiredDisclosures),
|
|
1760
|
-
prohibited_claims: uniqueStrings(prohibitedClaims)
|
|
1761
|
-
};
|
|
1762
|
-
}
|
|
1763
1826
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1764
1827
|
0 && (module.exports = {
|
|
1765
1828
|
RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
@@ -1796,7 +1859,12 @@ function summarizeRiddleProofPublicState(input) {
|
|
|
1796
1859
|
normalizeRunParams,
|
|
1797
1860
|
normalizeTerminalMetadata,
|
|
1798
1861
|
proofContractFromAuthorCheckpointResponse,
|
|
1862
|
+
publicMergeRecommendationForRunState,
|
|
1863
|
+
publicStateForRunState,
|
|
1799
1864
|
recordValue,
|
|
1865
|
+
riddleProofPublicStateAllowsClaim,
|
|
1866
|
+
riddleProofPublicStateAllowsMergeRecommendation,
|
|
1867
|
+
riddleProofPublicStateMergeRecommendation,
|
|
1800
1868
|
setRunStatus,
|
|
1801
1869
|
shipControlStateFor,
|
|
1802
1870
|
statePathsForRunState,
|
package/dist/spec/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofCheckpointArtifact, RiddleProofCheckpointPacket, RiddleProofCheckpointResponse, RiddleProofCheckpointRole, RiddleProofCheckpointRoutingHint, RiddleProofCheckpointSummary, RiddleProofCheckpointVisibility, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofPrLifecycleState, RiddleProofPrLifecycleStatus, RiddleProofProofContract, RiddleProofRunCard, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatePaths, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, RiddleProofViewportCapture, RiddleProofViewportMatrixStatus, RiddleProofVisualSession, RiddleProofVisualSessionFingerprintBasis, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter } from '../types.cjs';
|
|
2
|
-
export { RiddleProofShipControlState, TerminalMetadataInput, applyShipControlState, applyTerminalMetadata, compactRecord, createRunResult, isProtectedFinalStatus, isSuccessfulStatus, isTerminalStatus, nonEmptyString, normalizeTerminalMetadata, recordValue, shipControlStateFor } from '../result.cjs';
|
|
2
|
+
export { RiddleProofShipControlState, TerminalMetadataInput, applyShipControlState, applyTerminalMetadata, compactRecord, createRunResult, isProtectedFinalStatus, isSuccessfulStatus, isTerminalStatus, nonEmptyString, normalizeTerminalMetadata, publicMergeRecommendationForRunState, publicStateForRunState, recordValue, shipControlStateFor } from '../result.cjs';
|
|
3
3
|
export { CreateRunStateInput, RIDDLE_PROOF_RUN_STATE_VERSION, RunEventInput, appendRunEvent, appendStageHeartbeat, applyPrLifecycleState, createRunState, createRunStatusSnapshot, normalizeIntegrationContext, normalizePrLifecycleState, normalizeRunParams, setRunStatus } from '../state.cjs';
|
|
4
4
|
export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION, authorPacketPayloadFromCheckpointResponse, buildAuthorCheckpointPacket, buildCheckpointPacketForEngineResult, buildProofAssessmentCheckpointPacket, buildStageCheckpointPacket, checkpointPacketIdentity, checkpointResponseIdentity, checkpointSummaryFromState, createCheckpointResponseTemplate, isDuplicateCheckpointResponse, normalizeCheckpointResponse, proofContractFromAuthorCheckpointResponse, statePathsForRunState } from '../checkpoint.cjs';
|
|
5
5
|
export { RIDDLE_PROOF_RUN_CARD_VERSION, createRiddleProofRunCard } from '../run-card.cjs';
|
|
6
|
-
export { RiddleProofPublicCheckpointSummary, RiddleProofPublicPolicyState, RiddleProofPublicStateSummary, summarizeRiddleProofPublicState } from '../public-state.cjs';
|
|
6
|
+
export { RiddleProofPublicCheckpointSummary, RiddleProofPublicPolicyState, RiddleProofPublicStateSummary, riddleProofPublicStateAllowsClaim, riddleProofPublicStateAllowsMergeRecommendation, riddleProofPublicStateMergeRecommendation, summarizeRiddleProofPublicState } from '../public-state.cjs';
|
package/dist/spec/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofCheckpointArtifact, RiddleProofCheckpointPacket, RiddleProofCheckpointResponse, RiddleProofCheckpointRole, RiddleProofCheckpointRoutingHint, RiddleProofCheckpointSummary, RiddleProofCheckpointVisibility, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofPrLifecycleState, RiddleProofPrLifecycleStatus, RiddleProofProofContract, RiddleProofRunCard, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatePaths, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, RiddleProofViewportCapture, RiddleProofViewportMatrixStatus, RiddleProofVisualSession, RiddleProofVisualSessionFingerprintBasis, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter } from '../types.js';
|
|
2
|
-
export { RiddleProofShipControlState, TerminalMetadataInput, applyShipControlState, applyTerminalMetadata, compactRecord, createRunResult, isProtectedFinalStatus, isSuccessfulStatus, isTerminalStatus, nonEmptyString, normalizeTerminalMetadata, recordValue, shipControlStateFor } from '../result.js';
|
|
2
|
+
export { RiddleProofShipControlState, TerminalMetadataInput, applyShipControlState, applyTerminalMetadata, compactRecord, createRunResult, isProtectedFinalStatus, isSuccessfulStatus, isTerminalStatus, nonEmptyString, normalizeTerminalMetadata, publicMergeRecommendationForRunState, publicStateForRunState, recordValue, shipControlStateFor } from '../result.js';
|
|
3
3
|
export { CreateRunStateInput, RIDDLE_PROOF_RUN_STATE_VERSION, RunEventInput, appendRunEvent, appendStageHeartbeat, applyPrLifecycleState, createRunState, createRunStatusSnapshot, normalizeIntegrationContext, normalizePrLifecycleState, normalizeRunParams, setRunStatus } from '../state.js';
|
|
4
4
|
export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION, authorPacketPayloadFromCheckpointResponse, buildAuthorCheckpointPacket, buildCheckpointPacketForEngineResult, buildProofAssessmentCheckpointPacket, buildStageCheckpointPacket, checkpointPacketIdentity, checkpointResponseIdentity, checkpointSummaryFromState, createCheckpointResponseTemplate, isDuplicateCheckpointResponse, normalizeCheckpointResponse, proofContractFromAuthorCheckpointResponse, statePathsForRunState } from '../checkpoint.js';
|
|
5
5
|
export { RIDDLE_PROOF_RUN_CARD_VERSION, createRiddleProofRunCard } from '../run-card.js';
|
|
6
|
-
export { RiddleProofPublicCheckpointSummary, RiddleProofPublicPolicyState, RiddleProofPublicStateSummary, summarizeRiddleProofPublicState } from '../public-state.js';
|
|
6
|
+
export { RiddleProofPublicCheckpointSummary, RiddleProofPublicPolicyState, RiddleProofPublicStateSummary, riddleProofPublicStateAllowsClaim, riddleProofPublicStateAllowsMergeRecommendation, riddleProofPublicStateMergeRecommendation, summarizeRiddleProofPublicState } from '../public-state.js';
|
package/dist/spec/index.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import "../chunk-6F4PWJZI.js";
|
|
2
|
-
import {
|
|
3
|
-
summarizeRiddleProofPublicState
|
|
4
|
-
} from "../chunk-KG64Y5MC.js";
|
|
5
2
|
import {
|
|
6
3
|
RIDDLE_PROOF_RUN_STATE_VERSION,
|
|
7
4
|
appendRunEvent,
|
|
@@ -13,11 +10,11 @@ import {
|
|
|
13
10
|
normalizePrLifecycleState,
|
|
14
11
|
normalizeRunParams,
|
|
15
12
|
setRunStatus
|
|
16
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-UEY5SJG5.js";
|
|
17
14
|
import {
|
|
18
15
|
RIDDLE_PROOF_RUN_CARD_VERSION,
|
|
19
16
|
createRiddleProofRunCard
|
|
20
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-NXEAFQYZ.js";
|
|
21
18
|
import {
|
|
22
19
|
RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
23
20
|
RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
|
|
@@ -34,7 +31,7 @@ import {
|
|
|
34
31
|
normalizeCheckpointResponse,
|
|
35
32
|
proofContractFromAuthorCheckpointResponse,
|
|
36
33
|
statePathsForRunState
|
|
37
|
-
} from "../chunk-
|
|
34
|
+
} from "../chunk-FX2CB4MG.js";
|
|
38
35
|
import {
|
|
39
36
|
applyShipControlState,
|
|
40
37
|
applyTerminalMetadata,
|
|
@@ -45,9 +42,17 @@ import {
|
|
|
45
42
|
isTerminalStatus,
|
|
46
43
|
nonEmptyString,
|
|
47
44
|
normalizeTerminalMetadata,
|
|
45
|
+
publicMergeRecommendationForRunState,
|
|
46
|
+
publicStateForRunState,
|
|
48
47
|
recordValue,
|
|
49
48
|
shipControlStateFor
|
|
50
|
-
} from "../chunk-
|
|
49
|
+
} from "../chunk-QGMSN34W.js";
|
|
50
|
+
import {
|
|
51
|
+
riddleProofPublicStateAllowsClaim,
|
|
52
|
+
riddleProofPublicStateAllowsMergeRecommendation,
|
|
53
|
+
riddleProofPublicStateMergeRecommendation,
|
|
54
|
+
summarizeRiddleProofPublicState
|
|
55
|
+
} from "../chunk-WKIIJX3O.js";
|
|
51
56
|
import "../chunk-MLKGABMK.js";
|
|
52
57
|
export {
|
|
53
58
|
RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
@@ -84,7 +89,12 @@ export {
|
|
|
84
89
|
normalizeRunParams,
|
|
85
90
|
normalizeTerminalMetadata,
|
|
86
91
|
proofContractFromAuthorCheckpointResponse,
|
|
92
|
+
publicMergeRecommendationForRunState,
|
|
93
|
+
publicStateForRunState,
|
|
87
94
|
recordValue,
|
|
95
|
+
riddleProofPublicStateAllowsClaim,
|
|
96
|
+
riddleProofPublicStateAllowsMergeRecommendation,
|
|
97
|
+
riddleProofPublicStateMergeRecommendation,
|
|
88
98
|
setRunStatus,
|
|
89
99
|
shipControlStateFor,
|
|
90
100
|
statePathsForRunState,
|
|
@@ -20,11 +20,23 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/spec/public-state.ts
|
|
21
21
|
var public_state_exports = {};
|
|
22
22
|
__export(public_state_exports, {
|
|
23
|
+
riddleProofPublicStateAllowsClaim: () => riddleProofPublicStateAllowsClaim,
|
|
24
|
+
riddleProofPublicStateAllowsMergeRecommendation: () => riddleProofPublicStateAllowsMergeRecommendation,
|
|
25
|
+
riddleProofPublicStateMergeRecommendation: () => riddleProofPublicStateMergeRecommendation,
|
|
23
26
|
summarizeRiddleProofPublicState: () => summarizeRiddleProofPublicState
|
|
24
27
|
});
|
|
25
28
|
module.exports = __toCommonJS(public_state_exports);
|
|
26
29
|
|
|
27
30
|
// src/public-state.ts
|
|
31
|
+
function riddleProofPublicStateAllowsClaim(summary, claim) {
|
|
32
|
+
return !summary?.prohibited_claims.includes(claim);
|
|
33
|
+
}
|
|
34
|
+
function riddleProofPublicStateAllowsMergeRecommendation(summary) {
|
|
35
|
+
return riddleProofPublicStateAllowsClaim(summary, "merge_ready") && riddleProofPublicStateAllowsClaim(summary, "sync_allowed");
|
|
36
|
+
}
|
|
37
|
+
function riddleProofPublicStateMergeRecommendation(summary, recommendation) {
|
|
38
|
+
return recommendation && riddleProofPublicStateAllowsMergeRecommendation(summary) ? recommendation : void 0;
|
|
39
|
+
}
|
|
28
40
|
function asRecord(value) {
|
|
29
41
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
30
42
|
}
|
|
@@ -177,5 +189,8 @@ function summarizeRiddleProofPublicState(input) {
|
|
|
177
189
|
}
|
|
178
190
|
// Annotate the CommonJS export names for ESM import in node:
|
|
179
191
|
0 && (module.exports = {
|
|
192
|
+
riddleProofPublicStateAllowsClaim,
|
|
193
|
+
riddleProofPublicStateAllowsMergeRecommendation,
|
|
194
|
+
riddleProofPublicStateMergeRecommendation,
|
|
180
195
|
summarizeRiddleProofPublicState
|
|
181
196
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { RiddleProofPublicCheckpointSummary, RiddleProofPublicPolicyState, RiddleProofPublicStateSummary, summarizeRiddleProofPublicState } from '../public-state.cjs';
|
|
1
|
+
export { RiddleProofPublicCheckpointSummary, RiddleProofPublicPolicyState, RiddleProofPublicStateSummary, riddleProofPublicStateAllowsClaim, riddleProofPublicStateAllowsMergeRecommendation, riddleProofPublicStateMergeRecommendation, summarizeRiddleProofPublicState } from '../public-state.cjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { RiddleProofPublicCheckpointSummary, RiddleProofPublicPolicyState, RiddleProofPublicStateSummary, summarizeRiddleProofPublicState } from '../public-state.js';
|
|
1
|
+
export { RiddleProofPublicCheckpointSummary, RiddleProofPublicPolicyState, RiddleProofPublicStateSummary, riddleProofPublicStateAllowsClaim, riddleProofPublicStateAllowsMergeRecommendation, riddleProofPublicStateMergeRecommendation, summarizeRiddleProofPublicState } from '../public-state.js';
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
riddleProofPublicStateAllowsClaim,
|
|
3
|
+
riddleProofPublicStateAllowsMergeRecommendation,
|
|
4
|
+
riddleProofPublicStateMergeRecommendation,
|
|
2
5
|
summarizeRiddleProofPublicState
|
|
3
|
-
} from "../chunk-
|
|
6
|
+
} from "../chunk-WKIIJX3O.js";
|
|
4
7
|
import "../chunk-MLKGABMK.js";
|
|
5
8
|
export {
|
|
9
|
+
riddleProofPublicStateAllowsClaim,
|
|
10
|
+
riddleProofPublicStateAllowsMergeRecommendation,
|
|
11
|
+
riddleProofPublicStateMergeRecommendation,
|
|
6
12
|
summarizeRiddleProofPublicState
|
|
7
13
|
};
|