@riddledc/riddle-proof 0.7.5 → 0.7.6

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.
@@ -62,6 +62,8 @@ var BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES = [
62
62
  "selector_text_matches",
63
63
  "number_increases",
64
64
  "number_decreases",
65
+ "number_at_least",
66
+ "number_gte",
65
67
  "number_unchanged",
66
68
  "number_stays_equal",
67
69
  "number_equals",
@@ -147,10 +149,12 @@ function assessBasicGameplayRoute(route, options = {}) {
147
149
  const actionChange = changed(timed, afterAction);
148
150
  const surfaceVisible = numberValue(initial.visible_canvas_count) > 0 || numberValue(initial.enabled_clickable_count) > 0 || numberValue(initial.visible_large_node_count) >= minSurfaceLargeNodes;
149
151
  const actionResults = listValue(route.action_results || route.actionResults);
152
+ const restartActionResults = listValue(route.restart_action_results || route.restartActionResults);
150
153
  const actionAttempted = actionResults.some((result) => result.ok === true && result.action !== "wait");
151
154
  const actionFailed = actionResults.some((result) => result.ok === false && result.action !== "wait");
155
+ const restartActionAttempted = restartActionResults.some((result) => result.ok === true && result.action !== "wait");
152
156
  const stateChangeObserved = actionChange.changed || timedChange.changed;
153
- const resetPathPresent = numberValue(initial.reset_control_count) > 0 || numberValue(timed.reset_control_count) > 0 || numberValue(afterAction.reset_control_count) > 0;
157
+ const resetPathPresent = numberValue(initial.reset_control_count) > 0 || numberValue(timed.reset_control_count) > 0 || numberValue(afterAction.reset_control_count) > 0 || restartActionAttempted;
154
158
  const responseStatus = firstNumber(route.http_status, route.response_status, route.status);
155
159
  const pageErrorCount = numberValue(route.page_error_count);
156
160
  const consoleErrorCount = numberValue(route.console_error_count);
@@ -245,6 +249,11 @@ function assessBasicGameplayProgressionCheck(check) {
245
249
  } else if (type === "number_decreases") {
246
250
  ok = numericValue(before?.number) !== null && numericValue(after?.number) !== null && numberValue(after?.number) < numberValue(before?.number);
247
251
  reason = ok ? null : "number_did_not_decrease";
252
+ } else if (type === "number_at_least" || type === "number_gte") {
253
+ const min = numericValue(check.min ?? check.expected ?? check.value);
254
+ if (min === null && hasExplicitResult) return resolveBasicGameplayProgressionCheckWithArtifactScreenshots({ ...check, ok, reason });
255
+ ok = numericValue(after?.number) !== null && min !== null && numberValue(after?.number) >= min;
256
+ reason = ok ? null : "number_below_minimum";
248
257
  } else if (type === "number_unchanged" || type === "number_stays_equal") {
249
258
  ok = numericValue(before?.number) !== null && numericValue(after?.number) !== null && numberValue(after?.number) === numberValue(before?.number);
250
259
  reason = ok ? null : "number_changed";
@@ -37,7 +37,7 @@ interface BasicGameplayActionResult {
37
37
  [key: string]: unknown;
38
38
  }
39
39
  declare const BASIC_GAMEPLAY_ACTION_TYPES: readonly ["wait", "key", "key-down", "key-up", "hold-key", "repeat", "click", "click-by-text", "wait-for-text", "window-call", "evaluate"];
40
- declare const BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES: readonly ["selector_count_increases", "selector_count_at_least", "selector_absent", "selector_text_matches", "number_increases", "number_decreases", "number_unchanged", "number_stays_equal", "number_equals", "canvas_hash_changes", "screenshot_hash_changes", "visual_hash_changes", "state_changes"];
40
+ declare const BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES: readonly ["selector_count_increases", "selector_count_at_least", "selector_absent", "selector_text_matches", "number_increases", "number_decreases", "number_at_least", "number_gte", "number_unchanged", "number_stays_equal", "number_equals", "canvas_hash_changes", "screenshot_hash_changes", "visual_hash_changes", "state_changes"];
41
41
  type BasicGameplayActionType = typeof BASIC_GAMEPLAY_ACTION_TYPES[number] | (string & {});
42
42
  type BasicGameplayProgressCheckType = typeof BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES[number] | (string & {});
43
43
  interface BasicGameplayMetric {
@@ -123,6 +123,7 @@ interface RiddleProofBasicGameplayRouteEvidence {
123
123
  actionResults?: BasicGameplayActionResult[];
124
124
  continued_action_results?: BasicGameplayActionResult[];
125
125
  restart_action_results?: BasicGameplayActionResult[];
126
+ restartActionResults?: BasicGameplayActionResult[];
126
127
  progression_checks?: BasicGameplayProgressionCheck[];
127
128
  progressionChecks?: BasicGameplayProgressionCheck[];
128
129
  requires_reset?: boolean;
@@ -37,7 +37,7 @@ interface BasicGameplayActionResult {
37
37
  [key: string]: unknown;
38
38
  }
39
39
  declare const BASIC_GAMEPLAY_ACTION_TYPES: readonly ["wait", "key", "key-down", "key-up", "hold-key", "repeat", "click", "click-by-text", "wait-for-text", "window-call", "evaluate"];
40
- declare const BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES: readonly ["selector_count_increases", "selector_count_at_least", "selector_absent", "selector_text_matches", "number_increases", "number_decreases", "number_unchanged", "number_stays_equal", "number_equals", "canvas_hash_changes", "screenshot_hash_changes", "visual_hash_changes", "state_changes"];
40
+ declare const BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES: readonly ["selector_count_increases", "selector_count_at_least", "selector_absent", "selector_text_matches", "number_increases", "number_decreases", "number_at_least", "number_gte", "number_unchanged", "number_stays_equal", "number_equals", "canvas_hash_changes", "screenshot_hash_changes", "visual_hash_changes", "state_changes"];
41
41
  type BasicGameplayActionType = typeof BASIC_GAMEPLAY_ACTION_TYPES[number] | (string & {});
42
42
  type BasicGameplayProgressCheckType = typeof BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES[number] | (string & {});
43
43
  interface BasicGameplayMetric {
@@ -123,6 +123,7 @@ interface RiddleProofBasicGameplayRouteEvidence {
123
123
  actionResults?: BasicGameplayActionResult[];
124
124
  continued_action_results?: BasicGameplayActionResult[];
125
125
  restart_action_results?: BasicGameplayActionResult[];
126
+ restartActionResults?: BasicGameplayActionResult[];
126
127
  progression_checks?: BasicGameplayProgressionCheck[];
127
128
  progressionChecks?: BasicGameplayProgressionCheck[];
128
129
  requires_reset?: boolean;
@@ -16,7 +16,7 @@ import {
16
16
  extractBasicGameplayEvidence,
17
17
  resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
18
18
  sanitizeBasicGameplayJsonString
19
- } from "./chunk-AAIASO2C.js";
19
+ } from "./chunk-LHS7ZV2T.js";
20
20
  export {
21
21
  BASIC_GAMEPLAY_ACTION_TYPES,
22
22
  BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES,
@@ -22,6 +22,8 @@ var BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES = [
22
22
  "selector_text_matches",
23
23
  "number_increases",
24
24
  "number_decreases",
25
+ "number_at_least",
26
+ "number_gte",
25
27
  "number_unchanged",
26
28
  "number_stays_equal",
27
29
  "number_equals",
@@ -107,10 +109,12 @@ function assessBasicGameplayRoute(route, options = {}) {
107
109
  const actionChange = changed(timed, afterAction);
108
110
  const surfaceVisible = numberValue(initial.visible_canvas_count) > 0 || numberValue(initial.enabled_clickable_count) > 0 || numberValue(initial.visible_large_node_count) >= minSurfaceLargeNodes;
109
111
  const actionResults = listValue(route.action_results || route.actionResults);
112
+ const restartActionResults = listValue(route.restart_action_results || route.restartActionResults);
110
113
  const actionAttempted = actionResults.some((result) => result.ok === true && result.action !== "wait");
111
114
  const actionFailed = actionResults.some((result) => result.ok === false && result.action !== "wait");
115
+ const restartActionAttempted = restartActionResults.some((result) => result.ok === true && result.action !== "wait");
112
116
  const stateChangeObserved = actionChange.changed || timedChange.changed;
113
- const resetPathPresent = numberValue(initial.reset_control_count) > 0 || numberValue(timed.reset_control_count) > 0 || numberValue(afterAction.reset_control_count) > 0;
117
+ const resetPathPresent = numberValue(initial.reset_control_count) > 0 || numberValue(timed.reset_control_count) > 0 || numberValue(afterAction.reset_control_count) > 0 || restartActionAttempted;
114
118
  const responseStatus = firstNumber(route.http_status, route.response_status, route.status);
115
119
  const pageErrorCount = numberValue(route.page_error_count);
116
120
  const consoleErrorCount = numberValue(route.console_error_count);
@@ -205,6 +209,11 @@ function assessBasicGameplayProgressionCheck(check) {
205
209
  } else if (type === "number_decreases") {
206
210
  ok = numericValue(before?.number) !== null && numericValue(after?.number) !== null && numberValue(after?.number) < numberValue(before?.number);
207
211
  reason = ok ? null : "number_did_not_decrease";
212
+ } else if (type === "number_at_least" || type === "number_gte") {
213
+ const min = numericValue(check.min ?? check.expected ?? check.value);
214
+ if (min === null && hasExplicitResult) return resolveBasicGameplayProgressionCheckWithArtifactScreenshots({ ...check, ok, reason });
215
+ ok = numericValue(after?.number) !== null && min !== null && numberValue(after?.number) >= min;
216
+ reason = ok ? null : "number_below_minimum";
208
217
  } else if (type === "number_unchanged" || type === "number_stays_equal") {
209
218
  ok = numericValue(before?.number) !== null && numericValue(after?.number) !== null && numberValue(after?.number) === numberValue(before?.number);
210
219
  reason = ok ? null : "number_changed";
package/dist/index.cjs CHANGED
@@ -7829,6 +7829,8 @@ var BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES = [
7829
7829
  "selector_text_matches",
7830
7830
  "number_increases",
7831
7831
  "number_decreases",
7832
+ "number_at_least",
7833
+ "number_gte",
7832
7834
  "number_unchanged",
7833
7835
  "number_stays_equal",
7834
7836
  "number_equals",
@@ -7914,10 +7916,12 @@ function assessBasicGameplayRoute(route, options = {}) {
7914
7916
  const actionChange = changed(timed, afterAction);
7915
7917
  const surfaceVisible = numberValue2(initial.visible_canvas_count) > 0 || numberValue2(initial.enabled_clickable_count) > 0 || numberValue2(initial.visible_large_node_count) >= minSurfaceLargeNodes;
7916
7918
  const actionResults = listValue2(route.action_results || route.actionResults);
7919
+ const restartActionResults = listValue2(route.restart_action_results || route.restartActionResults);
7917
7920
  const actionAttempted = actionResults.some((result) => result.ok === true && result.action !== "wait");
7918
7921
  const actionFailed = actionResults.some((result) => result.ok === false && result.action !== "wait");
7922
+ const restartActionAttempted = restartActionResults.some((result) => result.ok === true && result.action !== "wait");
7919
7923
  const stateChangeObserved = actionChange.changed || timedChange.changed;
7920
- const resetPathPresent = numberValue2(initial.reset_control_count) > 0 || numberValue2(timed.reset_control_count) > 0 || numberValue2(afterAction.reset_control_count) > 0;
7924
+ const resetPathPresent = numberValue2(initial.reset_control_count) > 0 || numberValue2(timed.reset_control_count) > 0 || numberValue2(afterAction.reset_control_count) > 0 || restartActionAttempted;
7921
7925
  const responseStatus = firstNumber(route.http_status, route.response_status, route.status);
7922
7926
  const pageErrorCount = numberValue2(route.page_error_count);
7923
7927
  const consoleErrorCount = numberValue2(route.console_error_count);
@@ -8012,6 +8016,11 @@ function assessBasicGameplayProgressionCheck(check) {
8012
8016
  } else if (type === "number_decreases") {
8013
8017
  ok = numericValue3(before?.number) !== null && numericValue3(after?.number) !== null && numberValue2(after?.number) < numberValue2(before?.number);
8014
8018
  reason = ok ? null : "number_did_not_decrease";
8019
+ } else if (type === "number_at_least" || type === "number_gte") {
8020
+ const min = numericValue3(check.min ?? check.expected ?? check.value);
8021
+ if (min === null && hasExplicitResult) return resolveBasicGameplayProgressionCheckWithArtifactScreenshots({ ...check, ok, reason });
8022
+ ok = numericValue3(after?.number) !== null && min !== null && numberValue2(after?.number) >= min;
8023
+ reason = ok ? null : "number_below_minimum";
8015
8024
  } else if (type === "number_unchanged" || type === "number_stays_equal") {
8016
8025
  ok = numericValue3(before?.number) !== null && numericValue3(after?.number) !== null && numberValue2(after?.number) === numberValue2(before?.number);
8017
8026
  reason = ok ? null : "number_changed";
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  extractBasicGameplayEvidence,
37
37
  resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
38
38
  sanitizeBasicGameplayJsonString
39
- } from "./chunk-AAIASO2C.js";
39
+ } from "./chunk-LHS7ZV2T.js";
40
40
  import {
41
41
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
42
42
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
662
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
292
292
  blocking?: boolean;
293
293
  details?: Record<string, unknown>;
294
294
  ok: boolean;
295
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
295
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup" | "run";
296
296
  state_path: string;
297
297
  stage: any;
298
298
  summary: string;
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
382
382
  continueWithStage?: WorkflowStage | null;
383
383
  blocking?: boolean;
384
384
  details?: Record<string, unknown>;
385
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
385
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup" | "run";
386
386
  state_path: string;
387
387
  stage: any;
388
388
  checkpoint: string;
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
659
659
  error?: undefined;
660
660
  } | {
661
661
  ok: boolean;
662
- action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
662
+ action: "recon" | "author" | "ship" | "implement" | "verify" | "setup" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.5",
3
+ "version": "0.7.6",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",