@riddledc/riddle-proof 0.8.24 → 0.8.26

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 (36) hide show
  1. package/README.md +17 -0
  2. package/dist/advanced/engine-harness.cjs +54 -1
  3. package/dist/advanced/engine-harness.js +2 -2
  4. package/dist/advanced/index.cjs +54 -1
  5. package/dist/advanced/index.d.cts +1 -1
  6. package/dist/advanced/index.d.ts +1 -1
  7. package/dist/advanced/index.js +4 -4
  8. package/dist/advanced/proof-run-core.cjs +54 -1
  9. package/dist/advanced/proof-run-core.js +1 -1
  10. package/dist/advanced/proof-run-engine.cjs +54 -1
  11. package/dist/advanced/proof-run-engine.d.cts +1 -1
  12. package/dist/advanced/proof-run-engine.d.ts +1 -1
  13. package/dist/advanced/proof-run-engine.js +2 -2
  14. package/dist/advanced/runner.js +2 -2
  15. package/dist/{chunk-P2RN2NYR.js → chunk-DZYH67J2.js} +1 -1
  16. package/dist/{chunk-KS3N5APP.js → chunk-EGOVHMBQ.js} +1 -1
  17. package/dist/{chunk-2DW2LBUD.js → chunk-EMVMXVJV.js} +1 -1
  18. package/dist/{chunk-FU73I4V3.js → chunk-RF72NWHM.js} +54 -1
  19. package/dist/{chunk-UTQJHWCQ.js → chunk-WULFU42E.js} +322 -2
  20. package/dist/cli/index.js +3 -3
  21. package/dist/cli.cjs +374 -1
  22. package/dist/cli.js +3 -3
  23. package/dist/engine-harness.cjs +54 -1
  24. package/dist/engine-harness.js +2 -2
  25. package/dist/index.cjs +54 -1
  26. package/dist/index.js +3 -3
  27. package/dist/proof-run-core.cjs +54 -1
  28. package/dist/proof-run-core.js +1 -1
  29. package/dist/{proof-run-engine-Vh9uESqh.d.ts → proof-run-engine-By7oLsF-.d.ts} +3 -3
  30. package/dist/{proof-run-engine-DI1qBmMf.d.cts → proof-run-engine-D80hVFMf.d.cts} +3 -3
  31. package/dist/proof-run-engine.cjs +54 -1
  32. package/dist/proof-run-engine.d.cts +1 -1
  33. package/dist/proof-run-engine.d.ts +1 -1
  34. package/dist/proof-run-engine.js +2 -2
  35. package/dist/runner.js +2 -2
  36. package/package.json +1 -1
package/README.md CHANGED
@@ -225,6 +225,23 @@ The same pack also points at the local generic core suite:
225
225
  python3 packages/riddle-proof/runtime/tests/trust_boundary_regression.py
