@riddledc/riddle-proof 0.5.32 → 0.5.34

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 (40) hide show
  1. package/dist/{chunk-R4BPJNAM.js → chunk-4YCWZVBN.js} +101 -8
  2. package/dist/{chunk-LIDYNU7Q.js → chunk-7R6ZQE3X.js} +39 -2
  3. package/dist/{chunk-TMMKRKY5.js → chunk-J2MERROF.js} +1 -0
  4. package/dist/{chunk-F6VFKS7K.js → chunk-MQ2BHHLX.js} +2 -2
  5. package/dist/{chunk-7ZJAUEUN.js → chunk-OASB3CYU.js} +6 -1
  6. package/dist/chunk-ODORKNSO.js +121 -0
  7. package/dist/engine-harness.cjs +143 -9
  8. package/dist/engine-harness.js +4 -3
  9. package/dist/index.cjs +271 -11
  10. package/dist/index.d.cts +2 -1
  11. package/dist/index.d.ts +2 -1
  12. package/dist/index.js +24 -7
  13. package/dist/openclaw.cjs +5 -0
  14. package/dist/openclaw.js +2 -2
  15. package/dist/proof-run-core.cjs +104 -8
  16. package/dist/proof-run-core.d.cts +24 -1
  17. package/dist/proof-run-core.d.ts +24 -1
  18. package/dist/proof-run-core.js +7 -1
  19. package/dist/proof-run-engine.cjs +101 -8
  20. package/dist/proof-run-engine.d.cts +24 -0
  21. package/dist/proof-run-engine.d.ts +24 -0
  22. package/dist/proof-run-engine.js +4 -1
  23. package/dist/proof-session.cjs +151 -0
  24. package/dist/proof-session.d.cts +37 -0
  25. package/dist/proof-session.d.ts +37 -0
  26. package/dist/proof-session.js +18 -0
  27. package/dist/result.cjs +1 -0
  28. package/dist/result.js +1 -1
  29. package/dist/runner.cjs +6 -0
  30. package/dist/runner.js +3 -3
  31. package/dist/state.cjs +5 -0
  32. package/dist/state.js +2 -2
  33. package/dist/types.d.cts +67 -1
  34. package/dist/types.d.ts +67 -1
  35. package/package.json +7 -2
  36. package/runtime/lib/preflight.py +42 -2
  37. package/runtime/lib/ship.py +55 -1
  38. package/runtime/lib/util.py +237 -0
  39. package/runtime/lib/verify.py +93 -6
  40. package/runtime/tests/recon_verify_smoke.py +181 -3
@@ -83,6 +83,9 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
83
83
  last_requested_advance_stage: any;
84
84
  recon_results: any;
85
85
  verify_results: any;
86
+ proof_session: any;
87
+ parent_proof_session: any;
88
+ proof_session_artifact_url: any;
86
89
  } | null;
87
90
  pr_state: {
88
91
  status: string;
@@ -172,6 +175,9 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
172
175
  last_requested_advance_stage: any;
173
176
  recon_results: any;
174
177
  verify_results: any;
178
+ proof_session: any;
179
+ parent_proof_session: any;
180
+ proof_session_artifact_url: any;
175
181
  } | null;
176
182
  pr_state: {
177
183
  status: string;
@@ -259,6 +265,9 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
259
265
  last_requested_advance_stage: any;
260
266
  recon_results: any;
261
267
  verify_results: any;
268
+ proof_session: any;
269
+ parent_proof_session: any;
270
+ proof_session_artifact_url: any;
262
271
  } | null;
263
272
  pr_state: any;
264
273
  cleanup: Record<string, unknown> | null;
@@ -339,6 +348,9 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
339
348
  last_requested_advance_stage: any;
340
349
  recon_results: any;
341
350
  verify_results: any;
351
+ proof_session: any;
352
+ parent_proof_session: any;
353
+ proof_session_artifact_url: any;
342
354
  } | null;
343
355
  approval: any;
344
356
  error: any;
@@ -422,6 +434,9 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
422
434
  last_requested_advance_stage: any;
