@riddledc/riddle-proof 0.7.182 → 0.7.184

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
@@ -245,9 +245,13 @@ The package includes generic starter profiles:
245
245
  - `examples/profiles/handled-recovery-action-malformed-success.json` for action recovery profiles where the request succeeds at HTTP level but returns an unusable body.
246
246
  - `examples/profiles/terminal-result-partial-evidence.json` for API-console terminal error or timeout receipts that preserve partial screenshot, console, and HAR evidence.
247
247
  - `examples/profiles/gameplay-window-call-until.json` for gameplay profiles that wait on a runtime state contract instead of a fixed sleep.
248
+ - `examples/profiles/spa-route-exit-state-hygiene.json` for SPA routes that must clean up short-lived proof helpers, receipts, timers, input state, or touch state after visible UI navigation exits the route.
248
249
 
249
250
  Copy one of those shapes into a repository profile directory and replace the
250
251
  routes, selectors, mock URLs, and text checks with app-specific invariants.
252
+ For route-exit hygiene profiles, replace the watched global names with state
253
+ that is expected to exist while the route is active and expected to disappear
254
+ after navigation returns to the owning app shell.
251
255
 
252
256
  For handled recovery profiles, prefer proving the whole boundary instead of
253
257
  only checking that an error message appears. Mock one dependent endpoint into a
@@ -613,7 +613,7 @@ function profileSetupTapReceipts(results) {
613
613
  reason: result.reason ?? result.error ?? null
614
614
  }));
615
615
  }
616
- function profileSetupPressReceipts(results) {
616
+ function profileSetupKeyboardReceipts(results) {
617
617
  return results.filter((result) => ["press", "key_down", "key_up"].includes(profileSetupResultAction(result))).map((result) => ({
618
618
  action: profileSetupResultAction(result),
619
619
  ordinal: result.ordinal ?? null,
@@ -788,8 +788,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
788
788
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
789
789
  const tapReceipts = profileSetupTapReceipts(results);
790
790
  const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
791
- const pressReceipts = profileSetupPressReceipts(results);
792
- const sampledPressReceipts = sampleProfileSetupSummaryItems(pressReceipts, 8);
791
+ const keyboardReceipts = profileSetupKeyboardReceipts(results);
792
+ const sampledKeyboardReceipts = sampleProfileSetupSummaryItems(keyboardReceipts, 8);
793
793
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
794
794
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
795
795
  const clickedItems = results.filter((result) => profileSetupResultAction(result) === "click" && result.ok !== false).map((result) => {
@@ -857,9 +857,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
857
857
  tap_total: tapReceipts.length,
858
858
  tap_truncated: tapReceipts.length > sampledTapReceipts.length,
859
859
  tap: sampledTapReceipts,
860
- press_total: pressReceipts.length,
861
- press_truncated: pressReceipts.length > sampledPressReceipts.length,
862
- press: sampledPressReceipts,
860
+ keyboard_total: keyboardReceipts.length,
861
+ keyboard_truncated: keyboardReceipts.length > sampledKeyboardReceipts.length,
862
+ keyboard: sampledKeyboardReceipts,
863
863
  canvas_signature_total: canvasSignatureReceipts.length,
864
864
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
865
865
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -3460,6 +3460,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
3460
3460
  checks,
3461
3461
  summary: summarizeRiddleProofProfileResult({ profile_name: profile.name, status, checks, viewports: evidence?.viewports || [] }),
3462
3462
  captured_at: capturedAt,
3463
+ metadata: profile.metadata,
3463
3464
  warnings: warnings.length ? warnings : void 0,
3464
3465
  evidence,
3465
3466
  riddle: options.riddle
@@ -3521,6 +3522,7 @@ function createRiddleProofProfileEnvironmentBlockedResult(input) {
3521
3522
  checks: [],
3522
3523
  summary: summarizeEnvironmentBlockedRunner(input.profile.name, environmentBlocker),
3523
3524
  captured_at: (/* @__PURE__ */ new Date()).toISOString(),
3525
+ metadata: input.profile.metadata,
3524
3526
  warnings: warnings.length ? warnings : void 0,
3525
3527
  riddle: input.riddle,
3526
3528
  environment_blocker: environmentBlocker,
@@ -3597,6 +3599,7 @@ function createRiddleProofProfileInsufficientResult(input) {
3597
3599
  checks: [],
3598
3600
  summary: `${input.profile.name} did not produce enough evidence for a profile judgment.`,
3599
3601
  captured_at: (/* @__PURE__ */ new Date()).toISOString(),
3602
+ metadata: input.profile.metadata,
3600
3603
  warnings: warnings.length ? warnings : void 0,
3601
3604
  riddle: input.riddle,
3602
3605
  error: message
@@ -4497,7 +4500,7 @@ function profileSetupTapReceipts(results) {
4497
4500
  reason: result.reason || result.error || null,
4498
4501
  }));
4499
4502
  }
4500
- function profileSetupPressReceipts(results) {
4503
+ function profileSetupKeyboardReceipts(results) {
4501
4504
  return (results || [])
4502
4505
  .filter((result) => result && ["press", "key_down", "key_up"].includes(profileSetupResultAction(result)))
4503
4506
  .map((result) => ({
@@ -4699,8 +4702,8 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
4699
4702
  const sampledDragReceipts = sampleProfileSetupSummaryItems(dragReceipts, 8);
4700
4703
  const tapReceipts = profileSetupTapReceipts(results);
4701
4704
  const sampledTapReceipts = sampleProfileSetupSummaryItems(tapReceipts, 8);
4702
- const pressReceipts = profileSetupPressReceipts(results);
4703
- const sampledPressReceipts = sampleProfileSetupSummaryItems(pressReceipts, 8);
4705
+ const keyboardReceipts = profileSetupKeyboardReceipts(results);
4706
+ const sampledKeyboardReceipts = sampleProfileSetupSummaryItems(keyboardReceipts, 8);
4704
4707
  const canvasSignatureReceipts = profileSetupCanvasSignatureReceipts(results);
4705
4708
  const sampledCanvasSignatureReceipts = sampleProfileSetupSummaryItems(canvasSignatureReceipts, 8);
4706
4709
  const clickedItems = results
@@ -4778,9 +4781,9 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
4778
4781
  tap_total: tapReceipts.length,
4779
4782
  tap_truncated: tapReceipts.length > sampledTapReceipts.length,
4780
4783
  tap: sampledTapReceipts,
4781
- press_total: pressReceipts.length,
4782
- press_truncated: pressReceipts.length > sampledPressReceipts.length,
4783
- press: sampledPressReceipts,
4784
+ keyboard_total: keyboardReceipts.length,
4785
+ keyboard_truncated: keyboardReceipts.length > sampledKeyboardReceipts.length,
4786
+ keyboard: sampledKeyboardReceipts,
4784
4787
  canvas_signature_total: canvasSignatureReceipts.length,
4785
4788
  canvas_signature_truncated: canvasSignatureReceipts.length > sampledCanvasSignatureReceipts.length,
4786
4789
  canvas_signature: sampledCanvasSignatureReceipts,
@@ -5523,6 +5526,7 @@ function assessProfile(profile, evidence) {
5523
5526
  checks,
5524
5527
  summary,
5525
5528
  captured_at: evidence.captured_at,
5529
+ metadata: profile.metadata,
5526
5530
  warnings: profileWarnings.length ? profileWarnings : undefined,
5527
5531
  evidence,
5528
5532
  };