@riddledc/riddle-proof 0.8.20 → 0.8.21

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.
@@ -2623,10 +2623,10 @@ ${implementRes.stderr || ""}`;
2623
2623
  verifyContinueWithStage,
2624
2624
  convergenceSignals
2625
2625
  };
2626
- const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_failure_summary);
2626
+ const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_capture_failure_summary) || stringValue(verifyDecisionRequest?.structured_interaction_failure_summary) || stringValue(state?.structured_interaction_capture_failure_summary) || stringValue(state?.structured_interaction_failure_summary);
2627
2627
  if (verifyStatus !== "evidence_captured") {
2628
2628
  const captureQuality = verifyDecisionRequest?.capture_quality || {};
2629
- const captureTerminalBlocker = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2629
+ const captureTerminalBlocker = Boolean(structuredInteractionFailureSummary) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2630
2630
  if (!captureTerminalBlocker && (verifyContinueWithStage || verifyRecommendedStage || "author") === "author") {
2631
2631
  updateState(config.statePath, (currentState) => {
2632
2632
  currentState.author_status = "needs_authoring";
@@ -2636,7 +2636,7 @@ ${implementRes.stderr || ""}`;
2636
2636
  state = readState(config.statePath);
2637
2637
  }
2638
2638
  const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
2639
- const summary = stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2639
+ const summary = structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2640
2640
  recordAttempt("verify", "checkpoint", summary, {
2641
2641
  autoApproved: verifyRes.autoApproved || false,
2642
2642
  checkpoint: checkpointName,
@@ -2,7 +2,7 @@ import {
2
2
  createDisabledRiddleProofAgentAdapter,
3
3
  readRiddleProofRunStatus,
4
4
  runRiddleProofEngineHarness
5
- } from "../chunk-RWF763A4.js";
5
+ } from "../chunk-FQA3XMZM.js";
6
6
  import "../chunk-YZUVEJ5B.js";
7
7
  import "../chunk-FMOYUYH2.js";
8
8
  import "../chunk-FU73I4V3.js";
@@ -2654,10 +2654,10 @@ ${implementRes.stderr || ""}`;
2654
2654
  verifyContinueWithStage,
2655
2655
  convergenceSignals
2656
2656
  };
2657
- const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_failure_summary);
2657
+ const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_capture_failure_summary) || stringValue(verifyDecisionRequest?.structured_interaction_failure_summary) || stringValue(state?.structured_interaction_capture_failure_summary) || stringValue(state?.structured_interaction_failure_summary);
2658
2658
  if (verifyStatus !== "evidence_captured") {
2659
2659
  const captureQuality = verifyDecisionRequest?.capture_quality || {};
2660
- const captureTerminalBlocker = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2660
+ const captureTerminalBlocker = Boolean(structuredInteractionFailureSummary) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2661
2661
  if (!captureTerminalBlocker && (verifyContinueWithStage || verifyRecommendedStage || "author") === "author") {
2662
2662
  updateState(config.statePath, (currentState) => {
2663
2663
  currentState.author_status = "needs_authoring";
@@ -2667,7 +2667,7 @@ ${implementRes.stderr || ""}`;
2667
2667
  state = readState(config.statePath);
2668
2668
  }
2669
2669
  const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
2670
- const summary = stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2670
+ const summary = structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2671
2671
  recordAttempt("verify", "checkpoint", summary, {
2672
2672
  autoApproved: verifyRes.autoApproved || false,
2673
2673
  checkpoint: checkpointName,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  proof_run_engine_exports
3
- } from "../chunk-5NEO7WDZ.js";
3
+ } from "../chunk-X4T3LNP2.js";
4
4
  import {
5
5
  runner_exports
6
6
  } from "../chunk-P2RN2NYR.js";
7
7
  import {
8
8
  engine_harness_exports
9
- } from "../chunk-RWF763A4.js";
9
+ } from "../chunk-FQA3XMZM.js";
10
10
  import "../chunk-YZUVEJ5B.js";
11
11
  import "../chunk-FMOYUYH2.js";
