@riddledc/riddle-proof 0.7.183 → 0.7.185

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
@@ -489,8 +489,9 @@ function profileSetupWindowCallReceipts(results) {
489
489
  path: result.path ?? null,
490
490
  return_captured: result.return_captured ?? null,
491
491
  return_stored_to: result.return_stored_to ?? null,
492
- reason: result.reason ?? result.error ?? result.store_reason ?? null
492
+ reason: result.reason ?? result.store_reason ?? null
493
493
  };
494
+ if (result.error !== void 0) receipt.error = result.error;
494
495
  if (result.returned !== void 0) receipt.returned = result.returned;
495
496
  if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
496
497
  const returnSummary = profileSetupReturnSummary(result);
@@ -506,8 +507,9 @@ function profileSetupWindowEvalReceipts(results) {
506
507
  script_length: result.script_length ?? null,
507
508
  return_captured: result.return_captured ?? null,
508
509
  return_stored_to: result.return_stored_to ?? null,
509
- reason: result.reason ?? result.error ?? result.store_reason ?? null
510
+ reason: result.reason ?? result.store_reason ?? null
510
511
  };
512
+ if (result.error !== void 0) receipt.error = result.error;
511
513
  if (result.returned !== void 0) receipt.returned = result.returned;
512
514
  if (result.expected_return !== void 0) receipt.expected_return = result.expected_return;
513
515
  const returnSummary = profileSetupReturnSummary(result);
@@ -872,6 +874,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
872
874
  selector: result.selector ?? null,
873
875
  frame_selector: result.frame_selector ?? null,
874
876
  reason: result.reason ?? result.error ?? null,
877
+ error: result.error ?? null,
875
878
  case_insensitive_text: compactProfileSetupSummaryText(result.case_insensitive_text)
876
879
  })),
877
880
  optional_failed: optionalFailed.map((result) => ({
@@ -880,6 +883,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountByViewpo
880
883
  selector: result.selector ?? null,
881
884
  frame_selector: result.frame_selector ?? null,
882
885
  reason: result.reason ?? result.error ?? null,
886
+ error: result.error ?? null,
883
887
  case_insensitive_text: compactProfileSetupSummaryText(result.case_insensitive_text)
884
888
  }))
885
889
  };
@@ -3460,6 +3464,7 @@ function assessRiddleProofProfileEvidence(profile, evidence, options = {}) {
3460
3464
  checks,
3461
3465
  summary: summarizeRiddleProofProfileResult({ profile_name: profile.name, status, checks, viewports: evidence?.viewports || [] }),
3462
3466
  captured_at: capturedAt,
3467
+ metadata: profile.metadata,
3463
3468
  warnings: warnings.length ? warnings : void 0,
3464
3469
  evidence,
3465
3470
  riddle: options.riddle
@@ -3521,6 +3526,7 @@ function createRiddleProofProfileEnvironmentBlockedResult(input) {
3521
3526
  checks: [],
3522
3527
  summary: summarizeEnvironmentBlockedRunner(input.profile.name, environmentBlocker),
3523
3528
  captured_at: (/* @__PURE__ */ new Date()).toISOString(),
3529
+ metadata: input.profile.metadata,
3524
3530
  warnings: warnings.length ? warnings : void 0,
3525
3531
  riddle: input.riddle,
3526
3532
  environment_blocker: environmentBlocker,
@@ -3597,6 +3603,7 @@ function createRiddleProofProfileInsufficientResult(input) {
3597
3603
  checks: [],
3598
3604
  summary: `${input.profile.name} did not produce enough evidence for a profile judgment.`,
3599
3605
  captured_at: (/* @__PURE__ */ new Date()).toISOString(),
3606
+ metadata: input.profile.metadata,
3600
3607
  warnings: warnings.length ? warnings : void 0,
3601
3608
  riddle: input.riddle,
3602
3609
  error: message
@@ -4363,8 +4370,9 @@ function profileSetupWindowCallReceipts(results) {
4363
4370
  path: result.path ?? null,
4364
4371
  return_captured: result.return_captured ?? null,
4365
4372
  return_stored_to: result.return_stored_to ?? null,
4366
- reason: result.reason || result.error || result.store_reason || null,
4373
+ reason: result.reason || result.store_reason || null,
4367
4374
  };
4375
+ if (result.error !== undefined) receipt.error = result.error;
4368
4376
  if (result.returned !== undefined) receipt.returned = result.returned;
4369
4377
  if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
4370
4378
  const returnSummary = profileSetupReturnSummary(result);
@@ -4382,8 +4390,9 @@ function profileSetupWindowEvalReceipts(results) {
4382
4390
  script_length: result.script_length ?? null,
4383
4391
  return_captured: result.return_captured ?? null,
4384
4392
  return_stored_to: result.return_stored_to ?? null,
4385
- reason: result.reason || result.error || result.store_reason || null,
4393
+ reason: result.reason || result.store_reason || null,
4386
4394
  };
4395
+ if (result.error !== undefined) receipt.error = result.error;
4387
4396
  if (result.returned !== undefined) receipt.returned = result.returned;
4388
4397
  if (result.expected_return !== undefined) receipt.expected_return = result.expected_return;
4389
4398
  const returnSummary = profileSetupReturnSummary(result);
@@ -4793,6 +4802,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
4793
4802
  selector: result.selector ?? null,
4794
4803
  frame_selector: result.frame_selector ?? null,
4795
4804
  reason: result.reason || result.error || null,
4805
+ error: result.error || null,
4796
4806
  case_insensitive_text: compactProfileSetupSummaryText(result.case_insensitive_text),
4797
4807
  })),
4798
4808
  optional_failed: optionalFailed.map((result) => ({
@@ -4801,6 +4811,7 @@ function profileSetupSummary(viewports, actionCount, expectedActionCountsByViewp
4801
4811
  selector: result.selector ?? null,
4802
4812
  frame_selector: result.frame_selector ?? null,
4803
4813
  reason: result.reason || result.error || null,
4814
+ error: result.error || null,
4804
4815
  case_insensitive_text: compactProfileSetupSummaryText(result.case_insensitive_text),
4805
4816
  })),
4806
4817
  };
@@ -5523,6 +5534,7 @@ function assessProfile(profile, evidence) {
5523
5534
  checks,
5524
5535
  summary,
5525
5536
  captured_at: evidence.captured_at,
5537
+ metadata: profile.metadata,
5526
5538
  warnings: profileWarnings.length ? profileWarnings : undefined,
5527
5539
  evidence,
5528
5540
  };