423
435
  recon_results: any;
424
436
  verify_results: any;
437
+ proof_session: any;
438
+ parent_proof_session: any;
439
+ proof_session_artifact_url: any;
425
440
  } | null;
426
441
  decisionRequest: any;
427
442
  checkpointContract: any;
@@ -509,6 +524,9 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
509
524
  last_requested_advance_stage: any;
510
525
  recon_results: any;
511
526
  verify_results: any;
527
+ proof_session: any;
528
+ parent_proof_session: any;
529
+ proof_session_artifact_url: any;
512
530
  };
513
531
  state_path: string;
514
532
  ok?: undefined;
@@ -594,6 +612,9 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
594
612
  last_requested_advance_stage: any;
595
613
  recon_results: any;
596
614
  verify_results: any;
615
+ proof_session: any;
616
+ parent_proof_session: any;
617
+ proof_session_artifact_url: any;
597
618
  } | null;
598
619
  shipReport: any;
599
620
  checkpointContract: Record<string, unknown>;
@@ -674,6 +695,9 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
674
695
  last_requested_advance_stage: any;
675
696
  recon_results: any;
676
697
  verify_results: any;
698
+ proof_session: any;
699
+ parent_proof_session: any;
700
+ proof_session_artifact_url: any;
677
701
  } | null;
678
702
  approval: null;
679
703
  autoApproved: any;
@@ -14,7 +14,7 @@ import {
14
14
  validateShipGate,
15
15
  workflowFile,
16
16
  writeState
17
- } from "./chunk-R4BPJNAM.js";
17
+ } from "./chunk-4YCWZVBN.js";
18
18
 
19
19
  // src/proof-run-engine.ts
20
20
  import { execFileSync } from "child_process";
@@ -770,6 +770,9 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
770
770
  if (reasons.some((reason) => reason.includes("proof_assessment"))) {
771
771
  return "resume with riddle_proof_review using decision=ready_to_ship only after the screenshots and semantic evidence visibly prove the request; otherwise choose needs_implementation or needs_richer_proof";
772
772
  }
