@riddledc/riddle-proof 0.8.25 → 0.8.27

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 (54) hide show
  1. package/dist/adapters/codex-exec-agent.cjs +21 -3
  2. package/dist/adapters/codex-exec-agent.js +1 -1
  3. package/dist/adapters/codex.cjs +21 -3
  4. package/dist/adapters/codex.js +1 -1
  5. package/dist/adapters/local-agent.cjs +21 -3
  6. package/dist/adapters/local-agent.js +1 -1
  7. package/dist/adapters/openclaw.js +4 -4
  8. package/dist/advanced/engine-harness.cjs +103 -2
  9. package/dist/advanced/engine-harness.js +5 -5
  10. package/dist/advanced/index.cjs +103 -2
  11. package/dist/advanced/index.js +7 -7
  12. package/dist/advanced/proof-run-core.cjs +98 -1
  13. package/dist/advanced/proof-run-core.js +1 -1
  14. package/dist/advanced/proof-run-engine.cjs +98 -1
  15. package/dist/advanced/proof-run-engine.js +2 -2
  16. package/dist/advanced/runner.js +5 -5
  17. package/dist/checkpoint.cjs +20 -1
  18. package/dist/checkpoint.js +1 -1
  19. package/dist/{chunk-27AB2TEQ.js → chunk-27BG64ZG.js} +3 -3
  20. package/dist/{chunk-P2RN2NYR.js → chunk-3OTO7IDH.js} +2 -2
  21. package/dist/{chunk-EEIYUZXE.js → chunk-4PPJKW3Z.js} +21 -3
  22. package/dist/{chunk-2DW2LBUD.js → chunk-AM3K5FPW.js} +4 -4
  23. package/dist/{chunk-RBWSCU6V.js → chunk-AYMHHRJZ.js} +1 -1
  24. package/dist/{chunk-FU73I4V3.js → chunk-K6HZUSHH.js} +98 -1
  25. package/dist/{chunk-4FOHZ7JG.js → chunk-OILKSY5J.js} +20 -1
  26. package/dist/{chunk-FMOYUYH2.js → chunk-RDPG554T.js} +1 -1
  27. package/dist/{chunk-KS3N5APP.js → chunk-YC77HZVF.js} +1 -1
  28. package/dist/{chunk-YZUVEJ5B.js → chunk-ZQWVXQKJ.js} +1 -1
  29. package/dist/cli/index.js +7 -7
  30. package/dist/cli.cjs +139 -5
  31. package/dist/cli.js +7 -7
  32. package/dist/codex-exec-agent.cjs +21 -3
  33. package/dist/codex-exec-agent.js +1 -1
  34. package/dist/engine-harness.cjs +103 -2
  35. package/dist/engine-harness.js +5 -5
  36. package/dist/index.cjs +139 -5
  37. package/dist/index.js +7 -7
  38. package/dist/local-agent.cjs +21 -3
  39. package/dist/local-agent.js +1 -1
  40. package/dist/openclaw.js +4 -4
  41. package/dist/proof-run-core.cjs +98 -1
  42. package/dist/proof-run-core.js +1 -1
  43. package/dist/proof-run-engine.cjs +98 -1
  44. package/dist/proof-run-engine.js +2 -2
  45. package/dist/run-card.js +2 -2
  46. package/dist/runner.js +5 -5
  47. package/dist/spec/checkpoint.cjs +20 -1
  48. package/dist/spec/checkpoint.js +1 -1
  49. package/dist/spec/index.cjs +20 -1
  50. package/dist/spec/index.js +3 -3
  51. package/dist/spec/run-card.js +2 -2
  52. package/dist/spec/state.js +3 -3
  53. package/dist/state.js +3 -3
  54. package/package.json +1 -1
@@ -235,6 +235,30 @@ function normalizeRoutePath(value) {
235
235
  return `${pathname}${query}${hash}`;
236
236
  }
237
237
  }