226
226
  ```
227
227
 
228
+ Use the pack runner to validate the local generic core first and generate the
229
+ small serial OpenClaw handoff from the same manifest:
230
+
231
+ ```sh
232
+ riddle-proof-loop regression-pack run \
233
+ --pack oc-flow-regression \
234
+ --local-core true \
235
+ --format markdown \
236
+ --output artifacts/riddle-proof/oc-flow-regression
237
+ ```
238
+
239
+ The command writes `regression-pack-result.json`, `summary.md`, and
240
+ `oc-handoff.md` when `--output` / `--output-dir` is set. The OC handoff prompt
241
+ is generated only as wrapper/runtime validation guidance; the browser evidence,
242
+ required cases, forbidden lifecycle markers, and version gate remain owned by
243
+ the generic pack manifest.
244
+
228
245
  Before counting live wrapper runs, use the pack's runtime gate: verify
229
246
  `riddle_proof_status` reports the loaded `@riddledc/openclaw-riddle-proof` and
230
247
  `@riddledc/riddle-proof` versions. Disk package versions alone are not enough.
@@ -244,6 +244,36 @@ function normalizeCaptureScript(value) {
244
244
  const script = normalizeOptionalString(value) || "";
245
245
  return script ? guardProofEvidenceGlobalAssignments(script) : "";
246
246
  }
247
+ function compactCaptureScriptForHeuristics(script) {
248
+ return script.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/.*$/gm, "$1 ").replace(/\s+/g, " ").trim().toLowerCase();
249
+ }
250
+ function interactionCaptureScriptLooksPassive(script) {
251
+ const text = compactCaptureScriptForHeuristics(script);
252
+ if (!text) return true;
253
+ const actionPatterns = [
254
+ /\bpage\.(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?|goto|reload)\s*\(/,
255
+ /\blocator\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?)\s*\(/,
256
+ /\b(getby(role|text|label|testid|placeholder|title)|getbyalttext)\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption)\s*\(/,
257
+ /\bkeyboard\s*\.\s*(press|type|inserttext)\s*\(/,
258
+ /\bmouse\s*\.\s*(click|dblclick|down|up|move)\s*\(/,
259
+ /\btouchscreen\s*\.\s*tap\s*\(/
260
+ ];
261
+ if (actionPatterns.some((pattern) => pattern.test(text))) return false;
262
+ const evidencePatterns = [
263
+ /\breturn\s+[{[]/,
264
+ /\breturn\s+\w+/,
265
+ /__riddleproofevidence/,
266
+ /\bproof_evidence\b/,
267
+ /\brouteexpectationsource\b/,
268
+ /\bexpectedurl\b/,
269
+ /\bassertions?\b/
270
+ ];
271
+ return !evidencePatterns.some((pattern) => pattern.test(text));
272
+ }
273
+ function setStructuredInteractionCaptureFailure(state, summary) {
274
+ const existing = typeof state.structured_interaction_capture_failure_summary === "string" ? state.structured_interaction_capture_failure_summary.trim() : "";
275
+ if (!existing) state.structured_interaction_capture_failure_summary = summary;
276
+ }
247
277
  function appendProofSummaryLine(state, line) {
248
278
  const text = String(line || "").trim();
249
279
  if (!text) return;
@@ -484,6 +514,9 @@ function proofAssessmentHardBlockersForState(state = {}) {
484
514
  }
485
515
  add(state?.structured_interaction_capture_failure_summary);
486
516
  add(state?.structured_interaction_failure_summary);
517
+ if (isInteractionVerificationMode(normalizedVerificationMode(state)) && !stateHasProofEvidence(state)) {
518
+ add("interaction proof evidence is required before ready_to_ship; proof_evidence_present=false");
519
+ }
487
520
  const mergeRecommendation = String(state?.merge_recommendation || "").trim();
488
521
  if (mergeRecommendation === "do-not-merge" && blockers.length) {
489
522
  add("merge_recommendation=do-not-merge because the proof bundle contains hard blockers.");
@@ -519,7 +552,22 @@ function stateHasAfterEvidence(state = {}) {
519
552
  const observation = objectValue(after.observation);
520
553
  const supporting = objectValue(after.supporting_artifacts);
521
554
  return Boolean(
522
- 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)
555
+ observation.valid === true && (supporting.has_structured_payload === true || stateHasProofEvidence(state) || observation.telemetry_ready === true)
556
+ );
557
+ }
558
+ function stateHasProofEvidence(state = {}) {
559
+ if (state?.proof_evidence_present === true) return true;
560
+ if (state?.proof_evidence !== void 0 && state?.proof_evidence !== null) {
561
+ if (typeof state.proof_evidence !== "object") return true;
562
+ if (Object.keys(objectValue(state.proof_evidence)).length > 0) return true;
563
+ }
564
+ const bundle = objectValue(state?.evidence_bundle);
565
+ const after = objectValue(bundle.after);
566
+ const supporting = objectValue(after.supporting_artifacts);
567
+ const request = objectValue(state?.proof_assessment_request);
568
+ const structuredEvidence = objectValue(request.structured_evidence);
569
+ return Boolean(
570
+ 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
523
571
  );
524
572
  }
525
573
  function validateShipGate(state = {}) {
@@ -725,6 +773,11 @@ function mergeStateFromParams(statePath, params) {
725
773
  state.supervisor_author_packet = parsed;
726
774
  if (typeof parsed?.proof_plan === "string") state.proof_plan = normalizeOptionalString(parsed.proof_plan) || "";
727
775
  if (typeof parsed?.capture_script === "string") state.capture_script = normalizeCaptureScript(parsed.capture_script);
776
+ if (isInteractionVerificationMode(state.verification_mode) && interactionCaptureScriptLooksPassive(state.capture_script || "")) {
777
+ const warning = "Interaction proof capture script appears passive: it does not perform a browser interaction or return structured proof evidence.";
778
+ appendStateWarning(state, "author_warnings", warning);
779
+ setStructuredInteractionCaptureFailure(state, warning);
780
+ }
728
781
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
729
782
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
730
783
  }
@@ -2,10 +2,10 @@ import {
2
2
  createDisabledRiddleProofAgentAdapter,
3
3
  readRiddleProofRunStatus,
4
4
  runRiddleProofEngineHarness
5
- } from "../chunk-2DW2LBUD.js";
5
+ } from "../chunk-EMVMXVJV.js";
6
6
  import "../chunk-YZUVEJ5B.js";
7
7
  import "../chunk-FMOYUYH2.js";
8
- import "../chunk-FU73I4V3.js";
8
+ import "../chunk-RF72NWHM.js";
9
9
  import "../chunk-4FOHZ7JG.js";
10
10
  import "../chunk-VY4Y5U57.js";
11
11
  import "../chunk-MLKGABMK.js";
@@ -275,6 +275,36 @@ function normalizeCaptureScript(value) {
275
275
  const script = normalizeOptionalString(value) || "";
276
276
  return script ? guardProofEvidenceGlobalAssignments(script) : "";
277
277
  }
278
+ function compactCaptureScriptForHeuristics(script) {
279
+ return script.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/.*$/gm, "$1 ").replace(/\s+/g, " ").trim().toLowerCase();
280
+ }
281
+ function interactionCaptureScriptLooksPassive(script) {
282
+ const text = compactCaptureScriptForHeuristics(script);
283
+ if (!text) return true;
284
+ const actionPatterns = [
285
+ /\bpage\.(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?|goto|reload)\s*\(/,
286
+ /\blocator\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?)\s*\(/,
287
+ /\b(getby(role|text|label|testid|placeholder|title)|getbyalttext)\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption)\s*\(/,
288
+ /\bkeyboard\s*\.\s*(press|type|inserttext)\s*\(/,
289
+ /\bmouse\s*\.\s*(click|dblclick|down|up|move)\s*\(/,
290
+ /\btouchscreen\s*\.\s*tap\s*\(/
291
+ ];
292
+ if (actionPatterns.some((pattern) => pattern.test(text))) return false;
293
+ const evidencePatterns = [
294
+ /\breturn\s+[{[]/,
295
+ /\breturn\s+\w+/,
296
+ /__riddleproofevidence/,
297
+ /\bproof_evidence\b/,
298
+ /\brouteexpectationsource\b/,
299
+ /\bexpectedurl\b/,
300
+ /\bassertions?\b/
301
+ ];
302
+ return !evidencePatterns.some((pattern) => pattern.test(text));
303
+ }
304
+ function setStructuredInteractionCaptureFailure(state, summary) {
305
+ const existing = typeof state.structured_interaction_capture_failure_summary === "string" ? state.structured_interaction_capture_failure_summary.trim() : "";
306
+ if (!existing) state.structured_interaction_capture_failure_summary = summary;
307
+ }
278
308
  function appendProofSummaryLine(state, line) {
279
309
  const text = String(line || "").trim();
280
310
  if (!text) return;
@@ -515,6 +545,9 @@ function proofAssessmentHardBlockersForState(state = {}) {
515
545
  }
516
546
  add(state?.structured_interaction_capture_failure_summary);
517
547
  add(state?.structured_interaction_failure_summary);
548
+ if (isInteractionVerificationMode(normalizedVerificationMode(state)) && !stateHasProofEvidence(state)) {
549
+ add("interaction proof evidence is required before ready_to_ship; proof_evidence_present=false");
550
+ }
518
551
  const mergeRecommendation = String(state?.merge_recommendation || "").trim();
519
552
  if (mergeRecommendation === "do-not-merge" && blockers.length) {
520
553
  add("merge_recommendation=do-not-merge because the proof bundle contains hard blockers.");
@@ -550,7 +583,22 @@ function stateHasAfterEvidence(state = {}) {
550
583
  const observation = objectValue(after.observation);
551
584
  const supporting = objectValue(after.supporting_artifacts);
552
585
  return Boolean(
553
- 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)
586
+ observation.valid === true && (supporting.has_structured_payload === true || stateHasProofEvidence(state) || observation.telemetry_ready === true)
587
+ );
588
+ }
589
+ function stateHasProofEvidence(state = {}) {
590
+ if (state?.proof_evidence_present === true) return true;
591
+ if (state?.proof_evidence !== void 0 && state?.proof_evidence !== null) {
592
+ if (typeof state.proof_evidence !== "object") return true;
593
+ if (Object.keys(objectValue(state.proof_evidence)).length > 0) return true;
594
+ }
595
+ const bundle = objectValue(state?.evidence_bundle);
596
+ const after = objectValue(bundle.after);
597
+ const supporting = objectValue(after.supporting_artifacts);
598
+ const request = objectValue(state?.proof_assessment_request);
599
+ const structuredEvidence = objectValue(request.structured_evidence);
600
+ return Boolean(
601
+ 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
554
602
  );
555
603
  }
556
604
  function validateShipGate(state = {}) {
@@ -756,6 +804,11 @@ function mergeStateFromParams(statePath, params) {
756
804
  state.supervisor_author_packet = parsed;
757
805
  if (typeof parsed?.proof_plan === "string") state.proof_plan = normalizeOptionalString(parsed.proof_plan) || "";
758
806
  if (typeof parsed?.capture_script === "string") state.capture_script = normalizeCaptureScript(parsed.capture_script);
807
+ if (isInteractionVerificationMode(state.verification_mode) && interactionCaptureScriptLooksPassive(state.capture_script || "")) {
808
+ const warning = "Interaction proof capture script appears passive: it does not perform a browser interaction or return structured proof evidence.";
809
+ appendStateWarning(state, "author_warnings", warning);
810
+ setStructuredInteractionCaptureFailure(state, warning);
811
+ }
759
812
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
760
813
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
761
814
  }
@@ -1,5 +1,5 @@
1
1
  export { b as runner } from '../runner-4LJ5z0D-.cjs';
2
2
  export { l as engineHarness } from '../engine-harness-LBfqbFSe.cjs';
3
3
  export { p as proofRunCore } from '../proof-run-core-C8FDUhle.cjs';
4
- export { p as proofRunEngine } from '../proof-run-engine-DI1qBmMf.cjs';
4
+ export { p as proofRunEngine } from '../proof-run-engine-D80hVFMf.cjs';
5
5
  import '../types.cjs';
@@ -1,5 +1,5 @@
1
1
  export { b as runner } from '../runner-BdQpOkZD.js';
2
2
  export { l as engineHarness } from '../engine-harness-CMACHP6A.js';
3
3
  export { p as proofRunCore } from '../proof-run-core-C8FDUhle.js';
4
- export { p as proofRunEngine } from '../proof-run-engine-Vh9uESqh.js';
4
+ export { p as proofRunEngine } from '../proof-run-engine-By7oLsF-.js';
5
5
  import '../types.js';
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  proof_run_engine_exports
3
- } from "../chunk-KS3N5APP.js";
3
+ } from "../chunk-EGOVHMBQ.js";
4
4
  import {
5
5
  runner_exports
6
- } from "../chunk-P2RN2NYR.js";
6
+ } from "../chunk-DZYH67J2.js";
7
7
  import {
8
8
  engine_harness_exports
9
- } from "../chunk-2DW2LBUD.js";
9
+ } from "../chunk-EMVMXVJV.js";
10
10
  import "../chunk-YZUVEJ5B.js";
11
11
  import "../chunk-FMOYUYH2.js";
12
12
  import {
13
13
  proof_run_core_exports
14
- } from "../chunk-FU73I4V3.js";
14
+ } from "../chunk-RF72NWHM.js";
15
15
  import "../chunk-4FOHZ7JG.js";
16
16
  import "../chunk-VY4Y5U57.js";
17
17
  import "../chunk-MLKGABMK.js";
@@ -291,6 +291,36 @@ function normalizeCaptureScript(value) {
291
291
  const script = normalizeOptionalString(value) || "";
292
292
  return script ? guardProofEvidenceGlobalAssignments(script) : "";
293
293
  }
294
+ function compactCaptureScriptForHeuristics(script) {
295
+ return script.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/.*$/gm, "$1 ").replace(/\s+/g, " ").trim().toLowerCase();
296
+ }
297
+ function interactionCaptureScriptLooksPassive(script) {
298
+ const text = compactCaptureScriptForHeuristics(script);
299
+ if (!text) return true;
300
+ const actionPatterns = [
301
+ /\bpage\.(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?|goto|reload)\s*\(/,
302
+ /\blocator\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?)\s*\(/,
303
+ /\b(getby(role|text|label|testid|placeholder|title)|getbyalttext)\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption)\s*\(/,
304
+ /\bkeyboard\s*\.\s*(press|type|inserttext)\s*\(/,
305
+ /\bmouse\s*\.\s*(click|dblclick|down|up|move)\s*\(/,
306
+ /\btouchscreen\s*\.\s*tap\s*\(/
307
+ ];
308
+ if (actionPatterns.some((pattern) => pattern.test(text))) return false;
309
+ const evidencePatterns = [
310
+ /\breturn\s+[{[]/,
311
+ /\breturn\s+\w+/,
312
+ /__riddleproofevidence/,
313
+ /\bproof_evidence\b/,
314
+ /\brouteexpectationsource\b/,
315
+ /\bexpectedurl\b/,
316
+ /\bassertions?\b/
317
+ ];
318
+ return !evidencePatterns.some((pattern) => pattern.test(text));
319
+ }
320
+ function setStructuredInteractionCaptureFailure(state, summary) {
321
+ const existing = typeof state.structured_interaction_capture_failure_summary === "string" ? state.structured_interaction_capture_failure_summary.trim() : "";
322
+ if (!existing) state.structured_interaction_capture_failure_summary = summary;
323
+ }
294
324
  function appendProofSummaryLine(state, line) {
295
325
  const text = String(line || "").trim();
296
326
  if (!text) return;
@@ -540,6 +570,9 @@ function proofAssessmentHardBlockersForState(state = {}) {
540
570
  }
541
571
  add(state?.structured_interaction_capture_failure_summary);
542
572
  add(state?.structured_interaction_failure_summary);
573
+ if (isInteractionVerificationMode(normalizedVerificationMode(state)) && !stateHasProofEvidence(state)) {
574
+ add("interaction proof evidence is required before ready_to_ship; proof_evidence_present=false");
575
+ }
543
576
  const mergeRecommendation = String(state?.merge_recommendation || "").trim();
544
577
  if (mergeRecommendation === "do-not-merge" && blockers.length) {
545
578
  add("merge_recommendation=do-not-merge because the proof bundle contains hard blockers.");
@@ -575,7 +608,22 @@ function stateHasAfterEvidence(state = {}) {
575
608
  const observation = objectValue(after.observation);
576
609
  const supporting = objectValue(after.supporting_artifacts);
577
610
  return Boolean(
578
- 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)
611
+ observation.valid === true && (supporting.has_structured_payload === true || stateHasProofEvidence(state) || observation.telemetry_ready === true)
612
+ );
613
+ }
614
+ function stateHasProofEvidence(state = {}) {
615
+ if (state?.proof_evidence_present === true) return true;
616
+ if (state?.proof_evidence !== void 0 && state?.proof_evidence !== null) {
617
+ if (typeof state.proof_evidence !== "object") return true;
618
+ if (Object.keys(objectValue(state.proof_evidence)).length > 0) return true;
619
+ }
620
+ const bundle = objectValue(state?.evidence_bundle);
621
+ const after = objectValue(bundle.after);
622
+ const supporting = objectValue(after.supporting_artifacts);
623
+ const request = objectValue(state?.proof_assessment_request);
624
+ const structuredEvidence = objectValue(request.structured_evidence);
625
+ return Boolean(
626
+ 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
579
627
  );
580
628
  }
581
629
  function validateShipGate(state = {}) {
@@ -953,6 +1001,11 @@ function mergeStateFromParams(statePath, params) {
953
1001
  state.supervisor_author_packet = parsed;
954
1002
  if (typeof parsed?.proof_plan === "string") state.proof_plan = normalizeOptionalString(parsed.proof_plan) || "";
955
1003
  if (typeof parsed?.capture_script === "string") state.capture_script = normalizeCaptureScript(parsed.capture_script);
1004
+ if (isInteractionVerificationMode(state.verification_mode) && interactionCaptureScriptLooksPassive(state.capture_script || "")) {
1005
+ const warning = "Interaction proof capture script appears passive: it does not perform a browser interaction or return structured proof evidence.";
1006
+ appendStateWarning(state, "author_warnings", warning);
1007
+ setStructuredInteractionCaptureFailure(state, warning);
1008
+ }
956
1009
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
957
1010
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
958
1011
  }
@@ -27,7 +27,7 @@ import {
27
27
  visualDeltaShipGateReason,
28
28
  workflowFile,
29
29
  writeState
30
- } from "../chunk-FU73I4V3.js";
30
+ } from "../chunk-RF72NWHM.js";
31
31
  import "../chunk-MLKGABMK.js";
32
32
  export {
33
33
  BUNDLED_RIDDLE_PROOF_DIR,
@@ -270,6 +270,36 @@ function normalizeCaptureScript(value) {
270
270
  const script = normalizeOptionalString(value) || "";
271
271
  return script ? guardProofEvidenceGlobalAssignments(script) : "";
272
272
  }
273
+ function compactCaptureScriptForHeuristics(script) {
274
+ return script.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/.*$/gm, "$1 ").replace(/\s+/g, " ").trim().toLowerCase();
275
+ }
276
+ function interactionCaptureScriptLooksPassive(script) {
277
+ const text = compactCaptureScriptForHeuristics(script);
278
+ if (!text) return true;
279
+ const actionPatterns = [
280
+ /\bpage\.(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?|goto|reload)\s*\(/,
281
+ /\blocator\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?)\s*\(/,
282
+ /\b(getby(role|text|label|testid|placeholder|title)|getbyalttext)\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption)\s*\(/,
283
+ /\bkeyboard\s*\.\s*(press|type|inserttext)\s*\(/,
284
+ /\bmouse\s*\.\s*(click|dblclick|down|up|move)\s*\(/,
285
+ /\btouchscreen\s*\.\s*tap\s*\(/
286
+ ];
287
+ if (actionPatterns.some((pattern) => pattern.test(text))) return false;
288
+ const evidencePatterns = [
289
+ /\breturn\s+[{[]/,
290
+ /\breturn\s+\w+/,
291
+ /__riddleproofevidence/,
292
+ /\bproof_evidence\b/,
293
+ /\brouteexpectationsource\b/,
294
+ /\bexpectedurl\b/,
295
+ /\bassertions?\b/
296
+ ];
297
+ return !evidencePatterns.some((pattern) => pattern.test(text));
298
+ }
299
+ function setStructuredInteractionCaptureFailure(state, summary) {
300
+ const existing = typeof state.structured_interaction_capture_failure_summary === "string" ? state.structured_interaction_capture_failure_summary.trim() : "";
301
+ if (!existing) state.structured_interaction_capture_failure_summary = summary;
302
+ }
273
303
  function appendProofSummaryLine(state, line) {
274
304
  const text = String(line || "").trim();
275
305
  if (!text) return;
@@ -519,6 +549,9 @@ function proofAssessmentHardBlockersForState(state = {}) {
519
549
  }
520
550
  add(state?.structured_interaction_capture_failure_summary);
521
551
  add(state?.structured_interaction_failure_summary);
552
+ if (isInteractionVerificationMode(normalizedVerificationMode(state)) && !stateHasProofEvidence(state)) {
553
+ add("interaction proof evidence is required before ready_to_ship; proof_evidence_present=false");
554
+ }
522
555
  const mergeRecommendation = String(state?.merge_recommendation || "").trim();
523
556
  if (mergeRecommendation === "do-not-merge" && blockers.length) {
524
557
  add("merge_recommendation=do-not-merge because the proof bundle contains hard blockers.");
@@ -554,7 +587,22 @@ function stateHasAfterEvidence(state = {}) {
554
587
  const observation = objectValue(after.observation);
555
588
  const supporting = objectValue(after.supporting_artifacts);
556
589
  return Boolean(
557
- 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)
590
+ observation.valid === true && (supporting.has_structured_payload === true || stateHasProofEvidence(state) || observation.telemetry_ready === true)
591
+ );
592
+ }
593
+ function stateHasProofEvidence(state = {}) {
594
+ if (state?.proof_evidence_present === true) return true;
595
+ if (state?.proof_evidence !== void 0 && state?.proof_evidence !== null) {
596
+ if (typeof state.proof_evidence !== "object") return true;
597
+ if (Object.keys(objectValue(state.proof_evidence)).length > 0) return true;
598
+ }
599
+ const bundle = objectValue(state?.evidence_bundle);
600
+ const after = objectValue(bundle.after);
601
+ const supporting = objectValue(after.supporting_artifacts);
602
+ const request = objectValue(state?.proof_assessment_request);
603
+ const structuredEvidence = objectValue(request.structured_evidence);
604
+ return Boolean(
605
+ 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
558
606
  );
559
607
  }
560
608
  function validateShipGate(state = {}) {
@@ -932,6 +980,11 @@ function mergeStateFromParams(statePath, params) {
932
980
  state.supervisor_author_packet = parsed;
933
981
  if (typeof parsed?.proof_plan === "string") state.proof_plan = normalizeOptionalString(parsed.proof_plan) || "";
934
982
  if (typeof parsed?.capture_script === "string") state.capture_script = normalizeCaptureScript(parsed.capture_script);
983
+ if (isInteractionVerificationMode(state.verification_mode) && interactionCaptureScriptLooksPassive(state.capture_script || "")) {
984
+ const warning = "Interaction proof capture script appears passive: it does not perform a browser interaction or return structured proof evidence.";
985
+ appendStateWarning(state, "author_warnings", warning);
986
+ setStructuredInteractionCaptureFailure(state, warning);
987
+ }
935
988
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
936
989
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
937
990
  }
@@ -1,2 +1,2 @@
1
- export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-DI1qBmMf.cjs';
1
+ export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-D80hVFMf.cjs';
2
2
  import '../proof-run-core-C8FDUhle.cjs';
@@ -1,2 +1,2 @@
1
- export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-Vh9uESqh.js';
1
+ export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from '../proof-run-engine-By7oLsF-.js';
2
2
  import '../proof-run-core-C8FDUhle.js';
@@ -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-EGOVHMBQ.js";
5
+ import "../chunk-RF72NWHM.js";
6
6
  import "../chunk-MLKGABMK.js";
7
7
  export {
8
8
  createRiddleProofEngine,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "../chunk-P2RN2NYR.js";
3
+ } from "../chunk-DZYH67J2.js";
4
4
  import "../chunk-YZUVEJ5B.js";
5
5
  import "../chunk-FMOYUYH2.js";
6
- import "../chunk-FU73I4V3.js";
6
+ import "../chunk-RF72NWHM.js";
7
7
  import "../chunk-4FOHZ7JG.js";
8
8
  import "../chunk-VY4Y5U57.js";
9
9
  import "../chunk-MLKGABMK.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-YZUVEJ5B.js";
7
7
  import {
8
8
  noImplementationModeFor
9
- } from "./chunk-FU73I4V3.js";
9
+ } from "./chunk-RF72NWHM.js";
10
10
  import {
11
11
  createRunResult
12
12
  } from "./chunk-VY4Y5U57.js";
@@ -16,7 +16,7 @@ import {
16
16
  validateShipGate,
17
17
  workflowFile,
18
18
  writeState
19
- } from "./chunk-FU73I4V3.js";
19
+ } from "./chunk-RF72NWHM.js";
20
20
  import {
21
21
  __export
22
22
  } from "./chunk-MLKGABMK.js";
@@ -15,7 +15,7 @@ import {
15
15
  visualDeltaForState,
16
16
  visualDeltaRequiredForState,
17
17
  visualDeltaShipGateReason
18
- } from "./chunk-FU73I4V3.js";
18
+ } from "./chunk-RF72NWHM.js";
19
19
  import {
20
20
  authorPacketPayloadFromCheckpointResponse,
21
21
  buildCheckpointPacketForEngineResult,
@@ -262,6 +262,36 @@ function normalizeCaptureScript(value) {
262
262
  const script = normalizeOptionalString(value) || "";
263
263
  return script ? guardProofEvidenceGlobalAssignments(script) : "";
264
264
  }
265
+ function compactCaptureScriptForHeuristics(script) {
266
+ return script.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/.*$/gm, "$1 ").replace(/\s+/g, " ").trim().toLowerCase();
267
+ }
268
+ function interactionCaptureScriptLooksPassive(script) {
269
+ const text = compactCaptureScriptForHeuristics(script);
270
+ if (!text) return true;
271
+ const actionPatterns = [
272
+ /\bpage\.(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?|goto|reload)\s*\(/,
273
+ /\blocator\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?)\s*\(/,
274
+ /\b(getby(role|text|label|testid|placeholder|title)|getbyalttext)\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption)\s*\(/,
275
+ /\bkeyboard\s*\.\s*(press|type|inserttext)\s*\(/,
276
+ /\bmouse\s*\.\s*(click|dblclick|down|up|move)\s*\(/,
277
+ /\btouchscreen\s*\.\s*tap\s*\(/
278
+ ];
279
+ if (actionPatterns.some((pattern) => pattern.test(text))) return false;
280
+ const evidencePatterns = [
281
+ /\breturn\s+[{[]/,
282
+ /\breturn\s+\w+/,
283
+ /__riddleproofevidence/,
284
+ /\bproof_evidence\b/,
285
+ /\brouteexpectationsource\b/,
286
+ /\bexpectedurl\b/,
287
+ /\bassertions?\b/
288
+ ];
289
+ return !evidencePatterns.some((pattern) => pattern.test(text));
290
+ }
291
+ function setStructuredInteractionCaptureFailure(state, summary) {
292
+ const existing = typeof state.structured_interaction_capture_failure_summary === "string" ? state.structured_interaction_capture_failure_summary.trim() : "";
293
+ if (!existing) state.structured_interaction_capture_failure_summary = summary;
294
+ }
265
295
  function appendProofSummaryLine(state, line) {
266
296
  const text = String(line || "").trim();
267
297
  if (!text) return;
@@ -511,6 +541,9 @@ function proofAssessmentHardBlockersForState(state = {}) {
511
541
  }
512
542
  add(state?.structured_interaction_capture_failure_summary);
513
543
  add(state?.structured_interaction_failure_summary);
544
+ if (isInteractionVerificationMode(normalizedVerificationMode(state)) && !stateHasProofEvidence(state)) {
545
+ add("interaction proof evidence is required before ready_to_ship; proof_evidence_present=false");
546
+ }
514
547
  const mergeRecommendation = String(state?.merge_recommendation || "").trim();
515
548
  if (mergeRecommendation === "do-not-merge" && blockers.length) {
516
549
  add("merge_recommendation=do-not-merge because the proof bundle contains hard blockers.");
@@ -546,7 +579,22 @@ function stateHasAfterEvidence(state = {}) {
546
579
  const observation = objectValue(after.observation);
547
580
  const supporting = objectValue(after.supporting_artifacts);
548
581
  return Boolean(
549
- 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)
582
+ observation.valid === true && (supporting.has_structured_payload === true || stateHasProofEvidence(state) || observation.telemetry_ready === true)
583
+ );
584
+ }
585
+ function stateHasProofEvidence(state = {}) {
586
+ if (state?.proof_evidence_present === true) return true;
587
+ if (state?.proof_evidence !== void 0 && state?.proof_evidence !== null) {
588
+ if (typeof state.proof_evidence !== "object") return true;
589
+ if (Object.keys(objectValue(state.proof_evidence)).length > 0) return true;
590
+ }
591
+ const bundle = objectValue(state?.evidence_bundle);
592
+ const after = objectValue(bundle.after);
593
+ const supporting = objectValue(after.supporting_artifacts);
594
+ const request = objectValue(state?.proof_assessment_request);
595
+ const structuredEvidence = objectValue(request.structured_evidence);
596
+ return Boolean(
597
+ 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
550
598
  );
551
599
  }
552
600
  function validateShipGate(state = {}) {
@@ -924,6 +972,11 @@ function mergeStateFromParams(statePath, params) {
924
972
  state.supervisor_author_packet = parsed;
925
973
  if (typeof parsed?.proof_plan === "string") state.proof_plan = normalizeOptionalString(parsed.proof_plan) || "";
926
974
  if (typeof parsed?.capture_script === "string") state.capture_script = normalizeCaptureScript(parsed.capture_script);
975
+ if (isInteractionVerificationMode(state.verification_mode) && interactionCaptureScriptLooksPassive(state.capture_script || "")) {
976
+ const warning = "Interaction proof capture script appears passive: it does not perform a browser interaction or return structured proof evidence.";
977
+ appendStateWarning(state, "author_warnings", warning);
978
+ setStructuredInteractionCaptureFailure(state, warning);
979
+ }
927
980
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
928
981
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
929
982
  }