773
+ if (reasons.some((reason) => reason.includes("visual_delta"))) {
774
+ return "rerun verify with a measured before/after visual delta, or choose needs_richer_proof instead of ready_to_ship for this visual proof";
775
+ }
773
776
  if (reasons.some((reason) => reason.includes("after_cdn") || reason.includes("verify_status"))) {
774
777
  return "rerun verify with stronger proof framing so after evidence is captured before shipping";
775
778
  }
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/proof-session.ts
21
+ var proof_session_exports = {};
22
+ __export(proof_session_exports, {
23
+ RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION: () => RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
24
+ RIDDLE_PROOF_VISUAL_SESSION_VERSION: () => RIDDLE_PROOF_VISUAL_SESSION_VERSION,
25
+ buildVisualProofSession: () => buildVisualProofSession,
26
+ compareVisualProofSessionFingerprint: () => compareVisualProofSessionFingerprint,
27
+ parseVisualProofSession: () => parseVisualProofSession,
28
+ visualSessionFingerprint: () => visualSessionFingerprint,
29
+ visualSessionFingerprintBasis: () => visualSessionFingerprintBasis
30
+ });
31
+ module.exports = __toCommonJS(proof_session_exports);
32
+ var import_node_crypto = require("crypto");
33
+ var RIDDLE_PROOF_VISUAL_SESSION_VERSION = "riddle-proof.visual-session.v1";
34
+ var RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION = "riddle-proof.visual-session.fingerprint.v1";
35
+ function trim(value) {
36
+ const text = String(value ?? "").trim();
37
+ return text || void 0;
38
+ }
39
+ function hashString(value) {
40
+ const text = trim(value);
41
+ if (!text) return void 0;
42
+ return (0, import_node_crypto.createHash)("sha256").update(text).digest("hex");
43
+ }
44
+ function stableJson(value) {
45
+ if (value === void 0) return "null";
46
+ if (value === null || typeof value !== "object") return JSON.stringify(value);
47
+ if (Array.isArray(value)) return `[${value.map((item) => stableJson(item)).join(",")}]`;
48
+ const record = value;
49
+ return `{${Object.keys(record).sort().map((key) => `${JSON.stringify(key)}:${stableJson(record[key])}`).join(",")}}`;
50
+ }
51
+ function withoutUndefined(record) {
52
+ for (const key of Object.keys(record)) {
53
+ if (record[key] === void 0) delete record[key];
54
+ }
55
+ return record;
56
+ }
57
+ function visualSessionFingerprintBasis(input) {
58
+ return withoutUndefined({
59
+ version: RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
60
+ repo: trim(input.repo),
61
+ route: trim(input.route),
62
+ wait_for_selector: trim(input.wait_for_selector),
63
+ reference: trim(input.reference),
64
+ verification_mode: trim(input.verification_mode)?.toLowerCase(),
65
+ target_image_url: trim(input.target_image_url),
66
+ target_image_hash: trim(input.target_image_hash),
67
+ viewport_matrix: input.viewport_matrix,
68
+ deterministic_setup: input.deterministic_setup,
69
+ assertions: input.assertions,
70
+ capture_script_hash: hashString(input.capture_script)
71
+ });
72
+ }
73
+ function visualSessionFingerprint(input) {
74
+ const basis = input.version === RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION ? input : visualSessionFingerprintBasis(input);
75
+ return (0, import_node_crypto.createHash)("sha256").update(stableJson(basis)).digest("hex");
76
+ }
77
+ function buildVisualProofSession(input) {
78
+ const basis = visualSessionFingerprintBasis(input);
79
+ const fingerprint = visualSessionFingerprint(basis);
80
+ const session = {
81
+ version: RIDDLE_PROOF_VISUAL_SESSION_VERSION,
82
+ session_id: `rps_${(/* @__PURE__ */ new Date()).toISOString().replace(/[-:.TZ]/g, "").slice(0, 14)}_${(0, import_node_crypto.randomUUID)().slice(0, 8)}`,
83
+ run_id: trim(input.run_id),
84
+ parent_session_id: input.parent?.session_id || null,
85
+ parent_fingerprint: input.parent?.fingerprint || null,
86
+ created_at: (/* @__PURE__ */ new Date()).toISOString(),
87
+ fingerprint,
88
+ fingerprint_basis: basis,
89
+ repo: trim(input.repo),
90
+ branch: trim(input.branch),
91
+ route: withoutUndefined({
92
+ path: trim(input.route),
93
+ observed_after_path: trim(input.observed_after_path)
94
+ }),
95
+ reference: trim(input.reference),
96
+ verification_mode: trim(input.verification_mode),
97
+ target_image: withoutUndefined({
98
+ url: trim(input.target_image_url),
99
+ hash: trim(input.target_image_hash)
100
+ }),
101
+ viewport_matrix: input.viewport_matrix,
102
+ deterministic_setup: input.deterministic_setup,
103
+ capture: withoutUndefined({
104
+ proof_plan: trim(input.proof_plan),
105
+ capture_script: trim(input.capture_script),
106
+ wait_for_selector: trim(input.wait_for_selector)
107
+ }),
108
+ assertions: input.assertions,
109
+ artifacts: input.artifacts,
110
+ evidence: input.evidence,
111
+ status: trim(input.status)
112
+ };
113
+ return JSON.parse(JSON.stringify(session));
114
+ }
115
+ function parseVisualProofSession(value) {
116
+ const parsed = typeof value === "string" ? JSON.parse(value) : value;
117
+ if (!parsed || typeof parsed !== "object") throw new Error("proof session must be a JSON object");
118
+ const session = parsed;
119
+ if (session.version !== RIDDLE_PROOF_VISUAL_SESSION_VERSION) {
120
+ throw new Error(`unsupported proof session version: ${String(session.version || "")}`);
121
+ }
122
+ if (!session.session_id) throw new Error("proof session missing session_id");
123
+ if (!session.fingerprint) throw new Error("proof session missing fingerprint");
124
+ return session;
125
+ }
126
+ function compareVisualProofSessionFingerprint(parent, input) {
127
+ const actual = visualSessionFingerprintBasis(input);
128
+ const expected = parent.fingerprint_basis || {};
129
+ const keys = /* @__PURE__ */ new Set([...Object.keys(expected), ...Object.keys(actual)]);
130
+ const expectedRecord = expected;
131
+ const actualRecord = actual;
132
+ const mismatches = [];
133
+ for (const key of keys) {
134
+ const expectedValue = expectedRecord[key];
135
+ const actualValue = actualRecord[key];
136
+ if (stableJson(expectedValue) !== stableJson(actualValue)) {
137
+ mismatches.push({ key, expected: expectedValue, actual: actualValue });
138
+ }
139
+ }
140
+ return mismatches;
141
+ }
142
+ // Annotate the CommonJS export names for ESM import in node:
143
+ 0 && (module.exports = {
144
+ RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
145
+ RIDDLE_PROOF_VISUAL_SESSION_VERSION,
146
+ buildVisualProofSession,
147
+ compareVisualProofSessionFingerprint,
148
+ parseVisualProofSession,
149
+ visualSessionFingerprint,
150
+ visualSessionFingerprintBasis
151
+ });
@@ -0,0 +1,37 @@
1
+ import { RiddleProofVisualSession, JsonValue, RiddleProofVisualSessionFingerprintBasis } from './types.cjs';
2
+
3
+ declare const RIDDLE_PROOF_VISUAL_SESSION_VERSION: "riddle-proof.visual-session.v1";
4
+ declare const RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION: "riddle-proof.visual-session.fingerprint.v1";
5
+ interface BuildVisualProofSessionInput {
6
+ run_id?: string;
7
+ parent?: RiddleProofVisualSession | null;
8
+ repo?: string;
9
+ branch?: string;
10
+ route?: string;
11
+ observed_after_path?: string;
12
+ reference?: string;
13
+ verification_mode?: string;
14
+ target_image_url?: string;
15
+ target_image_hash?: string;
16
+ viewport_matrix?: JsonValue;
17
+ deterministic_setup?: JsonValue;
18
+ proof_plan?: string;
19
+ capture_script?: string;
20
+ wait_for_selector?: string;
21
+ assertions?: JsonValue;
22
+ artifacts?: RiddleProofVisualSession["artifacts"];
23
+ evidence?: RiddleProofVisualSession["evidence"];
24
+ status?: string;
25
+ }
26
+ interface VisualProofSessionMismatch {
27
+ key: string;
28
+ expected: JsonValue | undefined;
29
+ actual: JsonValue | undefined;
30
+ }
31
+ declare function visualSessionFingerprintBasis(input: BuildVisualProofSessionInput): RiddleProofVisualSessionFingerprintBasis;
32
+ declare function visualSessionFingerprint(input: BuildVisualProofSessionInput | RiddleProofVisualSessionFingerprintBasis): string;
33
+ declare function buildVisualProofSession(input: BuildVisualProofSessionInput): RiddleProofVisualSession;
34
+ declare function parseVisualProofSession(value: unknown): RiddleProofVisualSession;
35
+ declare function compareVisualProofSessionFingerprint(parent: RiddleProofVisualSession, input: BuildVisualProofSessionInput): VisualProofSessionMismatch[];
36
+
37
+ export { type BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, type VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis };
@@ -0,0 +1,37 @@
1
+ import { RiddleProofVisualSession, JsonValue, RiddleProofVisualSessionFingerprintBasis } from './types.js';
2
+
3
+ declare const RIDDLE_PROOF_VISUAL_SESSION_VERSION: "riddle-proof.visual-session.v1";
4
+ declare const RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION: "riddle-proof.visual-session.fingerprint.v1";
5
+ interface BuildVisualProofSessionInput {
6
+ run_id?: string;
7
+ parent?: RiddleProofVisualSession | null;
8
+ repo?: string;
9
+ branch?: string;
10
+ route?: string;
11
+ observed_after_path?: string;
12
+ reference?: string;
13
+ verification_mode?: string;
14
+ target_image_url?: string;
15
+ target_image_hash?: string;
16
+ viewport_matrix?: JsonValue;
17
+ deterministic_setup?: JsonValue;
18
+ proof_plan?: string;
19
+ capture_script?: string;
20
+ wait_for_selector?: string;
21
+ assertions?: JsonValue;
22
+ artifacts?: RiddleProofVisualSession["artifacts"];
23
+ evidence?: RiddleProofVisualSession["evidence"];
24
+ status?: string;
25
+ }
26
+ interface VisualProofSessionMismatch {
27
+ key: string;
28
+ expected: JsonValue | undefined;
29
+ actual: JsonValue | undefined;
30
+ }
31
+ declare function visualSessionFingerprintBasis(input: BuildVisualProofSessionInput): RiddleProofVisualSessionFingerprintBasis;
32
+ declare function visualSessionFingerprint(input: BuildVisualProofSessionInput | RiddleProofVisualSessionFingerprintBasis): string;
33
+ declare function buildVisualProofSession(input: BuildVisualProofSessionInput): RiddleProofVisualSession;
34
+ declare function parseVisualProofSession(value: unknown): RiddleProofVisualSession;
35
+ declare function compareVisualProofSessionFingerprint(parent: RiddleProofVisualSession, input: BuildVisualProofSessionInput): VisualProofSessionMismatch[];
36
+
37
+ export { type BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, type VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis };
@@ -0,0 +1,18 @@
1
+ import {
2
+ RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
3
+ RIDDLE_PROOF_VISUAL_SESSION_VERSION,
4
+ buildVisualProofSession,
5
+ compareVisualProofSessionFingerprint,
6
+ parseVisualProofSession,
7
+ visualSessionFingerprint,
8
+ visualSessionFingerprintBasis
9
+ } from "./chunk-ODORKNSO.js";
10
+ export {
11
+ RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
12
+ RIDDLE_PROOF_VISUAL_SESSION_VERSION,
13
+ buildVisualProofSession,
14
+ compareVisualProofSessionFingerprint,
15
+ parseVisualProofSession,
16
+ visualSessionFingerprint,
17
+ visualSessionFingerprintBasis
18
+ };
package/dist/result.cjs CHANGED
@@ -233,6 +233,7 @@ function createRunResult(input) {
233
233
  merge_recommendation: state.merge_recommendation,
234
234
  finalized: state.finalized,
235
235
  blocker: state.blocker,
236
+ proof_session: state.proof_session,
236
237
  evidence_bundle: input.evidence_bundle,
237
238
  raw: input.raw
238
239
  });