238
+ function trimRouteCandidate(value) {
239
+ return value.trim().replace(/[),.;\]}]+$/g, "");
240
+ }
241
+ function expectedTerminalRouteFromText(value) {
242
+ const text = typeof value === "string" ? value.trim() : "";
243
+ if (!text) return "";
244
+ const routePattern = "(https?:\\/\\/[^\\s\"'<>`]+|\\/[^\\s\"'<>`]+)";
245
+ const patterns = [
246
+ new RegExp(`\\bexpected\\s+(?:terminal\\s+|final\\s+|after\\s+)?(?:url|route|path)\\s*(?:is|=|:)\\s*${routePattern}`, "i"),
247
+ new RegExp(`\\b(?:terminal|final|after)\\s+(?:url|route|path)\\s*(?:is|=|:)\\s*${routePattern}`, "i"),
248
+ new RegExp(`\\b(?:ends|end|ending|lands|land|landing)\\s+(?:at|on)\\s*${routePattern}`, "i")
249
+ ];
250
+ for (const pattern of patterns) {
251
+ const match = text.match(pattern);
252
+ if (!match) continue;
253
+ const candidate = trimRouteCandidate(match[1] || "");
254
+ const normalized = normalizeRoutePath(candidate);
255
+ if (normalized) return normalized;
256
+ }
257
+ return "";
258
+ }
259
+ function requestedExpectedTerminalRouteForState(state) {
260
+ return expectedTerminalRouteFromText(state.success_criteria) || expectedTerminalRouteFromText(state.change_request) || expectedTerminalRouteFromText(state.context) || expectedTerminalRouteFromText(state.assertions_json);
261
+ }
238
262
  function isInteractionVerificationMode(value) {
239
263
  return INTERACTION_VERIFICATION_MODES.has(typeof value === "string" ? value.trim().toLowerCase() : "");
240
264
  }
@@ -247,6 +271,25 @@ function appendStateWarning(state, key, warning) {
247
271
  const existing = Array.isArray(state[key]) ? state[key].filter((item) => typeof item === "string") : [];
248
272
  if (!existing.includes(warning)) state[key] = [...existing, warning];
249
273
  }
