@riddledc/riddle-proof 0.8.2 → 0.8.4

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.
Files changed (55) hide show
  1. package/dist/adapters/openclaw.js +4 -4
  2. package/dist/advanced/engine-harness.cjs +33 -11
  3. package/dist/advanced/engine-harness.js +4 -4
  4. package/dist/advanced/index.cjs +33 -11
  5. package/dist/advanced/index.d.cts +1 -1
  6. package/dist/advanced/index.d.ts +1 -1
  7. package/dist/advanced/index.js +6 -6
  8. package/dist/advanced/proof-run-engine.cjs +28 -8
  9. package/dist/advanced/proof-run-engine.d.cts +1 -1
  10. package/dist/advanced/proof-run-engine.d.ts +1 -1
  11. package/dist/advanced/proof-run-engine.js +1 -1
  12. package/dist/advanced/runner.js +4 -4
  13. package/dist/checkpoint.cjs +3 -1
  14. package/dist/checkpoint.js +1 -1
  15. package/dist/{chunk-SKIAZTQ7.js → chunk-4FOHZ7JG.js} +3 -1
  16. package/dist/{chunk-U4FUFBSH.js → chunk-FMOYUYH2.js} +1 -1
  17. package/dist/{chunk-YB5ACBZE.js → chunk-IP64JLLR.js} +5 -5
  18. package/dist/{chunk-OIFHYMHP.js → chunk-LZFCIHDT.js} +2 -2
  19. package/dist/{chunk-TZ3YMCDM.js → chunk-P22V26PS.js} +28 -8
  20. package/dist/{chunk-SMBZT46I.js → chunk-RBWSCU6V.js} +1 -1
  21. package/dist/{chunk-ZX45XGDJ.js → chunk-UIJ7X63P.js} +1 -1
  22. package/dist/{chunk-TNCDVE5O.js → chunk-YZUVEJ5B.js} +1 -1
  23. package/dist/cli/index.js +5 -5
  24. package/dist/cli.cjs +33 -11
  25. package/dist/cli.js +5 -5
  26. package/dist/engine-harness.cjs +33 -11
  27. package/dist/engine-harness.js +4 -4
  28. package/dist/index.cjs +33 -11
  29. package/dist/index.js +5 -5
  30. package/dist/openclaw.js +4 -4
  31. package/dist/{proof-run-engine-CVnboNHj.d.cts → proof-run-engine-B7DCPzpK.d.cts} +3 -3
  32. package/dist/{proof-run-engine-BVkeO-Yo.d.ts → proof-run-engine-BomAcXhA.d.ts} +3 -3
  33. package/dist/proof-run-engine.cjs +28 -8
  34. package/dist/proof-run-engine.d.cts +1 -1
  35. package/dist/proof-run-engine.d.ts +1 -1
  36. package/dist/proof-run-engine.js +1 -1
  37. package/dist/run-card.js +2 -2
  38. package/dist/runner.js +4 -4
  39. package/dist/spec/checkpoint.cjs +3 -1
  40. package/dist/spec/checkpoint.js +1 -1
  41. package/dist/spec/index.cjs +3 -1
  42. package/dist/spec/index.js +3 -3
  43. package/dist/spec/run-card.js +2 -2
  44. package/dist/spec/state.js +3 -3
  45. package/dist/state.js +3 -3
  46. package/package.json +1 -1
  47. package/runtime/lib/util.py +57 -0
  48. package/runtime/lib/verify.py +128 -5
  49. package/runtime/pipelines/riddle-proof-author.lobster +2 -1
  50. package/runtime/pipelines/riddle-proof-implement.lobster +2 -1
  51. package/runtime/pipelines/riddle-proof-recon.lobster +2 -1
  52. package/runtime/pipelines/riddle-proof-setup.lobster +4 -2
  53. package/runtime/pipelines/riddle-proof-ship.lobster +2 -1
  54. package/runtime/pipelines/riddle-proof-verify.lobster +2 -1
  55. package/runtime/tests/recon_verify_smoke.py +116 -0
@@ -249,6 +249,47 @@ class FakeRiddle:
249
249
  'largeVisibleElements': [{'tag': 'button', 'text': 'Buy Now'}],
250
250
  }),
251
251
  }
