@riddledc/riddle-proof 0.8.6 → 0.8.8

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 (49) hide show
  1. package/dist/adapters/codex-exec-agent.cjs +30 -10
  2. package/dist/adapters/codex-exec-agent.js +1 -1
  3. package/dist/adapters/codex.cjs +30 -10
  4. package/dist/adapters/codex.js +1 -1
  5. package/dist/adapters/local-agent.cjs +30 -10
  6. package/dist/adapters/local-agent.js +1 -1
  7. package/dist/advanced/engine-harness.cjs +64 -7
  8. package/dist/advanced/engine-harness.js +2 -2
  9. package/dist/advanced/index.cjs +64 -7
  10. package/dist/advanced/index.d.cts +1 -1
  11. package/dist/advanced/index.d.ts +1 -1
  12. package/dist/advanced/index.js +4 -4
  13. package/dist/advanced/proof-run-core.cjs +63 -6
  14. package/dist/advanced/proof-run-core.js +1 -1
  15. package/dist/advanced/proof-run-engine.cjs +63 -6
  16. package/dist/advanced/proof-run-engine.d.cts +1 -1
  17. package/dist/advanced/proof-run-engine.d.ts +1 -1
  18. package/dist/advanced/proof-run-engine.js +2 -2
  19. package/dist/advanced/runner.js +2 -2
  20. package/dist/{chunk-GMZ57RRY.js → chunk-46DDSZJR.js} +1 -1
  21. package/dist/{chunk-RV6LK7HU.js → chunk-5N5QFI2S.js} +63 -6
  22. package/dist/{chunk-UIJ7X63P.js → chunk-5N6MQCLC.js} +1 -1
  23. package/dist/{chunk-BDFSMWTI.js → chunk-E7ATYSYS.js} +1 -1
  24. package/dist/{chunk-5MILMRQY.js → chunk-PYCQNK66.js} +30 -10
  25. package/dist/{chunk-NAFJ4KSF.js → chunk-V6VZ3CAI.js} +2 -2
  26. package/dist/cli/index.js +4 -4
  27. package/dist/cli.cjs +99 -22
  28. package/dist/cli.js +4 -4
  29. package/dist/codex-exec-agent.cjs +30 -10
  30. package/dist/codex-exec-agent.js +1 -1
  31. package/dist/engine-harness.cjs +64 -7
  32. package/dist/engine-harness.js +2 -2
  33. package/dist/index.cjs +99 -22
  34. package/dist/index.js +4 -4
  35. package/dist/local-agent.cjs +30 -10
  36. package/dist/local-agent.js +1 -1
  37. package/dist/proof-run-core.cjs +63 -6
  38. package/dist/proof-run-core.js +1 -1
  39. package/dist/{proof-run-engine-BO1h0Bmy.d.cts → proof-run-engine-BlocjMni.d.cts} +3 -3
  40. package/dist/{proof-run-engine-CIdpWNh6.d.ts → proof-run-engine-C_m8WJmX.d.ts} +3 -3
  41. package/dist/proof-run-engine.cjs +63 -6
  42. package/dist/proof-run-engine.d.cts +1 -1
  43. package/dist/proof-run-engine.d.ts +1 -1
  44. package/dist/proof-run-engine.js +2 -2
  45. package/dist/runner.js +2 -2
  46. package/package.json +1 -1
  47. package/runtime/lib/author.py +39 -1
  48. package/runtime/lib/verify.py +241 -6
  49. package/runtime/tests/recon_verify_smoke.py +89 -20
@@ -340,14 +340,18 @@ class FakeRiddle:
340
340
  'largeVisibleElements': [{'tag': 'h1', 'text': 'Proof'}],
341
341
  }
