@riddledc/riddle-proof 0.7.9 → 0.7.11

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
@@ -150,7 +150,9 @@ appears only after a picker, tab, login stub, transport control, or other
150
150
  bounded interaction. Supported setup actions are `click`, `wait`,
151
151
  `wait_for_selector`, and `wait_for_text`; a failed setup action is recorded as
152
152
  a failed `setup_actions_succeeded` check so the profile cannot pass without
153
- reaching the intended state.
153
+ reaching the intended state. Text-matched `click` actions prefer visible
154
+ matching elements, which keeps responsive layouts from selecting hidden desktop
155
+ or mobile-only links.
154
156
 
155
157
  The result uses `riddle-proof.profile-result.v1` and separates product failures
156
158
  from weak proof and environment blockers:
@@ -193,13 +193,19 @@ function normalizeRiddleProofProfile(input, options = {}) {
193
193
  function resolveRiddleProofProfileTargetUrl(profile) {
194
194
  const route = profile.target.route || "";
195
195
  const targetUrl = profile.target.url || "";
196
+ if (targetUrl && route) return resolveRiddleProofProfileRouteUrl(targetUrl, route);
196
197
  if (/^https?:\/\//i.test(route)) return route;
197
- if (targetUrl && route) return new URL(route, targetUrl).href;
198
198
  if (targetUrl) return targetUrl;
199
199
  throw new Error("profile target URL could not be resolved.");
200
200
  }
201
- function routeForViewport(viewport) {
202
- return viewport?.route || {
201
+ function routeForViewport(viewport, targetUrl) {
202
+ if (viewport?.route) {
203
+ return {
204
+ ...viewport.route,
205
+ matched: viewport.route.matched || routePathMatches(viewport.route.observed, viewport.route.expected_path, targetUrl)
206
+ };
207
+ }
208
+ return {
203
209
  requested: "",
204
210
  observed: "",
205
211
  matched: false,
@@ -225,8 +231,54 @@ function matchText(sample, check) {
225
231
  }
226
232
  return sample.includes(check.text || "");
227
233
  }
228
- function successfulRoute(route) {
229
- return route.matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
234
+ function normalizeRoutePath(path) {
235
+ const value = path || "/";
236
+ if (value === "/") return "/";
237
+ return value.replace(/\/+$/, "") || "/";
238
+ }
239
+ function previewMountPrefix(pathname) {
240
+ const value = pathname || "/";
241
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
242
+ if (apiPreview) return apiPreview[1];
243
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
244
+ return internalPreview ? internalPreview[1] : "";
245
+ }
246
+ function joinMountedRoutePath(mountPrefix, routePath) {
247
+ const route = routePath.startsWith("/") ? routePath : `/${routePath}`;
248
+ if (!mountPrefix) return route;
249
+ if (route === mountPrefix || route.startsWith(`${mountPrefix}/`)) return route;
250
+ return `${mountPrefix}${route}`;
251
+ }
252
+ function resolveRiddleProofProfileRouteUrl(targetUrl, route) {
253
+ if (/^https?:\/\//i.test(route)) return route;
254
+ if (!targetUrl) return route;
255
+ if (route.startsWith("/")) {
256
+ const base = new URL(targetUrl);
257
+ const mountPrefix = previewMountPrefix(base.pathname);
258
+ if (mountPrefix) {
259
+ const routeParts = new URL(route, base.origin);
260
+ base.pathname = joinMountedRoutePath(mountPrefix, routeParts.pathname);
261
+ base.search = routeParts.search;
262
+ base.hash = routeParts.hash;
263
+ return base.href;
264
+ }
265
+ }
266
+ return new URL(route, targetUrl).href;
267
+ }
268
+ function mountedExpectedRoutePath(targetUrl, expected) {
269
+ if (!targetUrl || !expected || !expected.startsWith("/")) return expected;
270
+ const mountPrefix = previewMountPrefix(new URL(targetUrl).pathname);
271
+ return mountPrefix ? joinMountedRoutePath(mountPrefix, expected) : expected;
272
+ }
273
+ function routePathMatches(observed, expected, targetUrl) {
274
+ const normalizedObserved = normalizeRoutePath(observed);
275
+ const normalizedExpected = normalizeRoutePath(expected);
276
+ if (normalizedObserved === normalizedExpected) return true;
277
+ return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
278
+ }
279
+ function successfulRoute(route, targetUrl) {
280
+ const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
281
+ return matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
230
282
  }
231
283
  function assessCheckFromEvidence(check, evidence) {
232
284
  const viewports = evidence.viewports || [];
@@ -244,8 +296,8 @@ function assessCheckFromEvidence(check, evidence) {
244
296
  const failed = viewports.filter((viewport) => !successfulRoute({
245
297
  ...viewport.route,
246
298
  expected_path: expectedPath,
247
- matched: viewport.route.observed === expectedPath || viewport.route.matched
248
- }));
299
+ matched: routePathMatches(viewport.route.observed, expectedPath, evidence.target_url) || viewport.route.matched
300
+ }, evidence.target_url));
249
301
  return {
250
302
  type: check.type,
251
303
  label: checkLabel(check),
@@ -420,7 +472,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
420
472
  runner: options.runner || "riddle",
421
473
  status,
422
474
  baseline_policy: profile.baseline_policy,
423
- route: routeForViewport(firstViewport),
475
+ route: routeForViewport(firstViewport, evidence?.target_url),
424
476
  artifacts: {
425
477
  screenshots,
426
478
  console: "console.json",
@@ -512,8 +564,37 @@ function createRiddleProofProfileInsufficientResult(input) {
512
564
  }
513
565
  function runtimeScriptAssessmentSource() {
514
566
  return String.raw`
515
- function routeOk(route) {
516
- return Boolean(route && route.matched && !route.error && (route.http_status == null || route.http_status < 400));
567
+ function normalizeRoutePath(path) {
568
+ const value = path || "/";
569
+ if (value === "/") return "/";
570
+ return value.replace(/\/+$/, "") || "/";
571
+ }
572
+ function previewMountPrefix(pathname) {
573
+ const value = pathname || "/";
574
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
575
+ if (apiPreview) return apiPreview[1];
576
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
577
+ return internalPreview ? internalPreview[1] : "";
578
+ }
579
+ function joinMountedRoutePath(mountPrefix, routePath) {
580
+ const route = routePath.startsWith("/") ? routePath : "/" + routePath;
581
+ if (!mountPrefix) return route;
582
+ if (route === mountPrefix || route.startsWith(mountPrefix + "/")) return route;
583
+ return mountPrefix + route;
584
+ }
585
+ function mountedExpectedRoutePath(targetUrl, expected) {
586
+ if (!targetUrl || !expected || !expected.startsWith("/")) return expected;
587
+ const mountPrefix = previewMountPrefix(new URL(targetUrl).pathname);
588
+ return mountPrefix ? joinMountedRoutePath(mountPrefix, expected) : expected;
589
+ }
590
+ function routePathMatches(observed, expected, targetUrl) {
591
+ const normalizedObserved = normalizeRoutePath(observed);
592
+ const normalizedExpected = normalizeRoutePath(expected);
593
+ if (normalizedObserved === normalizedExpected) return true;
594
+ return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
595
+ }
596
+ function routeOk(route, targetUrl) {
597
+ return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
517
598
  }
518
599
  function textMatches(sample, check) {
519
600
  if (check.pattern) {
@@ -570,8 +651,8 @@ function assessProfile(profile, evidence) {
570
651
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
571
652
  const failed = viewports.filter((viewport) => {
572
653
  const route = { ...(viewport.route || {}), expected_path: expectedPath };
573
- route.matched = route.observed === expectedPath || route.matched;
574
- return !routeOk(route);
654
+ route.matched = routePathMatches(route.observed, expectedPath, evidence.target_url) || route.matched;
655
+ return !routeOk(route, evidence.target_url);
575
656
  });
576
657
  checks.push({
577
658
  type: check.type,
@@ -743,6 +824,9 @@ function setupTextMatches(sample, action) {
743
824
  async function setupLocatorText(locator, index) {
744
825
  return await locator.nth(index).textContent({ timeout: 1000 }).catch(() => "");
745
826
  }
827
+ async function setupLocatorVisible(locator, index) {
828
+ return await locator.nth(index).isVisible({ timeout: 1000 }).catch(() => false);
829
+ }
746
830
  async function executeSetupAction(action, ordinal) {
747
831
  const type = setupActionType(action);
748
832
  const base = { ok: false, action: type || "unknown", ordinal, selector: action.selector || null };
@@ -763,16 +847,26 @@ async function executeSetupAction(action, ordinal) {
763
847
  if (!count) return { ...base, reason: "selector_not_found", count };
764
848
  let targetIndex = Number.isInteger(action.index) ? action.index : 0;
765
849
  let matchedText = null;
850
+ let hiddenMatchIndex = -1;
851
+ let hiddenMatchedText = null;
766
852
  if (action.text || action.pattern) {
767
853
  targetIndex = -1;
768
854
  for (let index = 0; index < count; index += 1) {
769
855
  const text = await setupLocatorText(locator, index);
770
856
  if (setupTextMatches(text, action)) {
771
- targetIndex = index;
772
- matchedText = text;
773
- break;
857
+ const visible = await setupLocatorVisible(locator, index);
858
+ if (visible) {
859
+ targetIndex = index;
860
+ matchedText = text;
861
+ break;
862
+ }
863
+ if (hiddenMatchIndex < 0) {
864
+ hiddenMatchIndex = index;
865
+ hiddenMatchedText = text;
866
+ }
774
867
  }
775
868
  }
869
+ if (targetIndex < 0 && hiddenMatchIndex >= 0) return { ...base, reason: "matching_element_not_visible", count, target_index: hiddenMatchIndex, text: hiddenMatchedText };
776
870
  if (targetIndex < 0) return { ...base, reason: "text_not_found", count };
777
871
  }
778
872
  if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex };
@@ -899,7 +993,7 @@ async function captureViewport(viewport) {
899
993
  requested: targetUrl,
900
994
  observed: dom.pathname,
901
995
  expected_path: expectedPath,
902
- matched: dom.pathname === expectedPath,
996
+ matched: routePathMatches(dom.pathname, expectedPath, targetUrl),
903
997
  http_status: httpStatus,
904
998
  error: navigationError || waitError || undefined,
905
999
  },
@@ -1015,6 +1109,7 @@ export {
1015
1109
  slugifyRiddleProofProfileName,
1016
1110
  normalizeRiddleProofProfile,
1017
1111
  resolveRiddleProofProfileTargetUrl,
1112
+ resolveRiddleProofProfileRouteUrl,
1018
1113
  assessRiddleProofProfileEvidence,
1019
1114
  summarizeRiddleProofProfileResult,
1020
1115
  profileStatusExitCode,
package/dist/cli.cjs CHANGED
@@ -6972,13 +6972,19 @@ function normalizeRiddleProofProfile(input, options = {}) {
6972
6972
  function resolveRiddleProofProfileTargetUrl(profile) {
6973
6973
  const route = profile.target.route || "";
6974
6974
  const targetUrl = profile.target.url || "";
6975
+ if (targetUrl && route) return resolveRiddleProofProfileRouteUrl(targetUrl, route);
6975
6976
  if (/^https?:\/\//i.test(route)) return route;
6976
- if (targetUrl && route) return new URL(route, targetUrl).href;
6977
6977
  if (targetUrl) return targetUrl;
6978
6978
  throw new Error("profile target URL could not be resolved.");
6979
6979
  }
6980
- function routeForViewport(viewport) {
6981
- return viewport?.route || {
6980
+ function routeForViewport(viewport, targetUrl) {
6981
+ if (viewport?.route) {
6982
+ return {
6983
+ ...viewport.route,
6984
+ matched: viewport.route.matched || routePathMatches(viewport.route.observed, viewport.route.expected_path, targetUrl)
6985
+ };
6986
+ }
6987
+ return {
6982
6988
  requested: "",
6983
6989
  observed: "",
6984
6990
  matched: false,
@@ -7004,8 +7010,54 @@ function matchText(sample, check) {
7004
7010
  }
7005
7011
  return sample.includes(check.text || "");
7006
7012
  }
7007
- function successfulRoute(route) {
7008
- return route.matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
7013
+ function normalizeRoutePath(path7) {
7014
+ const value = path7 || "/";
7015
+ if (value === "/") return "/";
7016
+ return value.replace(/\/+$/, "") || "/";
7017
+ }
7018
+ function previewMountPrefix(pathname) {
7019
+ const value = pathname || "/";
7020
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
7021
+ if (apiPreview) return apiPreview[1];
7022
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
7023
+ return internalPreview ? internalPreview[1] : "";
7024
+ }
7025
+ function joinMountedRoutePath(mountPrefix, routePath) {
7026
+ const route = routePath.startsWith("/") ? routePath : `/${routePath}`;
7027
+ if (!mountPrefix) return route;
7028
+ if (route === mountPrefix || route.startsWith(`${mountPrefix}/`)) return route;
7029
+ return `${mountPrefix}${route}`;
7030
+ }
7031
+ function resolveRiddleProofProfileRouteUrl(targetUrl, route) {
7032
+ if (/^https?:\/\//i.test(route)) return route;
7033
+ if (!targetUrl) return route;
7034
+ if (route.startsWith("/")) {
7035
+ const base = new URL(targetUrl);
7036
+ const mountPrefix = previewMountPrefix(base.pathname);
7037
+ if (mountPrefix) {
7038
+ const routeParts = new URL(route, base.origin);
7039
+ base.pathname = joinMountedRoutePath(mountPrefix, routeParts.pathname);
7040
+ base.search = routeParts.search;
7041
+ base.hash = routeParts.hash;
7042
+ return base.href;
7043
+ }
7044
+ }
7045
+ return new URL(route, targetUrl).href;
7046
+ }
7047
+ function mountedExpectedRoutePath(targetUrl, expected) {
7048
+ if (!targetUrl || !expected || !expected.startsWith("/")) return expected;
7049
+ const mountPrefix = previewMountPrefix(new URL(targetUrl).pathname);
7050
+ return mountPrefix ? joinMountedRoutePath(mountPrefix, expected) : expected;
7051
+ }
7052
+ function routePathMatches(observed, expected, targetUrl) {
7053
+ const normalizedObserved = normalizeRoutePath(observed);
7054
+ const normalizedExpected = normalizeRoutePath(expected);
7055
+ if (normalizedObserved === normalizedExpected) return true;
7056
+ return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
7057
+ }
7058
+ function successfulRoute(route, targetUrl) {
7059
+ const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
7060
+ return matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
7009
7061
  }
7010
7062
  function assessCheckFromEvidence(check, evidence) {
7011
7063
  const viewports = evidence.viewports || [];
@@ -7023,8 +7075,8 @@ function assessCheckFromEvidence(check, evidence) {
7023
7075
  const failed = viewports.filter((viewport) => !successfulRoute({
7024
7076
  ...viewport.route,
7025
7077
  expected_path: expectedPath,
7026
- matched: viewport.route.observed === expectedPath || viewport.route.matched
7027
- }));
7078
+ matched: routePathMatches(viewport.route.observed, expectedPath, evidence.target_url) || viewport.route.matched
7079
+ }, evidence.target_url));
7028
7080
  return {
7029
7081
  type: check.type,
7030
7082
  label: checkLabel(check),
@@ -7199,7 +7251,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
7199
7251
  runner: options.runner || "riddle",
7200
7252
  status,
7201
7253
  baseline_policy: profile.baseline_policy,
7202
- route: routeForViewport(firstViewport),
7254
+ route: routeForViewport(firstViewport, evidence?.target_url),
7203
7255
  artifacts: {
7204
7256
  screenshots,
7205
7257
  console: "console.json",
@@ -7275,8 +7327,37 @@ function createRiddleProofProfileInsufficientResult(input) {
7275
7327
  }
7276
7328
  function runtimeScriptAssessmentSource() {
7277
7329
  return String.raw`
7278
- function routeOk(route) {
7279
- return Boolean(route && route.matched && !route.error && (route.http_status == null || route.http_status < 400));
7330
+ function normalizeRoutePath(path) {
7331
+ const value = path || "/";
7332
+ if (value === "/") return "/";
7333
+ return value.replace(/\/+$/, "") || "/";
7334
+ }
7335
+ function previewMountPrefix(pathname) {
7336
+ const value = pathname || "/";
7337
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
7338
+ if (apiPreview) return apiPreview[1];
7339
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
7340
+ return internalPreview ? internalPreview[1] : "";
7341
+ }
7342
+ function joinMountedRoutePath(mountPrefix, routePath) {
7343
+ const route = routePath.startsWith("/") ? routePath : "/" + routePath;
7344
+ if (!mountPrefix) return route;
7345
+ if (route === mountPrefix || route.startsWith(mountPrefix + "/")) return route;
7346
+ return mountPrefix + route;
7347
+ }
7348
+ function mountedExpectedRoutePath(targetUrl, expected) {
7349
+ if (!targetUrl || !expected || !expected.startsWith("/")) return expected;
7350
+ const mountPrefix = previewMountPrefix(new URL(targetUrl).pathname);
7351
+ return mountPrefix ? joinMountedRoutePath(mountPrefix, expected) : expected;
7352
+ }
7353
+ function routePathMatches(observed, expected, targetUrl) {
7354
+ const normalizedObserved = normalizeRoutePath(observed);
7355
+ const normalizedExpected = normalizeRoutePath(expected);
7356
+ if (normalizedObserved === normalizedExpected) return true;
7357
+ return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
7358
+ }
7359
+ function routeOk(route, targetUrl) {
7360
+ return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
7280
7361
  }
7281
7362
  function textMatches(sample, check) {
7282
7363
  if (check.pattern) {
@@ -7333,8 +7414,8 @@ function assessProfile(profile, evidence) {
7333
7414
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
7334
7415
  const failed = viewports.filter((viewport) => {
7335
7416
  const route = { ...(viewport.route || {}), expected_path: expectedPath };
7336
- route.matched = route.observed === expectedPath || route.matched;
7337
- return !routeOk(route);
7417
+ route.matched = routePathMatches(route.observed, expectedPath, evidence.target_url) || route.matched;
7418
+ return !routeOk(route, evidence.target_url);
7338
7419
  });
7339
7420
  checks.push({
7340
7421
  type: check.type,
@@ -7506,6 +7587,9 @@ function setupTextMatches(sample, action) {
7506
7587
  async function setupLocatorText(locator, index) {
7507
7588
  return await locator.nth(index).textContent({ timeout: 1000 }).catch(() => "");
7508
7589
  }
7590
+ async function setupLocatorVisible(locator, index) {
7591
+ return await locator.nth(index).isVisible({ timeout: 1000 }).catch(() => false);
7592
+ }
7509
7593
  async function executeSetupAction(action, ordinal) {
7510
7594
  const type = setupActionType(action);
7511
7595
  const base = { ok: false, action: type || "unknown", ordinal, selector: action.selector || null };
@@ -7526,16 +7610,26 @@ async function executeSetupAction(action, ordinal) {
7526
7610
  if (!count) return { ...base, reason: "selector_not_found", count };
7527
7611
  let targetIndex = Number.isInteger(action.index) ? action.index : 0;
7528
7612
  let matchedText = null;
7613
+ let hiddenMatchIndex = -1;
7614
+ let hiddenMatchedText = null;
7529
7615
  if (action.text || action.pattern) {
7530
7616
  targetIndex = -1;
7531
7617
  for (let index = 0; index < count; index += 1) {
7532
7618
  const text = await setupLocatorText(locator, index);
7533
7619
  if (setupTextMatches(text, action)) {
7534
- targetIndex = index;
7535
- matchedText = text;
7536
- break;
7620
+ const visible = await setupLocatorVisible(locator, index);
7621
+ if (visible) {
7622
+ targetIndex = index;
7623
+ matchedText = text;
7624
+ break;
7625
+ }
7626
+ if (hiddenMatchIndex < 0) {
7627
+ hiddenMatchIndex = index;
7628
+ hiddenMatchedText = text;
7629
+ }
7537
7630
  }
7538
7631
  }
7632
+ if (targetIndex < 0 && hiddenMatchIndex >= 0) return { ...base, reason: "matching_element_not_visible", count, target_index: hiddenMatchIndex, text: hiddenMatchedText };
7539
7633
  if (targetIndex < 0) return { ...base, reason: "text_not_found", count };
7540
7634
  }
7541
7635
  if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex };
@@ -7662,7 +7756,7 @@ async function captureViewport(viewport) {
7662
7756
  requested: targetUrl,
7663
7757
  observed: dom.pathname,
7664
7758
  expected_path: expectedPath,
7665
- matched: dom.pathname === expectedPath,
7759
+ matched: routePathMatches(dom.pathname, expectedPath, targetUrl),
7666
7760
  http_status: httpStatus,
7667
7761
  error: navigationError || waitError || undefined,
7668
7762
  },
package/dist/cli.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  normalizeRiddleProofProfile,
10
10
  profileStatusExitCode,
11
11
  resolveRiddleProofProfileTargetUrl
12
- } from "./chunk-NUSUGO2P.js";
12
+ } from "./chunk-PZYQGRQ5.js";
13
13
  import {
14
14
  createRiddleApiClient,
15
15
  parseRiddleViewport
package/dist/index.cjs CHANGED
@@ -2994,6 +2994,7 @@ __export(index_exports, {
2994
2994
  redactForProofDiagnostics: () => redactForProofDiagnostics,
2995
2995
  resolveBasicGameplayProgressionCheckWithArtifactScreenshots: () => resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
2996
2996
  resolveRiddleApiKey: () => resolveRiddleApiKey,
2997
+ resolveRiddleProofProfileRouteUrl: () => resolveRiddleProofProfileRouteUrl,
2997
2998
  resolveRiddleProofProfileTargetUrl: () => resolveRiddleProofProfileTargetUrl,
2998
2999
  riddleRequestJson: () => riddleRequestJson,
2999
3000
  runCodexExecAgentDoctor: () => runCodexExecAgentDoctor,
@@ -8699,13 +8700,19 @@ function normalizeRiddleProofProfile(input, options = {}) {
8699
8700
  function resolveRiddleProofProfileTargetUrl(profile) {
8700
8701
  const route = profile.target.route || "";
8701
8702
  const targetUrl = profile.target.url || "";
8703
+ if (targetUrl && route) return resolveRiddleProofProfileRouteUrl(targetUrl, route);
8702
8704
  if (/^https?:\/\//i.test(route)) return route;
8703
- if (targetUrl && route) return new URL(route, targetUrl).href;
8704
8705
  if (targetUrl) return targetUrl;
8705
8706
  throw new Error("profile target URL could not be resolved.");
8706
8707
  }
8707
- function routeForViewport(viewport) {
8708
- return viewport?.route || {
8708
+ function routeForViewport(viewport, targetUrl) {
8709
+ if (viewport?.route) {
8710
+ return {
8711
+ ...viewport.route,
8712
+ matched: viewport.route.matched || routePathMatches(viewport.route.observed, viewport.route.expected_path, targetUrl)
8713
+ };
8714
+ }
8715
+ return {
8709
8716
  requested: "",
8710
8717
  observed: "",
8711
8718
  matched: false,
@@ -8731,8 +8738,54 @@ function matchText(sample, check) {
8731
8738
  }
8732
8739
  return sample.includes(check.text || "");
8733
8740
  }
8734
- function successfulRoute(route) {
8735
- return route.matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
8741
+ function normalizeRoutePath(path6) {
8742
+ const value = path6 || "/";
8743
+ if (value === "/") return "/";
8744
+ return value.replace(/\/+$/, "") || "/";
8745
+ }
8746
+ function previewMountPrefix(pathname) {
8747
+ const value = pathname || "/";
8748
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
8749
+ if (apiPreview) return apiPreview[1];
8750
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
8751
+ return internalPreview ? internalPreview[1] : "";
8752
+ }
8753
+ function joinMountedRoutePath(mountPrefix, routePath) {
8754
+ const route = routePath.startsWith("/") ? routePath : `/${routePath}`;
8755
+ if (!mountPrefix) return route;
8756
+ if (route === mountPrefix || route.startsWith(`${mountPrefix}/`)) return route;
8757
+ return `${mountPrefix}${route}`;
8758
+ }
8759
+ function resolveRiddleProofProfileRouteUrl(targetUrl, route) {
8760
+ if (/^https?:\/\//i.test(route)) return route;
8761
+ if (!targetUrl) return route;
8762
+ if (route.startsWith("/")) {
8763
+ const base = new URL(targetUrl);
8764
+ const mountPrefix = previewMountPrefix(base.pathname);
8765
+ if (mountPrefix) {
8766
+ const routeParts = new URL(route, base.origin);
8767
+ base.pathname = joinMountedRoutePath(mountPrefix, routeParts.pathname);
8768
+ base.search = routeParts.search;
8769
+ base.hash = routeParts.hash;
8770
+ return base.href;
8771
+ }
8772
+ }
8773
+ return new URL(route, targetUrl).href;
8774
+ }
8775
+ function mountedExpectedRoutePath(targetUrl, expected) {
8776
+ if (!targetUrl || !expected || !expected.startsWith("/")) return expected;
8777
+ const mountPrefix = previewMountPrefix(new URL(targetUrl).pathname);
8778
+ return mountPrefix ? joinMountedRoutePath(mountPrefix, expected) : expected;
8779
+ }
8780
+ function routePathMatches(observed, expected, targetUrl) {
8781
+ const normalizedObserved = normalizeRoutePath(observed);
8782
+ const normalizedExpected = normalizeRoutePath(expected);
8783
+ if (normalizedObserved === normalizedExpected) return true;
8784
+ return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
8785
+ }
8786
+ function successfulRoute(route, targetUrl) {
8787
+ const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
8788
+ return matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
8736
8789
  }
8737
8790
  function assessCheckFromEvidence(check, evidence) {
8738
8791
  const viewports = evidence.viewports || [];
@@ -8750,8 +8803,8 @@ function assessCheckFromEvidence(check, evidence) {
8750
8803
  const failed = viewports.filter((viewport) => !successfulRoute({
8751
8804
  ...viewport.route,
8752
8805
  expected_path: expectedPath,
8753
- matched: viewport.route.observed === expectedPath || viewport.route.matched
8754
- }));
8806
+ matched: routePathMatches(viewport.route.observed, expectedPath, evidence.target_url) || viewport.route.matched
8807
+ }, evidence.target_url));
8755
8808
  return {
8756
8809
  type: check.type,
8757
8810
  label: checkLabel(check),
@@ -8926,7 +8979,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
8926
8979
  runner: options.runner || "riddle",
8927
8980
  status,
8928
8981
  baseline_policy: profile.baseline_policy,
8929
- route: routeForViewport(firstViewport),
8982
+ route: routeForViewport(firstViewport, evidence?.target_url),
8930
8983
  artifacts: {
8931
8984
  screenshots,
8932
8985
  console: "console.json",
@@ -9018,8 +9071,37 @@ function createRiddleProofProfileInsufficientResult(input) {
9018
9071
  }
9019
9072
  function runtimeScriptAssessmentSource() {
9020
9073
  return String.raw`
9021
- function routeOk(route) {
9022
- return Boolean(route && route.matched && !route.error && (route.http_status == null || route.http_status < 400));
9074
+ function normalizeRoutePath(path) {
9075
+ const value = path || "/";
9076
+ if (value === "/") return "/";
9077
+ return value.replace(/\/+$/, "") || "/";
9078
+ }
9079
+ function previewMountPrefix(pathname) {
9080
+ const value = pathname || "/";
9081
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
9082
+ if (apiPreview) return apiPreview[1];
9083
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
9084
+ return internalPreview ? internalPreview[1] : "";
9085
+ }
9086
+ function joinMountedRoutePath(mountPrefix, routePath) {
9087
+ const route = routePath.startsWith("/") ? routePath : "/" + routePath;
9088
+ if (!mountPrefix) return route;
9089
+ if (route === mountPrefix || route.startsWith(mountPrefix + "/")) return route;
9090
+ return mountPrefix + route;
9091
+ }
9092
+ function mountedExpectedRoutePath(targetUrl, expected) {
9093
+ if (!targetUrl || !expected || !expected.startsWith("/")) return expected;
9094
+ const mountPrefix = previewMountPrefix(new URL(targetUrl).pathname);
9095
+ return mountPrefix ? joinMountedRoutePath(mountPrefix, expected) : expected;
9096
+ }
9097
+ function routePathMatches(observed, expected, targetUrl) {
9098
+ const normalizedObserved = normalizeRoutePath(observed);
9099
+ const normalizedExpected = normalizeRoutePath(expected);
9100
+ if (normalizedObserved === normalizedExpected) return true;
9101
+ return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
9102
+ }
9103
+ function routeOk(route, targetUrl) {
9104
+ return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
9023
9105
  }
9024
9106
  function textMatches(sample, check) {
9025
9107
  if (check.pattern) {
@@ -9076,8 +9158,8 @@ function assessProfile(profile, evidence) {
9076
9158
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
9077
9159
  const failed = viewports.filter((viewport) => {
9078
9160
  const route = { ...(viewport.route || {}), expected_path: expectedPath };
9079
- route.matched = route.observed === expectedPath || route.matched;
9080
- return !routeOk(route);
9161
+ route.matched = routePathMatches(route.observed, expectedPath, evidence.target_url) || route.matched;
9162
+ return !routeOk(route, evidence.target_url);
9081
9163
  });
9082
9164
  checks.push({
9083
9165
  type: check.type,
@@ -9249,6 +9331,9 @@ function setupTextMatches(sample, action) {
9249
9331
  async function setupLocatorText(locator, index) {
9250
9332
  return await locator.nth(index).textContent({ timeout: 1000 }).catch(() => "");
9251
9333
  }
9334
+ async function setupLocatorVisible(locator, index) {
9335
+ return await locator.nth(index).isVisible({ timeout: 1000 }).catch(() => false);
9336
+ }
9252
9337
  async function executeSetupAction(action, ordinal) {
9253
9338
  const type = setupActionType(action);
9254
9339
  const base = { ok: false, action: type || "unknown", ordinal, selector: action.selector || null };
@@ -9269,16 +9354,26 @@ async function executeSetupAction(action, ordinal) {
9269
9354
  if (!count) return { ...base, reason: "selector_not_found", count };
9270
9355
  let targetIndex = Number.isInteger(action.index) ? action.index : 0;
9271
9356
  let matchedText = null;
9357
+ let hiddenMatchIndex = -1;
9358
+ let hiddenMatchedText = null;
9272
9359
  if (action.text || action.pattern) {
9273
9360
  targetIndex = -1;
9274
9361
  for (let index = 0; index < count; index += 1) {
9275
9362
  const text = await setupLocatorText(locator, index);
9276
9363
  if (setupTextMatches(text, action)) {
9277
- targetIndex = index;
9278
- matchedText = text;
9279
- break;
9364
+ const visible = await setupLocatorVisible(locator, index);
9365
+ if (visible) {
9366
+ targetIndex = index;
9367
+ matchedText = text;
9368
+ break;
9369
+ }
9370
+ if (hiddenMatchIndex < 0) {
9371
+ hiddenMatchIndex = index;
9372
+ hiddenMatchedText = text;
9373
+ }
9280
9374
  }
9281
9375
  }
9376
+ if (targetIndex < 0 && hiddenMatchIndex >= 0) return { ...base, reason: "matching_element_not_visible", count, target_index: hiddenMatchIndex, text: hiddenMatchedText };
9282
9377
  if (targetIndex < 0) return { ...base, reason: "text_not_found", count };
9283
9378
  }
9284
9379
  if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex };
@@ -9405,7 +9500,7 @@ async function captureViewport(viewport) {
9405
9500
  requested: targetUrl,
9406
9501
  observed: dom.pathname,
9407
9502
  expected_path: expectedPath,
9408
- matched: dom.pathname === expectedPath,
9503
+ matched: routePathMatches(dom.pathname, expectedPath, targetUrl),
9409
9504
  http_status: httpStatus,
9410
9505
  error: navigationError || waitError || undefined,
9411
9506
  },
@@ -9840,6 +9935,7 @@ function createRiddleApiClient(config = {}) {
9840
9935
  redactForProofDiagnostics,
9841
9936
  resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
9842
9937
  resolveRiddleApiKey,
9938
+ resolveRiddleProofProfileRouteUrl,
9843
9939
  resolveRiddleProofProfileTargetUrl,
9844
9940
  riddleRequestJson,
9845
9941
  runCodexExecAgentDoctor,
package/dist/index.d.cts CHANGED
@@ -10,5 +10,5 @@ export { CreateCaptureDiagnosticInput, DEFAULT_DIAGNOSTIC_ARRAY_LIMIT, DEFAULT_D
10
10
  export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.cjs';
11
11
  export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.cjs';
12
12
  export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.cjs';
13
- export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileTargetUrl, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.cjs';
13
+ export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.cjs';
14
14
  export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobResult, RiddlePreviewDeployResult, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.cjs';
package/dist/index.d.ts CHANGED
@@ -10,5 +10,5 @@ export { CreateCaptureDiagnosticInput, DEFAULT_DIAGNOSTIC_ARRAY_LIMIT, DEFAULT_D
10
10
  export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.js';
11
11
  export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.js';
12
12
  export { AssessBasicGameplayOptions, AttachBasicGameplayArtifactOptions, BASIC_GAMEPLAY_ACTION_TYPES, BASIC_GAMEPLAY_PROGRESS_CHECK_TYPES, BasicGameplayActionResult, BasicGameplayActionType, BasicGameplayArtifactResolution, BasicGameplayAssessmentSummary, BasicGameplayCanvasState, BasicGameplayCatchRecord, BasicGameplayChangeSummary, BasicGameplayFailureCode, BasicGameplayFixReference, BasicGameplayMetric, BasicGameplayMobileEvidence, BasicGameplayProgressCheckType, BasicGameplayProgressionCheck, BasicGameplayProofArtifact, BasicGameplayRouteReference, BasicGameplaySnapshot, BasicGameplaySuiteFailure, BasicGameplayWarningCode, CreateBasicGameplayCatchSummaryInput, RIDDLE_PROOF_BASIC_GAMEPLAY_ASSESSMENT_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_CATCH_VERSION, RIDDLE_PROOF_BASIC_GAMEPLAY_VERSION, RiddleProofBasicGameplayAssessment, RiddleProofBasicGameplayCatchSummary, RiddleProofBasicGameplayEvidence, RiddleProofBasicGameplayRouteAssessment, RiddleProofBasicGameplayRouteEvidence, assessBasicGameplayEvidence, assessBasicGameplayProgressionCheck, assessBasicGameplayProgressionChecks, assessBasicGameplayRoute, attachBasicGameplayArtifactScreenshotHashes, augmentBasicGameplayAssessmentWithProgressionChecks, compactBasicGameplayText, createBasicGameplayCatchRecords, createBasicGameplayCatchSummary, extractBasicGameplayEvidence, resolveBasicGameplayProgressionCheckWithArtifactScreenshots, sanitizeBasicGameplayJsonString } from './basic-gameplay.js';
13
- export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileTargetUrl, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.js';
13
+ export { NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, RIDDLE_PROOF_PROFILE_STATUSES, RIDDLE_PROOF_PROFILE_VERSION, RiddleProofProfile, RiddleProofProfileArtifactRef, RiddleProofProfileBaselinePolicy, RiddleProofProfileCheck, RiddleProofProfileCheckResult, RiddleProofProfileCheckType, RiddleProofProfileEvidence, RiddleProofProfileFailureAction, RiddleProofProfileResult, RiddleProofProfileRouteEvidence, RiddleProofProfileRunner, RiddleProofProfileSetupAction, RiddleProofProfileSetupActionType, RiddleProofProfileStatus, RiddleProofProfileTarget, RiddleProofProfileViewport, RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult } from './profile.js';
14
14
  export { DEFAULT_RIDDLE_API_BASE_URL, DEFAULT_RIDDLE_API_KEY_FILE, RiddleApiError, RiddleClientConfig, RiddleFetch, RiddlePollJobResult, RiddlePreviewDeployResult, RiddleRunScriptInput, RiddleServerPreviewInput, RiddleServerPreviewResult, createRiddleApiClient, deployRiddleStaticPreview, isTerminalRiddleJobStatus, parseRiddleViewport, pollRiddleJob, resolveRiddleApiKey, riddleRequestJson, runRiddleScript, runRiddleServerPreview } from './riddle-client.js';
package/dist/index.js CHANGED
@@ -53,10 +53,11 @@ import {
53
53
  extractRiddleProofProfileResult,
54
54
  normalizeRiddleProofProfile,
55
55
  profileStatusExitCode,
56
+ resolveRiddleProofProfileRouteUrl,
56
57
  resolveRiddleProofProfileTargetUrl,
57
58
  slugifyRiddleProofProfileName,
58
59
  summarizeRiddleProofProfileResult
59
- } from "./chunk-NUSUGO2P.js";
60
+ } from "./chunk-PZYQGRQ5.js";
60
61
  import {
61
62
  DEFAULT_RIDDLE_API_BASE_URL,
62
63
  DEFAULT_RIDDLE_API_KEY_FILE,
@@ -231,6 +232,7 @@ export {
231
232
  redactForProofDiagnostics,
232
233
  resolveBasicGameplayProgressionCheckWithArtifactScreenshots,
233
234
  resolveRiddleApiKey,
235
+ resolveRiddleProofProfileRouteUrl,
234
236
  resolveRiddleProofProfileTargetUrl,
235
237
  riddleRequestJson,
236
238
  runCodexExecAgentDoctor,
package/dist/profile.cjs CHANGED
@@ -35,6 +35,7 @@ __export(profile_exports, {
35
35
  extractRiddleProofProfileResult: () => extractRiddleProofProfileResult,
36
36
  normalizeRiddleProofProfile: () => normalizeRiddleProofProfile,
37
37
  profileStatusExitCode: () => profileStatusExitCode,
38
+ resolveRiddleProofProfileRouteUrl: () => resolveRiddleProofProfileRouteUrl,
38
39
  resolveRiddleProofProfileTargetUrl: () => resolveRiddleProofProfileTargetUrl,
39
40
  slugifyRiddleProofProfileName: () => slugifyRiddleProofProfileName,
40
41
  summarizeRiddleProofProfileResult: () => summarizeRiddleProofProfileResult
@@ -234,13 +235,19 @@ function normalizeRiddleProofProfile(input, options = {}) {
234
235
  function resolveRiddleProofProfileTargetUrl(profile) {
235
236
  const route = profile.target.route || "";
236
237
  const targetUrl = profile.target.url || "";
238
+ if (targetUrl && route) return resolveRiddleProofProfileRouteUrl(targetUrl, route);
237
239
  if (/^https?:\/\//i.test(route)) return route;
238
- if (targetUrl && route) return new URL(route, targetUrl).href;
239
240
  if (targetUrl) return targetUrl;
240
241
  throw new Error("profile target URL could not be resolved.");
241
242
  }
242
- function routeForViewport(viewport) {
243
- return viewport?.route || {
243
+ function routeForViewport(viewport, targetUrl) {
244
+ if (viewport?.route) {
245
+ return {
246
+ ...viewport.route,
247
+ matched: viewport.route.matched || routePathMatches(viewport.route.observed, viewport.route.expected_path, targetUrl)
248
+ };
249
+ }
250
+ return {
244
251
  requested: "",
245
252
  observed: "",
246
253
  matched: false,
@@ -266,8 +273,54 @@ function matchText(sample, check) {
266
273
  }
267
274
  return sample.includes(check.text || "");
268
275
  }
269
- function successfulRoute(route) {
270
- return route.matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
276
+ function normalizeRoutePath(path) {
277
+ const value = path || "/";
278
+ if (value === "/") return "/";
279
+ return value.replace(/\/+$/, "") || "/";
280
+ }
281
+ function previewMountPrefix(pathname) {
282
+ const value = pathname || "/";
283
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
284
+ if (apiPreview) return apiPreview[1];
285
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
286
+ return internalPreview ? internalPreview[1] : "";
287
+ }
288
+ function joinMountedRoutePath(mountPrefix, routePath) {
289
+ const route = routePath.startsWith("/") ? routePath : `/${routePath}`;
290
+ if (!mountPrefix) return route;
291
+ if (route === mountPrefix || route.startsWith(`${mountPrefix}/`)) return route;
292
+ return `${mountPrefix}${route}`;
293
+ }
294
+ function resolveRiddleProofProfileRouteUrl(targetUrl, route) {
295
+ if (/^https?:\/\//i.test(route)) return route;
296
+ if (!targetUrl) return route;
297
+ if (route.startsWith("/")) {
298
+ const base = new URL(targetUrl);
299
+ const mountPrefix = previewMountPrefix(base.pathname);
300
+ if (mountPrefix) {
301
+ const routeParts = new URL(route, base.origin);
302
+ base.pathname = joinMountedRoutePath(mountPrefix, routeParts.pathname);
303
+ base.search = routeParts.search;
304
+ base.hash = routeParts.hash;
305
+ return base.href;
306
+ }
307
+ }
308
+ return new URL(route, targetUrl).href;
309
+ }
310
+ function mountedExpectedRoutePath(targetUrl, expected) {
311
+ if (!targetUrl || !expected || !expected.startsWith("/")) return expected;
312
+ const mountPrefix = previewMountPrefix(new URL(targetUrl).pathname);
313
+ return mountPrefix ? joinMountedRoutePath(mountPrefix, expected) : expected;
314
+ }
315
+ function routePathMatches(observed, expected, targetUrl) {
316
+ const normalizedObserved = normalizeRoutePath(observed);
317
+ const normalizedExpected = normalizeRoutePath(expected);
318
+ if (normalizedObserved === normalizedExpected) return true;
319
+ return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
320
+ }
321
+ function successfulRoute(route, targetUrl) {
322
+ const matched = route.matched || routePathMatches(route.observed, route.expected_path, targetUrl);
323
+ return matched && !route.error && (route.http_status === null || route.http_status === void 0 || route.http_status < 400);
271
324
  }
272
325
  function assessCheckFromEvidence(check, evidence) {
273
326
  const viewports = evidence.viewports || [];
@@ -285,8 +338,8 @@ function assessCheckFromEvidence(check, evidence) {
285
338
  const failed = viewports.filter((viewport) => !successfulRoute({
286
339
  ...viewport.route,
287
340
  expected_path: expectedPath,
288
- matched: viewport.route.observed === expectedPath || viewport.route.matched
289
- }));
341
+ matched: routePathMatches(viewport.route.observed, expectedPath, evidence.target_url) || viewport.route.matched
342
+ }, evidence.target_url));
290
343
  return {
291
344
  type: check.type,
292
345
  label: checkLabel(check),
@@ -461,7 +514,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
461
514
  runner: options.runner || "riddle",
462
515
  status,
463
516
  baseline_policy: profile.baseline_policy,
464
- route: routeForViewport(firstViewport),
517
+ route: routeForViewport(firstViewport, evidence?.target_url),
465
518
  artifacts: {
466
519
  screenshots,
467
520
  console: "console.json",
@@ -553,8 +606,37 @@ function createRiddleProofProfileInsufficientResult(input) {
553
606
  }
554
607
  function runtimeScriptAssessmentSource() {
555
608
  return String.raw`
556
- function routeOk(route) {
557
- return Boolean(route && route.matched && !route.error && (route.http_status == null || route.http_status < 400));
609
+ function normalizeRoutePath(path) {
610
+ const value = path || "/";
611
+ if (value === "/") return "/";
612
+ return value.replace(/\/+$/, "") || "/";
613
+ }
614
+ function previewMountPrefix(pathname) {
615
+ const value = pathname || "/";
616
+ const apiPreview = value.match(/^(\/s\/[^/]+)(?:\/|$)/);
617
+ if (apiPreview) return apiPreview[1];
618
+ const internalPreview = value.match(/^(\/preview\/[^/]+\/[^/]+)(?:\/|$)/);
619
+ return internalPreview ? internalPreview[1] : "";
620
+ }
621
+ function joinMountedRoutePath(mountPrefix, routePath) {
622
+ const route = routePath.startsWith("/") ? routePath : "/" + routePath;
623
+ if (!mountPrefix) return route;
624
+ if (route === mountPrefix || route.startsWith(mountPrefix + "/")) return route;
625
+ return mountPrefix + route;
626
+ }
627
+ function mountedExpectedRoutePath(targetUrl, expected) {
628
+ if (!targetUrl || !expected || !expected.startsWith("/")) return expected;
629
+ const mountPrefix = previewMountPrefix(new URL(targetUrl).pathname);
630
+ return mountPrefix ? joinMountedRoutePath(mountPrefix, expected) : expected;
631
+ }
632
+ function routePathMatches(observed, expected, targetUrl) {
633
+ const normalizedObserved = normalizeRoutePath(observed);
634
+ const normalizedExpected = normalizeRoutePath(expected);
635
+ if (normalizedObserved === normalizedExpected) return true;
636
+ return normalizedObserved === normalizeRoutePath(mountedExpectedRoutePath(targetUrl, expected));
637
+ }
638
+ function routeOk(route, targetUrl) {
639
+ return Boolean(route && (route.matched || routePathMatches(route.observed, route.expected_path, targetUrl)) && !route.error && (route.http_status == null || route.http_status < 400));
558
640
  }
559
641
  function textMatches(sample, check) {
560
642
  if (check.pattern) {
@@ -611,8 +693,8 @@ function assessProfile(profile, evidence) {
611
693
  const expectedPath = check.expected_path || new URL(evidence.target_url).pathname || "/";
612
694
  const failed = viewports.filter((viewport) => {
613
695
  const route = { ...(viewport.route || {}), expected_path: expectedPath };
614
- route.matched = route.observed === expectedPath || route.matched;
615
- return !routeOk(route);
696
+ route.matched = routePathMatches(route.observed, expectedPath, evidence.target_url) || route.matched;
697
+ return !routeOk(route, evidence.target_url);
616
698
  });
617
699
  checks.push({
618
700
  type: check.type,
@@ -784,6 +866,9 @@ function setupTextMatches(sample, action) {
784
866
  async function setupLocatorText(locator, index) {
785
867
  return await locator.nth(index).textContent({ timeout: 1000 }).catch(() => "");
786
868
  }
869
+ async function setupLocatorVisible(locator, index) {
870
+ return await locator.nth(index).isVisible({ timeout: 1000 }).catch(() => false);
871
+ }
787
872
  async function executeSetupAction(action, ordinal) {
788
873
  const type = setupActionType(action);
789
874
  const base = { ok: false, action: type || "unknown", ordinal, selector: action.selector || null };
@@ -804,16 +889,26 @@ async function executeSetupAction(action, ordinal) {
804
889
  if (!count) return { ...base, reason: "selector_not_found", count };
805
890
  let targetIndex = Number.isInteger(action.index) ? action.index : 0;
806
891
  let matchedText = null;
892
+ let hiddenMatchIndex = -1;
893
+ let hiddenMatchedText = null;
807
894
  if (action.text || action.pattern) {
808
895
  targetIndex = -1;
809
896
  for (let index = 0; index < count; index += 1) {
810
897
  const text = await setupLocatorText(locator, index);
811
898
  if (setupTextMatches(text, action)) {
812
- targetIndex = index;
813
- matchedText = text;
814
- break;
899
+ const visible = await setupLocatorVisible(locator, index);
900
+ if (visible) {
901
+ targetIndex = index;
902
+ matchedText = text;
903
+ break;
904
+ }
905
+ if (hiddenMatchIndex < 0) {
906
+ hiddenMatchIndex = index;
907
+ hiddenMatchedText = text;
908
+ }
815
909
  }
816
910
  }
911
+ if (targetIndex < 0 && hiddenMatchIndex >= 0) return { ...base, reason: "matching_element_not_visible", count, target_index: hiddenMatchIndex, text: hiddenMatchedText };
817
912
  if (targetIndex < 0) return { ...base, reason: "text_not_found", count };
818
913
  }
819
914
  if (targetIndex < 0 || targetIndex >= count) return { ...base, reason: "index_out_of_range", count, target_index: targetIndex };
@@ -940,7 +1035,7 @@ async function captureViewport(viewport) {
940
1035
  requested: targetUrl,
941
1036
  observed: dom.pathname,
942
1037
  expected_path: expectedPath,
943
- matched: dom.pathname === expectedPath,
1038
+ matched: routePathMatches(dom.pathname, expectedPath, targetUrl),
944
1039
  http_status: httpStatus,
945
1040
  error: navigationError || waitError || undefined,
946
1041
  },
@@ -1062,6 +1157,7 @@ function extractRiddleProofProfileResult(input) {
1062
1157
  extractRiddleProofProfileResult,
1063
1158
  normalizeRiddleProofProfile,
1064
1159
  profileStatusExitCode,
1160
+ resolveRiddleProofProfileRouteUrl,
1065
1161
  resolveRiddleProofProfileTargetUrl,
1066
1162
  slugifyRiddleProofProfileName,
1067
1163
  summarizeRiddleProofProfileResult
@@ -157,6 +157,7 @@ interface NormalizeRiddleProofProfileOptions {
157
157
  declare function slugifyRiddleProofProfileName(value: string): string;
158
158
  declare function normalizeRiddleProofProfile(input: unknown, options?: NormalizeRiddleProofProfileOptions): RiddleProofProfile;
159
159
  declare function resolveRiddleProofProfileTargetUrl(profile: RiddleProofProfile): string;
160
+ declare function resolveRiddleProofProfileRouteUrl(targetUrl: string, route: string): string;
160
161
  declare function assessRiddleProofProfileEvidence(profile: RiddleProofProfile, evidence: RiddleProofProfileEvidence | undefined, options?: {
161
162
  runner?: RiddleProofProfileRunner;
162
163
  riddle?: RiddleProofProfileResult["riddle"];
@@ -188,4 +189,4 @@ declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): str
188
189
  declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
189
190
  declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
190
191
 
191
- export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, 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 RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileTargetUrl, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
192
+ export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, 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 RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
package/dist/profile.d.ts CHANGED
@@ -157,6 +157,7 @@ interface NormalizeRiddleProofProfileOptions {
157
157
  declare function slugifyRiddleProofProfileName(value: string): string;
158
158
  declare function normalizeRiddleProofProfile(input: unknown, options?: NormalizeRiddleProofProfileOptions): RiddleProofProfile;
159
159
  declare function resolveRiddleProofProfileTargetUrl(profile: RiddleProofProfile): string;
160
+ declare function resolveRiddleProofProfileRouteUrl(targetUrl: string, route: string): string;
160
161
  declare function assessRiddleProofProfileEvidence(profile: RiddleProofProfile, evidence: RiddleProofProfileEvidence | undefined, options?: {
161
162
  runner?: RiddleProofProfileRunner;
162
163
  riddle?: RiddleProofProfileResult["riddle"];
@@ -188,4 +189,4 @@ declare function buildRiddleProofProfileScript(profile: RiddleProofProfile): str
188
189
  declare function collectRiddleProfileArtifactRefs(input: unknown): RiddleProofProfileArtifactRef[];
189
190
  declare function extractRiddleProofProfileResult(input: unknown): RiddleProofProfileResult | undefined;
190
191
 
191
- export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, 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 RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileTargetUrl, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
192
+ export { type NormalizeRiddleProofProfileOptions, RIDDLE_PROOF_PROFILE_CHECK_TYPES, RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION, RIDDLE_PROOF_PROFILE_RESULT_VERSION, RIDDLE_PROOF_PROFILE_SETUP_ACTION_TYPES, 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 RiddleProofProfileSetupAction, type RiddleProofProfileSetupActionType, type RiddleProofProfileStatus, type RiddleProofProfileTarget, type RiddleProofProfileViewport, type RiddleProofProfileViewportEvidence, assessRiddleProofProfileEvidence, buildRiddleProofProfileScript, collectRiddleProfileArtifactRefs, createRiddleProofProfileConfigurationError, createRiddleProofProfileEnvironmentBlockedResult, createRiddleProofProfileInsufficientResult, extractRiddleProofProfileResult, normalizeRiddleProofProfile, profileStatusExitCode, resolveRiddleProofProfileRouteUrl, resolveRiddleProofProfileTargetUrl, slugifyRiddleProofProfileName, summarizeRiddleProofProfileResult };
package/dist/profile.js CHANGED
@@ -14,10 +14,11 @@ import {
14
14
  extractRiddleProofProfileResult,
15
15
  normalizeRiddleProofProfile,
16
16
  profileStatusExitCode,
17
+ resolveRiddleProofProfileRouteUrl,
17
18
  resolveRiddleProofProfileTargetUrl,
18
19
  slugifyRiddleProofProfileName,
19
20
  summarizeRiddleProofProfileResult
20
- } from "./chunk-NUSUGO2P.js";
21
+ } from "./chunk-PZYQGRQ5.js";
21
22
  export {
22
23
  RIDDLE_PROOF_PROFILE_CHECK_TYPES,
23
24
  RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
@@ -34,6 +35,7 @@ export {
34
35
  extractRiddleProofProfileResult,
35
36
  normalizeRiddleProofProfile,
36
37
  profileStatusExitCode,
38
+ resolveRiddleProofProfileRouteUrl,
37
39
  resolveRiddleProofProfileTargetUrl,
38
40
  slugifyRiddleProofProfileName,
39
41
  summarizeRiddleProofProfileResult
@@ -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.9",
3
+ "version": "0.7.11",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",