@riddledc/riddle-proof 0.8.25 → 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.
@@ -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,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,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
  }
@@ -22,7 +22,7 @@ import {
22
22
  createDisabledRiddleProofAgentAdapter,
23
23
  readRiddleProofRunStatus,
24
24
  runRiddleProofEngineHarness
25
- } from "./chunk-2DW2LBUD.js";
25
+ } from "./chunk-EMVMXVJV.js";
26
26
  import {
27
27
  createCheckpointResponseTemplate
28
28
  } from "./chunk-4FOHZ7JG.js";
package/dist/cli/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import "../chunk-27AB2TEQ.js";
1
+ import "../chunk-WULFU42E.js";
2
2
  import "../chunk-PEWAIEER.js";
3
3
  import "../chunk-TWTEUS7R.js";
4
- import "../chunk-2DW2LBUD.js";
4
+ import "../chunk-EMVMXVJV.js";
5
5
  import "../chunk-YZUVEJ5B.js";
6
6
  import "../chunk-FMOYUYH2.js";
7
- import "../chunk-FU73I4V3.js";
7
+ import "../chunk-RF72NWHM.js";
8
8
  import "../chunk-4FOHZ7JG.js";
9
9
  import "../chunk-JFQXAJH2.js";
10
10
  import "../chunk-EEIYUZXE.js";
package/dist/cli.cjs CHANGED
@@ -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
  }
package/dist/cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import "./chunk-27AB2TEQ.js";
2
+ import "./chunk-WULFU42E.js";
3
3
  import "./chunk-PEWAIEER.js";
4
4
  import "./chunk-TWTEUS7R.js";
5
- import "./chunk-2DW2LBUD.js";
5
+ import "./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-JFQXAJH2.js";
11
11
  import "./chunk-EEIYUZXE.js";
@@ -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";
package/dist/index.cjs CHANGED
@@ -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
  }
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "./chunk-P2RN2NYR.js";
3
+ } from "./chunk-DZYH67J2.js";
4
4
  import "./chunk-6F4PWJZI.js";
