@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.
- package/README.md +17 -0
- package/dist/advanced/engine-harness.cjs +54 -1
- package/dist/advanced/engine-harness.js +2 -2
- package/dist/advanced/index.cjs +54 -1
- package/dist/advanced/index.d.cts +1 -1
- package/dist/advanced/index.d.ts +1 -1
- package/dist/advanced/index.js +4 -4
- package/dist/advanced/proof-run-core.cjs +54 -1
- package/dist/advanced/proof-run-core.js +1 -1
- package/dist/advanced/proof-run-engine.cjs +54 -1
- package/dist/advanced/proof-run-engine.d.cts +1 -1
- package/dist/advanced/proof-run-engine.d.ts +1 -1
- package/dist/advanced/proof-run-engine.js +2 -2
- package/dist/advanced/runner.js +2 -2
- package/dist/{chunk-P2RN2NYR.js → chunk-DZYH67J2.js} +1 -1
- package/dist/{chunk-KS3N5APP.js → chunk-EGOVHMBQ.js} +1 -1
- package/dist/{chunk-2DW2LBUD.js → chunk-EMVMXVJV.js} +1 -1
- package/dist/{chunk-FU73I4V3.js → chunk-RF72NWHM.js} +54 -1
- package/dist/{chunk-UTQJHWCQ.js → chunk-WULFU42E.js} +322 -2
- package/dist/cli/index.js +3 -3
- package/dist/cli.cjs +374 -1
- package/dist/cli.js +3 -3
- package/dist/engine-harness.cjs +54 -1
- package/dist/engine-harness.js +2 -2
- package/dist/index.cjs +54 -1
- package/dist/index.js +3 -3
- package/dist/proof-run-core.cjs +54 -1
- package/dist/proof-run-core.js +1 -1
- package/dist/{proof-run-engine-Vh9uESqh.d.ts → proof-run-engine-By7oLsF-.d.ts} +3 -3
- package/dist/{proof-run-engine-DI1qBmMf.d.cts → proof-run-engine-D80hVFMf.d.cts} +3 -3
- package/dist/proof-run-engine.cjs +54 -1
- package/dist/proof-run-engine.d.cts +1 -1
- package/dist/proof-run-engine.d.ts +1 -1
- package/dist/proof-run-engine.js +2 -2
- package/dist/runner.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runRiddleProof
|
|
3
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
115
|
+
import "./chunk-RF72NWHM.js";
|
|
116
116
|
import {
|
|
117
117
|
RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
|
|
118
118
|
RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
|
package/dist/proof-run-core.cjs
CHANGED
|
@@ -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 ||
|
|
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
|
}
|
package/dist/proof-run-core.js
CHANGED
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "author" | "recon" | "ship" | "implement" | "verify" | "setup";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|
|
@@ -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 ||
|
|
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,2 +1,2 @@
|
|
|
1
1
|
import './proof-run-core-C8FDUhle.cjs';
|
|
2
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-
|
|
2
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-D80hVFMf.cjs';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import './proof-run-core-C8FDUhle.js';
|
|
2
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-
|
|
2
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-By7oLsF-.js';
|
package/dist/proof-run-engine.js
CHANGED
package/dist/runner.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runRiddleProof
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DZYH67J2.js";
|
|
4
4
|
import "./chunk-YZUVEJ5B.js";
|
|
5
5
|
import "./chunk-FMOYUYH2.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-RF72NWHM.js";
|
|
7
7
|
import "./chunk-4FOHZ7JG.js";
|
|
8
8
|
import "./chunk-VY4Y5U57.js";
|
|
9
9
|
import "./chunk-MLKGABMK.js";
|