package/dist/result.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  nonEmptyString,
8
8
  normalizeTerminalMetadata,
9
9
  recordValue
10
- } from "./chunk-TMMKRKY5.js";
10
+ } from "./chunk-J2MERROF.js";
11
11
  export {
12
12
  applyTerminalMetadata,
13
13
  compactRecord,
package/dist/runner.cjs CHANGED
@@ -123,6 +123,7 @@ function createRunResult(input) {
123
123
  merge_recommendation: state.merge_recommendation,
124
124
  finalized: state.finalized,
125
125
  blocker: state.blocker,
126
+ proof_session: state.proof_session,
126
127
  evidence_bundle: input.evidence_bundle,
127
128
  raw: input.raw
128
129
  });
@@ -170,6 +171,11 @@ function normalizeRunParams(input) {
170
171
  success_criteria: input.success_criteria,
171
172
  assertions: input.assertions,
172
173
  verification_mode: input.verification_mode,
174
+ resume_session: input.resume_session,
175
+ target_image_url: input.target_image_url,
176
+ target_image_hash: input.target_image_hash,
177
+ viewport_matrix: input.viewport_matrix,
178
+ deterministic_setup: input.deterministic_setup,
173
179
  reference: input.reference,
174
180
  base_branch: input.base_branch,
175
181
  before_ref: input.before_ref,
package/dist/runner.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "./chunk-F6VFKS7K.js";
4
- import "./chunk-7ZJAUEUN.js";
5
- import "./chunk-TMMKRKY5.js";
3
+ } from "./chunk-MQ2BHHLX.js";
4
+ import "./chunk-OASB3CYU.js";
5
+ import "./chunk-J2MERROF.js";
6
6
  export {
7
7
  runRiddleProof
8
8
  };
