@riddledc/riddle-proof 0.6.0 → 0.7.1
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/README.md +65 -0
- package/dist/{chunk-MO24D3PY.js → chunk-4DM3OTWH.js} +3 -0
- package/dist/chunk-7NMAU4DP.js +808 -0
- package/dist/{chunk-RFJ5BQF6.js → chunk-FPD2RF3Q.js} +40 -3
- package/dist/{chunk-RXFKKYWA.js → chunk-HIKFPDRO.js} +63 -48
- package/dist/{chunk-2FBF2UDZ.js → chunk-N5BVCRKI.js} +10 -6
- package/dist/cli.cjs +1099 -20
- package/dist/cli.js +193 -4
- package/dist/engine-harness.cjs +149 -20
- package/dist/engine-harness.js +3 -3
- package/dist/index.cjs +1032 -67
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +40 -4
- package/dist/openclaw.cjs +6 -0
- package/dist/openclaw.d.cts +3 -0
- package/dist/openclaw.d.ts +3 -0
- package/dist/openclaw.js +4 -1
- package/dist/profile.cjs +848 -0
- package/dist/profile.d.cts +175 -0
- package/dist/profile.d.ts +175 -0
- package/dist/profile.js +38 -0
- package/dist/proof-run-core.cjs +42 -3
- package/dist/proof-run-core.d.cts +13 -3
- package/dist/proof-run-core.d.ts +13 -3
- package/dist/proof-run-core.js +5 -1
- package/dist/proof-run-engine.cjs +142 -19
- package/dist/proof-run-engine.d.cts +43 -3
- package/dist/proof-run-engine.d.ts +43 -3
- package/dist/proof-run-engine.js +106 -17
- package/dist/runner.cjs +107 -47
- package/dist/runner.js +3 -2
- package/dist/state.cjs +3 -0
- package/dist/state.js +1 -1
- package/dist/types.d.cts +3 -0
- package/dist/types.d.ts +3 -0
- package/examples/profiles/page-content-basic.json +26 -0
- package/package.json +8 -2
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { JsonValue } from './types.cjs';
|
|
2
|
+
|
|
3
|
+
declare const RIDDLE_PROOF_PROFILE_VERSION: "riddle-proof.profile.v1";
|
|
4
|
+
declare const RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION: "riddle-proof.profile-evidence.v1";
|
|
5
|
+
declare const RIDDLE_PROOF_PROFILE_RESULT_VERSION: "riddle-proof.profile-result.v1";
|
|
6
|
+
declare const RIDDLE_PROOF_PROFILE_STATUSES: readonly ["passed", "product_regression", "proof_insufficient", "environment_blocked", "configuration_error", "needs_human_review"];
|
|
7
|
+
declare const RIDDLE_PROOF_PROFILE_CHECK_TYPES: readonly ["route_loaded", "selector_visible", "selector_count_at_least", "text_visible", "text_absent", "no_horizontal_overflow", "no_mobile_horizontal_overflow", "no_fatal_console_errors"];
|
|
8
|
+
type RiddleProofProfileStatus = typeof RIDDLE_PROOF_PROFILE_STATUSES[number];
|
|
9
|
+
type RiddleProofProfileCheckType = typeof RIDDLE_PROOF_PROFILE_CHECK_TYPES[number];
|
|
10
|
+
type RiddleProofProfileRunner = "riddle" | "local-playwright" | "browserless" | "github-actions" | (string & {});
|
|
11
|
+
type RiddleProofProfileFailureAction = "fail" | "neutral" | "review";
|
|
12
|
+
type RiddleProofProfileBaselinePolicy = "invariant_only" | "production_comparison" | "last_accepted_artifact" | "golden_reference_artifact" | (string & {});
|
|
13
|
+
interface RiddleProofProfileViewport {
|
|
14
|
+
name: string;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
}
|
|
18
|
+
interface RiddleProofProfileTarget {
|
|
19
|
+
url?: string;
|
|
20
|
+
route?: string;
|
|
21
|
+
viewports: RiddleProofProfileViewport[];
|
|
22
|
+
auth?: "none" | (string & {});
|
|
23
|
+
wait_for_selector?: string;
|
|
24
|
+
wait_ms?: number;
|
|
25
|
+
}
|
|
26
|
+
interface RiddleProofProfileCheck {
|
|
27
|
+
type: RiddleProofProfileCheckType;
|
|
28
|
+
label?: string;
|
|
29
|
+
expected_path?: string;
|
|
30
|
+
selector?: string;
|
|
31
|
+
text?: string;
|
|
32
|
+
pattern?: string;
|
|
33
|
+
flags?: string;
|
|
34
|
+
min_count?: number;
|
|
35
|
+
max_overflow_px?: number;
|
|
36
|
+
}
|
|
37
|
+
interface RiddleProofProfile {
|
|
38
|
+
version: typeof RIDDLE_PROOF_PROFILE_VERSION;
|
|
39
|
+
name: string;
|
|
40
|
+
target: RiddleProofProfileTarget;
|
|
41
|
+
checks: RiddleProofProfileCheck[];
|
|
42
|
+
artifacts: string[];
|
|
43
|
+
baseline_policy: RiddleProofProfileBaselinePolicy;
|
|
44
|
+
failure_policy: Partial<Record<RiddleProofProfileStatus, RiddleProofProfileFailureAction>>;
|
|
45
|
+
metadata?: Record<string, JsonValue>;
|
|
46
|
+
}
|
|
47
|
+
interface RiddleProofProfileRouteEvidence {
|
|
48
|
+
requested: string;
|
|
49
|
+
observed: string;
|
|
50
|
+
expected_path?: string;
|
|
51
|
+
matched: boolean;
|
|
52
|
+
http_status?: number | null;
|
|
53
|
+
error?: string;
|
|
54
|
+
}
|
|
55
|
+
interface RiddleProofProfileViewportEvidence {
|
|
56
|
+
name: string;
|
|
57
|
+
width: number;
|
|
58
|
+
height: number;
|
|
59
|
+
url?: string;
|
|
60
|
+
route: RiddleProofProfileRouteEvidence;
|
|
61
|
+
title?: string;
|
|
62
|
+
body_text_length?: number;
|
|
63
|
+
body_text_sample?: string;
|
|
64
|
+
scroll_width?: number;
|
|
65
|
+
client_width?: number;
|
|
66
|
+
overflow_px?: number;
|
|
67
|
+
selectors?: Record<string, {
|
|
68
|
+
count: number;
|
|
69
|
+
visible_count: number;
|
|
70
|
+
}>;
|
|
71
|
+
text_matches?: Record<string, boolean>;
|
|
72
|
+
screenshot_label?: string;
|
|
73
|
+
navigation_error?: string;
|
|
74
|
+
wait_error?: string;
|
|
75
|
+
}
|
|
76
|
+
interface RiddleProofProfileEvidence {
|
|
77
|
+
version: typeof RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION;
|
|
78
|
+
profile_name: string;
|
|
79
|
+
target_url: string;
|
|
80
|
+
baseline_policy: RiddleProofProfileBaselinePolicy;
|
|
81
|
+
captured_at: string;
|
|
82
|
+
viewports: RiddleProofProfileViewportEvidence[];
|
|
83
|
+
console: {
|
|
84
|
+
events: Array<{
|
|
85
|
+
type: string;
|
|
86
|
+
text: string;
|
|
87
|
+
location?: JsonValue;
|
|
88
|
+
}>;
|
|
89
|
+
fatal_count: number;
|
|
90
|
+
};
|
|
91
|
+
page_errors: Array<{
|
|
92
|
+
message: string;
|
|
93
|
+
}>;
|
|
94
|
+
dom_summary?: Record<string, JsonValue>;
|
|
95
|
+
}
|
|
96
|
+
interface RiddleProofProfileCheckResult {
|
|
97
|
+
type: RiddleProofProfileCheckType | (string & {});
|
|
98
|
+
label?: string;
|
|
99
|
+
status: "passed" | "failed" | "skipped" | "needs_human_review";
|
|
100
|
+
evidence: Record<string, JsonValue>;
|
|
101
|
+
message?: string;
|
|
102
|
+
}
|
|
103
|
+
interface RiddleProofProfileResult {
|
|
104
|
+
version: typeof RIDDLE_PROOF_PROFILE_RESULT_VERSION;
|
|
105
|
+
profile_name: string;
|
|
106
|
+
runner: RiddleProofProfileRunner;
|
|
107
|
+
status: RiddleProofProfileStatus;
|
|
108
|
+
baseline_policy: RiddleProofProfileBaselinePolicy;
|
|
109
|
+
route: RiddleProofProfileRouteEvidence;
|
|
110
|
+
artifacts: {
|
|
111
|
+
screenshots: string[];
|
|
112
|
+
console?: string;
|
|
113
|
+
proof_json?: string;
|
|
114
|
+
dom_summary?: string;
|
|
115
|
+
riddle_artifacts?: RiddleProofProfileArtifactRef[];
|
|
116
|
+
};
|
|
117
|
+
checks: RiddleProofProfileCheckResult[];
|
|
118
|
+
summary: string;
|
|
119
|
+
captured_at: string;
|
|
120
|
+
evidence?: RiddleProofProfileEvidence;
|
|
121
|
+
riddle?: {
|
|
122
|
+
job_id?: string;
|
|
123
|
+
status?: string | null;
|
|
124
|
+
terminal?: boolean;
|
|
125
|
+
};
|
|
126
|
+
error?: string;
|
|
127
|
+
}
|
|
128
|
+
interface RiddleProofProfileArtifactRef {
|
|
129
|
+
name: string;
|
|
130
|
+
url?: string;
|
|
131
|
+
path?: string;
|
|
132
|
+
kind?: string;
|
|
133
|
+
content_type?: string;
|
|
134
|
+
source?: string;
|
|
135
|
+
}
|
|
136
|
+
interface NormalizeRiddleProofProfileOptions {
|
|
137
|
+
url?: string;
|
|
138
|
+
route?: string;
|
|
139
|
+
viewports?: RiddleProofProfileViewport[];
|
|
140
|
+
}
|
|
141
|
+
declare function slugifyRiddleProofProfileName(value: string): string;
|
|
142
|
+
declare function normalizeRiddleProofProfile(input: unknown, options?: NormalizeRiddleProofProfileOptions): RiddleProofProfile;
|
|
143
|
+
declare function resolveRiddleProofProfileTargetUrl(profile: RiddleProofProfile): string;
|
|
144
|
+
declare function assessRiddleProofProfileEvidence(profile: RiddleProofProfile, evidence: RiddleProofProfileEvidence | undefined, options?: {
|
|
145
|
+
runner?: RiddleProofProfileRunner;
|
|
146
|
+
riddle?: RiddleProofProfileResult["riddle"];
|
|
147
|
+
artifacts?: RiddleProofProfileArtifactRef[];
|
|
148
|
+
}): RiddleProofProfileResult;
|
|
149
|
+
declare function summarizeRiddleProofProfileResult(input: {
|
|
150
|
+
profile_name: string;
|
|
151
|
+
status: RiddleProofProfileStatus;
|
|
152
|
+
checks: RiddleProofProfileCheckResult[];
|
|
153
|
+
viewports: RiddleProofProfileViewportEvidence[];
|
|
154
|
+
}): string;
|
|
155
|
+
declare function profileStatusExitCode(profile: RiddleProofProfile, status: RiddleProofProfileStatus): 0 | 1;
|
|
156
|
+
declare function createRiddleProofProfileConfigurationError(name: string, error: unknown, runner?: RiddleProofProfileRunner): RiddleProofProfileResult;
|
|
157
|
+
declare function createRiddleProofProfileEnvironmentBlockedResult(input: {
|
|
158
|
+
profile: RiddleProofProfile;
|
|
159
|
+
runner?: RiddleProofProfileRunner;
|
|
160
|
+
error?: unknown;
|
|
161
|
+
riddle?: RiddleProofProfileResult["riddle"];
|
|
162
|
+
artifacts?: RiddleProofProfileArtifactRef[];
|
|
163
|
+
}): RiddleProofProfileResult;
|
|
164
|
+
declare function createRiddleProofProfileInsufficientResult(input: {
|
|
165
|
+
profile: RiddleProofProfile;
|
|
166
|
+
runner?: RiddleProofProfileRunner;
|
|
167
|
+
error?: unknown;
|
|
168
|
+
riddle?: RiddleProofProfileResult["riddle"];
|
|
169
|
+
artifacts?: RiddleProofProfileArtifactRef[];
|
|
170
|
+
}): RiddleProofProfileResult;
|
|
171
|
+
declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): string;
|
|
172
|
+
declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
|
|
173
|
+
declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
|
|
174
|
+
|
|
175
|
+
export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileResult, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRunner, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileTargetUrl, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { JsonValue } from './types.js';
|
|
2
|
+
|
|
3
|
+
declare const RIDDLE_PROOF_PROFILE_VERSION: "riddle-proof.profile.v1";
|
|
4
|
+
declare const RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION: "riddle-proof.profile-evidence.v1";
|
|
5
|
+
declare const RIDDLE_PROOF_PROFILE_RESULT_VERSION: "riddle-proof.profile-result.v1";
|
|
6
|
+
declare const RIDDLE_PROOF_PROFILE_STATUSES: readonly ["passed", "product_regression", "proof_insufficient", "environment_blocked", "configuration_error", "needs_human_review"];
|
|
7
|
+
declare const RIDDLE_PROOF_PROFILE_CHECK_TYPES: readonly ["route_loaded", "selector_visible", "selector_count_at_least", "text_visible", "text_absent", "no_horizontal_overflow", "no_mobile_horizontal_overflow", "no_fatal_console_errors"];
|
|
8
|
+
type RiddleProofProfileStatus = typeof RIDDLE_PROOF_PROFILE_STATUSES[number];
|
|
9
|
+
type RiddleProofProfileCheckType = typeof RIDDLE_PROOF_PROFILE_CHECK_TYPES[number];
|
|
10
|
+
type RiddleProofProfileRunner = "riddle" | "local-playwright" | "browserless" | "github-actions" | (string & {});
|
|
11
|
+
type RiddleProofProfileFailureAction = "fail" | "neutral" | "review";
|
|
12
|
+
type RiddleProofProfileBaselinePolicy = "invariant_only" | "production_comparison" | "last_accepted_artifact" | "golden_reference_artifact" | (string & {});
|
|
13
|
+
interface RiddleProofProfileViewport {
|
|
14
|
+
name: string;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
}
|
|
18
|
+
interface RiddleProofProfileTarget {
|
|
19
|
+
url?: string;
|
|
20
|
+
route?: string;
|
|
21
|
+
viewports: RiddleProofProfileViewport[];
|
|
22
|
+
auth?: "none" | (string & {});
|
|
23
|
+
wait_for_selector?: string;
|
|
24
|
+
wait_ms?: number;
|
|
25
|
+
}
|
|
26
|
+
interface RiddleProofProfileCheck {
|
|
27
|
+
type: RiddleProofProfileCheckType;
|
|
28
|
+
label?: string;
|
|
29
|
+
expected_path?: string;
|
|
30
|
+
selector?: string;
|
|
31
|
+
text?: string;
|
|
32
|
+
pattern?: string;
|
|
33
|
+
flags?: string;
|
|
34
|
+
min_count?: number;
|
|
35
|
+
max_overflow_px?: number;
|
|
36
|
+
}
|
|
37
|
+
interface RiddleProofProfile {
|
|
38
|
+
version: typeof RIDDLE_PROOF_PROFILE_VERSION;
|
|
39
|
+
name: string;
|
|
40
|
+
target: RiddleProofProfileTarget;
|
|
41
|
+
checks: RiddleProofProfileCheck[];
|
|
42
|
+
artifacts: string[];
|
|
43
|
+
baseline_policy: RiddleProofProfileBaselinePolicy;
|
|
44
|
+
failure_policy: Partial<Record<RiddleProofProfileStatus, RiddleProofProfileFailureAction>>;
|
|
45
|
+
metadata?: Record<string, JsonValue>;
|
|
46
|
+
}
|
|
47
|
+
interface RiddleProofProfileRouteEvidence {
|
|
48
|
+
requested: string;
|
|
49
|
+
observed: string;
|
|
50
|
+
expected_path?: string;
|
|
51
|
+
matched: boolean;
|
|
52
|
+
http_status?: number | null;
|
|
53
|
+
error?: string;
|
|
54
|
+
}
|
|
55
|
+
interface RiddleProofProfileViewportEvidence {
|
|
56
|
+
name: string;
|
|
57
|
+
width: number;
|
|
58
|
+
height: number;
|
|
59
|
+
url?: string;
|
|
60
|
+
route: RiddleProofProfileRouteEvidence;
|
|
61
|
+
title?: string;
|
|
62
|
+
body_text_length?: number;
|
|
63
|
+
body_text_sample?: string;
|
|
64
|
+
scroll_width?: number;
|
|
65
|
+
client_width?: number;
|
|
66
|
+
overflow_px?: number;
|
|
67
|
+
selectors?: Record<string, {
|
|
68
|
+
count: number;
|
|
69
|
+
visible_count: number;
|
|
70
|
+
}>;
|
|
71
|
+
text_matches?: Record<string, boolean>;
|
|
72
|
+
screenshot_label?: string;
|
|
73
|
+
navigation_error?: string;
|
|
74
|
+
wait_error?: string;
|
|
75
|
+
}
|
|
76
|
+
interface RiddleProofProfileEvidence {
|
|
77
|
+
version: typeof RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION;
|
|
78
|
+
profile_name: string;
|
|
79
|
+
target_url: string;
|
|
80
|
+
baseline_policy: RiddleProofProfileBaselinePolicy;
|
|
81
|
+
captured_at: string;
|
|
82
|
+
viewports: RiddleProofProfileViewportEvidence[];
|
|
83
|
+
console: {
|
|
84
|
+
events: Array<{
|
|
85
|
+
type: string;
|
|
86
|
+
text: string;
|
|
87
|
+
location?: JsonValue;
|
|
88
|
+
}>;
|
|
89
|
+
fatal_count: number;
|
|
90
|
+
};
|
|
91
|
+
page_errors: Array<{
|
|
92
|
+
message: string;
|
|
93
|
+
}>;
|
|
94
|
+
dom_summary?: Record<string, JsonValue>;
|
|
95
|
+
}
|
|
96
|
+
interface RiddleProofProfileCheckResult {
|
|
97
|
+
type: RiddleProofProfileCheckType | (string & {});
|
|
98
|
+
label?: string;
|
|
99
|
+
status: "passed" | "failed" | "skipped" | "needs_human_review";
|
|
100
|
+
evidence: Record<string, JsonValue>;
|
|
101
|
+
message?: string;
|
|
102
|
+
}
|
|
103
|
+
interface RiddleProofProfileResult {
|
|
104
|
+
version: typeof RIDDLE_PROOF_PROFILE_RESULT_VERSION;
|
|
105
|
+
profile_name: string;
|
|
106
|
+
runner: RiddleProofProfileRunner;
|
|
107
|
+
status: RiddleProofProfileStatus;
|
|
108
|
+
baseline_policy: RiddleProofProfileBaselinePolicy;
|
|
109
|
+
route: RiddleProofProfileRouteEvidence;
|
|
110
|
+
artifacts: {
|
|
111
|
+
screenshots: string[];
|
|
112
|
+
console?: string;
|
|
113
|
+
proof_json?: string;
|
|
114
|
+
dom_summary?: string;
|
|
115
|
+
riddle_artifacts?: RiddleProofProfileArtifactRef[];
|
|
116
|
+
};
|
|
117
|
+
checks: RiddleProofProfileCheckResult[];
|
|
118
|
+
summary: string;
|
|
119
|
+
captured_at: string;
|
|
120
|
+
evidence?: RiddleProofProfileEvidence;
|
|
121
|
+
riddle?: {
|
|
122
|
+
job_id?: string;
|
|
123
|
+
status?: string | null;
|
|
124
|
+
terminal?: boolean;
|
|
125
|
+
};
|
|
126
|
+
error?: string;
|
|
127
|
+
}
|
|
128
|
+
interface RiddleProofProfileArtifactRef {
|
|
129
|
+
name: string;
|
|
130
|
+
url?: string;
|
|
131
|
+
path?: string;
|
|
132
|
+
kind?: string;
|
|
133
|
+
content_type?: string;
|
|
134
|
+
source?: string;
|
|
135
|
+
}
|
|
136
|
+
interface NormalizeRiddleProofProfileOptions {
|
|
137
|
+
url?: string;
|
|
138
|
+
route?: string;
|
|
139
|
+
viewports?: RiddleProofProfileViewport[];
|
|
140
|
+
}
|
|
141
|
+
declare function slugifyRiddleProofProfileName(value: string): string;
|
|
142
|
+
declare function normalizeRiddleProofProfile(input: unknown, options?: NormalizeRiddleProofProfileOptions): RiddleProofProfile;
|
|
143
|
+
declare function resolveRiddleProofProfileTargetUrl(profile: RiddleProofProfile): string;
|
|
144
|
+
declare function assessRiddleProofProfileEvidence(profile: RiddleProofProfile, evidence: RiddleProofProfileEvidence | undefined, options?: {
|
|
145
|
+
runner?: RiddleProofProfileRunner;
|
|
146
|
+
riddle?: RiddleProofProfileResult["riddle"];
|
|
147
|
+
artifacts?: RiddleProofProfileArtifactRef[];
|
|
148
|
+
}): RiddleProofProfileResult;
|
|
149
|
+
declare function summarizeRiddleProofProfileResult(input: {
|
|
150
|
+
profile_name: string;
|
|
151
|
+
status: RiddleProofProfileStatus;
|
|
152
|
+
checks: RiddleProofProfileCheckResult[];
|
|
153
|
+
viewports: RiddleProofProfileViewportEvidence[];
|
|
154
|
+
}): string;
|
|
155
|
+
declare function profileStatusExitCode(profile: RiddleProofProfile, status: RiddleProofProfileStatus): 0 | 1;
|
|
156
|
+
declare function createRiddleProofProfileConfigurationError(name: string, error: unknown, runner?: RiddleProofProfileRunner): RiddleProofProfileResult;
|
|
157
|
+
declare function createRiddleProofProfileEnvironmentBlockedResult(input: {
|
|
158
|
+
profile: RiddleProofProfile;
|
|
159
|
+
runner?: RiddleProofProfileRunner;
|
|
160
|
+
error?: unknown;
|
|
161
|
+
riddle?: RiddleProofProfileResult["riddle"];
|
|
162
|
+
artifacts?: RiddleProofProfileArtifactRef[];
|
|
163
|
+
}): RiddleProofProfileResult;
|
|
164
|
+
declare function createRiddleProofProfileInsufficientResult(input: {
|
|
165
|
+
profile: RiddleProofProfile;
|
|
166
|
+
runner?: RiddleProofProfileRunner;
|
|
167
|
+
error?: unknown;
|
|
168
|
+
riddle?: RiddleProofProfileResult["riddle"];
|
|
169
|
+
artifacts?: RiddleProofProfileArtifactRef[];
|
|
170
|
+
}): RiddleProofProfileResult;
|
|
171
|
+
declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): string;
|
|
172
|
+
declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
|
|
173
|
+
declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
|
|
174
|
+
|
|
175
|
+
export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, type RiddleProofProfile, type RiddleProofProfileArtifactRef, type RiddleProofProfileBaselinePolicy, type RiddleProofProfileCheck, type RiddleProofProfileCheckResult, type RiddleProofProfileCheckType, type RiddleProofProfileEvidence, type RiddleProofProfileFailureAction, type RiddleProofProfileResult, type RiddleProofProfileRouteEvidence, type RiddleProofProfileRunner, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileTargetUrl, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
|
package/dist/profile.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
3
|
+
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|
|
4
|
+
RIDDLE_PROOF_PROFILE_RESULT_VERSION,
|
|
5
|
+
RIDDLE_PROOF_PROFILE_STATUSES,
|
|
6
|
+
RIDDLE_PROOF_PROFILE_VERSION,
|
|
7
|
+
assessRiddleProofProfileEvidence,
|
|
8
|
+
buildRiddleProofProfileScript,
|
|
9
|
+
collectRiddleProfileArtifactRefs,
|
|
10
|
+
createRiddleProofProfileConfigurationError,
|
|
11
|
+
createRiddleProofProfileEnvironmentBlockedResult,
|
|
12
|
+
createRiddleProofProfileInsufficientResult,
|
|
13
|
+
extractRiddleProofProfileResult,
|
|
14
|
+
normalizeRiddleProofProfile,
|
|
15
|
+
profileStatusExitCode,
|
|
16
|
+
resolveRiddleProofProfileTargetUrl,
|
|
17
|
+
slugifyRiddleProofProfileName,
|
|
18
|
+
summarizeRiddleProofProfileResult
|
|
19
|
+
} from "./chunk-7NMAU4DP.js";
|
|
20
|
+
export {
|
|
21
|
+
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
22
|
+
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|
|
23
|
+
RIDDLE_PROOF_PROFILE_RESULT_VERSION,
|
|
24
|
+
RIDDLE_PROOF_PROFILE_STATUSES,
|
|
25
|
+
RIDDLE_PROOF_PROFILE_VERSION,
|
|
26
|
+
assessRiddleProofProfileEvidence,
|
|
27
|
+
buildRiddleProofProfileScript,
|
|
28
|
+
collectRiddleProfileArtifactRefs,
|
|
29
|
+
createRiddleProofProfileConfigurationError,
|
|
30
|
+
createRiddleProofProfileEnvironmentBlockedResult,
|
|
31
|
+
createRiddleProofProfileInsufficientResult,
|
|
32
|
+
extractRiddleProofProfileResult,
|
|
33
|
+
normalizeRiddleProofProfile,
|
|
34
|
+
profileStatusExitCode,
|
|
35
|
+
resolveRiddleProofProfileTargetUrl,
|
|
36
|
+
slugifyRiddleProofProfileName,
|
|
37
|
+
summarizeRiddleProofProfileResult
|
|
38
|
+
};
|
package/dist/proof-run-core.cjs
CHANGED
|
@@ -42,6 +42,8 @@ __export(proof_run_core_exports, {
|
|
|
42
42
|
ensureStageLoopState: () => ensureStageLoopState,
|
|
43
43
|
invalidateVerifyEvidence: () => invalidateVerifyEvidence,
|
|
44
44
|
mergeStateFromParams: () => mergeStateFromParams,
|
|
45
|
+
noImplementationModeFor: () => noImplementationModeFor,
|
|
46
|
+
previewModeFromWorkflowMode: () => previewModeFromWorkflowMode,
|
|
45
47
|
readState: () => readState,
|
|
46
48
|
recordStageAttempt: () => recordStageAttempt,
|
|
47
49
|
requiredBaselineLabelsForState: () => requiredBaselineLabelsForState,
|
|
@@ -63,6 +65,25 @@ var import_node_path = __toESM(require("path"), 1);
|
|
|
63
65
|
var import_node_url = require("url");
|
|
64
66
|
var import_meta = {};
|
|
65
67
|
var WORKFLOW_STAGE_ORDER = ["setup", "recon", "author", "implement", "verify", "ship"];
|
|
68
|
+
function normalizedMode(value) {
|
|
69
|
+
return typeof value === "string" ? value.trim().toLowerCase() : "";
|
|
70
|
+
}
|
|
71
|
+
function previewModeFromWorkflowMode(value) {
|
|
72
|
+
const mode = normalizedMode(value);
|
|
73
|
+
return mode === "server" || mode === "static" ? mode : void 0;
|
|
74
|
+
}
|
|
75
|
+
function noImplementationModeInput(value) {
|
|
76
|
+
return value && typeof value === "object" ? value : {};
|
|
77
|
+
}
|
|
78
|
+
function noImplementationModeFor(params, state) {
|
|
79
|
+
const input = noImplementationModeInput(params);
|
|
80
|
+
const stateInput = noImplementationModeInput(state);
|
|
81
|
+
const mode = normalizedMode(input.mode ?? input.workflow_mode ?? stateInput.mode ?? stateInput.workflow_mode);
|
|
82
|
+
const implementationMode = normalizedMode(input.implementation_mode ?? stateInput.implementation_mode);
|
|
83
|
+
const requireDiff = input.require_diff ?? stateInput.require_diff;
|
|
84
|
+
const allowCodeChanges = input.allow_code_changes ?? stateInput.allow_code_changes;
|
|
85
|
+
return mode === "audit" || mode === "profile" || implementationMode === "none" || requireDiff === false || allowCodeChanges === false;
|
|
86
|
+
}
|
|
66
87
|
var CHECKPOINT_CONTRACT_VERSION = "riddle-proof-run.checkpoint.v1";
|
|
67
88
|
function currentDistDir() {
|
|
68
89
|
const meta = typeof import_meta === "object" ? import_meta : {};
|
|
@@ -155,7 +176,7 @@ function buildSetupArgs(params, config) {
|
|
|
155
176
|
allow_static_preview_fallback: params.allow_static_preview_fallback ? "true" : "",
|
|
156
177
|
context: params.context || "",
|
|
157
178
|
reviewer: params.reviewer || config.defaultReviewer,
|
|
158
|
-
mode: params.mode || "",
|
|
179
|
+
mode: previewModeFromWorkflowMode(params.mode) || "",
|
|
159
180
|
build_command: params.build_command || "npm run build",
|
|
160
181
|
build_output: params.build_output || "build",
|
|
161
182
|
server_image: params.server_image || "node:20-slim",
|
|
@@ -758,7 +779,8 @@ function mergeStateFromParams(statePath, params) {
|
|
|
758
779
|
"auth_cookies_json",
|
|
759
780
|
"auth_headers_json",
|
|
760
781
|
"proof_plan",
|
|
761
|
-
"implementation_notes"
|
|
782
|
+
"implementation_notes",
|
|
783
|
+
"implementation_mode"
|
|
762
784
|
];
|
|
763
785
|
for (const field of stringFields) {
|
|
764
786
|
if (params[field] !== void 0) {
|
|
@@ -773,7 +795,17 @@ function mergeStateFromParams(statePath, params) {
|
|
|
773
795
|
if (issues.length) state.implementation_environment_issues = issues;
|
|
774
796
|
}
|
|
775
797
|
if (params.reference !== void 0) state.reference = params.reference;
|
|
776
|
-
if (params.mode !== void 0)
|
|
798
|
+
if (params.mode !== void 0) {
|
|
799
|
+
const previewMode = previewModeFromWorkflowMode(params.mode);
|
|
800
|
+
if (previewMode) {
|
|
801
|
+
state.mode = previewMode;
|
|
802
|
+
} else {
|
|
803
|
+
state.workflow_mode = normalizeOptionalString(params.mode);
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
if (params.implementation_mode !== void 0) state.implementation_mode = normalizeOptionalString(params.implementation_mode);
|
|
807
|
+
if (params.require_diff !== void 0) state.require_diff = params.require_diff;
|
|
808
|
+
if (params.allow_code_changes !== void 0) state.allow_code_changes = params.allow_code_changes;
|
|
777
809
|
if (params.allow_static_preview_fallback !== void 0) {
|
|
778
810
|
state.allow_static_preview_fallback = params.allow_static_preview_fallback;
|
|
779
811
|
}
|
|
@@ -918,6 +950,11 @@ function summarizeState(state) {
|
|
|
918
950
|
repo: state.repo || null,
|
|
919
951
|
branch: state.branch || null,
|
|
920
952
|
mode: state.mode || null,
|
|
953
|
+
workflow_mode: state.workflow_mode || null,
|
|
954
|
+
implementation_mode: state.implementation_mode || null,
|
|
955
|
+
require_diff: state.require_diff ?? null,
|
|
956
|
+
allow_code_changes: state.allow_code_changes ?? null,
|
|
957
|
+
no_implementation_mode: noImplementationModeFor(state),
|
|
921
958
|
reference: state.reference || null,
|
|
922
959
|
before_ref: state.before_ref || null,
|
|
923
960
|
allow_static_preview_fallback: Boolean(state.allow_static_preview_fallback),
|
|
@@ -1015,6 +1052,8 @@ function summarizeState(state) {
|
|
|
1015
1052
|
ensureStageLoopState,
|
|
1016
1053
|
invalidateVerifyEvidence,
|
|
1017
1054
|
mergeStateFromParams,
|
|
1055
|
+
noImplementationModeFor,
|
|
1056
|
+
previewModeFromWorkflowMode,
|
|
1018
1057
|
readState,
|
|
1019
1058
|
recordStageAttempt,
|
|
1020
1059
|
requiredBaselineLabelsForState,
|
|
@@ -26,7 +26,10 @@ interface WorkflowParams {
|
|
|
26
26
|
allow_static_preview_fallback?: boolean;
|
|
27
27
|
context?: string;
|
|
28
28
|
reviewer?: string;
|
|
29
|
-
mode?: "server" | "static";
|
|
29
|
+
mode?: "server" | "static" | "audit" | (string & {});
|
|
30
|
+
implementation_mode?: "change" | "none" | (string & {});
|
|
31
|
+
require_diff?: boolean;
|
|
32
|
+
allow_code_changes?: boolean;
|
|
30
33
|
build_command?: string;
|
|
31
34
|
build_output?: string;
|
|
32
35
|
server_image?: string;
|
|
@@ -58,6 +61,8 @@ interface WorkflowParams {
|
|
|
58
61
|
update_base_checkout?: boolean;
|
|
59
62
|
advance_stage?: WorkflowStage;
|
|
60
63
|
}
|
|
64
|
+
declare function previewModeFromWorkflowMode(value: unknown): "server" | "static" | undefined;
|
|
65
|
+
declare function noImplementationModeFor(params?: unknown, state?: unknown): boolean;
|
|
61
66
|
interface PluginConfig {
|
|
62
67
|
riddleProofDir?: string;
|
|
63
68
|
statePath?: string;
|
|
@@ -115,7 +120,7 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
|
|
|
115
120
|
target_image_hash: string;
|
|
116
121
|
viewport_matrix_json: string;
|
|
117
122
|
deterministic_setup_json: string;
|
|
118
|
-
reference: "
|
|
123
|
+
reference: "prod" | "before" | "both";
|
|
119
124
|
base_branch: string;
|
|
120
125
|
before_ref: string;
|
|
121
126
|
allow_static_preview_fallback: string;
|
|
@@ -238,6 +243,11 @@ declare function summarizeState(state: any): {
|
|
|
238
243
|
repo: any;
|
|
239
244
|
branch: any;
|
|
240
245
|
mode: any;
|
|
246
|
+
workflow_mode: any;
|
|
247
|
+
implementation_mode: any;
|
|
248
|
+
require_diff: any;
|
|
249
|
+
allow_code_changes: any;
|
|
250
|
+
no_implementation_mode: boolean;
|
|
241
251
|
reference: any;
|
|
242
252
|
before_ref: any;
|
|
243
253
|
allow_static_preview_fallback: boolean;
|
|
@@ -306,4 +316,4 @@ declare function summarizeState(state: any): {
|
|
|
306
316
|
};
|
|
307
317
|
};
|
|
308
318
|
|
|
309
|
-
export { BUNDLED_RIDDLE_PROOF_DIR, CHECKPOINT_CONTRACT_VERSION, type CheckpointInputContract, type PluginConfig, RIDDLE_PROOF_DIR_CANDIDATES, type ShipGateValidation, WORKFLOW_STAGE_ORDER, type WorkflowAction, type WorkflowParams, type WorkflowStage, buildCheckpointContract, buildSetupArgs, checkpointContinueStage, clearStageDecisionRequest, ensureAction, ensureStageLoopState, invalidateVerifyEvidence, mergeStateFromParams, readState, recordStageAttempt, requiredBaselineLabelsForState, resolveConfig, resolveRiddleProofDir, setStageDecisionRequest, summarizeState, validateShipGate, visualDeltaForState, visualDeltaRequiredForState, visualDeltaShipGateReason, workflowFile, writeState };
|
|
319
|
+
export { BUNDLED_RIDDLE_PROOF_DIR, CHECKPOINT_CONTRACT_VERSION, type CheckpointInputContract, type PluginConfig, RIDDLE_PROOF_DIR_CANDIDATES, type ShipGateValidation, WORKFLOW_STAGE_ORDER, type WorkflowAction, type WorkflowParams, type WorkflowStage, buildCheckpointContract, buildSetupArgs, checkpointContinueStage, clearStageDecisionRequest, ensureAction, ensureStageLoopState, invalidateVerifyEvidence, mergeStateFromParams, noImplementationModeFor, previewModeFromWorkflowMode, readState, recordStageAttempt, requiredBaselineLabelsForState, resolveConfig, resolveRiddleProofDir, setStageDecisionRequest, summarizeState, validateShipGate, visualDeltaForState, visualDeltaRequiredForState, visualDeltaShipGateReason, workflowFile, writeState };
|
package/dist/proof-run-core.d.ts
CHANGED
|
@@ -26,7 +26,10 @@ interface WorkflowParams {
|
|
|
26
26
|
allow_static_preview_fallback?: boolean;
|
|
27
27
|
context?: string;
|
|
28
28
|
reviewer?: string;
|
|
29
|
-
mode?: "server" | "static";
|
|
29
|
+
mode?: "server" | "static" | "audit" | (string & {});
|
|
30
|
+
implementation_mode?: "change" | "none" | (string & {});
|
|
31
|
+
require_diff?: boolean;
|
|
32
|
+
allow_code_changes?: boolean;
|
|
30
33
|
build_command?: string;
|
|
31
34
|
build_output?: string;
|
|
32
35
|
server_image?: string;
|
|
@@ -58,6 +61,8 @@ interface WorkflowParams {
|
|
|
58
61
|
update_base_checkout?: boolean;
|
|
59
62
|
advance_stage?: WorkflowStage;
|
|
60
63
|
}
|
|
64
|
+
declare function previewModeFromWorkflowMode(value: unknown): "server" | "static" | undefined;
|
|
65
|
+
declare function noImplementationModeFor(params?: unknown, state?: unknown): boolean;
|
|
61
66
|
interface PluginConfig {
|
|
62
67
|
riddleProofDir?: string;
|
|
63
68
|
statePath?: string;
|
|
@@ -115,7 +120,7 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
|
|
|
115
120
|
target_image_hash: string;
|
|
116
121
|
viewport_matrix_json: string;
|
|
117
122
|
deterministic_setup_json: string;
|
|
118
|
-
reference: "
|
|
123
|
+
reference: "prod" | "before" | "both";
|
|
119
124
|
base_branch: string;
|
|
120
125
|
before_ref: string;
|
|
121
126
|
allow_static_preview_fallback: string;
|
|
@@ -238,6 +243,11 @@ declare function summarizeState(state: any): {
|
|
|
238
243
|
repo: any;
|
|
239
244
|
branch: any;
|
|
240
245
|
mode: any;
|
|
246
|
+
workflow_mode: any;
|
|
247
|
+
implementation_mode: any;
|
|
248
|
+
require_diff: any;
|
|
249
|
+
allow_code_changes: any;
|
|
250
|
+
no_implementation_mode: boolean;
|
|
241
251
|
reference: any;
|
|
242
252
|
before_ref: any;
|
|
243
253
|
allow_static_preview_fallback: boolean;
|
|
@@ -306,4 +316,4 @@ declare function summarizeState(state: any): {
|
|
|
306
316
|
};
|
|
307
317
|
};
|
|
308
318
|
|
|
309
|
-
export { BUNDLED_RIDDLE_PROOF_DIR, CHECKPOINT_CONTRACT_VERSION, type CheckpointInputContract, type PluginConfig, RIDDLE_PROOF_DIR_CANDIDATES, type ShipGateValidation, WORKFLOW_STAGE_ORDER, type WorkflowAction, type WorkflowParams, type WorkflowStage, buildCheckpointContract, buildSetupArgs, checkpointContinueStage, clearStageDecisionRequest, ensureAction, ensureStageLoopState, invalidateVerifyEvidence, mergeStateFromParams, readState, recordStageAttempt, requiredBaselineLabelsForState, resolveConfig, resolveRiddleProofDir, setStageDecisionRequest, summarizeState, validateShipGate, visualDeltaForState, visualDeltaRequiredForState, visualDeltaShipGateReason, workflowFile, writeState };
|
|
319
|
+
export { BUNDLED_RIDDLE_PROOF_DIR, CHECKPOINT_CONTRACT_VERSION, type CheckpointInputContract, type PluginConfig, RIDDLE_PROOF_DIR_CANDIDATES, type ShipGateValidation, WORKFLOW_STAGE_ORDER, type WorkflowAction, type WorkflowParams, type WorkflowStage, buildCheckpointContract, buildSetupArgs, checkpointContinueStage, clearStageDecisionRequest, ensureAction, ensureStageLoopState, invalidateVerifyEvidence, mergeStateFromParams, noImplementationModeFor, previewModeFromWorkflowMode, readState, recordStageAttempt, requiredBaselineLabelsForState, resolveConfig, resolveRiddleProofDir, setStageDecisionRequest, summarizeState, validateShipGate, visualDeltaForState, visualDeltaRequiredForState, visualDeltaShipGateReason, workflowFile, writeState };
|
package/dist/proof-run-core.js
CHANGED
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
ensureStageLoopState,
|
|
12
12
|
invalidateVerifyEvidence,
|
|
13
13
|
mergeStateFromParams,
|
|
14
|
+
noImplementationModeFor,
|
|
15
|
+
previewModeFromWorkflowMode,
|
|
14
16
|
readState,
|
|
15
17
|
recordStageAttempt,
|
|
16
18
|
requiredBaselineLabelsForState,
|
|
@@ -24,7 +26,7 @@ import {
|
|
|
24
26
|
visualDeltaShipGateReason,
|
|
25
27
|
workflowFile,
|
|
26
28
|
writeState
|
|
27
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-FPD2RF3Q.js";
|
|
28
30
|
export {
|
|
29
31
|
BUNDLED_RIDDLE_PROOF_DIR,
|
|
30
32
|
CHECKPOINT_CONTRACT_VERSION,
|
|
@@ -38,6 +40,8 @@ export {
|
|
|
38
40
|
ensureStageLoopState,
|
|
39
41
|
invalidateVerifyEvidence,
|
|
40
42
|
mergeStateFromParams,
|
|
43
|
+
noImplementationModeFor,
|
|
44
|
+
previewModeFromWorkflowMode,
|
|
41
45
|
readState,
|
|
42
46
|
recordStageAttempt,
|
|
43
47
|
requiredBaselineLabelsForState,
|