@riddledc/riddle-proof 0.7.13 → 0.7.15

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 CHANGED
@@ -314,7 +314,8 @@ const catches = createBasicGameplayCatchRecords(assessment, evidence);
314
314
  ```
315
315
 
316
316
  The package owns generic contracts such as `state_path`, `state_call`,
317
- `property_path`, `number_unchanged`, held-key, canvas-click,
317
+ `property_path`, `after_cleanup` terminal-before-restart evidence,
318
+ `number_unchanged`, held-key, canvas-click,
318
319
  canvas-pointer-down/move/up, window-call/evaluate action type constants, and
319
320
  JSON-safe text compaction. Site-specific manifests, selectors, and
320
321
  deterministic game scripts should stay in the caller.
@@ -63,6 +63,9 @@ var BASIC_GAMEPLAY_ACTION_TYPES = [
63
63
  var BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES = [
64
64
  "selector_count_increases",
65
65
  "selector_count_at_least",
66
+ "selector_count_equals",
67
+ "selector_count_equal",
68
+ "selector_count_eq",
66
69
  "selector_absent",
67
70
  "selector_text_matches",
68
71
  "number_increases",
@@ -95,6 +98,7 @@ var PHASE_SCREENSHOT_SUFFIXES = {
95
98
  initial: "before",
96
99
  after_action: "after",
97
100
  after_continue: "after-continue",
101
+ after_cleanup: "after-cleanup",
98
102
  after_restart: "after-restart",
99
103
  revisit: "revisit"
100
104
  };
@@ -150,20 +154,24 @@ function assessBasicGameplayRoute(route, options = {}) {
150
154
  const timed = route.timed || {};
151
155
  const afterAction = route.after_action || route.afterAction || {};
152
156
  const afterContinue = route.after_continue || route.afterContinue || {};
157
+ const afterCleanup = route.after_cleanup || route.afterCleanup || {};
153
158
  const mobile = route.mobile || {};
154
159
  const timedChange = changed(initial, timed);
155
160
  const actionChange = changed(timed, afterAction);
156
161
  const continuedActionChange = changed(afterAction, afterContinue);
162
+ const cleanupBase = route.after_continue || route.afterContinue ? afterContinue : afterAction;
163
+ const cleanupActionChange = changed(cleanupBase, afterCleanup);
157
164
  const surfaceVisible = numberValue(initial.visible_canvas_count) > 0 || numberValue(initial.enabled_clickable_count) > 0 || numberValue(initial.visible_large_node_count) >= minSurfaceLargeNodes;
158
165
  const actionResults = listValue(route.action_results || route.actionResults);
159
166
  const continuedActionResults = listValue(route.continued_action_results || route.continuedActionResults);
167
+ const continuedCleanupActionResults = listValue(route.continued_cleanup_action_results || route.continuedCleanupActionResults);
160
168
  const restartActionResults = listValue(route.restart_action_results || route.restartActionResults);
161
169
  const primaryActionResults = [...actionResults, ...continuedActionResults];
162
170
  const actionAttempted = primaryActionResults.some((result) => result.ok === true && result.action !== "wait");
163
- const actionFailed = primaryActionResults.some((result) => result.ok === false && result.action !== "wait");
171
+ const actionFailed = [...primaryActionResults, ...continuedCleanupActionResults].some((result) => result.ok === false && result.action !== "wait");
164
172
  const restartActionAttempted = restartActionResults.some((result) => result.ok === true && result.action !== "wait");
165
- const stateChangeObserved = actionChange.changed || continuedActionChange.changed || timedChange.changed;
166
- const resetPathPresent = numberValue(initial.reset_control_count) > 0 || numberValue(timed.reset_control_count) > 0 || numberValue(afterAction.reset_control_count) > 0 || restartActionAttempted;
173
+ const stateChangeObserved = actionChange.changed || continuedActionChange.changed || cleanupActionChange.changed || timedChange.changed;
174
+ const resetPathPresent = numberValue(initial.reset_control_count) > 0 || numberValue(timed.reset_control_count) > 0 || numberValue(afterAction.reset_control_count) > 0 || numberValue(afterContinue.reset_control_count) > 0 || numberValue(afterCleanup.reset_control_count) > 0 || restartActionAttempted;
167
175
  const responseStatus = firstNumber(route.http_status, route.response_status, route.status);
168
176
  const pageErrorCount = numberValue(route.page_error_count);
169
177
  const consoleErrorCount = numberValue(route.console_error_count);
@@ -206,7 +214,8 @@ function assessBasicGameplayRoute(route, options = {}) {
206
214
  diffs: {
207
215
  timed: timedChange,
208
216
  after_action: actionChange,
209
- after_continue: continuedActionChange
217
+ after_continue: continuedActionChange,
218
+ after_cleanup: cleanupActionChange
210
219
  }
211
220
  };
212
221
  }
@@ -246,6 +255,11 @@ function assessBasicGameplayProgressionCheck(check) {
246
255
  if (numericValue(check.min) === null && hasExplicitResult) return resolveBasicGameplayProgressionCheckWithArtifactScreenshots({ ...check, ok, reason });
247
256
  ok = numberValue(after?.count) >= numberValue(check.min);
248
257
  reason = ok ? null : "selector_count_below_min";
258
+ } else if (type === "selector_count_equals" || type === "selector_count_equal" || type === "selector_count_eq") {
259
+ const expected = numericValue(check.expected ?? check.count ?? check.value);
260
+ if (expected === null && hasExplicitResult) return resolveBasicGameplayProgressionCheckWithArtifactScreenshots({ ...check, ok, reason });
261
+ ok = numericValue(after?.count) !== null && expected !== null && numberValue(after?.count) === expected;
262
+ reason = ok ? null : "selector_count_did_not_equal_expected";
249
263
  } else if (type === "selector_absent") {
250
264
  ok = !after?.present || numberValue(after?.count) === 0;
251
265
  reason = ok ? null : "selector_still_present";
@@ -404,6 +418,7 @@ function createBasicGameplayCatchRecords(assessment, evidence) {
404
418
  for (const [group, phase] of [
405
419
  ["action_results", "after_action"],
406
420
  ["continued_action_results", "after_continue"],
421
+ ["continued_cleanup_action_results", "after_cleanup"],
407
422
  ["restart_action_results", "after_restart"]
408
423
  ]) {
409
424
  for (const actionResult of listValue(route[group])) {
@@ -561,7 +576,7 @@ function findBasicGameplayEvidence(value, seen, depth = 0) {
561
576
  return null;
562
577
  }
563
578
  function hasRouteShape(record) {
564
- return Boolean(record && (record.initial || record.after_action || record.afterAction || record.action_results || record.actionResults) && (record.path || record.name));
579
+ return Boolean(record && (record.initial || record.after_action || record.afterAction || record.after_cleanup || record.afterCleanup || record.action_results || record.actionResults || record.continued_cleanup_action_results || record.continuedCleanupActionResults) && (record.path || record.name));
565
580
  }
566
581
  function changed(before, after) {
567
582
  const bodyTextChanged = Boolean(before.body_text_hash && after.body_text_hash && before.body_text_hash !== after.body_text_hash);
@@ -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", "set-input-value", "canvas-click", "canvas-pointer-down", "canvas-pointer-move", "canvas-pointer-up", "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_at_least", "number_gte", "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_count_equals", "selector_count_equal", "selector_count_eq", "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 {
@@ -120,11 +120,15 @@ interface RiddleProofBasicGameplayRouteEvidence {
120
120
  afterAction?: BasicGameplaySnapshot;
121
121
  after_continue?: BasicGameplaySnapshot;
122
122
  afterContinue?: BasicGameplaySnapshot;
123
+ after_cleanup?: BasicGameplaySnapshot;
124
+ afterCleanup?: BasicGameplaySnapshot;
123
125
  mobile?: BasicGameplayMobileEvidence;
124
126
  action_results?: BasicGameplayActionResult[];
125
127
  actionResults?: BasicGameplayActionResult[];
126
128
  continued_action_results?: BasicGameplayActionResult[];
127
129
  continuedActionResults?: BasicGameplayActionResult[];
130
+ continued_cleanup_action_results?: BasicGameplayActionResult[];
131
+ continuedCleanupActionResults?: BasicGameplayActionResult[];
128
132
  restart_action_results?: BasicGameplayActionResult[];
129
133
  restartActionResults?: BasicGameplayActionResult[];
130
134
  progression_checks?: BasicGameplayProgressionCheck[];
@@ -176,6 +180,7 @@ interface RiddleProofBasicGameplayRouteAssessment {
176
180
  timed: BasicGameplayChangeSummary;
177
181
  after_action: BasicGameplayChangeSummary;
178
182
  after_continue?: BasicGameplayChangeSummary;
183
+ after_cleanup?: BasicGameplayChangeSummary;
179
184
  };
180
185
  }
181
186
  interface RiddleProofBasicGameplayAssessment {
@@ -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", "set-input-value", "canvas-click", "canvas-pointer-down", "canvas-pointer-move", "canvas-pointer-up", "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_at_least", "number_gte", "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_count_equals", "selector_count_equal", "selector_count_eq", "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 {
@@ -120,11 +120,15 @@ interface RiddleProofBasicGameplayRouteEvidence {
120
120
  afterAction?: BasicGameplaySnapshot;
121
121
  after_continue?: BasicGameplaySnapshot;
122
122
  afterContinue?: BasicGameplaySnapshot;
123
+ after_cleanup?: BasicGameplaySnapshot;
124
+ afterCleanup?: BasicGameplaySnapshot;
123
125
  mobile?: BasicGameplayMobileEvidence;
124
126
  action_results?: BasicGameplayActionResult[];
125
127
  actionResults?: BasicGameplayActionResult[];
126
128
  continued_action_results?: BasicGameplayActionResult[];
127
129
  continuedActionResults?: BasicGameplayActionResult[];
130
+ continued_cleanup_action_results?: BasicGameplayActionResult[];
131
+ continuedCleanupActionResults?: BasicGameplayActionResult[];
128
132
  restart_action_results?: BasicGameplayActionResult[];
129
133
  restartActionResults?: BasicGameplayActionResult[];
130
134
  progression_checks?: BasicGameplayProgressionCheck[];
@@ -176,6 +180,7 @@ interface RiddleProofBasicGameplayRouteAssessment {
176
180
  timed: BasicGameplayChangeSummary;
177
181
  after_action: BasicGameplayChangeSummary;
178
182
  after_continue?: BasicGameplayChangeSummary;
183
+ after_cleanup?: BasicGameplayChangeSummary;
179
184
  };
180
185
  }
181
186
  interface RiddleProofBasicGameplayAssessment {
@@ -16,7 +16,7 @@ import {
16
16
  extractBasicGameplayEvidence,
17
17
  resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
18
18
  sanitizeBasicGameplayJsonString
19
- } from "./chunk-I5D7F46V.js";
19
+ } from "./chunk-JDM244L7.js";
20
20
  export {
21
21
  BASIC_GAMEPLAY_ACTION_TYPES,
22
22
  BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES,
@@ -23,6 +23,9 @@ var BASIC_GAMEPLAY_ACTION_TYPES = [
23
23
  var BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES = [
24
24
  "selector_count_increases",
25
25
  "selector_count_at_least",
26
+ "selector_count_equals",
27
+ "selector_count_equal",
28
+ "selector_count_eq",
26
29
  "selector_absent",
27
30
  "selector_text_matches",
28
31
  "number_increases",
@@ -55,6 +58,7 @@ var PHASE_SCREENSHOT_SUFFIXES = {
55
58
  initial: "before",
56
59
  after_action: "after",
57
60
  after_continue: "after-continue",
61
+ after_cleanup: "after-cleanup",
58
62
  after_restart: "after-restart",
59
63
  revisit: "revisit"
60
64
  };
@@ -110,20 +114,24 @@ function assessBasicGameplayRoute(route, options = {}) {
110
114
  const timed = route.timed || {};
111
115
  const afterAction = route.after_action || route.afterAction || {};
112
116
  const afterContinue = route.after_continue || route.afterContinue || {};
117
+ const afterCleanup = route.after_cleanup || route.afterCleanup || {};
113
118
  const mobile = route.mobile || {};
114
119
  const timedChange = changed(initial, timed);
115
120
  const actionChange = changed(timed, afterAction);
116
121
  const continuedActionChange = changed(afterAction, afterContinue);
122
+ const cleanupBase = route.after_continue || route.afterContinue ? afterContinue : afterAction;
123
+ const cleanupActionChange = changed(cleanupBase, afterCleanup);
117
124
  const surfaceVisible = numberValue(initial.visible_canvas_count) > 0 || numberValue(initial.enabled_clickable_count) > 0 || numberValue(initial.visible_large_node_count) >= minSurfaceLargeNodes;
118
125
  const actionResults = listValue(route.action_results || route.actionResults);
119
126
  const continuedActionResults = listValue(route.continued_action_results || route.continuedActionResults);
127
+ const continuedCleanupActionResults = listValue(route.continued_cleanup_action_results || route.continuedCleanupActionResults);
120
128
  const restartActionResults = listValue(route.restart_action_results || route.restartActionResults);
121
129
  const primaryActionResults = [...actionResults, ...continuedActionResults];
122
130
  const actionAttempted = primaryActionResults.some((result) => result.ok === true && result.action !== "wait");
123
- const actionFailed = primaryActionResults.some((result) => result.ok === false && result.action !== "wait");
131
+ const actionFailed = [...primaryActionResults, ...continuedCleanupActionResults].some((result) => result.ok === false && result.action !== "wait");
124
132
  const restartActionAttempted = restartActionResults.some((result) => result.ok === true && result.action !== "wait");
125
- const stateChangeObserved = actionChange.changed || continuedActionChange.changed || timedChange.changed;
126
- const resetPathPresent = numberValue(initial.reset_control_count) > 0 || numberValue(timed.reset_control_count) > 0 || numberValue(afterAction.reset_control_count) > 0 || restartActionAttempted;
133
+ const stateChangeObserved = actionChange.changed || continuedActionChange.changed || cleanupActionChange.changed || timedChange.changed;
134
+ const resetPathPresent = numberValue(initial.reset_control_count) > 0 || numberValue(timed.reset_control_count) > 0 || numberValue(afterAction.reset_control_count) > 0 || numberValue(afterContinue.reset_control_count) > 0 || numberValue(afterCleanup.reset_control_count) > 0 || restartActionAttempted;
127
135
  const responseStatus = firstNumber(route.http_status, route.response_status, route.status);
128
136
  const pageErrorCount = numberValue(route.page_error_count);
129
137
  const consoleErrorCount = numberValue(route.console_error_count);
@@ -166,7 +174,8 @@ function assessBasicGameplayRoute(route, options = {}) {
166
174
  diffs: {
167
175
  timed: timedChange,
168
176
  after_action: actionChange,
169
- after_continue: continuedActionChange
177
+ after_continue: continuedActionChange,
178
+ after_cleanup: cleanupActionChange
170
179
  }
171
180
  };
172
181
  }
@@ -206,6 +215,11 @@ function assessBasicGameplayProgressionCheck(check) {
206
215
  if (numericValue(check.min) === null && hasExplicitResult) return resolveBasicGameplayProgressionCheckWithArtifactScreenshots({ ...check, ok, reason });
207
216
  ok = numberValue(after?.count) >= numberValue(check.min);
208
217
  reason = ok ? null : "selector_count_below_min";
218
+ } else if (type === "selector_count_equals" || type === "selector_count_equal" || type === "selector_count_eq") {
219
+ const expected = numericValue(check.expected ?? check.count ?? check.value);
220
+ if (expected === null && hasExplicitResult) return resolveBasicGameplayProgressionCheckWithArtifactScreenshots({ ...check, ok, reason });
221
+ ok = numericValue(after?.count) !== null && expected !== null && numberValue(after?.count) === expected;
222
+ reason = ok ? null : "selector_count_did_not_equal_expected";
209
223
  } else if (type === "selector_absent") {
210
224
  ok = !after?.present || numberValue(after?.count) === 0;
211
225
  reason = ok ? null : "selector_still_present";
@@ -364,6 +378,7 @@ function createBasicGameplayCatchRecords(assessment, evidence) {
364
378
  for (const [group, phase] of [
365
379
  ["action_results", "after_action"],
366
380
  ["continued_action_results", "after_continue"],
381
+ ["continued_cleanup_action_results", "after_cleanup"],
367
382
  ["restart_action_results", "after_restart"]
368
383
  ]) {
369
384
  for (const actionResult of listValue(route[group])) {
@@ -521,7 +536,7 @@ function findBasicGameplayEvidence(value, seen, depth = 0) {
521
536
  return null;
522
537
  }
523
538
  function hasRouteShape(record) {
524
- return Boolean(record && (record.initial || record.after_action || record.afterAction || record.action_results || record.actionResults) && (record.path || record.name));
539
+ return Boolean(record && (record.initial || record.after_action || record.afterAction || record.after_cleanup || record.afterCleanup || record.action_results || record.actionResults || record.continued_cleanup_action_results || record.continuedCleanupActionResults) && (record.path || record.name));
525
540
  }
526
541
  function changed(before, after) {
527
542
  const bodyTextChanged = Boolean(before.body_text_hash && after.body_text_hash && before.body_text_hash !== after.body_text_hash);
package/dist/index.cjs CHANGED
@@ -7832,6 +7832,9 @@ var BASIC_GAMEPLAY_ACTION_TYPES = [
7832
7832
  var BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES = [
7833
7833
  "selector_count_increases",
7834
7834
  "selector_count_at_least",
7835
+ "selector_count_equals",
7836
+ "selector_count_equal",
7837
+ "selector_count_eq",
7835
7838
  "selector_absent",
7836
7839
  "selector_text_matches",
7837
7840
  "number_increases",
@@ -7864,6 +7867,7 @@ var PHASE_SCREENSHOT_SUFFIXES = {
7864
7867
  initial: "before",
7865
7868
  after_action: "after",
7866
7869
  after_continue: "after-continue",
7870
+ after_cleanup: "after-cleanup",
7867
7871
  after_restart: "after-restart",
7868
7872
  revisit: "revisit"
7869
7873
  };
@@ -7919,20 +7923,24 @@ function assessBasicGameplayRoute(route, options = {}) {
7919
7923
  const timed = route.timed || {};
7920
7924
  const afterAction = route.after_action || route.afterAction || {};
7921
7925
  const afterContinue = route.after_continue || route.afterContinue || {};
7926
+ const afterCleanup = route.after_cleanup || route.afterCleanup || {};
7922
7927
  const mobile = route.mobile || {};
7923
7928
  const timedChange = changed(initial, timed);
7924
7929
  const actionChange = changed(timed, afterAction);
7925
7930
  const continuedActionChange = changed(afterAction, afterContinue);
7931
+ const cleanupBase = route.after_continue || route.afterContinue ? afterContinue : afterAction;
7932
+ const cleanupActionChange = changed(cleanupBase, afterCleanup);
7926
7933
  const surfaceVisible = numberValue2(initial.visible_canvas_count) > 0 || numberValue2(initial.enabled_clickable_count) > 0 || numberValue2(initial.visible_large_node_count) >= minSurfaceLargeNodes;
7927
7934
  const actionResults = listValue2(route.action_results || route.actionResults);
7928
7935
  const continuedActionResults = listValue2(route.continued_action_results || route.continuedActionResults);
7936
+ const continuedCleanupActionResults = listValue2(route.continued_cleanup_action_results || route.continuedCleanupActionResults);
7929
7937
  const restartActionResults = listValue2(route.restart_action_results || route.restartActionResults);
7930
7938
  const primaryActionResults = [...actionResults, ...continuedActionResults];
7931
7939
  const actionAttempted = primaryActionResults.some((result) => result.ok === true && result.action !== "wait");
7932
- const actionFailed = primaryActionResults.some((result) => result.ok === false && result.action !== "wait");
7940
+ const actionFailed = [...primaryActionResults, ...continuedCleanupActionResults].some((result) => result.ok === false && result.action !== "wait");
7933
7941
  const restartActionAttempted = restartActionResults.some((result) => result.ok === true && result.action !== "wait");
7934
- const stateChangeObserved = actionChange.changed || continuedActionChange.changed || timedChange.changed;
7935
- const resetPathPresent = numberValue2(initial.reset_control_count) > 0 || numberValue2(timed.reset_control_count) > 0 || numberValue2(afterAction.reset_control_count) > 0 || restartActionAttempted;
7942
+ const stateChangeObserved = actionChange.changed || continuedActionChange.changed || cleanupActionChange.changed || timedChange.changed;
7943
+ const resetPathPresent = numberValue2(initial.reset_control_count) > 0 || numberValue2(timed.reset_control_count) > 0 || numberValue2(afterAction.reset_control_count) > 0 || numberValue2(afterContinue.reset_control_count) > 0 || numberValue2(afterCleanup.reset_control_count) > 0 || restartActionAttempted;
7936
7944
  const responseStatus = firstNumber(route.http_status, route.response_status, route.status);
7937
7945
  const pageErrorCount = numberValue2(route.page_error_count);
7938
7946
  const consoleErrorCount = numberValue2(route.console_error_count);
@@ -7975,7 +7983,8 @@ function assessBasicGameplayRoute(route, options = {}) {
7975
7983
  diffs: {
7976
7984
  timed: timedChange,
7977
7985
  after_action: actionChange,
7978
- after_continue: continuedActionChange
7986
+ after_continue: continuedActionChange,
7987
+ after_cleanup: cleanupActionChange
7979
7988
  }
7980
7989
  };
7981
7990
  }
@@ -8015,6 +8024,11 @@ function assessBasicGameplayProgressionCheck(check) {
8015
8024
  if (numericValue3(check.min) === null && hasExplicitResult) return resolveBasicGameplayProgressionCheckWithArtifactScreenshots({ ...check, ok, reason });
8016
8025
  ok = numberValue2(after?.count) >= numberValue2(check.min);
8017
8026
  reason = ok ? null : "selector_count_below_min";
8027
+ } else if (type === "selector_count_equals" || type === "selector_count_equal" || type === "selector_count_eq") {
8028
+ const expected = numericValue3(check.expected ?? check.count ?? check.value);
8029
+ if (expected === null && hasExplicitResult) return resolveBasicGameplayProgressionCheckWithArtifactScreenshots({ ...check, ok, reason });
8030
+ ok = numericValue3(after?.count) !== null && expected !== null && numberValue2(after?.count) === expected;
8031
+ reason = ok ? null : "selector_count_did_not_equal_expected";
8018
8032
  } else if (type === "selector_absent") {
8019
8033
  ok = !after?.present || numberValue2(after?.count) === 0;
8020
8034
  reason = ok ? null : "selector_still_present";
@@ -8173,6 +8187,7 @@ function createBasicGameplayCatchRecords(assessment, evidence) {
8173
8187
  for (const [group, phase] of [
8174
8188
  ["action_results", "after_action"],
8175
8189
  ["continued_action_results", "after_continue"],
8190
+ ["continued_cleanup_action_results", "after_cleanup"],
8176
8191
  ["restart_action_results", "after_restart"]
8177
8192
  ]) {
8178
8193
  for (const actionResult of listValue2(route[group])) {
@@ -8330,7 +8345,7 @@ function findBasicGameplayEvidence(value, seen, depth = 0) {
8330
8345
  return null;
8331
8346
  }
8332
8347
  function hasRouteShape(record) {
8333
- return Boolean(record && (record.initial || record.after_action || record.afterAction || record.action_results || record.actionResults) && (record.path || record.name));
8348
+ return Boolean(record && (record.initial || record.after_action || record.afterAction || record.after_cleanup || record.afterCleanup || record.action_results || record.actionResults || record.continued_cleanup_action_results || record.continuedCleanupActionResults) && (record.path || record.name));
8334
8349
  }
8335
8350
  function changed(before, after) {
8336
8351
  const bodyTextChanged = Boolean(before.body_text_hash && after.body_text_hash && before.body_text_hash !== after.body_text_hash);
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  extractBasicGameplayEvidence,
37
37
  resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
38
38
  sanitizeBasicGameplayJsonString
39
- } from "./chunk-I5D7F46V.js";
39
+ } from "./chunk-JDM244L7.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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
295
+ action: "author" | "recon" | "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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
385
+ action: "author" | "recon" | "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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
662
+ action: "author" | "recon" | "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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
295
+ action: "author" | "recon" | "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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
385
+ action: "author" | "recon" | "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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
662
+ action: "author" | "recon" | "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.13",
3
+ "version": "0.7.15",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",