package/dist/state.cjs CHANGED
@@ -119,6 +119,11 @@ function normalizeRunParams(input) {
119
119
  success_criteria: input.success_criteria,
120
120
  assertions: input.assertions,
121
121
  verification_mode: input.verification_mode,
122
+ resume_session: input.resume_session,
123
+ target_image_url: input.target_image_url,
124
+ target_image_hash: input.target_image_hash,
125
+ viewport_matrix: input.viewport_matrix,
126
+ deterministic_setup: input.deterministic_setup,
122
127
  reference: input.reference,
123
128
  base_branch: input.base_branch,
124
129
  before_ref: input.before_ref,
package/dist/state.js CHANGED
@@ -9,8 +9,8 @@ import {
9
9
  normalizePrLifecycleState,
10
10
  normalizeRunParams,
11
11
  setRunStatus
12
- } from "./chunk-7ZJAUEUN.js";
13
- import "./chunk-TMMKRKY5.js";
12
+ } from "./chunk-OASB3CYU.js";
13
+ import "./chunk-J2MERROF.js";
14
14
  export {
15
15
  RIDDLE_PROOF_RUN_STATE_VERSION,
16
16
  appendRunEvent,
package/dist/types.d.cts CHANGED
@@ -19,6 +19,11 @@ interface RiddleProofRunParams {
19
19
  success_criteria?: string;
20
20
  assertions?: JsonValue;
21
21
  verification_mode?: RiddleProofVerificationMode;
22
+ resume_session?: string;
23
+ target_image_url?: string;
24
+ target_image_hash?: string;
25
+ viewport_matrix?: JsonValue;
26
+ deterministic_setup?: JsonValue;
22
27
  reference?: "prod" | "before" | "both";
23
28
  base_branch?: string;
24
29
  before_ref?: string;
@@ -105,6 +110,7 @@ interface RiddleProofRunState {
105
110
  merge_recommendation?: string;
106
111
  implementation_detection_summary?: string | null;
107
112
  implementation_detection?: Record<string, unknown> | null;
113
+ proof_session?: RiddleProofVisualSession;
108
114
  finalized?: boolean;
109
115
  blocker?: RiddleProofBlocker;
110
116
  events: RiddleProofEvent[];
@@ -142,6 +148,7 @@ interface RiddleProofRunResult {
142
148
  merge_recommendation?: string;
143
149
  finalized?: boolean;
144
150
  blocker?: RiddleProofBlocker;
151
+ proof_session?: RiddleProofVisualSession;
145
152
  evidence_bundle?: RiddleProofEvidenceBundle;
146
153
  raw?: Record<string, unknown>;
147
154
  }
@@ -179,6 +186,7 @@ interface RiddleProofEvidenceBundle {
179
186
  baselines?: EvidenceReference[];
180
187
  after?: EvidenceReference;
181
188
  artifacts?: EvidenceArtifact[];
189
+ proof_session?: RiddleProofVisualSession;
182
190
  proof_evidence?: unknown;
183
191
  proof_evidence_sample?: unknown;
184
192
  assertions?: JsonValue;
@@ -331,5 +339,63 @@ interface RiddleProofPrLifecycleState {
331
339
  next_action?: string;
332
340
  cleanup?: Record<string, unknown>;
333
341
  }
342
+ interface RiddleProofVisualSession {
343
+ version: "riddle-proof.visual-session.v1";
344
+ session_id: string;
345
+ run_id?: string;
346
+ parent_session_id?: string | null;
347
+ parent_fingerprint?: string | null;
348
+ created_at: string;
349
+ fingerprint: string;
350
+ fingerprint_basis: RiddleProofVisualSessionFingerprintBasis;
351
+ repo?: string;
352
+ branch?: string;
353
+ route?: {
354
+ path?: string;
355
+ observed_after_path?: string;
356
+ };
357
+ reference?: string;
358
+ verification_mode?: string;
359
+ target_image?: {
360
+ url?: string;
361
+ hash?: string;
362
+ };
363
+ viewport_matrix?: JsonValue;
364
+ deterministic_setup?: JsonValue;
365
+ capture?: {
366
+ proof_plan?: string;
367
+ capture_script?: string;
368
+ wait_for_selector?: string;
369
+ };
370
+ assertions?: JsonValue;
371
+ artifacts?: {
372
+ before?: string;
373
+ prod?: string;
374
+ after?: string;
375
+ session?: string;
376
+ outputs?: EvidenceArtifact[];
377
+ };
378
+ evidence?: {
379
+ visual_delta?: JsonValue;
380
+ semantic_context?: JsonValue;
381
+ artifact_contract?: JsonValue;
382
+ artifact_usage?: JsonValue;
383
+ };
384
+ status?: string;
385
+ }
386
+ interface RiddleProofVisualSessionFingerprintBasis {
387
+ version: "riddle-proof.visual-session.fingerprint.v1";
388
+ repo?: string;
389
+ route?: string;
390
+ wait_for_selector?: string;
391
+ reference?: string;
392
+ verification_mode?: string;
393
+ target_image_url?: string;
394
+ target_image_hash?: string;
395
+ viewport_matrix?: JsonValue;
396
+ deterministic_setup?: JsonValue;
397
+ assertions?: JsonValue;
398
+ capture_script_hash?: string;
399
+ }
334
400
 
335
- export type { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofPrLifecycleState, RiddleProofPrLifecycleStatus, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter };
401
+ export type { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofPrLifecycleState, RiddleProofPrLifecycleStatus, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, RiddleProofVisualSession, RiddleProofVisualSessionFingerprintBasis, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter };
package/dist/types.d.ts CHANGED
@@ -19,6 +19,11 @@ interface RiddleProofRunParams {
19
19
  success_criteria?: string;
20
20
  assertions?: JsonValue;
21
21
  verification_mode?: RiddleProofVerificationMode;
22
+ resume_session?: string;
23
+ target_image_url?: string;
24
+ target_image_hash?: string;
25
+ viewport_matrix?: JsonValue;
26
+ deterministic_setup?: JsonValue;
22
27
  reference?: "prod" | "before" | "both";
23
28
  base_branch?: string;
24
29
  before_ref?: string;
@@ -105,6 +110,7 @@ interface RiddleProofRunState {
105
110
  merge_recommendation?: string;
106
111
  implementation_detection_summary?: string | null;
107
112
  implementation_detection?: Record<string, unknown> | null;
113
+ proof_session?: RiddleProofVisualSession;
108
114
  finalized?: boolean;
109
115
  blocker?: RiddleProofBlocker;
110
116
  events: RiddleProofEvent[];
@@ -142,6 +148,7 @@ interface RiddleProofRunResult {
142
148
  merge_recommendation?: string;
143
149
  finalized?: boolean;
144
150
  blocker?: RiddleProofBlocker;
151
+ proof_session?: RiddleProofVisualSession;
145
152
  evidence_bundle?: RiddleProofEvidenceBundle;
146
153
  raw?: Record<string, unknown>;
147
154
  }
@@ -179,6 +186,7 @@ interface RiddleProofEvidenceBundle {
179
186
  baselines?: EvidenceReference[];
180
187
  after?: EvidenceReference;
181
188
  artifacts?: EvidenceArtifact[];
189
+ proof_session?: RiddleProofVisualSession;
182
190
  proof_evidence?: unknown;
183
191
  proof_evidence_sample?: unknown;
184
192
  assertions?: JsonValue;
@@ -331,5 +339,63 @@ interface RiddleProofPrLifecycleState {
331
339
  next_action?: string;
332
340
  cleanup?: Record<string, unknown>;
333
341
  }
342
+ interface RiddleProofVisualSession {
343
+ version: "riddle-proof.visual-session.v1";
344
+ session_id: string;
345
+ run_id?: string;
346
+ parent_session_id?: string | null;
347
+ parent_fingerprint?: string | null;
348
+ created_at: string;
349
+ fingerprint: string;
350
+ fingerprint_basis: RiddleProofVisualSessionFingerprintBasis;
351
+ repo?: string;
352
+ branch?: string;
353
+ route?: {
354
+ path?: string;
355
+ observed_after_path?: string;
356
+ };
357
+ reference?: string;
358
+ verification_mode?: string;
359
+ target_image?: {
360
+ url?: string;
361
+ hash?: string;
362
+ };
363
+ viewport_matrix?: JsonValue;
364
+ deterministic_setup?: JsonValue;
365
+ capture?: {
366
+ proof_plan?: string;
367
+ capture_script?: string;
368
+ wait_for_selector?: string;
369
+ };
370
+ assertions?: JsonValue;
371
+ artifacts?: {
372
+ before?: string;
373
+ prod?: string;
374
+ after?: string;
375
+ session?: string;
376
+ outputs?: EvidenceArtifact[];
377
+ };
378
+ evidence?: {
379
+ visual_delta?: JsonValue;
380
+ semantic_context?: JsonValue;
381
+ artifact_contract?: JsonValue;
382
+ artifact_usage?: JsonValue;
383
+ };
384
+ status?: string;
385
+ }
386
+ interface RiddleProofVisualSessionFingerprintBasis {
387
+ version: "riddle-proof.visual-session.fingerprint.v1";
388
+ repo?: string;
389
+ route?: string;
390
+ wait_for_selector?: string;
391
+ reference?: string;
392
+ verification_mode?: string;
393
+ target_image_url?: string;
394
+ target_image_hash?: string;
395
+ viewport_matrix?: JsonValue;
396
+ deterministic_setup?: JsonValue;
397
+ assertions?: JsonValue;
398
+ capture_script_hash?: string;
399
+ }
334
400
 
335
- export type { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofPrLifecycleState, RiddleProofPrLifecycleStatus, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter };
401
+ export type { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofPrLifecycleState, RiddleProofPrLifecycleStatus, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, RiddleProofVisualSession, RiddleProofVisualSessionFingerprintBasis, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.5.32",
3
+ "version": "0.5.34",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",
@@ -49,6 +49,11 @@
49
49
  "import": "./dist/diagnostics.js",
50
50
  "require": "./dist/diagnostics.cjs"
51
51
  },
52
+ "./proof-session": {
53
+ "types": "./dist/proof-session.d.ts",
54
+ "import": "./dist/proof-session.js",
55
+ "require": "./dist/proof-session.cjs"
56
+ },
52
57
  "./openclaw": {
53
58
  "types": "./dist/openclaw.d.ts",
54
59
  "import": "./dist/openclaw.js",
@@ -82,7 +87,7 @@
82
87
  "typescript": "^5.4.5"
83
88
  },
84
89
  "scripts": {
85
- "build": "tsup src/index.ts src/types.ts src/result.ts src/state.ts src/runner.ts src/engine-harness.ts src/diagnostics.ts src/openclaw.ts src/proof-run-core.ts src/proof-run-engine.ts --format cjs,esm --dts --out-dir dist --clean",
90
+ "build": "tsup src/index.ts src/types.ts src/result.ts src/state.ts src/runner.ts src/engine-harness.ts src/diagnostics.ts src/proof-session.ts src/openclaw.ts src/proof-run-core.ts src/proof-run-engine.ts --format cjs,esm --dts --out-dir dist --clean",
86
91
  "clean": "rm -rf dist",
87
92
  "lint": "echo 'lint: (not configured)'",
88
93
  "test": "npm run build && node test.js && node proof-run.test.js"