@riddledc/riddle-proof 0.8.56 → 0.8.58
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/{chunk-6KYXX4OE.js → chunk-62XLYPMS.js} +93 -2
- package/dist/chunk-KG64Y5MC.js +155 -0
- package/dist/{chunk-54DIEDR3.js → chunk-ONOPGCID.js} +1 -1
- package/dist/cli/index.js +3 -2
- package/dist/cli.cjs +266 -27
- package/dist/cli.js +3 -2
- package/dist/index.cjs +554 -313
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -1
- package/dist/pr-comment.cjs +268 -27
- package/dist/pr-comment.d.cts +21 -1
- package/dist/pr-comment.d.ts +21 -1
- package/dist/pr-comment.js +2 -1
- package/dist/public-state.cjs +179 -0
- package/dist/public-state.d.cts +29 -0
- package/dist/public-state.d.ts +29 -0
- package/dist/public-state.js +7 -0
- package/dist/spec/index.cjs +156 -2
- package/dist/spec/index.d.cts +1 -0
- package/dist/spec/index.d.ts +1 -0
- package/dist/spec/index.js +5 -1
- package/dist/spec/public-state.cjs +181 -0
- package/dist/spec/public-state.d.cts +1 -0
- package/dist/spec/public-state.d.ts +1 -0
- package/dist/spec/public-state.js +7 -0
- package/package.json +12 -2
package/dist/cli.cjs
CHANGED
|
@@ -17721,23 +17721,182 @@ function extractRiddleProofProfileResult(input) {
|
|
|
17721
17721
|
return void 0;
|
|
17722
17722
|
}
|
|
17723
17723
|
|
|
17724
|
+
// src/public-state.ts
|
|
17725
|
+
function asRecord(value) {
|
|
17726
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
17727
|
+
}
|
|
17728
|
+
function stringValue3(value) {
|
|
17729
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
17730
|
+
}
|
|
17731
|
+
function booleanValue2(value) {
|
|
17732
|
+
return typeof value === "boolean" ? value : void 0;
|
|
17733
|
+
}
|
|
17734
|
+
function numberValue2(value) {
|
|
17735
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
17736
|
+
}
|
|
17737
|
+
function firstStringValue(...values) {
|
|
17738
|
+
for (const value of values) {
|
|
17739
|
+
const text = stringValue3(value);
|
|
17740
|
+
if (text) return text;
|
|
17741
|
+
}
|
|
17742
|
+
return void 0;
|
|
17743
|
+
}
|
|
17744
|
+
function firstBooleanValue(...values) {
|
|
17745
|
+
for (const value of values) {
|
|
17746
|
+
const bool = booleanValue2(value);
|
|
17747
|
+
if (typeof bool === "boolean") return bool;
|
|
17748
|
+
}
|
|
17749
|
+
return void 0;
|
|
17750
|
+
}
|
|
17751
|
+
function firstRecordValue(...values) {
|
|
17752
|
+
for (const value of values) {
|
|
17753
|
+
const record = asRecord(value);
|
|
17754
|
+
if (Object.keys(record).length) return record;
|
|
17755
|
+
}
|
|
17756
|
+
return void 0;
|
|
17757
|
+
}
|
|
17758
|
+
function countValue(value) {
|
|
17759
|
+
const number = numberValue2(value);
|
|
17760
|
+
return typeof number === "number" && number > 0 ? Math.trunc(number) : 0;
|
|
17761
|
+
}
|
|
17762
|
+
function checkpointSummaryFrom(...values) {
|
|
17763
|
+
const record = firstRecordValue(...values);
|
|
17764
|
+
if (!record) return void 0;
|
|
17765
|
+
const accepted = countValue(record.response_count);
|
|
17766
|
+
const rejected = countValue(record.rejected_response_count);
|
|
17767
|
+
const ignored = countValue(record.ignored_response_count);
|
|
17768
|
+
const duplicate = countValue(record.duplicate_response_count);
|
|
17769
|
+
const summary = {
|
|
17770
|
+
pending: booleanValue2(record.pending),
|
|
17771
|
+
accepted_response_count: accepted,
|
|
17772
|
+
rejected_response_count: rejected,
|
|
17773
|
+
ignored_response_count: ignored,
|
|
17774
|
+
duplicate_response_count: duplicate,
|
|
17775
|
+
latest_decision: stringValue3(record.latest_decision),
|
|
17776
|
+
audit_disclosure_required: rejected > 0 || ignored > 0 || duplicate > 0
|
|
17777
|
+
};
|
|
17778
|
+
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
17779
|
+
}
|
|
17780
|
+
function uniqueStrings(values) {
|
|
17781
|
+
return [...new Set(values.filter(Boolean))];
|
|
17782
|
+
}
|
|
17783
|
+
function summarizeRiddleProofPublicState(input) {
|
|
17784
|
+
const record = asRecord(input);
|
|
17785
|
+
const runCard = asRecord(record.run_card);
|
|
17786
|
+
const stopCondition = asRecord(runCard.stop_condition);
|
|
17787
|
+
const raw = asRecord(record.raw);
|
|
17788
|
+
const request = asRecord(record.request);
|
|
17789
|
+
const requestMetadata = asRecord(record.request_metadata);
|
|
17790
|
+
const prState = asRecord(record.pr_state);
|
|
17791
|
+
const handoff = asRecord(record.pr_handoff_policy);
|
|
17792
|
+
const handoffState = stringValue3(handoff.state);
|
|
17793
|
+
const status = firstStringValue(record.status, stopCondition.status);
|
|
17794
|
+
const ok = booleanValue2(record.ok) ?? null;
|
|
17795
|
+
const shipMode = firstStringValue(request.ship_mode, requestMetadata.ship_mode, record.ship_mode, handoff.ship_mode);
|
|
17796
|
+
const explicitShippingDisabled = firstBooleanValue(
|
|
17797
|
+
record.shipping_disabled,
|
|
17798
|
+
stopCondition.shipping_disabled,
|
|
17799
|
+
raw.shipping_disabled,
|
|
17800
|
+
handoff.shipping_disabled
|
|
17801
|
+
);
|
|
17802
|
+
const shippingDisabled = explicitShippingDisabled === true || shipMode === "none" || handoffState === "proof_complete_ship_disabled";
|
|
17803
|
+
const explicitShipAuthorized = firstBooleanValue(
|
|
17804
|
+
record.ship_authorized,
|
|
17805
|
+
stopCondition.ship_authorized,
|
|
17806
|
+
raw.ship_authorized
|
|
17807
|
+
);
|
|
17808
|
+
const authorizationEvidence = Boolean(
|
|
17809
|
+
status === "shipped" || record.marked_ready === true || stringValue3(prState.status) === "merged" || record.merge_commit || record.merged_at
|
|
17810
|
+
);
|
|
17811
|
+
const shipAuthorizedBeforeHold = explicitShipAuthorized ?? authorizationEvidence;
|
|
17812
|
+
const explicitShipHeld = firstBooleanValue(record.ship_held, stopCondition.ship_held, raw.ship_held);
|
|
17813
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !shipAuthorizedBeforeHold;
|
|
17814
|
+
const shipHeld = explicitShipHeld === true || inferredHeld;
|
|
17815
|
+
const shipAuthorized = shipHeld ? false : shipAuthorizedBeforeHold === true;
|
|
17816
|
+
const proofComplete = Boolean(
|
|
17817
|
+
status === "ready_to_ship" || status === "shipped" || status === "completed" || status === "passed" || ok === true || handoff.proof_complete === true
|
|
17818
|
+
);
|
|
17819
|
+
const checkpointSummary = checkpointSummaryFrom(
|
|
17820
|
+
record.checkpoint_summary,
|
|
17821
|
+
stopCondition.checkpoint_summary,
|
|
17822
|
+
asRecord(record.details).checkpoint_summary,
|
|
17823
|
+
asRecord(raw.details).checkpoint_summary
|
|
17824
|
+
);
|
|
17825
|
+
const blockedOrWaiting = status === "blocked" || status === "failed" || status === "awaiting_checkpoint" || handoffState === "proof_blocked" || handoffState === "proof_review_required" || handoffState === "proof_failed" || handoffState === "proof_checkpoint_required";
|
|
17826
|
+
const proofPassed = Boolean(proofComplete && !blockedOrWaiting);
|
|
17827
|
+
const explicitMergeReady = firstBooleanValue(record.merge_ready, stopCondition.merge_ready, raw.merge_ready, handoff.merge_ready);
|
|
17828
|
+
const normalPrAllowed = firstBooleanValue(record.normal_pr_allowed, raw.normal_pr_allowed, handoff.normal_pr_allowed);
|
|
17829
|
+
const baseHandoffAllowed = !blockedOrWaiting && !shipHeld && !shippingDisabled;
|
|
17830
|
+
const mergeReady = baseHandoffAllowed && normalPrAllowed !== false && (explicitMergeReady ?? shipAuthorized);
|
|
17831
|
+
const syncAllowed = mergeReady;
|
|
17832
|
+
let policyState = "unknown";
|
|
17833
|
+
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") policyState = "awaiting_checkpoint";
|
|
17834
|
+
else if (status === "failed" || handoffState === "proof_failed") policyState = "proof_failed";
|
|
17835
|
+
else if (status === "blocked" || handoffState === "proof_blocked" || handoffState === "proof_review_required") policyState = "proof_blocked";
|
|
17836
|
+
else if (handoffState === "proof_complete_ship_disabled") policyState = "proof_complete_ship_disabled";
|
|
17837
|
+
else if (proofComplete && shipHeld && !shipAuthorized) policyState = "proof_passed_ship_held";
|
|
17838
|
+
else if (proofComplete && shippingDisabled && !shipAuthorized) policyState = "proof_complete_ship_disabled";
|
|
17839
|
+
else if (shipAuthorized) policyState = "ship_authorized";
|
|
17840
|
+
else if (proofPassed) policyState = "proof_passed";
|
|
17841
|
+
else if (status === "running") policyState = "proof_in_progress";
|
|
17842
|
+
const requiredDisclosures = [];
|
|
17843
|
+
if (shipHeld) requiredDisclosures.push("ship_held");
|
|
17844
|
+
if (shippingDisabled) requiredDisclosures.push("shipping_disabled");
|
|
17845
|
+
if (checkpointSummary?.audit_disclosure_required) requiredDisclosures.push("checkpoint_audit_counters");
|
|
17846
|
+
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") requiredDisclosures.push("checkpoint_required");
|
|
17847
|
+
const prohibitedClaims = [];
|
|
17848
|
+
if (!shipAuthorized || shipHeld || shippingDisabled) prohibitedClaims.push("ship_authorized", "shipped");
|
|
17849
|
+
if (!mergeReady) prohibitedClaims.push("merge_ready");
|
|
17850
|
+
if (!syncAllowed) prohibitedClaims.push("sync_allowed");
|
|
17851
|
+
if (blockedOrWaiting) {
|
|
17852
|
+
prohibitedClaims.push("proof_passed", "ready_to_ship");
|
|
17853
|
+
}
|
|
17854
|
+
if (checkpointSummary?.audit_disclosure_required) {
|
|
17855
|
+
prohibitedClaims.push("all_checkpoint_responses_accepted");
|
|
17856
|
+
}
|
|
17857
|
+
const resultLabel2 = 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";
|
|
17858
|
+
return {
|
|
17859
|
+
status,
|
|
17860
|
+
ok,
|
|
17861
|
+
policy_state: policyState,
|
|
17862
|
+
result_label: resultLabel2,
|
|
17863
|
+
proof_complete: proofComplete,
|
|
17864
|
+
proof_passed: proofPassed,
|
|
17865
|
+
ship_held: shipHeld,
|
|
17866
|
+
shipping_disabled: shippingDisabled,
|
|
17867
|
+
ship_authorized: shipAuthorized,
|
|
17868
|
+
merge_ready: mergeReady,
|
|
17869
|
+
sync_allowed: syncAllowed,
|
|
17870
|
+
checkpoint_summary: checkpointSummary,
|
|
17871
|
+
required_disclosures: uniqueStrings(requiredDisclosures),
|
|
17872
|
+
prohibited_claims: uniqueStrings(prohibitedClaims)
|
|
17873
|
+
};
|
|
17874
|
+
}
|
|
17875
|
+
|
|
17724
17876
|
// src/pr-comment.ts
|
|
17725
17877
|
var RIDDLE_PROOF_PR_COMMENT_MARKER = "<!-- riddle-proof:pr-comment:v1 -->";
|
|
17726
|
-
function
|
|
17878
|
+
function asRecord2(value) {
|
|
17727
17879
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
17728
17880
|
}
|
|
17729
17881
|
function asArray(value) {
|
|
17730
17882
|
return Array.isArray(value) ? value : [];
|
|
17731
17883
|
}
|
|
17732
|
-
function
|
|
17884
|
+
function stringValue4(value) {
|
|
17733
17885
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
17734
17886
|
}
|
|
17735
|
-
function
|
|
17887
|
+
function numberValue3(value) {
|
|
17736
17888
|
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
17737
17889
|
}
|
|
17738
|
-
function
|
|
17890
|
+
function booleanValue3(value) {
|
|
17739
17891
|
return typeof value === "boolean" ? value : void 0;
|
|
17740
17892
|
}
|
|
17893
|
+
function firstStringValue2(...values) {
|
|
17894
|
+
for (const value of values) {
|
|
17895
|
+
const text = stringValue4(value);
|
|
17896
|
+
if (text) return text;
|
|
17897
|
+
}
|
|
17898
|
+
return void 0;
|
|
17899
|
+
}
|
|
17741
17900
|
function artifactKind(name, url) {
|
|
17742
17901
|
const target = `${name} ${url}`.toLowerCase();
|
|
17743
17902
|
if (/\.(png|jpe?g|gif|webp|avif|svg)(\?|#|$)/.test(target)) return "image";
|
|
@@ -17745,18 +17904,18 @@ function artifactKind(name, url) {
|
|
|
17745
17904
|
return "artifact";
|
|
17746
17905
|
}
|
|
17747
17906
|
function artifactDisplayName(value, fallback) {
|
|
17748
|
-
const raw =
|
|
17907
|
+
const raw = stringValue4(value);
|
|
17749
17908
|
if (raw) return raw;
|
|
17750
17909
|
return fallback;
|
|
17751
17910
|
}
|
|
17752
17911
|
function collectArtifacts(runResponse) {
|
|
17753
|
-
const proofResult =
|
|
17912
|
+
const proofResult = asRecord2(runResponse.proofResult);
|
|
17754
17913
|
const outputs = asArray(proofResult.outputs);
|
|
17755
17914
|
const artifacts = [];
|
|
17756
17915
|
const seen = /* @__PURE__ */ new Set();
|
|
17757
17916
|
for (const [index, item] of outputs.entries()) {
|
|
17758
|
-
const artifact =
|
|
17759
|
-
const url =
|
|
17917
|
+
const artifact = asRecord2(item);
|
|
17918
|
+
const url = stringValue4(artifact.url);
|
|
17760
17919
|
if (!url || seen.has(url)) continue;
|
|
17761
17920
|
seen.add(url);
|
|
17762
17921
|
const name = artifactDisplayName(artifact.name, `artifact-${index + 1}`);
|
|
@@ -17764,7 +17923,7 @@ function collectArtifacts(runResponse) {
|
|
|
17764
17923
|
name,
|
|
17765
17924
|
url,
|
|
17766
17925
|
kind: artifactKind(name, url),
|
|
17767
|
-
size_bytes:
|
|
17926
|
+
size_bytes: numberValue3(artifact.size)
|
|
17768
17927
|
});
|
|
17769
17928
|
}
|
|
17770
17929
|
return artifacts;
|
|
@@ -17772,9 +17931,9 @@ function collectArtifacts(runResponse) {
|
|
|
17772
17931
|
function pageSummaries(result) {
|
|
17773
17932
|
const pages = [];
|
|
17774
17933
|
for (const page of asArray(result.pages)) {
|
|
17775
|
-
const record =
|
|
17776
|
-
const route =
|
|
17777
|
-
const checks =
|
|
17934
|
+
const record = asRecord2(page);
|
|
17935
|
+
const route = stringValue4(record.route) || stringValue4(record.url) || "page";
|
|
17936
|
+
const checks = asRecord2(record.checks);
|
|
17778
17937
|
let passed = 0;
|
|
17779
17938
|
let failed = 0;
|
|
17780
17939
|
for (const value of Object.values(checks)) {
|
|
@@ -17814,27 +17973,74 @@ function selectPrimaryImage(artifacts) {
|
|
|
17814
17973
|
const images = artifacts.filter((artifact) => artifact.kind === "image");
|
|
17815
17974
|
return images.find((artifact) => /after|proof|screenshot/i.test(artifact.name)) || images[0];
|
|
17816
17975
|
}
|
|
17976
|
+
function firstRecordValue2(...values) {
|
|
17977
|
+
for (const value of values) {
|
|
17978
|
+
const record = asRecord2(value);
|
|
17979
|
+
if (Object.keys(record).length) return record;
|
|
17980
|
+
}
|
|
17981
|
+
return void 0;
|
|
17982
|
+
}
|
|
17983
|
+
function checkpointSummaryFrom2(...values) {
|
|
17984
|
+
const record = firstRecordValue2(...values);
|
|
17985
|
+
if (!record) return void 0;
|
|
17986
|
+
const summary = {
|
|
17987
|
+
pending: booleanValue3(record.pending),
|
|
17988
|
+
response_count: numberValue3(record.response_count),
|
|
17989
|
+
rejected_response_count: numberValue3(record.rejected_response_count),
|
|
17990
|
+
ignored_response_count: numberValue3(record.ignored_response_count),
|
|
17991
|
+
duplicate_response_count: numberValue3(record.duplicate_response_count),
|
|
17992
|
+
latest_decision: stringValue4(record.latest_decision),
|
|
17993
|
+
latest_packet_id: stringValue4(record.latest_packet_id),
|
|
17994
|
+
latest_resume_token: stringValue4(record.latest_resume_token)
|
|
17995
|
+
};
|
|
17996
|
+
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
17997
|
+
}
|
|
17817
17998
|
function summarizeRiddleProofPrComment(input) {
|
|
17818
|
-
const runResponse =
|
|
17819
|
-
const result =
|
|
17820
|
-
const proofResult =
|
|
17821
|
-
const preview =
|
|
17999
|
+
const runResponse = asRecord2(input.runResponse);
|
|
18000
|
+
const result = asRecord2(input.result);
|
|
18001
|
+
const proofResult = asRecord2(runResponse.proofResult);
|
|
18002
|
+
const preview = asRecord2(runResponse.preview);
|
|
18003
|
+
const resultRunCard = asRecord2(result.run_card);
|
|
18004
|
+
const stopCondition = asRecord2(resultRunCard.stop_condition);
|
|
18005
|
+
const resultDetails = asRecord2(result.details);
|
|
18006
|
+
const resultRaw = asRecord2(result.raw);
|
|
18007
|
+
const rawDetails = asRecord2(resultRaw.details);
|
|
17822
18008
|
const artifacts = collectArtifacts(runResponse);
|
|
17823
18009
|
const pages = pageSummaries(result);
|
|
17824
18010
|
const checkSource = { ...result };
|
|
17825
18011
|
delete checkSource.ok;
|
|
17826
18012
|
const nestedChecks = summarizeExplicitChecks(checkSource);
|
|
17827
|
-
const ok =
|
|
18013
|
+
const ok = booleanValue3(result.ok) ?? booleanValue3(runResponse.ok) ?? null;
|
|
18014
|
+
const checkpointSummary = checkpointSummaryFrom2(
|
|
18015
|
+
result.checkpoint_summary,
|
|
18016
|
+
stopCondition.checkpoint_summary,
|
|
18017
|
+
resultDetails.checkpoint_summary,
|
|
18018
|
+
rawDetails.checkpoint_summary,
|
|
18019
|
+
proofResult.checkpoint_summary
|
|
18020
|
+
);
|
|
18021
|
+
const publicState = summarizeRiddleProofPublicState({
|
|
18022
|
+
...result,
|
|
18023
|
+
status: firstStringValue2(result.status, stopCondition.status),
|
|
18024
|
+
checkpoint_summary: checkpointSummary || result.checkpoint_summary
|
|
18025
|
+
});
|
|
17828
18026
|
return {
|
|
17829
18027
|
ok,
|
|
17830
|
-
status:
|
|
17831
|
-
|
|
17832
|
-
|
|
17833
|
-
|
|
17834
|
-
|
|
17835
|
-
|
|
17836
|
-
|
|
17837
|
-
|
|
18028
|
+
status: stringValue4(proofResult.status),
|
|
18029
|
+
result_status: publicState.status,
|
|
18030
|
+
job_id: stringValue4(proofResult.job_id),
|
|
18031
|
+
duration_ms: numberValue3(proofResult.duration_ms),
|
|
18032
|
+
proof_url: stringValue4(runResponse.proofUrl),
|
|
18033
|
+
preview_id: stringValue4(preview.id),
|
|
18034
|
+
preview_url: stringValue4(preview.preview_url) || stringValue4(preview.url),
|
|
18035
|
+
preview_publish_recovered: booleanValue3(preview.publish_recovered),
|
|
18036
|
+
preview_publish_error: stringValue4(preview.publish_error),
|
|
18037
|
+
ship_held: publicState.ship_held,
|
|
18038
|
+
shipping_disabled: publicState.shipping_disabled,
|
|
18039
|
+
ship_authorized: publicState.ship_authorized,
|
|
18040
|
+
proof_decision: firstStringValue2(result.proof_decision, stopCondition.proof_decision, resultRaw.proof_decision),
|
|
18041
|
+
merge_recommendation: firstStringValue2(result.merge_recommendation, stopCondition.merge_recommendation, resultRaw.merge_recommendation),
|
|
18042
|
+
checkpoint_summary: checkpointSummary,
|
|
18043
|
+
public_state: publicState,
|
|
17838
18044
|
passed_checks: nestedChecks.passed,
|
|
17839
18045
|
failed_checks: nestedChecks.failed,
|
|
17840
18046
|
pages,
|
|
@@ -17853,9 +18059,16 @@ function markdownLink(label, url) {
|
|
|
17853
18059
|
return `[${label.replace(/\]/g, "\\]")}](${url})`;
|
|
17854
18060
|
}
|
|
17855
18061
|
function resultLabel(summary) {
|
|
17856
|
-
if (summary.
|
|
18062
|
+
if (summary.public_state?.result_label) return summary.public_state.result_label;
|
|
18063
|
+
if (summary.ok === true) {
|
|
18064
|
+
if (summary.result_status === "shipped") return "shipped";
|
|
18065
|
+
if (summary.result_status === "completed") return "completed";
|
|
18066
|
+
if (summary.ship_held === true) return "proof passed; ship held";
|
|
18067
|
+
if (summary.ship_authorized === true) return "passed; ship authorized";
|
|
18068
|
+
return "passed";
|
|
18069
|
+
}
|
|
17857
18070
|
if (summary.ok === false) return "failed";
|
|
17858
|
-
return summary.status || "recorded";
|
|
18071
|
+
return summary.result_status || summary.status || "recorded";
|
|
17859
18072
|
}
|
|
17860
18073
|
function artifactRank(artifact) {
|
|
17861
18074
|
const name = artifact.name.toLowerCase();
|
|
@@ -17867,6 +18080,25 @@ function artifactRank(artifact) {
|
|
|
17867
18080
|
if (artifact.kind === "image") return 20;
|
|
17868
18081
|
return 30;
|
|
17869
18082
|
}
|
|
18083
|
+
function formatBool(value) {
|
|
18084
|
+
return typeof value === "boolean" ? String(value) : "unknown";
|
|
18085
|
+
}
|
|
18086
|
+
function hasShipControl(summary) {
|
|
18087
|
+
return typeof summary.ship_held === "boolean" || typeof summary.shipping_disabled === "boolean" || typeof summary.ship_authorized === "boolean";
|
|
18088
|
+
}
|
|
18089
|
+
function checkpointSummaryLine(summary) {
|
|
18090
|
+
const accepted = summary.response_count ?? 0;
|
|
18091
|
+
const rejected = summary.rejected_response_count ?? 0;
|
|
18092
|
+
const ignored = summary.ignored_response_count ?? 0;
|
|
18093
|
+
const parts = [`${accepted} accepted`, `${rejected} rejected`, `${ignored} ignored`];
|
|
18094
|
+
if ((summary.duplicate_response_count ?? 0) > 0) parts.push(`${summary.duplicate_response_count} duplicate`);
|
|
18095
|
+
const state = summary.pending === true ? "pending" : summary.pending === false ? "complete" : "";
|
|
18096
|
+
return [
|
|
18097
|
+
parts.join(" / "),
|
|
18098
|
+
state,
|
|
18099
|
+
summary.latest_decision ? `latest decision \`${summary.latest_decision}\`` : ""
|
|
18100
|
+
].filter(Boolean).join("; ");
|
|
18101
|
+
}
|
|
17870
18102
|
function buildRiddleProofPrCommentMarkdown(input) {
|
|
17871
18103
|
const summary = summarizeRiddleProofPrComment(input);
|
|
17872
18104
|
const title = input.title?.trim() || "Riddle Proof Evidence";
|
|
@@ -17878,9 +18110,16 @@ function buildRiddleProofPrCommentMarkdown(input) {
|
|
|
17878
18110
|
];
|
|
17879
18111
|
if (input.goal?.trim()) lines.push(`**Goal:** ${input.goal.trim()}`);
|
|
17880
18112
|
if (input.successCriteria?.trim()) lines.push(`**Success criteria:** ${input.successCriteria.trim()}`);
|
|
18113
|
+
if (summary.result_status) lines.push(`**Evidence status:** ${summary.result_status}`);
|
|
17881
18114
|
if (summary.status) lines.push(`**Riddle job status:** ${summary.status}`);
|
|
17882
18115
|
if (summary.job_id) lines.push(`**Riddle job:** \`${summary.job_id}\``);
|
|
17883
18116
|
if (summary.duration_ms) lines.push(`**Duration:** ${formatDuration(summary.duration_ms)}`);
|
|
18117
|
+
if (hasShipControl(summary)) {
|
|
18118
|
+
lines.push(`**Ship control:** held=${formatBool(summary.ship_held)}, shipping_disabled=${formatBool(summary.shipping_disabled)}, authorized=${formatBool(summary.ship_authorized)}`);
|
|
18119
|
+
}
|
|
18120
|
+
if (summary.proof_decision) lines.push(`**Proof decision:** \`${summary.proof_decision}\``);
|
|
18121
|
+
if (summary.merge_recommendation) lines.push(`**Merge recommendation:** ${summary.merge_recommendation}`);
|
|
18122
|
+
if (summary.checkpoint_summary) lines.push(`**Checkpoints:** ${checkpointSummaryLine(summary.checkpoint_summary)}`);
|
|
17884
18123
|
if (summary.proof_url) lines.push(`**Proof URL:** ${markdownLink(summary.proof_url, summary.proof_url)}`);
|
|
17885
18124
|
if (summary.preview_id || summary.preview_url) {
|
|
17886
18125
|
const previewLabel = summary.preview_id ? `\`${summary.preview_id}\`` : "preview";
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-ONOPGCID.js";
|
|
3
3
|
import "./chunk-DI2XNGEZ.js";
|
|
4
|
-
import "./chunk-
|
|
4
|
+
import "./chunk-62XLYPMS.js";
|
|
5
5
|
import "./chunk-EX7TO4I5.js";
|
|
6
|
+
import "./chunk-KG64Y5MC.js";
|
|
6
7
|
import "./chunk-GHBNDHG7.js";
|
|
7
8
|
import "./chunk-UZIX7M7D.js";
|
|
8
9
|
import "./chunk-KNPCWWF3.js";
|