5
5
  import {
6
6
  RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION,
@@ -95,7 +95,7 @@ import {
95
95
  createDisabledRiddleProofAgentAdapter,
96
96
  readRiddleProofRunStatus,
97
97
  runRiddleProofEngineHarness
98
- } from "./chunk-2DW2LBUD.js";
98
+ } from "./chunk-EMVMXVJV.js";
99
99
  import {
100
100
  RIDDLE_PROOF_RUN_STATE_VERSION,
101
101
  appendRunEvent,
@@ -112,7 +112,7 @@ import {
112
112
  RIDDLE_PROOF_RUN_CARD_VERSION,
113
113
  createRiddleProofRunCard
114
114
  } from "./chunk-FMOYUYH2.js";
115
- import "./chunk-FU73I4V3.js";
115
+ import "./chunk-RF72NWHM.js";
116
116
  import {
117
117
  RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
118
118
  RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
@@ -289,6 +289,36 @@ function normalizeCaptureScript(value) {
289
289
  const script = normalizeOptionalString(value) || "";
290
290
  return script ? guardProofEvidenceGlobalAssignments(script) : "";
291
291
  }
292
+ function compactCaptureScriptForHeuristics(script) {
293
+ return script.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/.*$/gm, "$1 ").replace(/\s+/g, " ").trim().toLowerCase();
294
+ }
295
+ function interactionCaptureScriptLooksPassive(script) {
296
+ const text = compactCaptureScriptForHeuristics(script);
297
+ if (!text) return true;
298
+ const actionPatterns = [
299
+ /\bpage\.(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?|goto|reload)\s*\(/,
300
+ /\blocator\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?)\s*\(/,
301
+ /\b(getby(role|text|label|testid|placeholder|title)|getbyalttext)\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption)\s*\(/,
302
+ /\bkeyboard\s*\.\s*(press|type|inserttext)\s*\(/,
303
+ /\bmouse\s*\.\s*(click|dblclick|down|up|move)\s*\(/,
304
+ /\btouchscreen\s*\.\s*tap\s*\(/
305
+ ];
306
+ if (actionPatterns.some((pattern) => pattern.test(text))) return false;
307
+ const evidencePatterns = [
308
+ /\breturn\s+[{[]/,
309
+ /\breturn\s+\w+/,
310
+ /__riddleproofevidence/,
311
+ /\bproof_evidence\b/,
312
+ /\brouteexpectationsource\b/,
313
+ /\bexpectedurl\b/,
314
+ /\bassertions?\b/
315
+ ];
316
+ return !evidencePatterns.some((pattern) => pattern.test(text));
317
+ }
318
+ function setStructuredInteractionCaptureFailure(state, summary) {
319
+ const existing = typeof state.structured_interaction_capture_failure_summary === "string" ? state.structured_interaction_capture_failure_summary.trim() : "";
320
+ if (!existing) state.structured_interaction_capture_failure_summary = summary;
321
+ }
292
322
  function appendProofSummaryLine(state, line) {
293
323
  const text = String(line || "").trim();
294
324
  if (!text) return;
@@ -538,6 +568,9 @@ function proofAssessmentHardBlockersForState(state = {}) {
538
568
  }
539
569
  add(state?.structured_interaction_capture_failure_summary);
540
570
  add(state?.structured_interaction_failure_summary);
571
+ if (isInteractionVerificationMode(normalizedVerificationMode(state)) && !stateHasProofEvidence(state)) {
572
+ add("interaction proof evidence is required before ready_to_ship; proof_evidence_present=false");
573
+ }
541
574
  const mergeRecommendation = String(state?.merge_recommendation || "").trim();
542
575
  if (mergeRecommendation === "do-not-merge" && blockers.length) {
543
576
  add("merge_recommendation=do-not-merge because the proof bundle contains hard blockers.");
@@ -573,7 +606,22 @@ function stateHasAfterEvidence(state = {}) {
573
606
  const observation = objectValue(after.observation);
574
607
  const supporting = objectValue(after.supporting_artifacts);
575
608
  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)
609
+ observation.valid === true && (supporting.has_structured_payload === true || stateHasProofEvidence(state) || observation.telemetry_ready === true)
610
+ );
611
+ }
612
+ function stateHasProofEvidence(state = {}) {
613
+ if (state?.proof_evidence_present === true) return true;
614
+ if (state?.proof_evidence !== void 0 && state?.proof_evidence !== null) {
615
+ if (typeof state.proof_evidence !== "object") return true;
616
+ if (Object.keys(objectValue(state.proof_evidence)).length > 0) return true;
617
+ }
618
+ const bundle = objectValue(state?.evidence_bundle);
619
+ const after = objectValue(bundle.after);
620
+ const supporting = objectValue(after.supporting_artifacts);
621
+ const request = objectValue(state?.proof_assessment_request);
622
+ const structuredEvidence = objectValue(request.structured_evidence);
623
+ return Boolean(
624
+ 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
625
  );
578
626
  }
579
627
  function validateShipGate(state = {}) {
@@ -951,6 +999,11 @@ function mergeStateFromParams(statePath, params) {
951
999
  state.supervisor_author_packet = parsed;
952
1000
  if (typeof parsed?.proof_plan === "string") state.proof_plan = normalizeOptionalString(parsed.proof_plan) || "";
953
1001
  if (typeof parsed?.capture_script === "string") state.capture_script = normalizeCaptureScript(parsed.capture_script);
1002
+ if (isInteractionVerificationMode(state.verification_mode) && interactionCaptureScriptLooksPassive(state.capture_script || "")) {
1003
+ const warning = "Interaction proof capture script appears passive: it does not perform a browser interaction or return structured proof evidence.";
1004
+ appendStateWarning(state, "author_warnings", warning);
1005
+ setStructuredInteractionCaptureFailure(state, warning);
1006
+ }
954
1007
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
955
1008
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
956
1009
  }
@@ -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,
@@ -268,6 +268,36 @@ function normalizeCaptureScript(value) {
268
268
  const script = normalizeOptionalString(value) || "";
269
269
  return script ? guardProofEvidenceGlobalAssignments(script) : "";
270
270
  }
271
+ function compactCaptureScriptForHeuristics(script) {
272
+ return script.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/(^|[^:])\/\/.*$/gm, "$1 ").replace(/\s+/g, " ").trim().toLowerCase();
273
+ }
274
+ function interactionCaptureScriptLooksPassive(script) {
275
+ const text = compactCaptureScriptForHeuristics(script);
276
+ if (!text) return true;
277
+ const actionPatterns = [
278
+ /\bpage\.(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?|goto|reload)\s*\(/,
279
+ /\blocator\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption|dispatch(event)?)\s*\(/,
280
+ /\b(getby(role|text|label|testid|placeholder|title)|getbyalttext)\s*\([^)]*\)\s*\.\s*(click|dblclick|tap|fill|press|type|check|uncheck|selectoption)\s*\(/,
281
+ /\bkeyboard\s*\.\s*(press|type|inserttext)\s*\(/,
282
+ /\bmouse\s*\.\s*(click|dblclick|down|up|move)\s*\(/,
283
+ /\btouchscreen\s*\.\s*tap\s*\(/
284
+ ];
285
+ if (actionPatterns.some((pattern) => pattern.test(text))) return false;
286
+ const evidencePatterns = [
287
+ /\breturn\s+[{[]/,
288
+ /\breturn\s+\w+/,
289
+ /__riddleproofevidence/,
290
+ /\bproof_evidence\b/,
291
+ /\brouteexpectationsource\b/,
292
+ /\bexpectedurl\b/,
293
+ /\bassertions?\b/
294
+ ];
295
+ return !evidencePatterns.some((pattern) => pattern.test(text));
296
+ }
297
+ function setStructuredInteractionCaptureFailure(state, summary) {
298
+ const existing = typeof state.structured_interaction_capture_failure_summary === "string" ? state.structured_interaction_capture_failure_summary.trim() : "";
299
+ if (!existing) state.structured_interaction_capture_failure_summary = summary;
300
+ }
271
301
  function appendProofSummaryLine(state, line) {
272
302
  const text = String(line || "").trim();
273
303
  if (!text) return;
@@ -517,6 +547,9 @@ function proofAssessmentHardBlockersForState(state = {}) {
517
547
  }
518
548
  add(state?.structured_interaction_capture_failure_summary);
519
549
  add(state?.structured_interaction_failure_summary);
550
+ if (isInteractionVerificationMode(normalizedVerificationMode(state)) && !stateHasProofEvidence(state)) {
551
+ add("interaction proof evidence is required before ready_to_ship; proof_evidence_present=false");
552
+ }
520
553
  const mergeRecommendation = String(state?.merge_recommendation || "").trim();
521
554
  if (mergeRecommendation === "do-not-merge" && blockers.length) {
522
555
  add("merge_recommendation=do-not-merge because the proof bundle contains hard blockers.");
@@ -552,7 +585,22 @@ function stateHasAfterEvidence(state = {}) {
552
585
  const observation = objectValue(after.observation);
553
586
  const supporting = objectValue(after.supporting_artifacts);
554
587
  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)
588
+ observation.valid === true && (supporting.has_structured_payload === true || stateHasProofEvidence(state) || observation.telemetry_ready === true)
589
+ );
590
+ }
591
+ function stateHasProofEvidence(state = {}) {
592
+ if (state?.proof_evidence_present === true) return true;
593
+ if (state?.proof_evidence !== void 0 && state?.proof_evidence !== null) {
594
+ if (typeof state.proof_evidence !== "object") return true;
595
+ if (Object.keys(objectValue(state.proof_evidence)).length > 0) return true;
596
+ }
597
+ const bundle = objectValue(state?.evidence_bundle);
598
+ const after = objectValue(bundle.after);
599
+ const supporting = objectValue(after.supporting_artifacts);
600
+ const request = objectValue(state?.proof_assessment_request);
601
+ const structuredEvidence = objectValue(request.structured_evidence);
602
+ return Boolean(
603
+ 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
604
  );
557
605
  }
558
606
  function validateShipGate(state = {}) {
@@ -930,6 +978,11 @@ function mergeStateFromParams(statePath, params) {
930
978
  state.supervisor_author_packet = parsed;
931
979
  if (typeof parsed?.proof_plan === "string") state.proof_plan = normalizeOptionalString(parsed.proof_plan) || "";
932
980
  if (typeof parsed?.capture_script === "string") state.capture_script = normalizeCaptureScript(parsed.capture_script);
981
+ if (isInteractionVerificationMode(state.verification_mode) && interactionCaptureScriptLooksPassive(state.capture_script || "")) {
982
+ const warning = "Interaction proof capture script appears passive: it does not perform a browser interaction or return structured proof evidence.";
983
+ appendStateWarning(state, "author_warnings", warning);
984
+ setStructuredInteractionCaptureFailure(state, warning);
985
+ }
933
986
  if (parsed?.baseline_understanding_used && typeof parsed.baseline_understanding_used === "object") {
934
987
  state.author_baseline_understanding_used = parsed.baseline_understanding_used;
935
988
  }
@@ -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,
package/dist/runner.js CHANGED
@@ -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";
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.26",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",