274
+ function applyRequestedInteractionRouteContract(state) {
275
+ if (!isInteractionVerificationMode(state.verification_mode)) return;
276
+ const requestedTerminal = requestedExpectedTerminalRouteForState(state);
277
+ if (!requestedTerminal) return;
278
+ state.requested_expected_terminal_path = requestedTerminal;
279
+ if (!stringRecordValue(state, "expected_terminal_path")) {
280
+ state.expected_terminal_path = requestedTerminal;
281
+ }
282
+ const startPath = normalizeRoutePath(state.server_path) || normalizeRoutePath(state.expected_start_path) || "/";
283
+ if (!stringRecordValue(state, "expected_start_path")) {
284
+ state.expected_start_path = startPath;
285
+ }
286
+ const existingContract = state.interaction_contract && typeof state.interaction_contract === "object" ? state.interaction_contract : {};
287
+ state.interaction_contract = {
288
+ ...existingContract,
289
+ start_path: stringRecordValue(existingContract, "start_path") || startPath,
290
+ expected_terminal_path: stringRecordValue(existingContract, "expected_terminal_path") || requestedTerminal
291
+ };
292
+ }
250
293
  function interactionStartPathForAuthorPacket(state, parsed, refined) {
251
294
  return normalizeRoutePath(
252
295
  stringRecordValue(state, "expected_start_path") || stringRecordValue(refined, "expected_start_path") || stringRecordValue(parsed.interaction_contract, "start_path") || stringRecordValue(parsed.proof_contract, "start_path") || stringRecordValue(state, "server_path") || "/"
@@ -289,6 +332,36 @@ function normalizeCaptureScript(value) {
289
332
  const script = normalizeOptionalString(value) || "";
290
333
  return script ? guardProofEvidenceGlobalAssignments(script) : "";
291
334
  }
335
+ function compactCaptureScriptForHeuristics(script) {
336
+ return script.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/.*$/gm, "$1 ").replace(/\s+/g, " ").trim().toLowerCase();
337
+ }
338
+ function interactionCaptureScriptLooksPassive(script) {
339
+ const text = compactCaptureScriptForHeuristics(script);
340
+ if (!text) return true;
341
+ const actionPatterns = [
342
+ /\bpage\.(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?|goto|reload)\s*\(/,
343
+ /\blocator\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?)\s*\(/,
344
+ /\b(getby(role|text|label|testid|placeholder|title)|getbyalttext)\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption)\s*\(/,
345
+ /\bkeyboard\s*\.\s*(press|type|inserttext)\s*\(/,
346
+ /\bmouse\s*\.\s*(click|dblclick|down|up|move)\s*\(/,
347
+ /\btouchscreen\s*\.\s*tap\s*\(/
348
+ ];
349
+ if (actionPatterns.some((pattern) => pattern.test(text))) return false;
350
+ const evidencePatterns = [
351
+ /\breturn\s+[{[]/,
352
+ /\breturn\s+\w+/,
353
+ /__riddleproofevidence/,
354
+ /\bproof_evidence\b/,
355
+ /\brouteexpectationsource\b/,
356
+ /\bexpectedurl\b/,
357
+ /\bassertions?\b/
358
+ ];
359
+ return !evidencePatterns.some((pattern) => pattern.test(text));
360
+ }
361
+ function setStructuredInteractionCaptureFailure(state, summary) {
362
+ const existing = typeof state.structured_interaction_capture_failure_summary === "string" ? state.structured_interaction_capture_failure_summary.trim() : "";
363
+ if (!existing) state.structured_interaction_capture_failure_summary = summary;
364
+ }
292
365
  function appendProofSummaryLine(state, line) {
293
366
  const text = String(line || "").trim();
294
367
  if (!text) return;
@@ -538,6 +611,9 @@ function proofAssessmentHardBlockersForState(state = {}) {
538
611
  }
539
612
  add(state?.structured_interaction_capture_failure_summary);
540
613
  add(state?.structured_interaction_failure_summary);
614
+ if (isInteractionVerificationMode(normalizedVerificationMode(state)) && !stateHasProofEvidence(state)) {
615
+ add("interaction proof evidence is required before ready_to_ship; proof_evidence_present=false");
616
+ }
541
617
  const mergeRecommendation = String(state?.merge_recommendation || "").trim();
542
618
  if (mergeRecommendation === "do-not-merge" && blockers.length) {
543
619
  add("merge_recommendation=do-not-merge because the proof bundle contains hard blockers.");
@@ -573,7 +649,22 @@ function stateHasAfterEvidence(state = {}) {
573
649
  const observation = objectValue(after.observation);
574
650
  const supporting = objectValue(after.supporting_artifacts);
575
651
  return Boolean(
576
- observation.valid === true && (supporting.has_structured_payload === true || supporting.proof_evidence_present === true || observation.telemetry_ready === true || Object.keys(objectValue(bundle.proof_evidence)).length > 0 || Object.keys(objectValue(after.proof_evidence)).length > 0)
652
+ observation.valid === true && (supporting.has_structured_payload === true || stateHasProofEvidence(state) || observation.telemetry_ready === true)
653
+ );
654
+ }
655
+ function stateHasProofEvidence(state = {}) {
656
+ if (state?.proof_evidence_present === true) return true;
657
+ if (state?.proof_evidence !== void 0 && state?.proof_evidence !== null) {
658
+ if (typeof state.proof_evidence !== "object") return true;
659
+ if (Object.keys(objectValue(state.proof_evidence)).length > 0) return true;
660
+ }
661
+ const bundle = objectValue(state?.evidence_bundle);
662
+ const after = objectValue(bundle.after);
663
+ const supporting = objectValue(after.supporting_artifacts);
664
+ const request = objectValue(state?.proof_assessment_request);
665
+ const structuredEvidence = objectValue(request.structured_evidence);
666
+ return Boolean(
667
+ supporting.proof_evidence_present === true || structuredEvidence.proof_evidence_present === true || Object.keys(objectValue(bundle.proof_evidence)).length > 0 || Object.keys(objectValue(after.proof_evidence)).length > 0
577
668
  );
578
669
  }
579
670
  function validateShipGate(state = {}) {
@@ -915,6 +1006,7 @@ function mergeStateFromParams(statePath, params) {
915
1006
  if (params.use_auth !== void 0) state.use_auth = params.use_auth ? "true" : "";
916
1007
  if (params.leave_draft !== void 0) state.leave_draft = params.leave_draft ? "true" : "";
917
1008
  if (params.advance_stage !== void 0) state.last_requested_advance_stage = params.advance_stage;
1009
+ applyRequestedInteractionRouteContract(state);
918
1010
  if (params.recon_assessment_json !== void 0) {
919
1011
  const raw = normalizeOptionalString(params.recon_assessment_json) || "";
920
1012
  if (!raw) {
@@ -951,6 +1043,11 @@ function mergeStateFromParams(statePath, params) {
951
1043
  state.supervisor_author_packet = parsed;
952
1044
  if (typeof parsed?.proof_plan === "string") state.proof_plan = normalizeOptionalString(parsed.proof_plan) || "";
953
1045
  if (typeof parsed?.capture_script === "string") state.capture_script = normalizeCaptureScript(parsed.capture_script);
1046
+ if (isInteractionVerificationMode(state.verification_mode) && interactionCaptureScriptLooksPassive(state.capture_script || "")) {
1047
+ const warning = "Interaction proof capture script appears passive: it does not perform a browser interaction or return structured proof evidence.";
1048
+ appendStateWarning(state, "author_warnings", warning);
1049
+ setStructuredInteractionCaptureFailure(state, warning);
1050
+ }
954
1051
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
955
1052
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
956
1053
  }
@@ -27,7 +27,7 @@ import {
27
27
  visualDeltaShipGateReason,
28
28
  workflowFile,
29
29
  writeState
30
- } from "./chunk-FU73I4V3.js";
30
+ } from "./chunk-K6HZUSHH.js";
31
31
  import "./chunk-MLKGABMK.js";
32
32
  export {
33
33
  BUNDLED_RIDDLE_PROOF_DIR,
@@ -214,6 +214,30 @@ function normalizeRoutePath(value) {
214
214
  return `${pathname}${query}${hash}`;
215
215
  }
216
216
  }
217
+ function trimRouteCandidate(value) {
218
+ return value.trim().replace(/[),.;\]}]+$/g, "");
219
+ }
220
+ function expectedTerminalRouteFromText(value) {
221
+ const text = typeof value === "string" ? value.trim() : "";
222
+ if (!text) return "";
223
+ const routePattern = "(https?:\\/\\/[^\\s\"'<>`]+|\\/[^\\s\"'<>`]+)";
224
+ const patterns = [
225
+ new RegExp(`\\bexpected\\s+(?:terminal\\s+|final\\s+|after\\s+)?(?:url|route|path)\\s*(?:is|=|:)\\s*${routePattern}`, "i"),
226
+ new RegExp(`\\b(?:terminal|final|after)\\s+(?:url|route|path)\\s*(?:is|=|:)\\s*${routePattern}`, "i"),
227
+ new RegExp(`\\b(?:ends|end|ending|lands|land|landing)\\s+(?:at|on)\\s*${routePattern}`, "i")
228
+ ];
229
+ for (const pattern of patterns) {
230
+ const match = text.match(pattern);
231
+ if (!match) continue;
232
+ const candidate = trimRouteCandidate(match[1] || "");
233
+ const normalized = normalizeRoutePath(candidate);
234
+ if (normalized) return normalized;
235
+ }
236
+ return "";
237
+ }
238
+ function requestedExpectedTerminalRouteForState(state) {
239
+ return expectedTerminalRouteFromText(state.success_criteria) || expectedTerminalRouteFromText(state.change_request) || expectedTerminalRouteFromText(state.context) || expectedTerminalRouteFromText(state.assertions_json);
240
+ }
217
241
  function isInteractionVerificationMode(value) {
218
242
  return INTERACTION_VERIFICATION_MODES.has(typeof value === "string" ? value.trim().toLowerCase() : "");
219
243
  }
@@ -226,6 +250,25 @@ function appendStateWarning(state, key, warning) {
226
250
  const existing = Array.isArray(state[key]) ? state[key].filter((item) => typeof item === "string") : [];
227
251
  if (!existing.includes(warning)) state[key] = [...existing, warning];
228
252
  }
253
+ function applyRequestedInteractionRouteContract(state) {
254
+ if (!isInteractionVerificationMode(state.verification_mode)) return;
255
+ const requestedTerminal = requestedExpectedTerminalRouteForState(state);
256
+ if (!requestedTerminal) return;
257
+ state.requested_expected_terminal_path = requestedTerminal;
258
+ if (!stringRecordValue(state, "expected_terminal_path")) {
259
+ state.expected_terminal_path = requestedTerminal;
260
+ }
261
+ const startPath = normalizeRoutePath(state.server_path) || normalizeRoutePath(state.expected_start_path) || "/";
262
+ if (!stringRecordValue(state, "expected_start_path")) {
263
+ state.expected_start_path = startPath;
264
+ }
265
+ const existingContract = state.interaction_contract && typeof state.interaction_contract === "object" ? state.interaction_contract : {};
266
+ state.interaction_contract = {
267
+ ...existingContract,
268
+ start_path: stringRecordValue(existingContract, "start_path") || startPath,
269
+ expected_terminal_path: stringRecordValue(existingContract, "expected_terminal_path") || requestedTerminal
270
+ };
271
+ }
229
272
  function interactionStartPathForAuthorPacket(state, parsed, refined) {
230
273
  return normalizeRoutePath(
231
274
  stringRecordValue(state, "expected_start_path") || stringRecordValue(refined, "expected_start_path") || stringRecordValue(parsed.interaction_contract, "start_path") || stringRecordValue(parsed.proof_contract, "start_path") || stringRecordValue(state, "server_path") || "/"
@@ -268,6 +311,36 @@ function normalizeCaptureScript(value) {
268
311
  const script = normalizeOptionalString(value) || "";
269
312
  return script ? guardProofEvidenceGlobalAssignments(script) : "";
270
313
  }
314
+ function compactCaptureScriptForHeuristics(script) {
315
+ return script.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/.*$/gm, "$1 ").replace(/\s+/g, " ").trim().toLowerCase();
316
+ }
317
+ function interactionCaptureScriptLooksPassive(script) {
318
+ const text = compactCaptureScriptForHeuristics(script);
319
+ if (!text) return true;
320
+ const actionPatterns = [
321
+ /\bpage\.(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?|goto|reload)\s*\(/,
322
+ /\blocator\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?)\s*\(/,
323
+ /\b(getby(role|text|label|testid|placeholder|title)|getbyalttext)\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption)\s*\(/,
324
+ /\bkeyboard\s*\.\s*(press|type|inserttext)\s*\(/,
325
+ /\bmouse\s*\.\s*(click|dblclick|down|up|move)\s*\(/,
326
+ /\btouchscreen\s*\.\s*tap\s*\(/
327
+ ];
328
+ if (actionPatterns.some((pattern) => pattern.test(text))) return false;
329
+ const evidencePatterns = [
330
+ /\breturn\s+[{[]/,
331
+ /\breturn\s+\w+/,
332
+ /__riddleproofevidence/,
333
+ /\bproof_evidence\b/,
334
+ /\brouteexpectationsource\b/,
335
+ /\bexpectedurl\b/,
336
+ /\bassertions?\b/
337
+ ];
338
+ return !evidencePatterns.some((pattern) => pattern.test(text));
339
+ }
340
+ function setStructuredInteractionCaptureFailure(state, summary) {
341
+ const existing = typeof state.structured_interaction_capture_failure_summary === "string" ? state.structured_interaction_capture_failure_summary.trim() : "";
342
+ if (!existing) state.structured_interaction_capture_failure_summary = summary;
343
+ }
271
344
  function appendProofSummaryLine(state, line) {
272
345
  const text = String(line || "").trim();
273
346
  if (!text) return;
@@ -517,6 +590,9 @@ function proofAssessmentHardBlockersForState(state = {}) {
517
590
  }
518
591
  add(state?.structured_interaction_capture_failure_summary);
519
592
  add(state?.structured_interaction_failure_summary);
593
+ if (isInteractionVerificationMode(normalizedVerificationMode(state)) && !stateHasProofEvidence(state)) {
594
+ add("interaction proof evidence is required before ready_to_ship; proof_evidence_present=false");
595
+ }
520
596
  const mergeRecommendation = String(state?.merge_recommendation || "").trim();
521
597
  if (mergeRecommendation === "do-not-merge" && blockers.length) {
522
598
  add("merge_recommendation=do-not-merge because the proof bundle contains hard blockers.");
@@ -552,7 +628,22 @@ function stateHasAfterEvidence(state = {}) {
552
628
  const observation = objectValue(after.observation);
553
629
  const supporting = objectValue(after.supporting_artifacts);
554
630
  return Boolean(
555
- observation.valid === true && (supporting.has_structured_payload === true || supporting.proof_evidence_present === true || observation.telemetry_ready === true || Object.keys(objectValue(bundle.proof_evidence)).length > 0 || Object.keys(objectValue(after.proof_evidence)).length > 0)
631
+ observation.valid === true && (supporting.has_structured_payload === true || stateHasProofEvidence(state) || observation.telemetry_ready === true)
632
+ );
633
+ }
634
+ function stateHasProofEvidence(state = {}) {
635
+ if (state?.proof_evidence_present === true) return true;
636
+ if (state?.proof_evidence !== void 0 && state?.proof_evidence !== null) {
637
+ if (typeof state.proof_evidence !== "object") return true;
638
+ if (Object.keys(objectValue(state.proof_evidence)).length > 0) return true;
639
+ }
640
+ const bundle = objectValue(state?.evidence_bundle);
641
+ const after = objectValue(bundle.after);
642
+ const supporting = objectValue(after.supporting_artifacts);
643
+ const request = objectValue(state?.proof_assessment_request);
644
+ const structuredEvidence = objectValue(request.structured_evidence);
645
+ return Boolean(
646
+ supporting.proof_evidence_present === true || structuredEvidence.proof_evidence_present === true || Object.keys(objectValue(bundle.proof_evidence)).length > 0 || Object.keys(objectValue(after.proof_evidence)).length > 0
556
647
  );
557
648
  }
558
649
  function validateShipGate(state = {}) {
@@ -894,6 +985,7 @@ function mergeStateFromParams(statePath, params) {
894
985
  if (params.use_auth !== void 0) state.use_auth = params.use_auth ? "true" : "";
895
986
  if (params.leave_draft !== void 0) state.leave_draft = params.leave_draft ? "true" : "";
896
987
  if (params.advance_stage !== void 0) state.last_requested_advance_stage = params.advance_stage;
988
+ applyRequestedInteractionRouteContract(state);
897
989
  if (params.recon_assessment_json !== void 0) {
898
990
  const raw = normalizeOptionalString(params.recon_assessment_json) || "";
899
991
  if (!raw) {
@@ -930,6 +1022,11 @@ function mergeStateFromParams(statePath, params) {
930
1022
  state.supervisor_author_packet = parsed;
931
1023
  if (typeof parsed?.proof_plan === "string") state.proof_plan = normalizeOptionalString(parsed.proof_plan) || "";
932
1024
  if (typeof parsed?.capture_script === "string") state.capture_script = normalizeCaptureScript(parsed.capture_script);
1025
+ if (isInteractionVerificationMode(state.verification_mode) && interactionCaptureScriptLooksPassive(state.capture_script || "")) {
1026
+ const warning = "Interaction proof capture script appears passive: it does not perform a browser interaction or return structured proof evidence.";
1027
+ appendStateWarning(state, "author_warnings", warning);
1028
+ setStructuredInteractionCaptureFailure(state, warning);
1029
+ }
933
1030
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
934
1031
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
935
1032
  }
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  createRiddleProofEngine,
3
3
  executeWorkflow
4
- } from "./chunk-KS3N5APP.js";
5
- import "./chunk-FU73I4V3.js";
4
+ } from "./chunk-YC77HZVF.js";
5
+ import "./chunk-K6HZUSHH.js";
6
6
  import "./chunk-MLKGABMK.js";
7
7
  export {
8
8
  createRiddleProofEngine,
package/dist/run-card.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RIDDLE_PROOF_RUN_CARD_VERSION,
3
3
  createRiddleProofRunCard
4
- } from "./chunk-FMOYUYH2.js";
5
- import "./chunk-4FOHZ7JG.js";
4
+ } from "./chunk-RDPG554T.js";
5
+ import "./chunk-OILKSY5J.js";
6
6
  import "./chunk-VY4Y5U57.js";
7
7
  import "./chunk-MLKGABMK.js";
8
8
  export {
package/dist/runner.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "./chunk-P2RN2NYR.js";
4
- import "./chunk-YZUVEJ5B.js";
5
- import "./chunk-FMOYUYH2.js";
6
- import "./chunk-FU73I4V3.js";
7
- import "./chunk-4FOHZ7JG.js";
3
+ } from "./chunk-3OTO7IDH.js";
4
+ import "./chunk-ZQWVXQKJ.js";
5
+ import "./chunk-RDPG554T.js";
6
+ import "./chunk-K6HZUSHH.js";
7
+ import "./chunk-OILKSY5J.js";
8
8
  import "./chunk-VY4Y5U57.js";
9
9
  import "./chunk-MLKGABMK.js";
10
10
  export {
@@ -121,7 +121,7 @@ function responseSchemaForAuthorPacket() {
121
121
  summary: { type: "string" },
122
122
  payload: {
123
123
  type: "object",
124
- description: "For decision=author_packet, provide the proof packet itself or {author_packet:{...}} with proof_plan, capture_script, and refined_inputs.expected_terminal_path when the proof changes route, query, or hash."
124
+ description: "For decision=author_packet, provide the proof packet itself or {author_packet:{...}} with proof_plan, capture_script, refined_inputs.expected_terminal_path, and interaction_contract when the proof changes route, query, or hash."
125
125
  },
126
126
  reasons: { type: "array", items: { type: "string" } },
127
127
  continue_with_stage: { type: "string", enum: ["author", "recon"] },
@@ -432,6 +432,10 @@ function buildAuthorCheckpointPacket(input) {
432
432
  reference: input.request.reference || fullState.reference,
433
433
  server_path: fullState.server_path,
434
434
  wait_for_selector: fullState.wait_for_selector,
435
+ expected_start_path: fullState.expected_start_path,
436
+ expected_terminal_path: fullState.expected_terminal_path,
437
+ requested_expected_terminal_path: fullState.requested_expected_terminal_path,
438
+ interaction_contract: jsonCloneRecord(fullState.interaction_contract),
435
439
  route_expectation: jsonCloneRecord(fullState.route_expectation),
436
440
  author_summary: fullState.author_summary,
437
441
  author_request: jsonCloneRecord(authorRequest),
@@ -639,9 +643,24 @@ function defaultContinueStage(packet, decision) {
639
643
  }
640
644
  function templatePayloadFor(packet, decision) {
641
645
  if (decision === "author_packet") {
646
+ const expectedTerminalPath = packet.state_excerpt?.expected_terminal_path || packet.state_excerpt?.requested_expected_terminal_path || null;
647
+ const expectedStartPath = packet.state_excerpt?.expected_start_path || packet.state_excerpt?.server_path || null;
642
648
  return {
643
649
  proof_plan: "TODO: describe the exact proof plan and stop condition.",
644
650
  capture_script: "TODO: provide the capture script that collects required artifacts/evidence.",
651
+ refined_inputs: {
652
+ server_path: packet.state_excerpt?.server_path || null,
653
+ wait_for_selector: packet.state_excerpt?.wait_for_selector || null,
654
+ reference: packet.state_excerpt?.reference || null,
655
+ expected_start_path: expectedStartPath,
656
+ expected_terminal_path: expectedTerminalPath
657
+ },
658
+ interaction_contract: {
659
+ start_path: expectedStartPath,
660
+ expected_terminal_path: expectedTerminalPath,
661
+ action: "TODO: describe the browser interaction, for example click the visible Proof nav link.",
662
+ assertions: []
663
+ },
645
664
  summary: "TODO: summarize why this proof packet targets the requested change."
646
665
  };
647
666
  }
@@ -13,7 +13,7 @@ import {
13
13
  normalizeCheckpointResponse,
14
14
  proofContractFromAuthorCheckpointResponse,
15
15
  statePathsForRunState
16
- } from "../chunk-4FOHZ7JG.js";
16
+ } from "../chunk-OILKSY5J.js";
17
17
  import "../chunk-VY4Y5U57.js";
18
18
  import "../chunk-MLKGABMK.js";
19
19
  export {
@@ -344,7 +344,7 @@ function responseSchemaForAuthorPacket() {
344
344
  summary: { type: "string" },
345
345
  payload: {
346
346
  type: "object",
347
- description: "For decision=author_packet, provide the proof packet itself or {author_packet:{...}} with proof_plan, capture_script, and refined_inputs.expected_terminal_path when the proof changes route, query, or hash."
347
+ description: "For decision=author_packet, provide the proof packet itself or {author_packet:{...}} with proof_plan, capture_script, refined_inputs.expected_terminal_path, and interaction_contract when the proof changes route, query, or hash."
348
348
  },
349
349
  reasons: { type: "array", items: { type: "string" } },
350
350
  continue_with_stage: { type: "string", enum: ["author", "recon"] },
@@ -655,6 +655,10 @@ function buildAuthorCheckpointPacket(input) {
655
655
  reference: input.request.reference || fullState.reference,
656
656
  server_path: fullState.server_path,
657
657
  wait_for_selector: fullState.wait_for_selector,
658
+ expected_start_path: fullState.expected_start_path,
659
+ expected_terminal_path: fullState.expected_terminal_path,
660
+ requested_expected_terminal_path: fullState.requested_expected_terminal_path,
661
+ interaction_contract: jsonCloneRecord(fullState.interaction_contract),
658
662
  route_expectation: jsonCloneRecord(fullState.route_expectation),
659
663
  author_summary: fullState.author_summary,
660
664
  author_request: jsonCloneRecord(authorRequest),
@@ -862,9 +866,24 @@ function defaultContinueStage(packet, decision) {
862
866
  }
863
867
  function templatePayloadFor(packet, decision) {
864
868
  if (decision === "author_packet") {
869
+ const expectedTerminalPath = packet.state_excerpt?.expected_terminal_path || packet.state_excerpt?.requested_expected_terminal_path || null;
870
+ const expectedStartPath = packet.state_excerpt?.expected_start_path || packet.state_excerpt?.server_path || null;
865
871
  return {
866
872
  proof_plan: "TODO: describe the exact proof plan and stop condition.",
867
873
  capture_script: "TODO: provide the capture script that collects required artifacts/evidence.",
874
+ refined_inputs: {
875
+ server_path: packet.state_excerpt?.server_path || null,
876
+ wait_for_selector: packet.state_excerpt?.wait_for_selector || null,
877
+ reference: packet.state_excerpt?.reference || null,
878
+ expected_start_path: expectedStartPath,
879
+ expected_terminal_path: expectedTerminalPath
880
+ },
881
+ interaction_contract: {
882
+ start_path: expectedStartPath,
883
+ expected_terminal_path: expectedTerminalPath,
884
+ action: "TODO: describe the browser interaction, for example click the visible Proof nav link.",
885
+ assertions: []
886
+ },
868
887
  summary: "TODO: summarize why this proof packet targets the requested change."
869
888
  };
870
889
  }
@@ -10,11 +10,11 @@ import {
10
10
  normalizePrLifecycleState,
11
11
  normalizeRunParams,
12
12
  setRunStatus
13
- } from "../chunk-YZUVEJ5B.js";
13
+ } from "../chunk-ZQWVXQKJ.js";
14
14
  import {
15
15
  RIDDLE_PROOF_RUN_CARD_VERSION,
16
16
  createRiddleProofRunCard
17
- } from "../chunk-FMOYUYH2.js";
17
+ } from "../chunk-RDPG554T.js";
18
18
  import {
19
19
  RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
20
20
  RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
@@ -30,7 +30,7 @@ import {
30
30
  normalizeCheckpointResponse,
31
31
  proofContractFromAuthorCheckpointResponse,
32
32
  statePathsForRunState
33
- } from "../chunk-4FOHZ7JG.js";
33
+ } from "../chunk-OILKSY5J.js";
34
34
  import {
35
35
  applyTerminalMetadata,
36
36
  compactRecord,
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  RIDDLE_PROOF_RUN_CARD_VERSION,
3
3
  createRiddleProofRunCard
4
- } from "../chunk-FMOYUYH2.js";
5
- import "../chunk-4FOHZ7JG.js";
4
+ } from "../chunk-RDPG554T.js";
5
+ import "../chunk-OILKSY5J.js";
6
6
  import "../chunk-VY4Y5U57.js";
7
7
  import "../chunk-MLKGABMK.js";
8
8
  export {
@@ -9,9 +9,9 @@ import {
9
9
  normalizePrLifecycleState,
10
10
  normalizeRunParams,
11
11
  setRunStatus
12
- } from "../chunk-YZUVEJ5B.js";
13
- import "../chunk-FMOYUYH2.js";
14
- import "../chunk-4FOHZ7JG.js";
12
+ } from "../chunk-ZQWVXQKJ.js";
13
+ import "../chunk-RDPG554T.js";
14
+ import "../chunk-OILKSY5J.js";
15
15
  import "../chunk-VY4Y5U57.js";
16
16
  import "../chunk-MLKGABMK.js";
17
17
  export {
package/dist/state.js CHANGED
@@ -9,9 +9,9 @@ import {
9
9
  normalizePrLifecycleState,
10
10
  normalizeRunParams,
11
11
  setRunStatus
12
- } from "./chunk-YZUVEJ5B.js";
13
- import "./chunk-FMOYUYH2.js";
14
- import "./chunk-4FOHZ7JG.js";
12
+ } from "./chunk-ZQWVXQKJ.js";
13
+ import "./chunk-RDPG554T.js";
14
+ import "./chunk-OILKSY5J.js";
15
15
  import "./chunk-VY4Y5U57.js";
16
16
  import "./chunk-MLKGABMK.js";
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.8.25",
3
+ "version": "0.8.27",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",