12
12
  import {
@@ -2623,10 +2623,10 @@ ${implementRes.stderr || ""}`;
2623
2623
  verifyContinueWithStage,
2624
2624
  convergenceSignals
2625
2625
  };
2626
- const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_failure_summary);
2626
+ const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_capture_failure_summary) || stringValue(verifyDecisionRequest?.structured_interaction_failure_summary) || stringValue(state?.structured_interaction_capture_failure_summary) || stringValue(state?.structured_interaction_failure_summary);
2627
2627
  if (verifyStatus !== "evidence_captured") {
2628
2628
  const captureQuality = verifyDecisionRequest?.capture_quality || {};
2629
- const captureTerminalBlocker = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2629
+ const captureTerminalBlocker = Boolean(structuredInteractionFailureSummary) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2630
2630
  if (!captureTerminalBlocker && (verifyContinueWithStage || verifyRecommendedStage || "author") === "author") {
2631
2631
  updateState(config.statePath, (currentState) => {
2632
2632
  currentState.author_status = "needs_authoring";
@@ -2636,7 +2636,7 @@ ${implementRes.stderr || ""}`;
2636
2636
  state = readState(config.statePath);
2637
2637
  }
2638
2638
  const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
2639
- const summary = stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2639
+ const summary = structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2640
2640
  recordAttempt("verify", "checkpoint", summary, {
2641
2641
  autoApproved: verifyRes.autoApproved || false,
2642
2642
  checkpoint: checkpointName,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createRiddleProofEngine,
3
3
  executeWorkflow
4
- } from "../chunk-5NEO7WDZ.js";
4
+ } from "../chunk-X4T3LNP2.js";
5
5
  import "../chunk-FU73I4V3.js";
6
6
  import "../chunk-MLKGABMK.js";
7
7
  export {
@@ -22,7 +22,7 @@ import {
22
22
  createDisabledRiddleProofAgentAdapter,
23
23
  readRiddleProofRunStatus,
24
24
  runRiddleProofEngineHarness
25
- } from "./chunk-RWF763A4.js";
25
+ } from "./chunk-FQA3XMZM.js";
26
26
  import {
27
27
  createCheckpointResponseTemplate
28
28
  } from "./chunk-4FOHZ7JG.js";
@@ -1511,10 +1511,10 @@ ${implementRes.stderr || ""}`;
1511
1511
  verifyContinueWithStage,
1512
1512
  convergenceSignals
1513
1513
  };
1514
- const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_failure_summary);
1514
+ const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_capture_failure_summary) || stringValue(verifyDecisionRequest?.structured_interaction_failure_summary) || stringValue(state?.structured_interaction_capture_failure_summary) || stringValue(state?.structured_interaction_failure_summary);
1515
1515
  if (verifyStatus !== "evidence_captured") {
1516
1516
  const captureQuality = verifyDecisionRequest?.capture_quality || {};
1517
- const captureTerminalBlocker = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
1517
+ const captureTerminalBlocker = Boolean(structuredInteractionFailureSummary) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
1518
1518
  if (!captureTerminalBlocker && (verifyContinueWithStage || verifyRecommendedStage || "author") === "author") {
1519
1519
  updateState(config.statePath, (currentState) => {
1520
1520
  currentState.author_status = "needs_authoring";
@@ -1524,7 +1524,7 @@ ${implementRes.stderr || ""}`;
1524
1524
  state = readState(config.statePath);
1525
1525
  }
1526
1526
  const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
