@riddledc/riddle-proof 0.5.33 → 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.
- package/dist/{chunk-A5AWVY5A.js → chunk-4YCWZVBN.js} +20 -2
- package/dist/{chunk-CHKYSZLU.js → chunk-7R6ZQE3X.js} +5 -5
- package/dist/{chunk-TMMKRKY5.js → chunk-J2MERROF.js} +1 -0
- package/dist/{chunk-F6VFKS7K.js → chunk-MQ2BHHLX.js} +2 -2
- package/dist/{chunk-7ZJAUEUN.js → chunk-OASB3CYU.js} +6 -1
- package/dist/chunk-ODORKNSO.js +121 -0
- package/dist/engine-harness.cjs +26 -2
- package/dist/engine-harness.js +4 -4
- package/dist/index.cjs +154 -4
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +24 -8
- package/dist/openclaw.cjs +5 -0
- package/dist/openclaw.js +2 -2
- package/dist/proof-run-core.cjs +20 -2
- package/dist/proof-run-core.d.cts +16 -0
- package/dist/proof-run-core.d.ts +16 -0
- package/dist/proof-run-core.js +1 -1
- package/dist/proof-run-engine.cjs +20 -2
- package/dist/proof-run-engine.d.cts +24 -0
- package/dist/proof-run-engine.d.ts +24 -0
- package/dist/proof-run-engine.js +1 -1
- package/dist/proof-session.cjs +151 -0
- package/dist/proof-session.d.cts +37 -0
- package/dist/proof-session.d.ts +37 -0
- package/dist/proof-session.js +18 -0
- package/dist/result.cjs +1 -0
- package/dist/result.js +1 -1
- package/dist/runner.cjs +6 -0
- package/dist/runner.js +3 -3
- package/dist/state.cjs +5 -0
- package/dist/state.js +2 -2
- package/dist/types.d.cts +67 -1
- package/dist/types.d.ts +67 -1
- package/package.json +7 -2
- package/runtime/lib/preflight.py +42 -2
- package/runtime/lib/util.py +237 -0
- package/runtime/lib/verify.py +55 -2
- package/runtime/tests/recon_verify_smoke.py +120 -1
|
@@ -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
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
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-
|
|
13
|
-
import "./chunk-
|
|
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.
|
|
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"
|
package/runtime/lib/preflight.py
CHANGED
|
@@ -8,7 +8,16 @@ capture_script: optional at setup and recon; required before verify.
|
|
|
8
8
|
|
|
9
9
|
import json, os, re, time, uuid, sys
|
|
10
10
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
|
11
|
-
from util import
|
|
11
|
+
from util import (
|
|
12
|
+
STATE_FILE,
|
|
13
|
+
ARGS_FILE,
|
|
14
|
+
apply_proof_session_defaults,
|
|
15
|
+
invoke,
|
|
16
|
+
load_package_json,
|
|
17
|
+
load_proof_session_source,
|
|
18
|
+
save_state,
|
|
19
|
+
validate_proof_session_resume,
|
|
20
|
+
)
|
|
12
21
|
|
|
13
22
|
def truthy(value):
|
|
14
23
|
return str(value or '').strip().lower() in ('1', 'true', 'yes', 'y', 'on')
|
|
@@ -40,6 +49,19 @@ if not os.path.exists(args_file):
|
|
|
40
49
|
with open(args_file) as f:
|
|
41
50
|
s = json.load(f)
|
|
42
51
|
|
|
52
|
+
resume_session_source = (s.get('resume_session') or '').strip()
|
|
53
|
+
if resume_session_source:
|
|
54
|
+
parent_proof_session = load_proof_session_source(resume_session_source)
|
|
55
|
+
s['parent_proof_session'] = parent_proof_session
|
|
56
|
+
s['parent_proof_session_id'] = parent_proof_session.get('session_id')
|
|
57
|
+
s['proof_session_resume'] = {
|
|
58
|
+
'status': 'loaded',
|
|
59
|
+
'source': 'inline_json' if resume_session_source.startswith('{') else resume_session_source,
|
|
60
|
+
'parent_session_id': parent_proof_session.get('session_id'),
|
|
61
|
+
'parent_fingerprint': parent_proof_session.get('fingerprint'),
|
|
62
|
+
'applied_fields': apply_proof_session_defaults(s, parent_proof_session),
|
|
63
|
+
}
|
|
64
|
+
|
|
43
65
|
mode = (s.get('mode') or '').strip().lower()
|
|
44
66
|
reference = s.get('reference', 'both')
|
|
45
67
|
requested_reference = reference
|
|
@@ -107,6 +129,8 @@ if raw_assertions:
|
|
|
107
129
|
except Exception as e:
|
|
108
130
|
raise SystemExit('assertions_json is not valid JSON: ' + str(e))
|
|
109
131
|
s['parsed_assertions'] = parsed_assertions
|
|
132
|
+
s['viewport_matrix'] = parse_json_arg('viewport_matrix_json', (dict, list), None)
|
|
133
|
+
s['deterministic_setup'] = parse_json_arg('deterministic_setup_json', (dict, list), None)
|
|
110
134
|
|
|
111
135
|
# Generate branch if not provided. The riddle-proof/* namespace is reserved for
|
|
112
136
|
# temporary proof worktrees, so never let a user-supplied branch use it as the
|
|
@@ -173,6 +197,16 @@ s['stage'] = 'preflight'
|
|
|
173
197
|
s['status'] = 'ready' if not missing else 'needs_input'
|
|
174
198
|
s['missing'] = missing
|
|
175
199
|
|
|
200
|
+
if s.get('parent_proof_session') and not missing:
|
|
201
|
+
try:
|
|
202
|
+
s['proof_session_resume'] = {
|
|
203
|
+
**(s.get('proof_session_resume') or {}),
|
|
204
|
+
**validate_proof_session_resume(s, route=s.get('server_path') or ''),
|
|
205
|
+
}
|
|
206
|
+
except SystemExit:
|
|
207
|
+
save_state(s)
|
|
208
|
+
raise
|
|
209
|
+
|
|
176
210
|
# Auth context can be supplied directly for public-plugin use, while use_auth
|
|
177
211
|
# remains a private/configured Cognito helper for Riddle-owned environments.
|
|
178
212
|
explicit_local_storage = parse_json_arg('auth_localStorage_json', (dict,), {})
|
|
@@ -231,7 +265,7 @@ print('RIDDLE PROOF — PREFLIGHT (' + mode.upper() + ' / ' + reference.upper()
|
|
|
231
265
|
print('=' * 50)
|
|
232
266
|
display_keys = ['repo', 'branch', 'target_branch', 'ship_target_branch', 'base_branch', 'before_ref', 'change_request', 'commit_message',
|
|
233
267
|
'reference', 'verification_mode', 'success_criteria', 'prod_url', 'build_command',
|
|
234
|
-
'allow_static_preview_fallback']
|
|
268
|
+
'allow_static_preview_fallback', 'resume_session', 'target_image_url', 'target_image_hash']
|
|
235
269
|
if mode == 'server':
|
|
236
270
|
display_keys += ['server_image', 'server_command', 'server_port', 'server_path']
|
|
237
271
|
if s.get('auth_localStorage'):
|
|
@@ -247,6 +281,12 @@ for k in display_keys:
|
|
|
247
281
|
print(k + ': ' + v)
|
|
248
282
|
if parsed_assertions is not None:
|
|
249
283
|
print('assertions_json: parsed')
|
|
284
|
+
if s.get('viewport_matrix') is not None:
|
|
285
|
+
print('viewport_matrix_json: parsed')
|
|
286
|
+
if s.get('deterministic_setup') is not None:
|
|
287
|
+
print('deterministic_setup_json: parsed')
|
|
288
|
+
if s.get('proof_session_resume'):
|
|
289
|
+
print('proof_session_resume: ' + str((s.get('proof_session_resume') or {}).get('status') or 'loaded'))
|
|
250
290
|
if not (s.get('capture_script') or '').strip():
|
|
251
291
|
print('NOTE: capture_script can be added later after recon and before verify.')
|
|
252
292
|
if reference_note:
|