@riddledc/riddle-proof 0.5.53 → 0.5.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/basic-gameplay.cjs +255 -0
- package/dist/basic-gameplay.d.cts +117 -0
- package/dist/basic-gameplay.d.ts +117 -0
- package/dist/basic-gameplay.js +14 -0
- package/dist/checkpoint.cjs +2 -2
- package/dist/checkpoint.js +1 -1
- package/dist/{chunk-KYGWIA7A.js → chunk-2FBF2UDZ.js} +8 -8
- package/dist/{chunk-T5RHGGQ2.js → chunk-33XO42CY.js} +2 -2
- package/dist/{chunk-53UPEUVU.js → chunk-3UHWI3FO.js} +1 -1
- package/dist/{chunk-PVUZZ2P6.js → chunk-MO24D3PY.js} +2 -1
- package/dist/{chunk-4ASMX4R6.js → chunk-RFJ5BQF6.js} +1 -0
- package/dist/chunk-RNGJX62B.js +227 -0
- package/dist/{chunk-QBOKV3ES.js → chunk-RXFKKYWA.js} +1 -1
- package/dist/chunk-UR6ADV4Y.js +163 -0
- package/dist/cli.cjs +217 -12
- package/dist/cli.js +67 -10
- package/dist/engine-harness.cjs +4 -2
- package/dist/engine-harness.js +5 -5
- package/dist/index.cjs +409 -5
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +49 -13
- package/dist/openclaw.cjs +1 -0
- package/dist/openclaw.js +3 -3
- package/dist/proof-run-core.cjs +1 -0
- package/dist/proof-run-core.js +1 -1
- package/dist/proof-run-engine.cjs +1 -0
- package/dist/proof-run-engine.d.cts +3 -3
- package/dist/proof-run-engine.d.ts +3 -3
- package/dist/proof-run-engine.js +1 -1
- package/dist/riddle-client.cjs +207 -0
- package/dist/riddle-client.d.cts +71 -0
- package/dist/riddle-client.d.ts +71 -0
- package/dist/riddle-client.js +26 -0
- package/dist/run-card.js +2 -2
- package/dist/runner.cjs +1 -0
- package/dist/runner.js +4 -4
- package/dist/state.cjs +1 -0
- package/dist/state.js +3 -3
- package/dist/types.d.cts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +12 -2
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/basic-gameplay.ts
|
|
21
|
+
var basic_gameplay_exports = {};
|
|
22
|
+
__export(basic_gameplay_exports, {
|
|
23
|
+
RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION: () => RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION,
|
|
24
|
+
RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION: () => RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION,
|
|
25
|
+
assessBasicGameplayEvidence: () => assessBasicGameplayEvidence,
|
|
26
|
+
assessBasicGameplayRoute: () => assessBasicGameplayRoute,
|
|
27
|
+
extractBasicGameplayEvidence: () => extractBasicGameplayEvidence
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(basic_gameplay_exports);
|
|
30
|
+
var RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION = "riddle-proof.basic-gameplay.v1";
|
|
31
|
+
var RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION = "riddle-proof.basic-gameplay.assessment.v1";
|
|
32
|
+
var BASIC_GAMEPLAY_CONTAINER_KEYS = [
|
|
33
|
+
"basic_gameplay",
|
|
34
|
+
"basicGameplay",
|
|
35
|
+
"basic_gameplay_evidence",
|
|
36
|
+
"basicGameplayEvidence",
|
|
37
|
+
"gameplay_proof",
|
|
38
|
+
"gameplayProof"
|
|
39
|
+
];
|
|
40
|
+
function assessBasicGameplayEvidence(evidence, options = {}) {
|
|
41
|
+
const run = extractBasicGameplayEvidence(evidence);
|
|
42
|
+
if (!run) {
|
|
43
|
+
return {
|
|
44
|
+
version: RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION,
|
|
45
|
+
evidence_present: false,
|
|
46
|
+
passed: false,
|
|
47
|
+
checked_routes: 0,
|
|
48
|
+
passing_routes: 0,
|
|
49
|
+
failing_routes: [],
|
|
50
|
+
failure_counts: {},
|
|
51
|
+
warning_counts: {},
|
|
52
|
+
route_results: []
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
const routeResults = (run.results || []).map((route) => assessBasicGameplayRoute(route, options));
|
|
56
|
+
const failingRoutes = routeResults.filter((result) => !result.ok).map((result) => ({
|
|
57
|
+
name: result.name,
|
|
58
|
+
path: result.path,
|
|
59
|
+
failures: result.failures,
|
|
60
|
+
warnings: result.warnings
|
|
61
|
+
}));
|
|
62
|
+
return {
|
|
63
|
+
version: RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION,
|
|
64
|
+
evidence_present: true,
|
|
65
|
+
passed: failingRoutes.length === 0,
|
|
66
|
+
checked_routes: routeResults.length,
|
|
67
|
+
passing_routes: routeResults.filter((result) => result.ok).length,
|
|
68
|
+
failing_routes: failingRoutes,
|
|
69
|
+
failure_counts: countCodes(routeResults.flatMap((result) => result.failures)),
|
|
70
|
+
warning_counts: countCodes(routeResults.flatMap((result) => result.warnings)),
|
|
71
|
+
route_results: routeResults
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function assessBasicGameplayRoute(route, options = {}) {
|
|
75
|
+
const maxMobileOverflowPx = options.maxMobileOverflowPx ?? 4;
|
|
76
|
+
const minBodyTextLength = options.minBodyTextLength ?? 20;
|
|
77
|
+
const minVisibleLargeNodes = options.minVisibleLargeNodes ?? 3;
|
|
78
|
+
const minSurfaceLargeNodes = options.minSurfaceLargeNodes ?? 8;
|
|
79
|
+
const warnOnMissingResetPath = options.warnOnMissingResetPath ?? true;
|
|
80
|
+
const warnOnConsoleError = options.warnOnConsoleError ?? true;
|
|
81
|
+
const failOnConsoleError = options.failOnConsoleError ?? false;
|
|
82
|
+
const failures = [];
|
|
83
|
+
const warnings = [];
|
|
84
|
+
const initial = route.initial || {};
|
|
85
|
+
const timed = route.timed || {};
|
|
86
|
+
const afterAction = route.after_action || route.afterAction || {};
|
|
87
|
+
const mobile = route.mobile || {};
|
|
88
|
+
const timedChange = changed(initial, timed);
|
|
89
|
+
const actionChange = changed(timed, afterAction);
|
|
90
|
+
const surfaceVisible = numberValue(initial.visible_canvas_count) > 0 || numberValue(initial.enabled_clickable_count) > 0 || numberValue(initial.visible_large_node_count) >= minSurfaceLargeNodes;
|
|
91
|
+
const actionResults = listValue(route.action_results || route.actionResults);
|
|
92
|
+
const actionAttempted = actionResults.some((result) => result.ok === true && result.action !== "wait");
|
|
93
|
+
const actionFailed = actionResults.some((result) => result.ok === false && result.action !== "wait");
|
|
94
|
+
const stateChangeObserved = actionChange.changed || timedChange.changed;
|
|
95
|
+
const resetPathPresent = numberValue(initial.reset_control_count) > 0 || numberValue(timed.reset_control_count) > 0 || numberValue(afterAction.reset_control_count) > 0;
|
|
96
|
+
const responseStatus = firstNumber(route.http_status, route.response_status, route.status);
|
|
97
|
+
const pageErrorCount = numberValue(route.page_error_count);
|
|
98
|
+
const consoleErrorCount = numberValue(route.console_error_count);
|
|
99
|
+
const mobileOverflowPx = numberValue(mobile.overflow_px);
|
|
100
|
+
if (responseStatus !== null && responseStatus >= 400) failures.push("route_http_error");
|
|
101
|
+
if (pageErrorCount > 0) failures.push("fatal_page_error");
|
|
102
|
+
if (numberValue(initial.body_text_length) < minBodyTextLength && numberValue(initial.visible_large_node_count) < minVisibleLargeNodes) {
|
|
103
|
+
failures.push("route_blank_or_thin");
|
|
104
|
+
}
|
|
105
|
+
if (!surfaceVisible) failures.push("no_game_surface");
|
|
106
|
+
if (mobileOverflowPx > maxMobileOverflowPx) failures.push("mobile_horizontal_overflow");
|
|
107
|
+
if (!actionAttempted && !timedChange.changed) failures.push("primary_control_missing");
|
|
108
|
+
if (actionAttempted && !stateChangeObserved) failures.push("primary_control_inert");
|
|
109
|
+
if (failOnConsoleError && consoleErrorCount > 0) failures.push("fatal_page_error");
|
|
110
|
+
if (numberValue(initial.visible_canvas_count) > 0 && actionAttempted && !timedChange.canvas_changed && !actionChange.canvas_changed && !actionChange.screenshot_changed) {
|
|
111
|
+
warnings.push("canvas_inert");
|
|
112
|
+
}
|
|
113
|
+
if (actionFailed) warnings.push("some_actions_failed");
|
|
114
|
+
if (warnOnMissingResetPath && !resetPathPresent && route.requires_reset !== false && actionAttempted && stateChangeObserved) {
|
|
115
|
+
warnings.push("missing_reset_path");
|
|
116
|
+
}
|
|
117
|
+
if (warnOnConsoleError && consoleErrorCount > 0) warnings.push("critical_console_error");
|
|
118
|
+
return {
|
|
119
|
+
name: route.name,
|
|
120
|
+
path: route.path,
|
|
121
|
+
ok: failures.length === 0,
|
|
122
|
+
failures,
|
|
123
|
+
warnings,
|
|
124
|
+
signals: {
|
|
125
|
+
route_loaded: !failures.includes("route_http_error") && !failures.includes("route_blank_or_thin"),
|
|
126
|
+
surface_visible: surfaceVisible,
|
|
127
|
+
action_attempted: actionAttempted,
|
|
128
|
+
timed_progression_observed: timedChange.changed,
|
|
129
|
+
first_interaction_observed: actionChange.changed,
|
|
130
|
+
state_change_observed: stateChangeObserved,
|
|
131
|
+
mobile_overflow_absent: mobileOverflowPx <= maxMobileOverflowPx,
|
|
132
|
+
reset_path_present: resetPathPresent,
|
|
133
|
+
fatal_errors_absent: pageErrorCount === 0
|
|
134
|
+
},
|
|
135
|
+
diffs: {
|
|
136
|
+
timed: timedChange,
|
|
137
|
+
after_action: actionChange
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function extractBasicGameplayEvidence(...sources) {
|
|
142
|
+
const seen = /* @__PURE__ */ new Set();
|
|
143
|
+
for (const source of sources) {
|
|
144
|
+
const found = findBasicGameplayEvidence(source, seen);
|
|
145
|
+
if (found) return found;
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
function findBasicGameplayEvidence(value, seen, depth = 0) {
|
|
150
|
+
if (depth > 6 || value === null || value === void 0) return null;
|
|
151
|
+
if (typeof value === "string") {
|
|
152
|
+
const parsed = parseJson(value);
|
|
153
|
+
return parsed === null ? null : findBasicGameplayEvidence(parsed, seen, depth + 1);
|
|
154
|
+
}
|
|
155
|
+
if (Array.isArray(value)) {
|
|
156
|
+
if (seen.has(value)) return null;
|
|
157
|
+
seen.add(value);
|
|
158
|
+
if (value.some((item) => hasRouteShape(recordValue(item)))) {
|
|
159
|
+
return { results: value.filter((item) => hasRouteShape(recordValue(item))) };
|
|
160
|
+
}
|
|
161
|
+
for (const item of value) {
|
|
162
|
+
const found = findBasicGameplayEvidence(item, seen, depth + 1);
|
|
163
|
+
if (found) return found;
|
|
164
|
+
}
|
|
165
|
+
return null;
|
|
166
|
+
}
|
|
167
|
+
const record = recordValue(value);
|
|
168
|
+
if (!record || seen.has(record)) return null;
|
|
169
|
+
seen.add(record);
|
|
170
|
+
if (record.version === RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION || Array.isArray(record.results)) {
|
|
171
|
+
return {
|
|
172
|
+
...record,
|
|
173
|
+
results: listValue(record.results).filter((item) => Boolean(recordValue(item)))
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
if (hasRouteShape(record)) {
|
|
177
|
+
return { results: [record] };
|
|
178
|
+
}
|
|
179
|
+
for (const key of BASIC_GAMEPLAY_CONTAINER_KEYS) {
|
|
180
|
+
if (Object.prototype.hasOwnProperty.call(record, key)) {
|
|
181
|
+
const nested = findBasicGameplayEvidence(record[key], seen, depth + 1);
|
|
182
|
+
if (nested) return nested;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
for (const item of Object.values(record)) {
|
|
186
|
+
const found = findBasicGameplayEvidence(item, seen, depth + 1);
|
|
187
|
+
if (found) return found;
|
|
188
|
+
}
|
|
189
|
+
return null;
|
|
190
|
+
}
|
|
191
|
+
function hasRouteShape(record) {
|
|
192
|
+
return Boolean(record && (record.initial || record.after_action || record.afterAction || record.action_results || record.actionResults) && (record.path || record.name));
|
|
193
|
+
}
|
|
194
|
+
function changed(before, after) {
|
|
195
|
+
const bodyTextChanged = Boolean(before.body_text_hash && after.body_text_hash && before.body_text_hash !== after.body_text_hash);
|
|
196
|
+
const screenshotChanged = Boolean(before.screenshot_hash && after.screenshot_hash && before.screenshot_hash !== after.screenshot_hash);
|
|
197
|
+
const beforeCanvasHashes = canvasHashes(before.canvases);
|
|
198
|
+
const afterCanvasHashes = canvasHashes(after.canvases);
|
|
199
|
+
const canvasChanged = Boolean(beforeCanvasHashes && afterCanvasHashes && beforeCanvasHashes !== afterCanvasHashes);
|
|
200
|
+
return {
|
|
201
|
+
body_text_changed: bodyTextChanged,
|
|
202
|
+
screenshot_changed: screenshotChanged,
|
|
203
|
+
canvas_changed: canvasChanged,
|
|
204
|
+
changed: bodyTextChanged || screenshotChanged || canvasChanged
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function canvasHashes(canvases) {
|
|
208
|
+
return (canvases || []).map((canvas) => canvas.hash).filter(Boolean).join("|");
|
|
209
|
+
}
|
|
210
|
+
function countCodes(codes) {
|
|
211
|
+
const counts = {};
|
|
212
|
+
for (const code of codes) counts[code] = (counts[code] || 0) + 1;
|
|
213
|
+
return counts;
|
|
214
|
+
}
|
|
215
|
+
function firstNumber(...values) {
|
|
216
|
+
for (const value of values) {
|
|
217
|
+
const number = numericValue(value);
|
|
218
|
+
if (number !== null) return number;
|
|
219
|
+
}
|
|
220
|
+
return null;
|
|
221
|
+
}
|
|
222
|
+
function numberValue(value) {
|
|
223
|
+
return numericValue(value) ?? 0;
|
|
224
|
+
}
|
|
225
|
+
function numericValue(value) {
|
|
226
|
+
if (typeof value === "number" && Number.isFinite(value)) return value;
|
|
227
|
+
if (typeof value === "string" && value.trim()) {
|
|
228
|
+
const parsed = Number(value);
|
|
229
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
230
|
+
}
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
function recordValue(value) {
|
|
234
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
235
|
+
}
|
|
236
|
+
function listValue(value) {
|
|
237
|
+
return Array.isArray(value) ? value : [];
|
|
238
|
+
}
|
|
239
|
+
function parseJson(value) {
|
|
240
|
+
const trimmed = value.trim();
|
|
241
|
+
if (!trimmed || !/^[{[]/.test(trimmed)) return null;
|
|
242
|
+
try {
|
|
243
|
+
return JSON.parse(trimmed);
|
|
244
|
+
} catch {
|
|
245
|
+
return null;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
249
|
+
0 && (module.exports = {
|
|
250
|
+
RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION,
|
|
251
|
+
RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION,
|
|
252
|
+
assessBasicGameplayEvidence,
|
|
253
|
+
assessBasicGameplayRoute,
|
|
254
|
+
extractBasicGameplayEvidence
|
|
255
|
+
});
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
declare const RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION = "riddle-proof.basic-gameplay.v1";
|
|
2
|
+
declare const RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION = "riddle-proof.basic-gameplay.assessment.v1";
|
|
3
|
+
type BasicGameplayFailureCode = "route_http_error" | "fatal_page_error" | "route_blank_or_thin" | "no_game_surface" | "mobile_horizontal_overflow" | "primary_control_missing" | "primary_control_inert";
|
|
4
|
+
type BasicGameplayWarningCode = "canvas_inert" | "some_actions_failed" | "missing_reset_path" | "critical_console_error";
|
|
5
|
+
interface BasicGameplayCanvasState {
|
|
6
|
+
index?: number;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
css_width?: number;
|
|
10
|
+
css_height?: number;
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
readable?: boolean;
|
|
13
|
+
hash?: string | null;
|
|
14
|
+
}
|
|
15
|
+
interface BasicGameplaySnapshot {
|
|
16
|
+
screenshot_hash?: string | null;
|
|
17
|
+
body_text_hash?: string | null;
|
|
18
|
+
body_text_length?: number;
|
|
19
|
+
visible_large_node_count?: number;
|
|
20
|
+
enabled_clickable_count?: number;
|
|
21
|
+
reset_control_count?: number;
|
|
22
|
+
visible_canvas_count?: number;
|
|
23
|
+
canvases?: BasicGameplayCanvasState[];
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
interface BasicGameplayActionResult {
|
|
27
|
+
ok?: boolean;
|
|
28
|
+
action?: string;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
interface BasicGameplayMobileEvidence {
|
|
32
|
+
overflow_px?: number;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
interface RiddleProofBasicGameplayRouteEvidence {
|
|
36
|
+
name?: string;
|
|
37
|
+
path?: string;
|
|
38
|
+
http_status?: number | null;
|
|
39
|
+
response_status?: number | null;
|
|
40
|
+
status?: number | null;
|
|
41
|
+
console_error_count?: number;
|
|
42
|
+
page_error_count?: number;
|
|
43
|
+
initial?: BasicGameplaySnapshot;
|
|
44
|
+
timed?: BasicGameplaySnapshot;
|
|
45
|
+
after_action?: BasicGameplaySnapshot;
|
|
46
|
+
afterAction?: BasicGameplaySnapshot;
|
|
47
|
+
mobile?: BasicGameplayMobileEvidence;
|
|
48
|
+
action_results?: BasicGameplayActionResult[];
|
|
49
|
+
actionResults?: BasicGameplayActionResult[];
|
|
50
|
+
requires_reset?: boolean;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
interface RiddleProofBasicGameplayEvidence {
|
|
54
|
+
version?: typeof RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION | string;
|
|
55
|
+
site?: string | null;
|
|
56
|
+
base_url?: string;
|
|
57
|
+
results?: RiddleProofBasicGameplayRouteEvidence[];
|
|
58
|
+
[key: string]: unknown;
|
|
59
|
+
}
|
|
60
|
+
interface AssessBasicGameplayOptions {
|
|
61
|
+
maxMobileOverflowPx?: number;
|
|
62
|
+
minBodyTextLength?: number;
|
|
63
|
+
minVisibleLargeNodes?: number;
|
|
64
|
+
minSurfaceLargeNodes?: number;
|
|
65
|
+
warnOnMissingResetPath?: boolean;
|
|
66
|
+
warnOnConsoleError?: boolean;
|
|
67
|
+
failOnConsoleError?: boolean;
|
|
68
|
+
}
|
|
69
|
+
interface BasicGameplayChangeSummary {
|
|
70
|
+
body_text_changed: boolean;
|
|
71
|
+
screenshot_changed: boolean;
|
|
72
|
+
canvas_changed: boolean;
|
|
73
|
+
changed: boolean;
|
|
74
|
+
}
|
|
75
|
+
interface RiddleProofBasicGameplayRouteAssessment {
|
|
76
|
+
name?: string;
|
|
77
|
+
path?: string;
|
|
78
|
+
ok: boolean;
|
|
79
|
+
failures: BasicGameplayFailureCode[];
|
|
80
|
+
warnings: BasicGameplayWarningCode[];
|
|
81
|
+
signals: {
|
|
82
|
+
route_loaded: boolean;
|
|
83
|
+
surface_visible: boolean;
|
|
84
|
+
action_attempted: boolean;
|
|
85
|
+
timed_progression_observed: boolean;
|
|
86
|
+
first_interaction_observed: boolean;
|
|
87
|
+
state_change_observed: boolean;
|
|
88
|
+
mobile_overflow_absent: boolean;
|
|
89
|
+
reset_path_present: boolean;
|
|
90
|
+
fatal_errors_absent: boolean;
|
|
91
|
+
};
|
|
92
|
+
diffs: {
|
|
93
|
+
timed: BasicGameplayChangeSummary;
|
|
94
|
+
after_action: BasicGameplayChangeSummary;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
interface RiddleProofBasicGameplayAssessment {
|
|
98
|
+
version: typeof RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION;
|
|
99
|
+
evidence_present: boolean;
|
|
100
|
+
passed: boolean;
|
|
101
|
+
checked_routes: number;
|
|
102
|
+
passing_routes: number;
|
|
103
|
+
failing_routes: Array<{
|
|
104
|
+
name?: string;
|
|
105
|
+
path?: string;
|
|
106
|
+
failures: BasicGameplayFailureCode[];
|
|
107
|
+
warnings: BasicGameplayWarningCode[];
|
|
108
|
+
}>;
|
|
109
|
+
failure_counts: Record<string, number>;
|
|
110
|
+
warning_counts: Record<string, number>;
|
|
111
|
+
route_results: RiddleProofBasicGameplayRouteAssessment[];
|
|
112
|
+
}
|
|
113
|
+
declare function assessBasicGameplayEvidence(evidence: unknown, options?: AssessBasicGameplayOptions): RiddleProofBasicGameplayAssessment;
|
|
114
|
+
declare function assessBasicGameplayRoute(route: RiddleProofBasicGameplayRouteEvidence, options?: AssessBasicGameplayOptions): RiddleProofBasicGameplayRouteAssessment;
|
|
115
|
+
declare function extractBasicGameplayEvidence(...sources: unknown[]): RiddleProofBasicGameplayEvidence | null;
|
|
116
|
+
|
|
117
|
+
export { type AssessBasicGameplayOptions, type BasicGameplayActionResult, type BasicGameplayCanvasState, type BasicGameplayChangeSummary, type BasicGameplayFailureCode, type BasicGameplayMobileEvidence, type BasicGameplaySnapshot, type BasicGameplayWarningCode, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, type RiddleProofBasicGameplayAssessment, type RiddleProofBasicGameplayEvidence, type RiddleProofBasicGameplayRouteAssessment, type RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayRoute, extractBasicGameplayEvidence };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
declare const RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION = "riddle-proof.basic-gameplay.v1";
|
|
2
|
+
declare const RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION = "riddle-proof.basic-gameplay.assessment.v1";
|
|
3
|
+
type BasicGameplayFailureCode = "route_http_error" | "fatal_page_error" | "route_blank_or_thin" | "no_game_surface" | "mobile_horizontal_overflow" | "primary_control_missing" | "primary_control_inert";
|
|
4
|
+
type BasicGameplayWarningCode = "canvas_inert" | "some_actions_failed" | "missing_reset_path" | "critical_console_error";
|
|
5
|
+
interface BasicGameplayCanvasState {
|
|
6
|
+
index?: number;
|
|
7
|
+
width?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
css_width?: number;
|
|
10
|
+
css_height?: number;
|
|
11
|
+
visible?: boolean;
|
|
12
|
+
readable?: boolean;
|
|
13
|
+
hash?: string | null;
|
|
14
|
+
}
|
|
15
|
+
interface BasicGameplaySnapshot {
|
|
16
|
+
screenshot_hash?: string | null;
|
|
17
|
+
body_text_hash?: string | null;
|
|
18
|
+
body_text_length?: number;
|
|
19
|
+
visible_large_node_count?: number;
|
|
20
|
+
enabled_clickable_count?: number;
|
|
21
|
+
reset_control_count?: number;
|
|
22
|
+
visible_canvas_count?: number;
|
|
23
|
+
canvases?: BasicGameplayCanvasState[];
|
|
24
|
+
[key: string]: unknown;
|
|
25
|
+
}
|
|
26
|
+
interface BasicGameplayActionResult {
|
|
27
|
+
ok?: boolean;
|
|
28
|
+
action?: string;
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
}
|
|
31
|
+
interface BasicGameplayMobileEvidence {
|
|
32
|
+
overflow_px?: number;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
interface RiddleProofBasicGameplayRouteEvidence {
|
|
36
|
+
name?: string;
|
|
37
|
+
path?: string;
|
|
38
|
+
http_status?: number | null;
|
|
39
|
+
response_status?: number | null;
|
|
40
|
+
status?: number | null;
|
|
41
|
+
console_error_count?: number;
|
|
42
|
+
page_error_count?: number;
|
|
43
|
+
initial?: BasicGameplaySnapshot;
|
|
44
|
+
timed?: BasicGameplaySnapshot;
|
|
45
|
+
after_action?: BasicGameplaySnapshot;
|
|
46
|
+
afterAction?: BasicGameplaySnapshot;
|
|
47
|
+
mobile?: BasicGameplayMobileEvidence;
|
|
48
|
+
action_results?: BasicGameplayActionResult[];
|
|
49
|
+
actionResults?: BasicGameplayActionResult[];
|
|
50
|
+
requires_reset?: boolean;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
interface RiddleProofBasicGameplayEvidence {
|
|
54
|
+
version?: typeof RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION | string;
|
|
55
|
+
site?: string | null;
|
|
56
|
+
base_url?: string;
|
|
57
|
+
results?: RiddleProofBasicGameplayRouteEvidence[];
|
|
58
|
+
[key: string]: unknown;
|
|
59
|
+
}
|
|
60
|
+
interface AssessBasicGameplayOptions {
|
|
61
|
+
maxMobileOverflowPx?: number;
|
|
62
|
+
minBodyTextLength?: number;
|
|
63
|
+
minVisibleLargeNodes?: number;
|
|
64
|
+
minSurfaceLargeNodes?: number;
|
|
65
|
+
warnOnMissingResetPath?: boolean;
|
|
66
|
+
warnOnConsoleError?: boolean;
|
|
67
|
+
failOnConsoleError?: boolean;
|
|
68
|
+
}
|
|
69
|
+
interface BasicGameplayChangeSummary {
|
|
70
|
+
body_text_changed: boolean;
|
|
71
|
+
screenshot_changed: boolean;
|
|
72
|
+
canvas_changed: boolean;
|
|
73
|
+
changed: boolean;
|
|
74
|
+
}
|
|
75
|
+
interface RiddleProofBasicGameplayRouteAssessment {
|
|
76
|
+
name?: string;
|
|
77
|
+
path?: string;
|
|
78
|
+
ok: boolean;
|
|
79
|
+
failures: BasicGameplayFailureCode[];
|
|
80
|
+
warnings: BasicGameplayWarningCode[];
|
|
81
|
+
signals: {
|
|
82
|
+
route_loaded: boolean;
|
|
83
|
+
surface_visible: boolean;
|
|
84
|
+
action_attempted: boolean;
|
|
85
|
+
timed_progression_observed: boolean;
|
|
86
|
+
first_interaction_observed: boolean;
|
|
87
|
+
state_change_observed: boolean;
|
|
88
|
+
mobile_overflow_absent: boolean;
|
|
89
|
+
reset_path_present: boolean;
|
|
90
|
+
fatal_errors_absent: boolean;
|
|
91
|
+
};
|
|
92
|
+
diffs: {
|
|
93
|
+
timed: BasicGameplayChangeSummary;
|
|
94
|
+
after_action: BasicGameplayChangeSummary;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
interface RiddleProofBasicGameplayAssessment {
|
|
98
|
+
version: typeof RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION;
|
|
99
|
+
evidence_present: boolean;
|
|
100
|
+
passed: boolean;
|
|
101
|
+
checked_routes: number;
|
|
102
|
+
passing_routes: number;
|
|
103
|
+
failing_routes: Array<{
|
|
104
|
+
name?: string;
|
|
105
|
+
path?: string;
|
|
106
|
+
failures: BasicGameplayFailureCode[];
|
|
107
|
+
warnings: BasicGameplayWarningCode[];
|
|
108
|
+
}>;
|
|
109
|
+
failure_counts: Record<string, number>;
|
|
110
|
+
warning_counts: Record<string, number>;
|
|
111
|
+
route_results: RiddleProofBasicGameplayRouteAssessment[];
|
|
112
|
+
}
|
|
113
|
+
declare function assessBasicGameplayEvidence(evidence: unknown, options?: AssessBasicGameplayOptions): RiddleProofBasicGameplayAssessment;
|
|
114
|
+
declare function assessBasicGameplayRoute(route: RiddleProofBasicGameplayRouteEvidence, options?: AssessBasicGameplayOptions): RiddleProofBasicGameplayRouteAssessment;
|
|
115
|
+
declare function extractBasicGameplayEvidence(...sources: unknown[]): RiddleProofBasicGameplayEvidence | null;
|
|
116
|
+
|
|
117
|
+
export { type AssessBasicGameplayOptions, type BasicGameplayActionResult, type BasicGameplayCanvasState, type BasicGameplayChangeSummary, type BasicGameplayFailureCode, type BasicGameplayMobileEvidence, type BasicGameplaySnapshot, type BasicGameplayWarningCode, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, type RiddleProofBasicGameplayAssessment, type RiddleProofBasicGameplayEvidence, type RiddleProofBasicGameplayRouteAssessment, type RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayRoute, extractBasicGameplayEvidence };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION,
|
|
3
|
+
RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION,
|
|
4
|
+
assessBasicGameplayEvidence,
|
|
5
|
+
assessBasicGameplayRoute,
|
|
6
|
+
extractBasicGameplayEvidence
|
|
7
|
+
} from "./chunk-RNGJX62B.js";
|
|
8
|
+
export {
|
|
9
|
+
RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION,
|
|
10
|
+
RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION,
|
|
11
|
+
assessBasicGameplayEvidence,
|
|
12
|
+
assessBasicGameplayRoute,
|
|
13
|
+
extractBasicGameplayEvidence
|
|
14
|
+
};
|
package/dist/checkpoint.cjs
CHANGED
|
@@ -499,8 +499,8 @@ function buildProofAssessmentCheckpointPacket(input) {
|
|
|
499
499
|
const artifactContract = recordValue(proofAssessmentRequest.artifact_contract) || recordValue(bundle?.artifact_contract);
|
|
500
500
|
const requiredSignals = recordValue(recordValue(artifactContract)?.required);
|
|
501
501
|
const visualDelta = visualDeltaFromState(fullState);
|
|
502
|
-
const verificationMode = nonEmptyString(
|
|
503
|
-
const visualDeltaRequired = requiredSignals?.visual_delta === true || verificationModeRequiresVisualDelta(verificationMode);
|
|
502
|
+
const verificationMode = nonEmptyString(bundle?.verification_mode) || nonEmptyString(fullState.verification_mode) || nonEmptyString(input.request.verification_mode) || "proof";
|
|
503
|
+
const visualDeltaRequired = requiredSignals?.visual_delta !== false && (requiredSignals?.visual_delta === true || verificationModeRequiresVisualDelta(verificationMode));
|
|
504
504
|
const evidenceIssueCode = visualDeltaIssueCode(visualDelta, visualDeltaRequired);
|
|
505
505
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.verify_summary) || "Verify captured evidence and needs a supervising proof assessment.";
|
|
506
506
|
const recoveryHint = evidenceIssueCode ? "Required visual_delta evidence is incomplete. Keep this same run in verify/evidence recovery with decision=revise_capture and continue_with_stage=verify unless the evidence proves an implementation or recon problem." : "Assess whether the current artifacts prove the requested change, then choose the next stage.";
|
package/dist/checkpoint.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
normalizeCheckpointResponse,
|
|
14
14
|
proofContractFromAuthorCheckpointResponse,
|
|
15
15
|
statePathsForRunState
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-33XO42CY.js";
|
|
17
17
|
import "./chunk-DUFDZJOF.js";
|
|
18
18
|
export {
|
|
19
19
|
RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
visualDeltaForState,
|
|
3
|
-
visualDeltaRequiredForState,
|
|
4
|
-
visualDeltaShipGateReason
|
|
5
|
-
} from "./chunk-4ASMX4R6.js";
|
|
6
1
|
import {
|
|
7
2
|
appendRunEvent,
|
|
8
3
|
appendStageHeartbeat,
|
|
@@ -10,10 +5,15 @@ import {
|
|
|
10
5
|
createRunStatusSnapshot,
|
|
11
6
|
normalizeRunParams,
|
|
12
7
|
setRunStatus
|
|
13
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MO24D3PY.js";
|
|
9
|
+
import {
|
|
10
|
+
visualDeltaForState,
|
|
11
|
+
visualDeltaRequiredForState,
|
|
12
|
+
visualDeltaShipGateReason
|
|
13
|
+
} from "./chunk-RFJ5BQF6.js";
|
|
14
14
|
import {
|
|
15
15
|
createRiddleProofRunCard
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3UHWI3FO.js";
|
|
17
17
|
import {
|
|
18
18
|
authorPacketPayloadFromCheckpointResponse,
|
|
19
19
|
buildCheckpointPacketForEngineResult,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
normalizeCheckpointResponse,
|
|
24
24
|
proofContractFromAuthorCheckpointResponse,
|
|
25
25
|
statePathsForRunState
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-33XO42CY.js";
|
|
27
27
|
import {
|
|
28
28
|
applyTerminalMetadata,
|
|
29
29
|
compactRecord,
|
|
@@ -445,8 +445,8 @@ function buildProofAssessmentCheckpointPacket(input) {
|
|
|
445
445
|
const artifactContract = recordValue(proofAssessmentRequest.artifact_contract) || recordValue(bundle?.artifact_contract);
|
|
446
446
|
const requiredSignals = recordValue(recordValue(artifactContract)?.required);
|
|
447
447
|
const visualDelta = visualDeltaFromState(fullState);
|
|
448
|
-
const verificationMode = nonEmptyString(
|
|
449
|
-
const visualDeltaRequired = requiredSignals?.visual_delta === true || verificationModeRequiresVisualDelta(verificationMode);
|
|
448
|
+
const verificationMode = nonEmptyString(bundle?.verification_mode) || nonEmptyString(fullState.verification_mode) || nonEmptyString(input.request.verification_mode) || "proof";
|
|
449
|
+
const visualDeltaRequired = requiredSignals?.visual_delta !== false && (requiredSignals?.visual_delta === true || verificationModeRequiresVisualDelta(verificationMode));
|
|
450
450
|
const evidenceIssueCode = visualDeltaIssueCode(visualDelta, visualDeltaRequired);
|
|
451
451
|
const summary = nonEmptyString(input.engineResult.summary) || nonEmptyString(fullState.verify_summary) || "Verify captured evidence and needs a supervising proof assessment.";
|
|
452
452
|
const recoveryHint = evidenceIssueCode ? "Required visual_delta evidence is incomplete. Keep this same run in verify/evidence recovery with decision=revise_capture and continue_with_stage=verify unless the evidence proves an implementation or recon problem." : "Assess whether the current artifacts prove the requested change, then choose the next stage.";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRiddleProofRunCard
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3UHWI3FO.js";
|
|
4
4
|
import {
|
|
5
5
|
compactRecord,
|
|
6
6
|
isTerminalStatus,
|
|
@@ -108,6 +108,7 @@ function normalizeRunParams(input) {
|
|
|
108
108
|
leave_draft: input.leave_draft,
|
|
109
109
|
engine_state_path: input.engine_state_path,
|
|
110
110
|
harness_state_path: input.harness_state_path,
|
|
111
|
+
riddle_engine_module_url: input.riddle_engine_module_url,
|
|
111
112
|
max_iterations: input.max_iterations,
|
|
112
113
|
auto_approve: input.auto_approve,
|
|
113
114
|
dry_run: input.dry_run,
|
|
@@ -355,6 +355,7 @@ function visualDeltaRequiredForState(state = {}) {
|
|
|
355
355
|
const bundle = objectValue(state?.evidence_bundle);
|
|
356
356
|
const contract = objectValue(bundle.artifact_contract);
|
|
357
357
|
const required = objectValue(contract.required);
|
|
358
|
+
if (required.visual_delta === false) return false;
|
|
358
359
|
return required.visual_delta === true || VISUAL_FIRST_MODES.has(normalizedVerificationMode(state));
|
|
359
360
|
}
|
|
360
361
|
function visualDeltaForState(state = {}) {
|