1527
- const summary = stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
1527
+ const summary = structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
1528
1528
  recordAttempt("verify", "checkpoint", summary, {
1529
1529
  autoApproved: verifyRes.autoApproved || false,
1530
1530
  checkpoint: checkpointName,
package/dist/cli/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import "../chunk-K3TPF55N.js";
1
+ import "../chunk-DAF4EX6A.js";
2
2
  import "../chunk-PEWAIEER.js";
3
3
  import "../chunk-TWTEUS7R.js";
4
- import "../chunk-RWF763A4.js";
4
+ import "../chunk-FQA3XMZM.js";
5
5
  import "../chunk-YZUVEJ5B.js";
6
6
  import "../chunk-FMOYUYH2.js";
7
7
  import "../chunk-FU73I4V3.js";
package/dist/cli.cjs CHANGED
@@ -2623,10 +2623,10 @@ ${implementRes.stderr || ""}`;
2623
2623
  verifyContinueWithStage,
2624
2624
  convergenceSignals
2625
2625
  };
2626
- const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_failure_summary);
2626
+ const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_capture_failure_summary) || stringValue(verifyDecisionRequest?.structured_interaction_failure_summary) || stringValue(state?.structured_interaction_capture_failure_summary) || stringValue(state?.structured_interaction_failure_summary);
2627
2627
  if (verifyStatus !== "evidence_captured") {
2628
2628
  const captureQuality = verifyDecisionRequest?.capture_quality || {};
2629
- const captureTerminalBlocker = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2629
+ const captureTerminalBlocker = Boolean(structuredInteractionFailureSummary) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2630
2630
  if (!captureTerminalBlocker && (verifyContinueWithStage || verifyRecommendedStage || "author") === "author") {
2631
2631
  updateState(config.statePath, (currentState) => {
2632
2632
  currentState.author_status = "needs_authoring";
@@ -2636,7 +2636,7 @@ ${implementRes.stderr || ""}`;
2636
2636
  state = readState(config.statePath);
2637
2637
  }
2638
2638
  const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
2639
- const summary = stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2639
+ const summary = structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2640
2640
  recordAttempt("verify", "checkpoint", summary, {
2641
2641
  autoApproved: verifyRes.autoApproved || false,
2642
2642
  checkpoint: checkpointName,
package/dist/cli.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-K3TPF55N.js";
2
+ import "./chunk-DAF4EX6A.js";
3
3
  import "./chunk-PEWAIEER.js";
4
4
  import "./chunk-TWTEUS7R.js";
5
- import "./chunk-RWF763A4.js";
5
+ import "./chunk-FQA3XMZM.js";
6
6
  import "./chunk-YZUVEJ5B.js";
7
7
  import "./chunk-FMOYUYH2.js";
8
8
  import "./chunk-FU73I4V3.js";
@@ -2623,10 +2623,10 @@ ${implementRes.stderr || ""}`;
2623
2623
  verifyContinueWithStage,
2624
2624
  convergenceSignals
2625
2625
  };
2626
- const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_failure_summary);
2626
+ const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_capture_failure_summary) || stringValue(verifyDecisionRequest?.structured_interaction_failure_summary) || stringValue(state?.structured_interaction_capture_failure_summary) || stringValue(state?.structured_interaction_failure_summary);
2627
2627
  if (verifyStatus !== "evidence_captured") {
2628
2628
  const captureQuality = verifyDecisionRequest?.capture_quality || {};
2629
- const captureTerminalBlocker = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2629
+ const captureTerminalBlocker = Boolean(structuredInteractionFailureSummary) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2630
2630
  if (!captureTerminalBlocker && (verifyContinueWithStage || verifyRecommendedStage || "author") === "author") {
2631
2631
  updateState(config.statePath, (currentState) => {
2632
2632
  currentState.author_status = "needs_authoring";
@@ -2636,7 +2636,7 @@ ${implementRes.stderr || ""}`;
2636
2636
  state = readState(config.statePath);
2637
2637
  }
2638
2638
  const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
2639
- const summary = stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2639
+ const summary = structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2640
2640
  recordAttempt("verify", "checkpoint", summary, {
2641
2641
  autoApproved: verifyRes.autoApproved || false,
2642
2642
  checkpoint: checkpointName,
@@ -2,7 +2,7 @@ import {
2
2
  createDisabledRiddleProofAgentAdapter,
3
3
  readRiddleProofRunStatus,
4
4
  runRiddleProofEngineHarness
5
- } from "./chunk-RWF763A4.js";
5
+ } from "./chunk-FQA3XMZM.js";
6
6
  import "./chunk-YZUVEJ5B.js";
7
7
  import "./chunk-FMOYUYH2.js";
8
8
  import "./chunk-FU73I4V3.js";
package/dist/index.cjs CHANGED
@@ -2623,10 +2623,10 @@ ${implementRes.stderr || ""}`;
2623
2623
  verifyContinueWithStage,
2624
2624
  convergenceSignals
2625
2625
  };
2626
- const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_failure_summary);
2626
+ const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_capture_failure_summary) || stringValue(verifyDecisionRequest?.structured_interaction_failure_summary) || stringValue(state?.structured_interaction_capture_failure_summary) || stringValue(state?.structured_interaction_failure_summary);
2627
2627
  if (verifyStatus !== "evidence_captured") {
2628
2628
  const captureQuality = verifyDecisionRequest?.capture_quality || {};
2629
- const captureTerminalBlocker = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2629
+ const captureTerminalBlocker = Boolean(structuredInteractionFailureSummary) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2630
2630
  if (!captureTerminalBlocker && (verifyContinueWithStage || verifyRecommendedStage || "author") === "author") {
2631
2631
  updateState(config.statePath, (currentState) => {
2632
2632
  currentState.author_status = "needs_authoring";
@@ -2636,7 +2636,7 @@ ${implementRes.stderr || ""}`;
2636
2636
  state = readState(config.statePath);
2637
2637
  }
2638
2638
  const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
2639
- const summary = stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2639
+ const summary = structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2640
2640
  recordAttempt("verify", "checkpoint", summary, {
2641
2641
  autoApproved: verifyRes.autoApproved || false,
2642
2642
  checkpoint: checkpointName,
package/dist/index.js CHANGED
@@ -95,7 +95,7 @@ import {
95
95
  createDisabledRiddleProofAgentAdapter,
96
96
  readRiddleProofRunStatus,
97
97
  runRiddleProofEngineHarness
98
- } from "./chunk-RWF763A4.js";
98
+ } from "./chunk-FQA3XMZM.js";
99
99
  import {
100
100
  RIDDLE_PROOF_RUN_STATE_VERSION,
101
101
  appendRunEvent,
@@ -2621,10 +2621,10 @@ ${implementRes.stderr || ""}`;
2621
2621
  verifyContinueWithStage,
2622
2622
  convergenceSignals
2623
2623
  };
2624
- const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_failure_summary);
2624
+ const structuredInteractionFailureSummary = stringValue(verifyDecisionRequest?.structured_interaction_capture_failure_summary) || stringValue(verifyDecisionRequest?.structured_interaction_failure_summary) || stringValue(state?.structured_interaction_capture_failure_summary) || stringValue(state?.structured_interaction_failure_summary);
2625
2625
  if (verifyStatus !== "evidence_captured") {
2626
2626
  const captureQuality = verifyDecisionRequest?.capture_quality || {};
2627
- const captureTerminalBlocker = captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2627
+ const captureTerminalBlocker = Boolean(structuredInteractionFailureSummary) || captureQuality?.terminal_blocker === true || captureQuality?.blocking === true;
2628
2628
  if (!captureTerminalBlocker && (verifyContinueWithStage || verifyRecommendedStage || "author") === "author") {
2629
2629
  updateState(config.statePath, (currentState) => {
2630
2630
  currentState.author_status = "needs_authoring";
@@ -2634,7 +2634,7 @@ ${implementRes.stderr || ""}`;
2634
2634
  state = readState(config.statePath);
2635
2635
  }
2636
2636
  const checkpointName = captureTerminalBlocker ? "verify_capture_blocked" : "verify_capture_retry";
2637
- const summary = stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2637
+ const summary = structuredInteractionFailureSummary || stringValue(proofAssessment.summary) || "Verify ran, but the proof packet still needs internal capture-plan work before it should ship.";
2638
2638
  recordAttempt("verify", "checkpoint", summary, {
2639
2639
  autoApproved: verifyRes.autoApproved || false,
2640
2640
  checkpoint: checkpointName,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createRiddleProofEngine,
3
3
  executeWorkflow
4
- } from "./chunk-5NEO7WDZ.js";
4
+ } from "./chunk-X4T3LNP2.js";
5
5
  import "./chunk-FU73I4V3.js";
6
6
  import "./chunk-MLKGABMK.js";
7
7
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.8.20",
3
+ "version": "0.8.21",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",
@@ -2112,15 +2112,40 @@ EXPECTED_TERMINAL_PATH_KEYS = (
2112
2112
  'expected_final_route', 'expectedFinalRoute',
2113
2113
  )
2114
2114
  OBSERVED_TERMINAL_PATH_KEYS = (
2115
- 'terminal_path', 'terminalPath',
2116
2115
  'terminal_url', 'terminalUrl',
2117
2116
  'terminal_href', 'terminalHref',
2118
2117
  'terminal_route', 'terminalRoute',
2119
- 'after_path', 'afterPath',
2118
+ 'terminal_path', 'terminalPath',
2120
2119
  'after_url', 'afterUrl',
2121
2120
  'after_href', 'afterHref',
2122
2121
  'after_route', 'afterRoute',
2122
+ 'after_path', 'afterPath',
2123
+ 'final_url', 'finalUrl',
2124
+ 'final_href', 'finalHref',
2125
+ 'final_route', 'finalRoute',
2123
2126
  'final_path', 'finalPath',
2127
+ )
2128
+ EXPECTED_TERMINAL_FULL_PATH_KEYS = (
2129
+ 'expected_url', 'expectedUrl',
2130
+ 'expected_href', 'expectedHref',
2131
+ 'expected_route', 'expectedRoute',
2132
+ 'expected_terminal_url', 'expectedTerminalUrl',
2133
+ 'expected_terminal_href', 'expectedTerminalHref',
2134
+ 'expected_terminal_route', 'expectedTerminalRoute',
2135
+ 'expected_after_url', 'expectedAfterUrl',
2136
+ 'expected_after_href', 'expectedAfterHref',
2137
+ 'expected_after_route', 'expectedAfterRoute',
2138
+ 'expected_final_url', 'expectedFinalUrl',
2139
+ 'expected_final_href', 'expectedFinalHref',
2140
+ 'expected_final_route', 'expectedFinalRoute',
2141
+ )
2142
+ OBSERVED_TERMINAL_FULL_PATH_KEYS = (
2143
+ 'terminal_url', 'terminalUrl',
2144
+ 'terminal_href', 'terminalHref',
2145
+ 'terminal_route', 'terminalRoute',
2146
+ 'after_url', 'afterUrl',
2147
+ 'after_href', 'afterHref',
2148
+ 'after_route', 'afterRoute',
2124
2149
  'final_url', 'finalUrl',
2125
2150
  'final_href', 'finalHref',
2126
2151
  'final_route', 'finalRoute',
@@ -2211,6 +2236,103 @@ def record_path_candidate(record, allow_location_keys=False):
2211
2236
  return record_path_candidate_for_keys(record, EXPLICIT_TERMINAL_PATH_KEYS, allow_location_keys)
2212
2237
 
2213
2238
 
2239
+ def first_string_for_keys(record, keys):
2240
+ if not isinstance(record, dict):
2241
+ return ''
2242
+ for key in keys:
2243
+ value = record.get(key)
2244
+ if isinstance(value, str) and value.strip():
2245
+ return value.strip()
2246
+ return ''
2247
+
2248
+
2249
+ def route_component_candidate(record, path_keys, query_keys, hash_keys):
2250
+ path_value = first_string_for_keys(record, path_keys)
2251
+ if not path_value:
2252
+ return ''
2253
+ base = path_candidate(path_value)
2254
+ if not base:
2255
+ return ''
2256
+ parsed = urlparse(base)
2257
+ query = parsed.query or ''
2258
+ fragment = parsed.fragment or ''
2259
+ query_value = first_string_for_keys(record, query_keys)
2260
+ hash_value = first_string_for_keys(record, hash_keys)
2261
+ if query_value:
2262
+ query = query_value[1:] if query_value.startswith('?') else query_value
2263
+ if hash_value:
2264
+ fragment = hash_value[1:] if hash_value.startswith('#') else hash_value
2265
+ pathname = parsed.path or '/'
2266
+ return normalize_observed_path(
2267
+ pathname
2268
+ + (('?' + query) if query else '')
2269
+ + (('#' + fragment) if fragment else '')
2270
+ )
2271
+
2272
+
2273
+ EXPECTED_COMPONENT_PATH_KEYS = (
2274
+ 'expected_path', 'expectedPath',
2275
+ 'expected_terminal_path', 'expectedTerminalPath',
2276
+ 'expected_after_path', 'expectedAfterPath',
2277
+ 'expected_final_path', 'expectedFinalPath',
2278
+ )
2279
+ EXPECTED_COMPONENT_QUERY_KEYS = (
2280
+ 'expected_query', 'expectedQuery',
2281
+ 'expected_search', 'expectedSearch',
2282
+ 'expected_terminal_query', 'expectedTerminalQuery',
2283
+ 'expected_terminal_search', 'expectedTerminalSearch',
2284
+ 'expected_after_query', 'expectedAfterQuery',
2285
+ 'expected_after_search', 'expectedAfterSearch',
2286
+ 'expected_final_query', 'expectedFinalQuery',
2287
+ 'expected_final_search', 'expectedFinalSearch',
2288
+ )
2289
+ EXPECTED_COMPONENT_HASH_KEYS = (
2290
+ 'expected_hash', 'expectedHash',
2291
+ 'expected_fragment', 'expectedFragment',
2292
+ 'expected_terminal_hash', 'expectedTerminalHash',
2293
+ 'expected_terminal_fragment', 'expectedTerminalFragment',
2294
+ 'expected_after_hash', 'expectedAfterHash',
2295
+ 'expected_after_fragment', 'expectedAfterFragment',
2296
+ 'expected_final_hash', 'expectedFinalHash',
2297
+ 'expected_final_fragment', 'expectedFinalFragment',
2298
+ )
2299
+ OBSERVED_COMPONENT_PATH_KEYS = (
2300
+ 'terminal_path', 'terminalPath',
2301
+ 'after_path', 'afterPath',
2302
+ 'final_path', 'finalPath',
2303
+ 'observed_path', 'observedPath',
2304
+ 'actual_path', 'actualPath',
2305
+ 'pathname',
2306
+ )
2307
+ OBSERVED_COMPONENT_QUERY_KEYS = (
2308
+ 'terminal_query', 'terminalQuery',
2309
+ 'terminal_search', 'terminalSearch',
2310
+ 'after_query', 'afterQuery',
2311
+ 'after_search', 'afterSearch',
2312
+ 'final_query', 'finalQuery',
2313
+ 'final_search', 'finalSearch',
2314
+ 'observed_query', 'observedQuery',
2315
+ 'observed_search', 'observedSearch',
2316
+ 'actual_query', 'actualQuery',
2317
+ 'actual_search', 'actualSearch',
2318
+ 'search',
2319
+ )
2320
+ OBSERVED_COMPONENT_HASH_KEYS = (
2321
+ 'terminal_hash', 'terminalHash',
2322
+ 'terminal_fragment', 'terminalFragment',
2323
+ 'after_hash', 'afterHash',
2324
+ 'after_fragment', 'afterFragment',
2325
+ 'final_hash', 'finalHash',
2326
+ 'final_fragment', 'finalFragment',
2327
+ 'observed_hash', 'observedHash',
2328
+ 'observed_fragment', 'observedFragment',
2329
+ 'actual_hash', 'actualHash',
2330
+ 'actual_fragment', 'actualFragment',
2331
+ 'hash',
2332
+ 'fragment',
2333
+ )
2334
+
2335
+
2214
2336
  def terminal_path_from_record(record, depth=0):
2215
2337
  if not isinstance(record, dict) or depth > 4:
2216
2338
  return ''
@@ -2256,6 +2378,17 @@ def terminal_path_from_record(record, depth=0):
2256
2378
  def expected_terminal_path_from_record(record, depth=0):
2257
2379
  if not isinstance(record, dict) or depth > 4:
2258
2380
  return ''
2381
+ candidate = record_path_candidate_for_keys(record, EXPECTED_TERMINAL_FULL_PATH_KEYS)
2382
+ if candidate:
2383
+ return candidate
2384
+ candidate = route_component_candidate(
2385
+ record,
2386
+ EXPECTED_COMPONENT_PATH_KEYS,
2387
+ EXPECTED_COMPONENT_QUERY_KEYS,
2388
+ EXPECTED_COMPONENT_HASH_KEYS,
2389
+ )
2390
+ if candidate:
2391
+ return candidate
2259
2392
  candidate = record_path_candidate_for_keys(record, EXPECTED_TERMINAL_PATH_KEYS)
2260
2393
  if candidate:
2261
2394
  return candidate
@@ -2304,6 +2437,17 @@ def expected_terminal_path_from_record(record, depth=0):
2304
2437
  def observed_terminal_path_from_record(record, depth=0):
2305
2438
  if not isinstance(record, dict) or depth > 4:
2306
2439
  return ''
2440
+ candidate = record_path_candidate_for_keys(record, OBSERVED_TERMINAL_FULL_PATH_KEYS)
2441
+ if candidate:
2442
+ return candidate
2443
+ candidate = route_component_candidate(
2444
+ record,
2445
+ OBSERVED_COMPONENT_PATH_KEYS,
2446
+ OBSERVED_COMPONENT_QUERY_KEYS,
2447
+ OBSERVED_COMPONENT_HASH_KEYS,
2448
+ )
2449
+ if candidate:
2450
+ return candidate
2307
2451
  candidate = record_path_candidate_for_keys(record, OBSERVED_TERMINAL_PATH_KEYS)
2308
2452
  if candidate:
2309
2453
  return candidate
@@ -412,6 +412,12 @@ class FakeRiddle:
412
412
  }
413
413
  proof_evidence = {
414
414
  'version': 'riddle-proof.interaction.v1',
415
+ 'routeExpectationSource': 'capture_script.expectedUrl',
416
+ 'expectedUrl': 'https://riddledc.com/pricing/?rp_probe=1#pricing-probe',
417
+ 'terminalPath': '/pricing/',
418
+ 'terminalSearch': '?rp_probe=1',
419
+ 'terminalHash': '#pricing-probe',
420
+ 'terminalUrl': 'https://riddledc.com/pricing/?rp_probe=1#pricing-probe',
415
421
  'start': {'href': 'https://riddledc.com/'},
416
422
  'action': {'type': 'click', 'target': 'Pricing'},
417
423
  'terminal': {
File without changes