252
+ if 'clickedSkipHashNavigation' in script:
253
+ page_state = {
254
+ 'bodyTextLength': 180,
255
+ 'visibleTextSample': 'Riddle Proof homepage main content',
256
+ 'interactiveElements': 4,
257
+ 'visibleInteractiveElements': 4,
258
+ 'pathname': '/',
259
+ 'search': '',
260
+ 'hash': '#main-content',
261
+ 'title': 'Riddle',
262
+ 'buttons': ['Start Free'],
263
+ 'headings': ['Riddle Proof'],
264
+ 'links': [{'text': 'Skip to main content', 'href': '#main-content'}],
265
+ 'canvasCount': 0,
266
+ 'largeVisibleElements': [{'tag': 'main', 'text': 'Riddle Proof'}],
267
+ }
268
+ proof_evidence = {
269
+ 'before': {'href': 'https://riddledc.com/'},
270
+ 'action': 'clicked Skip to main content',
271
+ 'after': {'href': 'https://riddledc.com/#main-content'},
272
+ 'assertions': {
273
+ 'startedOnHome': True,
274
+ 'hashPreserved': True,
275
+ 'mainContentFocused': True,
276
+ },
277
+ }
278
+ return {
279
+ 'ok': True,
280
+ 'screenshots': [{'url': 'https://cdn.example.com/hash-after.png'}],
281
+ 'outputs': [{'name': 'after-hash.png', 'url': 'https://cdn.example.com/hash-after.png'}],
282
+ 'result': {'pageState': page_state, 'proofEvidence': proof_evidence},
283
+ 'console': [
284
+ 'RIDDLE_PROOF_STATE:' + json.dumps(page_state),
285
+ 'RIDDLE_PROOF_EVIDENCE:' + json.dumps(proof_evidence),
286
+ ],
287
+ 'visual_diff': {
288
+ 'diffPercentage': 1.2,
289
+ 'differentPixels': 12000,
290
+ 'totalPixels': 972000,
291
+ },
292
+ }
252
293
  if 'clickedProofNavigation' in script:
