@riddledc/riddle-proof 0.8.59 → 0.8.60
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 +253 -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 +253 -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-XSNMMAPJ.js → chunk-AWRBSVNW.js} +4 -4
- package/dist/{chunk-MOTQNIZX.js → chunk-FX2CB4MG.js} +1 -1
- package/dist/{chunk-2PKBTYOA.js → chunk-HZOILEGF.js} +3 -3
- package/dist/{chunk-KNPCWWF3.js → chunk-NXEAFQYZ.js} +16 -10
- package/dist/{chunk-GHBNDHG7.js → chunk-PCEDAQPG.js} +4 -4
- 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 +461 -404
- 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 +253 -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 +236 -169
- 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 +7 -2
- 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/local-agent.js
CHANGED
|
@@ -3,8 +3,9 @@ import {
|
|
|
3
3
|
createCodexExecAgentAdapter,
|
|
4
4
|
createCodexExecJsonRunner,
|
|
5
5
|
runCodexExecAgentDoctor
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-QPKY767W.js";
|
|
7
|
+
import "./chunk-QGMSN34W.js";
|
|
8
|
+
import "./chunk-WKIIJX3O.js";
|
|
8
9
|
import "./chunk-MLKGABMK.js";
|
|
9
10
|
export {
|
|
10
11
|
createCodexExecAgentAdapter as createLocalAgentAdapter,
|
package/dist/openclaw.d.cts
CHANGED
package/dist/openclaw.d.ts
CHANGED
package/dist/openclaw.js
CHANGED
|
@@ -3,11 +3,12 @@ import {
|
|
|
3
3
|
parseOpenClawAssertions,
|
|
4
4
|
parseOpenClawJsonObjectOrArray,
|
|
5
5
|
toRiddleProofRunParams
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-3FK5HZHK.js";
|
|
7
|
+
import "./chunk-UEY5SJG5.js";
|
|
8
|
+
import "./chunk-NXEAFQYZ.js";
|
|
9
|
+
import "./chunk-FX2CB4MG.js";
|
|
10
|
+
import "./chunk-QGMSN34W.js";
|
|
11
|
+
import "./chunk-WKIIJX3O.js";
|
|
11
12
|
import "./chunk-MLKGABMK.js";
|
|
12
13
|
export {
|
|
13
14
|
openClawIntegrationContext,
|
package/dist/pr-comment.cjs
CHANGED
|
@@ -27,6 +27,12 @@ __export(pr_comment_exports, {
|
|
|
27
27
|
module.exports = __toCommonJS(pr_comment_exports);
|
|
28
28
|
|
|
29
29
|
// src/public-state.ts
|
|
30
|
+
function riddleProofPublicStateAllowsClaim(summary, claim) {
|
|
31
|
+
return !summary?.prohibited_claims.includes(claim);
|
|
32
|
+
}
|
|
33
|
+
function riddleProofPublicStateAllowsMergeRecommendation(summary) {
|
|
34
|
+
return riddleProofPublicStateAllowsClaim(summary, "merge_ready") && riddleProofPublicStateAllowsClaim(summary, "sync_allowed");
|
|
35
|
+
}
|
|
30
36
|
function asRecord(value) {
|
|
31
37
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
32
38
|
}
|
|
@@ -398,8 +404,7 @@ function hasHandoffControl(summary) {
|
|
|
398
404
|
}
|
|
399
405
|
function shouldRenderMergeRecommendation(summary) {
|
|
400
406
|
if (!summary.merge_recommendation) return false;
|
|
401
|
-
|
|
402
|
-
return !prohibited.includes("merge_ready") && !prohibited.includes("sync_allowed");
|
|
407
|
+
return riddleProofPublicStateAllowsMergeRecommendation(summary.public_state);
|
|
403
408
|
}
|
|
404
409
|
function checkpointSummaryLine(summary) {
|
|
405
410
|
const accepted = summary.response_count ?? 0;
|
package/dist/pr-comment.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
RIDDLE_PROOF_PR_COMMENT_MARKER,
|
|
3
3
|
buildRiddleProofPrCommentMarkdown,
|
|
4
4
|
summarizeRiddleProofPrComment
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-HZOILEGF.js";
|
|
6
|
+
import "./chunk-WKIIJX3O.js";
|
|
7
7
|
import "./chunk-MLKGABMK.js";
|
|
8
8
|
export {
|
|
9
9
|
RIDDLE_PROOF_PR_COMMENT_MARKER,
|
package/dist/profile/index.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofArtifactBodyAssertionInput, RiddleProofArtifactBodyAssertionResult, RiddleProofProfile, RiddleProofProfileArtifactCompleteness, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileHttpStatusBodyJsonAssertion, RiddleProofProfileHttpStatusBodyJsonAssertionResult, RiddleProofProfileHttpStatusPreflightCheckResult, RiddleProofProfileHttpStatusPreflightFetch, RiddleProofProfileHttpStatusPreflightFetchResponse, RiddleProofProfileHttpStatusPreflightOptions, RiddleProofProfileHttpStatusPreflightResult, RiddleProofProfileJsonValueType, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileReturnSummaryField, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, applyRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from '../profile.cjs';
|
|
2
2
|
import '../types.cjs';
|
|
3
|
+
import '../public-state.cjs';
|
package/dist/profile/index.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_NETWORK_ABORT_ERROR_CODES, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofArtifactBodyAssertionInput, RiddleProofArtifactBodyAssertionResult, RiddleProofProfile, RiddleProofProfileArtifactCompleteness, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileBoundsOffender, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileHttpStatusBodyJsonAssertion, RiddleProofProfileHttpStatusBodyJsonAssertionResult, RiddleProofProfileHttpStatusPreflightCheckResult, RiddleProofProfileHttpStatusPreflightFetch, RiddleProofProfileHttpStatusPreflightFetchResponse, RiddleProofProfileHttpStatusPreflightOptions, RiddleProofProfileHttpStatusPreflightResult, RiddleProofProfileJsonValueType, RiddleProofProfileNetworkAbortErrorCode, RiddleProofProfileNetworkMock, RiddleProofProfileNetworkMockResponse, RiddleProofProfileResult, RiddleProofProfileReturnSummaryField, RiddleProofProfileRouteEvidence, RiddleProofProfileRouteInventoryRoute, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, applyRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileArtifactCompleteness, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, collectRiddleProofProfileWarnings, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, deriveRiddleProofArtifactBodyAssertions, extractRiddleProofProfileResult, normalizeRiddleProofProfile, preflightRiddleProofProfileHttpStatusChecks, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, resolveRiddleProofProfileTimeoutSec, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from '../profile.js';
|
|
2
2
|
import '../types.js';
|
|
3
|
+
import '../public-state.js';
|
package/dist/profile.d.cts
CHANGED
package/dist/profile.d.ts
CHANGED
package/dist/proof-session.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RiddleProofVisualSession, JsonValue, RiddleProofVisualSessionFingerprintBasis } from './types.cjs';
|
|
2
|
+
import './public-state.cjs';
|
|
2
3
|
|
|
3
4
|
declare const RIDDLE_PROOF_VISUAL_SESSION_VERSION: "riddle-proof.visual-session.v1";
|
|
4
5
|
declare const RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION: "riddle-proof.visual-session.fingerprint.v1";
|
package/dist/proof-session.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RiddleProofVisualSession, JsonValue, RiddleProofVisualSessionFingerprintBasis } from './types.js';
|
|
2
|
+
import './public-state.js';
|
|
2
3
|
|
|
3
4
|
declare const RIDDLE_PROOF_VISUAL_SESSION_VERSION: "riddle-proof.visual-session.v1";
|
|
4
5
|
declare const RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION: "riddle-proof.visual-session.fingerprint.v1";
|
package/dist/public-state.cjs
CHANGED
|
@@ -20,9 +20,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/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);
|
|
29
|
+
function riddleProofPublicStateAllowsClaim(summary, claim) {
|
|
30
|
+
return !summary?.prohibited_claims.includes(claim);
|
|
31
|
+
}
|
|
32
|
+
function riddleProofPublicStateAllowsMergeRecommendation(summary) {
|
|
33
|
+
return riddleProofPublicStateAllowsClaim(summary, "merge_ready") && riddleProofPublicStateAllowsClaim(summary, "sync_allowed");
|
|
34
|
+
}
|
|
35
|
+
function riddleProofPublicStateMergeRecommendation(summary, recommendation) {
|
|
36
|
+
return recommendation && riddleProofPublicStateAllowsMergeRecommendation(summary) ? recommendation : void 0;
|
|
37
|
+
}
|
|
26
38
|
function asRecord(value) {
|
|
27
39
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
28
40
|
}
|
|
@@ -175,5 +187,8 @@ function summarizeRiddleProofPublicState(input) {
|
|
|
175
187
|
}
|
|
176
188
|
// Annotate the CommonJS export names for ESM import in node:
|
|
177
189
|
0 && (module.exports = {
|
|
190
|
+
riddleProofPublicStateAllowsClaim,
|
|
191
|
+
riddleProofPublicStateAllowsMergeRecommendation,
|
|
192
|
+
riddleProofPublicStateMergeRecommendation,
|
|
178
193
|
summarizeRiddleProofPublicState
|
|
179
194
|
});
|
package/dist/public-state.d.cts
CHANGED
|
@@ -24,6 +24,9 @@ interface RiddleProofPublicStateSummary {
|
|
|
24
24
|
required_disclosures: string[];
|
|
25
25
|
prohibited_claims: string[];
|
|
26
26
|
}
|
|
27
|
+
declare function riddleProofPublicStateAllowsClaim(summary: RiddleProofPublicStateSummary | undefined, claim: string): boolean;
|
|
28
|
+
declare function riddleProofPublicStateAllowsMergeRecommendation(summary: RiddleProofPublicStateSummary | undefined): boolean;
|
|
29
|
+
declare function riddleProofPublicStateMergeRecommendation(summary: RiddleProofPublicStateSummary | undefined, recommendation: string | undefined): string | undefined;
|
|
27
30
|
declare function summarizeRiddleProofPublicState(input: unknown): RiddleProofPublicStateSummary;
|
|
28
31
|
|
|
29
|
-
export { type RiddleProofPublicCheckpointSummary, type RiddleProofPublicPolicyState, type RiddleProofPublicStateSummary, summarizeRiddleProofPublicState };
|
|
32
|
+
export { type RiddleProofPublicCheckpointSummary, type RiddleProofPublicPolicyState, type RiddleProofPublicStateSummary, riddleProofPublicStateAllowsClaim, riddleProofPublicStateAllowsMergeRecommendation, riddleProofPublicStateMergeRecommendation, summarizeRiddleProofPublicState };
|
package/dist/public-state.d.ts
CHANGED
|
@@ -24,6 +24,9 @@ interface RiddleProofPublicStateSummary {
|
|
|
24
24
|
required_disclosures: string[];
|
|
25
25
|
prohibited_claims: string[];
|
|
26
26
|
}
|
|
27
|
+
declare function riddleProofPublicStateAllowsClaim(summary: RiddleProofPublicStateSummary | undefined, claim: string): boolean;
|
|
28
|
+
declare function riddleProofPublicStateAllowsMergeRecommendation(summary: RiddleProofPublicStateSummary | undefined): boolean;
|
|
29
|
+
declare function riddleProofPublicStateMergeRecommendation(summary: RiddleProofPublicStateSummary | undefined, recommendation: string | undefined): string | undefined;
|
|
27
30
|
declare function summarizeRiddleProofPublicState(input: unknown): RiddleProofPublicStateSummary;
|
|
28
31
|
|
|
29
|
-
export { type RiddleProofPublicCheckpointSummary, type RiddleProofPublicPolicyState, type RiddleProofPublicStateSummary, summarizeRiddleProofPublicState };
|
|
32
|
+
export { type RiddleProofPublicCheckpointSummary, type RiddleProofPublicPolicyState, type RiddleProofPublicStateSummary, riddleProofPublicStateAllowsClaim, riddleProofPublicStateAllowsMergeRecommendation, riddleProofPublicStateMergeRecommendation, summarizeRiddleProofPublicState };
|
package/dist/public-state.js
CHANGED
|
@@ -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
|
};
|
package/dist/result.cjs
CHANGED
|
@@ -29,10 +29,175 @@ __export(result_exports, {
|
|
|
29
29
|
isTerminalStatus: () => isTerminalStatus,
|
|
30
30
|
nonEmptyString: () => nonEmptyString,
|
|
31
31
|
normalizeTerminalMetadata: () => normalizeTerminalMetadata,
|
|
32
|
+
publicMergeRecommendationForRunState: () => publicMergeRecommendationForRunState,
|
|
33
|
+
publicStateForRunState: () => publicStateForRunState,
|
|
32
34
|
recordValue: () => recordValue,
|
|
33
35
|
shipControlStateFor: () => shipControlStateFor
|
|
34
36
|
});
|
|
35
37
|
module.exports = __toCommonJS(result_exports);
|
|
38
|
+
|
|
39
|
+
// src/public-state.ts
|
|
40
|
+
function riddleProofPublicStateAllowsClaim(summary, claim) {
|
|
41
|
+
return !summary?.prohibited_claims.includes(claim);
|
|
42
|
+
}
|
|
43
|
+
function riddleProofPublicStateAllowsMergeRecommendation(summary) {
|
|
44
|
+
return riddleProofPublicStateAllowsClaim(summary, "merge_ready") && riddleProofPublicStateAllowsClaim(summary, "sync_allowed");
|
|
45
|
+
}
|
|
46
|
+
function riddleProofPublicStateMergeRecommendation(summary, recommendation) {
|
|
47
|
+
return recommendation && riddleProofPublicStateAllowsMergeRecommendation(summary) ? recommendation : void 0;
|
|
48
|
+
}
|
|
49
|
+
function asRecord(value) {
|
|
50
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
51
|
+
}
|
|
52
|
+
function stringValue(value) {
|
|
53
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
54
|
+
}
|
|
55
|
+
function booleanValue(value) {
|
|
56
|
+
return typeof value === "boolean" ? value : void 0;
|
|
57
|
+
}
|
|
58
|
+
function numberValue(value) {
|
|
59
|
+
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
60
|
+
}
|
|
61
|
+
function firstStringValue(...values) {
|
|
62
|
+
for (const value of values) {
|
|
63
|
+
const text = stringValue(value);
|
|
64
|
+
if (text) return text;
|
|
65
|
+
}
|
|
66
|
+
return void 0;
|
|
67
|
+
}
|
|
68
|
+
function firstBooleanValue(...values) {
|
|
69
|
+
for (const value of values) {
|
|
70
|
+
const bool = booleanValue(value);
|
|
71
|
+
if (typeof bool === "boolean") return bool;
|
|
72
|
+
}
|
|
73
|
+
return void 0;
|
|
74
|
+
}
|
|
75
|
+
function firstRecordValue(...values) {
|
|
76
|
+
for (const value of values) {
|
|
77
|
+
const record = asRecord(value);
|
|
78
|
+
if (Object.keys(record).length) return record;
|
|
79
|
+
}
|
|
80
|
+
return void 0;
|
|
81
|
+
}
|
|
82
|
+
function countValue(value) {
|
|
83
|
+
const number = numberValue(value);
|
|
84
|
+
return typeof number === "number" && number > 0 ? Math.trunc(number) : 0;
|
|
85
|
+
}
|
|
86
|
+
function checkpointSummaryFrom(...values) {
|
|
87
|
+
const record = firstRecordValue(...values);
|
|
88
|
+
if (!record) return void 0;
|
|
89
|
+
const accepted = countValue(record.response_count);
|
|
90
|
+
const rejected = countValue(record.rejected_response_count);
|
|
91
|
+
const ignored = countValue(record.ignored_response_count);
|
|
92
|
+
const duplicate = countValue(record.duplicate_response_count);
|
|
93
|
+
const summary = {
|
|
94
|
+
pending: booleanValue(record.pending),
|
|
95
|
+
accepted_response_count: accepted,
|
|
96
|
+
rejected_response_count: rejected,
|
|
97
|
+
ignored_response_count: ignored,
|
|
98
|
+
duplicate_response_count: duplicate,
|
|
99
|
+
latest_decision: stringValue(record.latest_decision),
|
|
100
|
+
audit_disclosure_required: rejected > 0 || ignored > 0 || duplicate > 0
|
|
101
|
+
};
|
|
102
|
+
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
103
|
+
}
|
|
104
|
+
function uniqueStrings(values) {
|
|
105
|
+
return [...new Set(values.filter(Boolean))];
|
|
106
|
+
}
|
|
107
|
+
function summarizeRiddleProofPublicState(input) {
|
|
108
|
+
const record = asRecord(input);
|
|
109
|
+
const runCard = asRecord(record.run_card);
|
|
110
|
+
const stopCondition = asRecord(runCard.stop_condition);
|
|
111
|
+
const raw = asRecord(record.raw);
|
|
112
|
+
const request = asRecord(record.request);
|
|
113
|
+
const requestMetadata = asRecord(record.request_metadata);
|
|
114
|
+
const prState = asRecord(record.pr_state);
|
|
115
|
+
const handoff = asRecord(record.pr_handoff_policy);
|
|
116
|
+
const handoffState = stringValue(handoff.state);
|
|
117
|
+
const status = firstStringValue(record.status, stopCondition.status);
|
|
118
|
+
const ok = booleanValue(record.ok) ?? null;
|
|
119
|
+
const shipMode = firstStringValue(request.ship_mode, requestMetadata.ship_mode, record.ship_mode, handoff.ship_mode);
|
|
120
|
+
const explicitShippingDisabled = firstBooleanValue(
|
|
121
|
+
record.shipping_disabled,
|
|
122
|
+
stopCondition.shipping_disabled,
|
|
123
|
+
raw.shipping_disabled,
|
|
124
|
+
handoff.shipping_disabled
|
|
125
|
+
);
|
|
126
|
+
const shippingDisabled = explicitShippingDisabled === true || shipMode === "none" || handoffState === "proof_complete_ship_disabled";
|
|
127
|
+
const explicitShipAuthorized = firstBooleanValue(
|
|
128
|
+
record.ship_authorized,
|
|
129
|
+
stopCondition.ship_authorized,
|
|
130
|
+
raw.ship_authorized
|
|
131
|
+
);
|
|
132
|
+
const authorizationEvidence = Boolean(
|
|
133
|
+
status === "shipped" || record.marked_ready === true || stringValue(prState.status) === "merged" || record.merge_commit || record.merged_at
|
|
134
|
+
);
|
|
135
|
+
const shipAuthorizedBeforeHold = explicitShipAuthorized ?? authorizationEvidence;
|
|
136
|
+
const explicitShipHeld = firstBooleanValue(record.ship_held, stopCondition.ship_held, raw.ship_held);
|
|
137
|
+
const inferredHeld = status === "ready_to_ship" && shippingDisabled && !shipAuthorizedBeforeHold;
|
|
138
|
+
const shipHeld = explicitShipHeld === true || inferredHeld;
|
|
139
|
+
const shipAuthorized = shipHeld ? false : shipAuthorizedBeforeHold === true;
|
|
140
|
+
const proofComplete = Boolean(
|
|
141
|
+
status === "ready_to_ship" || status === "shipped" || status === "completed" || status === "passed" || ok === true || handoff.proof_complete === true
|
|
142
|
+
);
|
|
143
|
+
const checkpointSummary = checkpointSummaryFrom(
|
|
144
|
+
record.checkpoint_summary,
|
|
145
|
+
stopCondition.checkpoint_summary,
|
|
146
|
+
asRecord(record.details).checkpoint_summary,
|
|
147
|
+
asRecord(raw.details).checkpoint_summary
|
|
148
|
+
);
|
|
149
|
+
const blockedOrWaiting = status === "blocked" || status === "failed" || status === "awaiting_checkpoint" || handoffState === "proof_blocked" || handoffState === "proof_review_required" || handoffState === "proof_failed" || handoffState === "proof_checkpoint_required";
|
|
150
|
+
const proofPassed = Boolean(proofComplete && !blockedOrWaiting);
|
|
151
|
+
const explicitMergeReady = firstBooleanValue(record.merge_ready, stopCondition.merge_ready, raw.merge_ready, handoff.merge_ready);
|
|
152
|
+
const normalPrAllowed = firstBooleanValue(record.normal_pr_allowed, raw.normal_pr_allowed, handoff.normal_pr_allowed);
|
|
153
|
+
const baseHandoffAllowed = !blockedOrWaiting && !shipHeld && !shippingDisabled;
|
|
154
|
+
const mergeReady = baseHandoffAllowed && normalPrAllowed !== false && (explicitMergeReady ?? shipAuthorized);
|
|
155
|
+
const syncAllowed = mergeReady;
|
|
156
|
+
let policyState = "unknown";
|
|
157
|
+
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") policyState = "awaiting_checkpoint";
|
|
158
|
+
else if (status === "failed" || handoffState === "proof_failed") policyState = "proof_failed";
|
|
159
|
+
else if (status === "blocked" || handoffState === "proof_blocked" || handoffState === "proof_review_required") policyState = "proof_blocked";
|
|
160
|
+
else if (handoffState === "proof_complete_ship_disabled") policyState = "proof_complete_ship_disabled";
|
|
161
|
+
else if (proofComplete && shipHeld && !shipAuthorized) policyState = "proof_passed_ship_held";
|
|
162
|
+
else if (proofComplete && shippingDisabled && !shipAuthorized) policyState = "proof_complete_ship_disabled";
|
|
163
|
+
else if (shipAuthorized) policyState = "ship_authorized";
|
|
164
|
+
else if (proofPassed) policyState = "proof_passed";
|
|
165
|
+
else if (status === "running") policyState = "proof_in_progress";
|
|
166
|
+
const requiredDisclosures = [];
|
|
167
|
+
if (shipHeld) requiredDisclosures.push("ship_held");
|
|
168
|
+
if (shippingDisabled) requiredDisclosures.push("shipping_disabled");
|
|
169
|
+
if (checkpointSummary?.audit_disclosure_required) requiredDisclosures.push("checkpoint_audit_counters");
|
|
170
|
+
if (status === "awaiting_checkpoint" || handoffState === "proof_checkpoint_required") requiredDisclosures.push("checkpoint_required");
|
|
171
|
+
const prohibitedClaims = [];
|
|
172
|
+
if (!shipAuthorized || shipHeld || shippingDisabled) prohibitedClaims.push("ship_authorized", "shipped");
|
|
173
|
+
if (!mergeReady) prohibitedClaims.push("merge_ready");
|
|
174
|
+
if (!syncAllowed) prohibitedClaims.push("sync_allowed");
|
|
175
|
+
if (blockedOrWaiting) {
|
|
176
|
+
prohibitedClaims.push("proof_passed", "ready_to_ship");
|
|
177
|
+
}
|
|
178
|
+
if (checkpointSummary?.audit_disclosure_required) {
|
|
179
|
+
prohibitedClaims.push("all_checkpoint_responses_accepted");
|
|
180
|
+
}
|
|
181
|
+
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";
|
|
182
|
+
return {
|
|
183
|
+
status,
|
|
184
|
+
ok,
|
|
185
|
+
policy_state: policyState,
|
|
186
|
+
result_label: resultLabel,
|
|
187
|
+
proof_complete: proofComplete,
|
|
188
|
+
proof_passed: proofPassed,
|
|
189
|
+
ship_held: shipHeld,
|
|
190
|
+
shipping_disabled: shippingDisabled,
|
|
191
|
+
ship_authorized: shipAuthorized,
|
|
192
|
+
merge_ready: mergeReady,
|
|
193
|
+
sync_allowed: syncAllowed,
|
|
194
|
+
checkpoint_summary: checkpointSummary,
|
|
195
|
+
required_disclosures: uniqueStrings(requiredDisclosures),
|
|
196
|
+
prohibited_claims: uniqueStrings(prohibitedClaims)
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// src/result.ts
|
|
36
201
|
function isTerminalStatus(status) {
|
|
37
202
|
return status === "blocked" || status === "failed" || status === "ready_to_ship" || status === "shipped" || status === "completed";
|
|
38
203
|
}
|
|
@@ -206,6 +371,37 @@ function applyTerminalMetadata(state, metadata) {
|
|
|
206
371
|
if (typeof metadata.finalized === "boolean") state.finalized = metadata.finalized;
|
|
207
372
|
return state;
|
|
208
373
|
}
|
|
374
|
+
function publicStateForRunState(input) {
|
|
375
|
+
const state = input.state;
|
|
376
|
+
const status = input.status || state.status;
|
|
377
|
+
const raw = recordValue(input.raw) || {};
|
|
378
|
+
const extendedState = state;
|
|
379
|
+
const terminalOk = isTerminalStatus(status) ? state.ok : void 0;
|
|
380
|
+
return summarizeRiddleProofPublicState(compactRecord({
|
|
381
|
+
status,
|
|
382
|
+
ok: terminalOk,
|
|
383
|
+
request: state.request,
|
|
384
|
+
pr_state: state.pr_state,
|
|
385
|
+
marked_ready: state.marked_ready,
|
|
386
|
+
ship_held: state.ship_held,
|
|
387
|
+
shipping_disabled: state.shipping_disabled,
|
|
388
|
+
ship_authorized: state.ship_authorized,
|
|
389
|
+
ship_mode: state.request?.ship_mode,
|
|
390
|
+
merge_commit: state.merge_commit,
|
|
391
|
+
merged_at: state.merged_at,
|
|
392
|
+
checkpoint_summary: state.checkpoint_summary,
|
|
393
|
+
pr_handoff_policy: recordValue(extendedState.pr_handoff_policy),
|
|
394
|
+
merge_ready: extendedState.merge_ready,
|
|
395
|
+
normal_pr_allowed: extendedState.normal_pr_allowed,
|
|
396
|
+
raw: Object.keys(raw).length ? raw : void 0
|
|
397
|
+
}));
|
|
398
|
+
}
|
|
399
|
+
function publicMergeRecommendationForRunState(input) {
|
|
400
|
+
return riddleProofPublicStateMergeRecommendation(
|
|
401
|
+
publicStateForRunState(input),
|
|
402
|
+
input.state.merge_recommendation
|
|
403
|
+
);
|
|
404
|
+
}
|
|
209
405
|
function shipControlStateFor(input) {
|
|
210
406
|
const state = input.state;
|
|
211
407
|
const status = input.status || state.status;
|
|
@@ -254,6 +450,11 @@ function createRunResult(input) {
|
|
|
254
450
|
state.ok = ok;
|
|
255
451
|
if (isProtectedFinalStatus(status)) state.finalized = true;
|
|
256
452
|
applyShipControlState(state, { status, raw: input.raw });
|
|
453
|
+
const publicState = publicStateForRunState({ state, status, raw: input.raw });
|
|
454
|
+
const publicMergeRecommendation = riddleProofPublicStateMergeRecommendation(
|
|
455
|
+
publicState,
|
|
456
|
+
state.merge_recommendation
|
|
457
|
+
);
|
|
257
458
|
return compactRecord({
|
|
258
459
|
ok,
|
|
259
460
|
status,
|
|
@@ -271,9 +472,12 @@ function createRunResult(input) {
|
|
|
271
472
|
pr_state: state.pr_state,
|
|
272
473
|
marked_ready: state.marked_ready,
|
|
273
474
|
left_draft: state.left_draft,
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
475
|
+
result_label: publicState.result_label,
|
|
476
|
+
ship_held: publicState.ship_held,
|
|
477
|
+
shipping_disabled: publicState.shipping_disabled,
|
|
478
|
+
ship_authorized: publicState.ship_authorized,
|
|
479
|
+
merge_ready: publicState.merge_ready,
|
|
480
|
+
sync_allowed: publicState.sync_allowed,
|
|
277
481
|
ci_status: state.ci_status,
|
|
278
482
|
ship_commit: state.ship_commit,
|
|
279
483
|
ship_remote_head: state.ship_remote_head,
|
|
@@ -287,7 +491,8 @@ function createRunResult(input) {
|
|
|
287
491
|
cleanup_report: state.cleanup_report,
|
|
288
492
|
notification: state.notification,
|
|
289
493
|
proof_decision: state.proof_decision,
|
|
290
|
-
merge_recommendation:
|
|
494
|
+
merge_recommendation: publicMergeRecommendation,
|
|
495
|
+
public_state: publicState,
|
|
291
496
|
finalized: state.finalized,
|
|
292
497
|
blocker: state.blocker,
|
|
293
498
|
checkpoint_packet: state.checkpoint_packet,
|
|
@@ -312,6 +517,8 @@ function createRunResult(input) {
|
|
|
312
517
|
isTerminalStatus,
|
|
313
518
|
nonEmptyString,
|
|
314
519
|
normalizeTerminalMetadata,
|
|
520
|
+
publicMergeRecommendationForRunState,
|
|
521
|
+
publicStateForRunState,
|
|
315
522
|
recordValue,
|
|
316
523
|
shipControlStateFor
|
|
317
524
|
});
|
package/dist/result.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RiddleProofPublicStateSummary } from './public-state.cjs';
|
|
1
2
|
import { RiddleProofRunState, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofEvidenceBundle, RiddleProofRunResult } from './types.cjs';
|
|
2
3
|
|
|
3
4
|
declare function isTerminalStatus(status: RiddleProofStatus): boolean;
|
|
@@ -18,6 +19,16 @@ interface RiddleProofShipControlState {
|
|
|
18
19
|
shipping_disabled: boolean;
|
|
19
20
|
ship_authorized: boolean;
|
|
20
21
|
}
|
|
22
|
+
declare function publicStateForRunState(input: {
|
|
23
|
+
state: RiddleProofRunState;
|
|
24
|
+
status?: RiddleProofStatus;
|
|
25
|
+
raw?: Record<string, unknown>;
|
|
26
|
+
}): RiddleProofPublicStateSummary;
|
|
27
|
+
declare function publicMergeRecommendationForRunState(input: {
|
|
28
|
+
state: RiddleProofRunState;
|
|
29
|
+
status?: RiddleProofStatus;
|
|
30
|
+
raw?: Record<string, unknown>;
|
|
31
|
+
}): string | undefined;
|
|
21
32
|
declare function shipControlStateFor(input: {
|
|
22
33
|
state: RiddleProofRunState;
|
|
23
34
|
status?: RiddleProofStatus;
|
|
@@ -37,4 +48,4 @@ declare function createRunResult(input: {
|
|
|
37
48
|
raw?: Record<string, unknown>;
|
|
38
49
|
}): RiddleProofRunResult;
|
|
39
50
|
|
|
40
|
-
export { type RiddleProofShipControlState, type TerminalMetadataInput, applyShipControlState, applyTerminalMetadata, compactRecord, createRunResult, isProtectedFinalStatus, isSuccessfulStatus, isTerminalStatus, nonEmptyString, normalizeTerminalMetadata, recordValue, shipControlStateFor };
|
|
51
|
+
export { type RiddleProofShipControlState, type TerminalMetadataInput, applyShipControlState, applyTerminalMetadata, compactRecord, createRunResult, isProtectedFinalStatus, isSuccessfulStatus, isTerminalStatus, nonEmptyString, normalizeTerminalMetadata, publicMergeRecommendationForRunState, publicStateForRunState, recordValue, shipControlStateFor };
|
package/dist/result.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RiddleProofPublicStateSummary } from './public-state.js';
|
|
1
2
|
import { RiddleProofRunState, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofEvidenceBundle, RiddleProofRunResult } from './types.js';
|
|
2
3
|
|
|
3
4
|
declare function isTerminalStatus(status: RiddleProofStatus): boolean;
|
|
@@ -18,6 +19,16 @@ interface RiddleProofShipControlState {
|
|
|
18
19
|
shipping_disabled: boolean;
|
|
19
20
|
ship_authorized: boolean;
|
|
20
21
|
}
|
|
22
|
+
declare function publicStateForRunState(input: {
|
|
23
|
+
state: RiddleProofRunState;
|
|
24
|
+
status?: RiddleProofStatus;
|
|
25
|
+
raw?: Record<string, unknown>;
|
|
26
|
+
}): RiddleProofPublicStateSummary;
|
|
27
|
+
declare function publicMergeRecommendationForRunState(input: {
|
|
28
|
+
state: RiddleProofRunState;
|
|
29
|
+
status?: RiddleProofStatus;
|
|
30
|
+
raw?: Record<string, unknown>;
|
|
31
|
+
}): string | undefined;
|
|
21
32
|
declare function shipControlStateFor(input: {
|
|
22
33
|
state: RiddleProofRunState;
|
|
23
34
|
status?: RiddleProofStatus;
|
|
@@ -37,4 +48,4 @@ declare function createRunResult(input: {
|
|
|
37
48
|
raw?: Record<string, unknown>;
|
|
38
49
|
}): RiddleProofRunResult;
|
|
39
50
|
|
|
40
|
-
export { type RiddleProofShipControlState, type TerminalMetadataInput, applyShipControlState, applyTerminalMetadata, compactRecord, createRunResult, isProtectedFinalStatus, isSuccessfulStatus, isTerminalStatus, nonEmptyString, normalizeTerminalMetadata, recordValue, shipControlStateFor };
|
|
51
|
+
export { type RiddleProofShipControlState, type TerminalMetadataInput, applyShipControlState, applyTerminalMetadata, compactRecord, createRunResult, isProtectedFinalStatus, isSuccessfulStatus, isTerminalStatus, nonEmptyString, normalizeTerminalMetadata, publicMergeRecommendationForRunState, publicStateForRunState, recordValue, shipControlStateFor };
|
package/dist/result.js
CHANGED
|
@@ -8,9 +8,12 @@ import {
|
|
|
8
8
|
isTerminalStatus,
|
|
9
9
|
nonEmptyString,
|
|
10
10
|
normalizeTerminalMetadata,
|
|
11
|
+
publicMergeRecommendationForRunState,
|
|
12
|
+
publicStateForRunState,
|
|
11
13
|
recordValue,
|
|
12
14
|
shipControlStateFor
|
|
13
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QGMSN34W.js";
|
|
16
|
+
import "./chunk-WKIIJX3O.js";
|
|
14
17
|
import "./chunk-MLKGABMK.js";
|
|
15
18
|
export {
|
|
16
19
|
applyShipControlState,
|
|
@@ -22,6 +25,8 @@ export {
|
|
|
22
25
|
isTerminalStatus,
|
|
23
26
|
nonEmptyString,
|
|
24
27
|
normalizeTerminalMetadata,
|
|
28
|
+
publicMergeRecommendationForRunState,
|
|
29
|
+
publicStateForRunState,
|
|
25
30
|
recordValue,
|
|
26
31
|
shipControlStateFor
|
|
27
32
|
};
|