342
342
  proof_evidence = {
343
- 'before': {'path': '/'},
344
- 'action': 'clicked Proof',
345
- 'after': {'path': '/proof/'},
346
- 'assertions': {
347
- 'startedOnHome': True,
348
- 'clickedProofNavigation': True,
349
- 'terminalPathIsProof': True,
350
- 'proofContentVisible': True,
343
+ 'proofEvidence': {
344
+ 'version': 'riddle-proof.interaction.v1',
345
+ 'start': {'href': 'https://riddledc.com/'},
346
+ 'action': {'type': 'click', 'target': 'Proof'},
347
+ 'terminal': {'href': 'https://riddledc.com/proof/'},
348
+ 'afterUrl': 'https://riddledc.com/proof/',
349
+ 'assertions': {
350
+ 'startedOnHome': True,
351
+ 'clickedProofNavigation': True,
352
+ 'terminalPathIsProof': True,
353
+ 'proofContentVisible': True,
354
+ },
351
355
  },
352
356
  }
353
357
  return {
@@ -1921,6 +1925,63 @@ def run_author_applies_supervisor_packet():
1921
1925
  shutil.rmtree(tempdir, ignore_errors=True)
1922
1926
 
1923
1927
 
1928
+ def run_author_keeps_interaction_start_route():
1929
+ tempdir = Path(tempfile.mkdtemp(prefix='riddle-proof-supervisor-interaction-start-'))
1930
+ state_path = tempdir / 'state.json'
1931
+ try:
1932
+ state = base_state(tempdir, reference='before')
1933
+ state.update({
1934
+ 'recon_status': 'ready_for_proof_plan',
1935
+ 'verification_mode': 'interaction',
1936
+ 'server_path': '/',
1937
+ 'expected_start_path': '/',
1938
+ 'before_cdn': 'https://cdn.example.com/before-home.png',
1939
+ 'recon_results': {
1940
+ 'baselines': {'before': {'path': '/', 'url': 'https://cdn.example.com/before-home.png'}},
1941
+ 'current_plan': {'target_path': '/'},
1942
+ },
1943
+ 'author_request': {
1944
+ 'current_plan': {'target_path': '/'},
1945
+ 'observed_baselines': {'before': {'path': '/', 'url': 'https://cdn.example.com/before-home.png'}},
1946
+ },
1947
+ 'supervisor_author_packet': {
1948
+ 'proof_plan': 'Start at /, click Proof, and verify the terminal /proof/ route.',
1949
+ 'capture_script': "clickedProofNavigation(); await saveScreenshot('after-proof');",
1950
+ 'refined_inputs': {
1951
+ 'server_path': '/proof/',
1952
+ 'expected_terminal_path': '/proof/',
1953
+ 'wait_for_selector': '',
1954
+ 'reference': 'before',
1955
+ },
1956
+ 'rationale': ['The interaction starts on home and terminates on Proof.'],
1957
+ 'confidence': 'high',
1958
+ 'summary': 'Supervisor supplied the interaction proof packet.',
1959
+ },
1960
+ })
1961
+ write_state(state_path, state)
1962
+ os.environ['RIDDLE_PROOF_STATE_FILE'] = str(state_path)
1963
+
1964
+ fake = FakeRiddle()
1965
+ load_util_with_fake(fake)
1966
+ load_module('author_supervisor_interaction_start', AUTHOR_PATH)
1967
+ after_author = json.loads(state_path.read_text())
1968
+
1969
+ assert after_author['author_status'] == 'ready'
1970
+ assert after_author['server_path'] == '/'
1971
+ assert after_author['expected_start_path'] == '/'
1972
+ assert after_author['expected_terminal_path'] == '/proof/'
1973
+ assert after_author['author_packet']['refined_inputs']['server_path'] == '/'
1974
+ assert after_author['author_warnings']
1975
+ assert 'terminal interaction route' in after_author['author_warnings'][0]
1976
+ return {
1977
+ 'ok': True,
1978
+ 'server_path': after_author['server_path'],
1979
+ 'expected_terminal_path': after_author['expected_terminal_path'],
1980
+ }
1981
+ finally:
1982
+ shutil.rmtree(tempdir, ignore_errors=True)
1983
+
1984
+
1924
1985
  def run_verify_requests_supervisor_assessment():
1925
1986
  tempdir = Path(tempfile.mkdtemp(prefix='riddle-proof-verify-supervisor-'))
1926
1987
  state_path = tempdir / 'state.json'
@@ -2530,7 +2591,7 @@ def run_verify_interaction_hash_terminal_route_from_proof_evidence():
2530
2591
  shutil.rmtree(tempdir, ignore_errors=True)
2531
2592
 
2532
2593
 
2533
- def run_verify_interaction_authored_query_hash_mismatch_returns_author():
2594
+ def run_verify_interaction_authored_query_hash_mismatch_blocks_with_evidence():
2534
2595
  tempdir = Path(tempfile.mkdtemp(prefix='riddle-proof-interaction-query-hash-mismatch-'))
2535
2596
  state_path = tempdir / 'state.json'
2536
2597
  try:
@@ -2569,17 +2630,24 @@ def run_verify_interaction_authored_query_hash_mismatch_returns_author():
2569
2630
  after_verify = json.loads(state_path.read_text())
2570
2631
 
2571
2632
  request = after_verify['verify_decision_request']
2572
- capture_quality = request['capture_quality']
2573
- assert after_verify['verify_status'] == 'capture_incomplete'
2633
+ assert after_verify['verify_status'] == 'evidence_captured'
2634
+ assert after_verify['merge_recommendation'] == 'do-not-merge'
2574
2635
  assert after_verify['route_expectation']['expected_query'] == 'rp_probe=1'
2575
2636
  assert after_verify['route_expectation']['expected_hash'] == '#pricing-probe'
2576
- assert request['recommended_stage'] == 'author'
2577
- assert request['continue_with_stage'] == 'author'
2578
- assert capture_quality['recommended_stage'] == 'author'
2579
- assert capture_quality['mismatch']['expected_path'] == '/pricing?rp_probe=1#pricing-probe'
2580
- assert capture_quality['mismatch']['observed_after_path'] == '/pricing/'
2581
- assert 'page.waitForURL: Timeout 15000ms exceeded' in capture_quality['summary']
2582
- assert any('capture plan should be revised' in reason for reason in capture_quality['reasons'])
2637
+ assert 'capture_quality' not in request
2638
+ assert request['recommended_stage'] is None
2639
+ assert request['continue_with_stage'] is None
2640
+ assert 'failed assertions' in request['summary']
2641
+ assert 'checks.routeMatches' in request['structured_interaction_failure_summary']
2642
+ assert 'page.waitForURL: Timeout 15000ms exceeded' in request['structured_interaction_failure_summary']
2643
+ assessment_request = after_verify['proof_assessment_request']
2644
+ assert 'structured-interaction-failure' in assessment_request['evidence_basis']
2645
+ assert any('checks.routeMatches' in blocker for blocker in assessment_request['hard_blockers'])
2646
+ assert assessment_request['semantic_context']['route']['expected_terminal_query'] == 'rp_probe=1'
2647
+ assert assessment_request['semantic_context']['route']['expected_terminal_hash'] == '#pricing-probe'
2648
+ assert assessment_request['semantic_context']['route']['after_observed_path'] == '/pricing'
2649
+ assert assessment_request['semantic_context']['route']['after_observed_query'] == ''
2650
+ assert assessment_request['semantic_context']['route']['after_observed_hash'] == ''
2583
2651
  supporting = after_verify['verify_results']['after']['supporting_artifacts']
2584
2652
  assert supporting['proof_evidence_present'] is True
2585
2653
  assert supporting['has_structured_payload'] is True
@@ -2594,7 +2662,7 @@ def run_verify_interaction_authored_query_hash_mismatch_returns_author():
2594
2662
  assert 'page.waitForURL: Timeout 15000ms exceeded' in synthetic_evidence['capture_error']
2595
2663
  return {
2596
2664
  'ok': True,
2597
- 'summary': capture_quality['summary'],
2665
+ 'summary': request['summary'],
2598
2666
  'recommended_stage': request['recommended_stage'],
2599
2667
  }
2600
2668
  finally:
@@ -3009,6 +3077,7 @@ if __name__ == '__main__':
3009
3077
  'recon_hint_root_preference': run_recon_prefers_hint_root_over_single_route_literal(),
3010
3078
  'capture_hint_rejects_route_specific_mode_only_match': run_capture_hint_rejects_route_specific_mode_only_match(),
3011
3079
  'author_applies_supervisor_packet': run_author_applies_supervisor_packet(),
3080
+ 'author_keeps_interaction_start_route': run_author_keeps_interaction_start_route(),
3012
3081
  'verify_requests_supervisor_assessment': run_verify_requests_supervisor_assessment(),
3013
3082
  'verify_routes_unmeasured_visual_delta_to_recovery': run_verify_routes_unmeasured_visual_delta_to_recovery(),
3014
3083
  'verify_structured_evidence_without_screenshot': run_verify_structured_evidence_without_screenshot(),
@@ -3020,7 +3089,7 @@ if __name__ == '__main__':
3020
3089
  'verify_interaction_terminal_route_from_proof_evidence': run_verify_interaction_terminal_route_from_proof_evidence(),
3021
3090
  'verify_interaction_reverse_terminal_route_from_proof_evidence': run_verify_interaction_reverse_terminal_route_from_proof_evidence(),
3022
3091
  'verify_interaction_hash_terminal_route_from_proof_evidence': run_verify_interaction_hash_terminal_route_from_proof_evidence(),
3023
- 'verify_interaction_authored_query_hash_mismatch_returns_author': run_verify_interaction_authored_query_hash_mismatch_returns_author(),
3092
+ 'verify_interaction_authored_query_hash_mismatch_blocks_with_evidence': run_verify_interaction_authored_query_hash_mismatch_blocks_with_evidence(),
3024
3093
  'verify_capture_retry_surfaces_script_timeout': run_verify_capture_retry_surfaces_script_timeout(),
3025
3094
  'missing_baseline_guard': run_verify_missing_baseline(),
3026
3095
  'ship_supervisor_gate': run_ship_missing_supervisor_gate(),