253
294
  page_state = {
254
295
  'bodyTextLength': 180,
@@ -1376,6 +1417,34 @@ def run_project_build_retries_after_clean_failure():
1376
1417
  shutil.rmtree(tempdir)
1377
1418
 
1378
1419
 
1420
+ def run_invoke_retry_stops_on_playwright_locator_timeout():
1421
+ util = load_module('util_retry_timeout', UTIL_PATH)
1422
+ calls = []
1423
+ original_invoke = util.invoke
1424
+ original_sleep = util.time.sleep
1425
+
1426
+ def fake_invoke(tool, args, timeout=180):
1427
+ calls.append({'tool': tool, 'args': args, 'timeout': timeout})
1428
+ return {
1429
+ 'ok': False,
1430
+ 'error': 'locator.scrollIntoViewIfNeeded: Timeout 30000ms exceeded',
1431
+ }
1432
+
1433
+ try:
1434
+ util.invoke = fake_invoke
1435
+ util.time.sleep = lambda _seconds: None
1436
+ result = util.invoke_retry('riddle_script', {'script': 'await page.locator("a").click();'}, retries=3, timeout=60)
1437
+ assert result['ok'] is False
1438
+ assert len(calls) == 1, calls
1439
+ calls.clear()
1440
+ generic = util.invoke_retry('riddle_preview', {'directory': '/tmp/nope'}, retries=3, timeout=60)
1441
+ assert generic['ok'] is False
1442
+ assert len(calls) == 3, calls
1443
+ finally:
1444
+ util.invoke = original_invoke
1445
+ util.time.sleep = original_sleep
1446
+
1447
+
1379
1448
  def run_implement_records_detection_when_changes_missing():
1380
1449
  tempdir = Path(tempfile.mkdtemp(prefix='riddle-proof-implement-missing-'))
1381
1450
  state_path = tempdir / 'state.json'
@@ -2381,6 +2450,51 @@ def run_verify_interaction_reverse_terminal_route_from_proof_evidence():
2381
2450
  shutil.rmtree(tempdir, ignore_errors=True)
2382
2451
 
2383
2452
 
2453
+ def run_verify_interaction_hash_terminal_route_from_proof_evidence():
2454
+ tempdir = Path(tempfile.mkdtemp(prefix='riddle-proof-interaction-hash-'))
2455
+ state_path = tempdir / 'state.json'
2456
+ try:
2457
+ state = base_state(tempdir, reference='before')
2458
+ state.update({
2459
+ 'recon_status': 'ready_for_proof_plan',
2460
+ 'author_status': 'ready',
2461
+ 'proof_plan_status': 'ready',
2462
+ 'implementation_status': 'changes_detected',
2463
+ 'verification_mode': 'interaction',
2464
+ 'server_path': '/',
2465
+ 'before_cdn': 'https://cdn.example.com/before-home.png',
2466
+ 'proof_plan': 'Start at /, click the skip link, and verify the terminal /#main-content route.',
2467
+ 'capture_script': "clickedSkipHashNavigation(); await saveScreenshot('after-hash');",
2468
+ 'recon_results': {
2469
+ 'baselines': {'before': {'path': '/', 'url': 'https://cdn.example.com/before-home.png'}},
2470
+ },
2471
+ })
2472
+ write_state(state_path, state)
2473
+ os.environ['RIDDLE_PROOF_STATE_FILE'] = str(state_path)
2474
+
2475
+ fake = FakeRiddle()
2476
+ load_util_with_fake(fake)
2477
+ load_module('verify_interaction_hash_terminal_route', VERIFY_PATH)
2478
+ after_verify = json.loads(state_path.read_text())
2479
+
2480
+ assert after_verify['verify_status'] == 'evidence_captured'
2481
+ assert after_verify['route_expectation']['expected_path'] == '/#main-content'
2482
+ assert after_verify['route_expectation']['expected_hash'] == '#main-content'
2483
+ route = after_verify['proof_assessment_request']['semantic_context']['route']
2484
+ assert route['expected_after_path'] == '/#main-content'
2485
+ assert route['expected_terminal_hash'] == '#main-content'
2486
+ assert route['after_observed_path'] == '/#main-content'
2487
+ assert route['after_observed_hash'] == '#main-content'
2488
+ assert 'wrong route' not in after_verify['verify_results']['after']['observation']['reason']
2489
+ return {
2490
+ 'ok': True,
2491
+ 'expected_path': after_verify['route_expectation']['expected_path'],
2492
+ 'after_observed_hash': route['after_observed_hash'],
2493
+ }
2494
+ finally:
2495
+ shutil.rmtree(tempdir, ignore_errors=True)
2496
+
2497
+
2384
2498
  def run_verify_capture_retry_surfaces_script_timeout():
2385
2499
  tempdir = Path(tempfile.mkdtemp(prefix='riddle-proof-capture-timeout-'))
2386
2500
  state_path = tempdir / 'state.json'
@@ -2778,6 +2892,7 @@ if __name__ == '__main__':
2778
2892
  'capture_diagnostics_redaction': run_capture_diagnostics_redact_sensitive_values(),
2779
2893
  'apply_auth_context': run_apply_auth_context_passes_supported_auth_payloads(),
2780
2894
  'run_project_build_retries_after_clean_failure': run_project_build_retries_after_clean_failure(),
2895
+ 'invoke_retry_stops_on_playwright_locator_timeout': run_invoke_retry_stops_on_playwright_locator_timeout(),
2781
2896
  'implement_records_detection_when_changes_missing': run_implement_records_detection_when_changes_missing(),
2782
2897
  'implement_ignores_tool_noise_when_detecting_changes': run_implement_ignores_tool_noise_when_detecting_changes(),
2783
2898
  'verify_quality_ignores_proof_telemetry_console_text': run_verify_quality_ignores_proof_telemetry_console_text(),
@@ -2798,6 +2913,7 @@ if __name__ == '__main__':
2798
2913
  'remote_audit_verify_uses_default_capture_script': run_remote_audit_verify_uses_default_capture_script(),
2799
2914
  'verify_interaction_terminal_route_from_proof_evidence': run_verify_interaction_terminal_route_from_proof_evidence(),
2800
2915
  'verify_interaction_reverse_terminal_route_from_proof_evidence': run_verify_interaction_reverse_terminal_route_from_proof_evidence(),
2916
+ 'verify_interaction_hash_terminal_route_from_proof_evidence': run_verify_interaction_hash_terminal_route_from_proof_evidence(),
2801
2917
  'verify_capture_retry_surfaces_script_timeout': run_verify_capture_retry_surfaces_script_timeout(),
2802
2918
  'missing_baseline_guard': run_verify_missing_baseline(),
2803
2919
  'ship_supervisor_gate': run_ship_missing_supervisor_gate(),