@riddledc/riddle-proof 0.8.84 → 0.8.86
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 +193 -0
- package/capabilities.json +17 -0
- package/dist/advanced/engine-harness.js +2 -2
- package/dist/advanced/index.d.cts +2 -2
- package/dist/advanced/index.d.ts +2 -2
- package/dist/advanced/index.js +4 -4
- package/dist/advanced/proof-run-core.d.cts +1 -1
- package/dist/advanced/proof-run-core.d.ts +1 -1
- package/dist/advanced/proof-run-engine.d.cts +2 -2
- package/dist/advanced/proof-run-engine.d.ts +2 -2
- package/dist/advanced/runner.js +2 -2
- package/dist/change-proof.cjs +24 -269
- package/dist/change-proof.d.cts +2 -2
- package/dist/change-proof.d.ts +2 -2
- package/dist/change-proof.js +3 -3
- package/dist/checked-meaning.cjs +67 -0
- package/dist/checked-meaning.d.cts +2 -0
- package/dist/checked-meaning.d.ts +2 -0
- package/dist/checked-meaning.js +41 -0
- package/dist/{chunk-QYZ3GKCP.js → chunk-3W4NGKZ6.js} +20 -19
- package/dist/chunk-6S33FQL7.js +14 -0
- package/dist/{chunk-FW7CKARF.js → chunk-7W6ZJPHJ.js} +1 -1
- package/dist/{chunk-7OAETQU3.js → chunk-BVYM4WJ5.js} +1 -1
- package/dist/chunk-GQOE5Q7C.js +32 -0
- package/dist/chunk-H5AALGSA.js +32 -0
- package/dist/chunk-J2SIQGQI.js +71 -0
- package/dist/chunk-KB7FYRBG.js +46 -0
- package/dist/{chunk-2K3DIK7A.js → chunk-KF6F2RMQ.js} +301 -3979
- package/dist/{chunk-LR4UYJDY.js → chunk-NR2XQXIC.js} +4 -4
- package/dist/chunk-NWLKJ2WI.js +31 -0
- package/dist/chunk-ODLGSEP2.js +43 -0
- package/dist/chunk-OHDNCXRM.js +17 -0
- package/dist/cli/index.js +9 -9
- package/dist/cli.cjs +606 -5177
- package/dist/cli.d.cts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +9 -9
- package/dist/engine-harness.js +2 -2
- package/dist/evidence-trust-root.cjs +54 -0
- package/dist/evidence-trust-root.d.cts +2 -0
- package/dist/evidence-trust-root.d.ts +2 -0
- package/dist/evidence-trust-root.js +31 -0
- package/dist/grounded-evidence.cjs +95 -0
- package/dist/grounded-evidence.d.cts +2 -0
- package/dist/grounded-evidence.d.ts +2 -0
- package/dist/grounded-evidence.js +69 -0
- package/dist/index.cjs +5995 -11368
- package/dist/index.d.cts +17 -4
- package/dist/index.d.ts +17 -4
- package/dist/index.js +202 -28
- package/dist/packet.cjs +54 -0
- package/dist/packet.d.cts +2 -0
- package/dist/packet.d.ts +2 -0
- package/dist/packet.js +31 -0
- package/dist/pr-comment.cjs +19 -116
- package/dist/pr-comment.d.cts +2 -2
- package/dist/pr-comment.d.ts +2 -2
- package/dist/pr-comment.js +4 -4
- package/dist/profile/index.cjs +277 -3991
- package/dist/profile/index.d.cts +2 -3
- package/dist/profile/index.d.ts +2 -3
- package/dist/profile/index.js +1 -1
- package/dist/profile-suggestions.cjs +2 -2
- package/dist/profile-suggestions.d.cts +1 -3
- package/dist/profile-suggestions.d.ts +1 -3
- package/dist/profile-suggestions.js +2 -2
- package/dist/profile.cjs +277 -3991
- package/dist/profile.d.cts +3 -550
- package/dist/profile.d.ts +3 -550
- package/dist/profile.js +1 -1
- package/dist/{proof-run-core-7Dqm7RKM.d.cts → proof-run-core-DwwrRhY4.d.cts} +1 -1
- package/dist/{proof-run-core-7Dqm7RKM.d.ts → proof-run-core-DwwrRhY4.d.ts} +1 -1
- package/dist/proof-run-core.d.cts +1 -1
- package/dist/proof-run-core.d.ts +1 -1
- package/dist/{proof-run-engine-BqRoA3Do.d.ts → proof-run-engine-CWBgj-15.d.ts} +4 -4
- package/dist/{proof-run-engine-DpChFR5H.d.cts → proof-run-engine-hEfje943.d.cts} +4 -4
- package/dist/proof-run-engine.d.cts +2 -2
- package/dist/proof-run-engine.d.ts +2 -2
- package/dist/receipts.cjs +10 -255
- package/dist/receipts.d.cts +10 -115
- package/dist/receipts.d.ts +10 -115
- package/dist/receipts.js +1 -1
- package/dist/riddle-client.cjs +23 -695
- package/dist/riddle-client.d.cts +1 -188
- package/dist/riddle-client.d.ts +1 -188
- package/dist/riddle-client.js +5 -2
- package/dist/rule-trust-root.cjs +36 -0
- package/dist/rule-trust-root.d.cts +2 -0
- package/dist/rule-trust-root.d.ts +2 -0
- package/dist/rule-trust-root.js +13 -0
- package/dist/runner.js +2 -2
- package/dist/runtime/index.cjs +23 -695
- package/dist/runtime/index.d.cts +1 -5
- package/dist/runtime/index.d.ts +1 -5
- package/dist/runtime/index.js +5 -2
- package/dist/runtime/riddle-client.cjs +23 -695
- package/dist/runtime/riddle-client.d.cts +1 -5
- package/dist/runtime/riddle-client.d.ts +1 -5
- package/dist/runtime/riddle-client.js +5 -2
- package/dist/semantic-certificate.cjs +17 -1083
- package/dist/semantic-certificate.d.cts +2 -310
- package/dist/semantic-certificate.d.ts +2 -310
- package/dist/semantic-certificate.js +1 -1
- package/package.json +42 -4
- package/runtime/lib/riddle_core_call.mjs +3 -806
- package/dist/chunk-5IFZSUPF.js +0 -644
- package/dist/chunk-AQTCU6W5.js +0 -1086
- package/dist/chunk-MEVVL4TI.js +0 -258
- package/dist/{chunk-WLUMLHII.js → chunk-BID7CKMM.js} +9 -9
- package/dist/{chunk-YH7ADFY4.js → chunk-IVSP24XI.js} +3 -3
package/dist/change-proof.cjs
CHANGED
|
@@ -15,6 +15,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
}
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
20
|
|
|
20
21
|
// src/change-proof.ts
|
|
@@ -37,265 +38,19 @@ __export(change_proof_exports, {
|
|
|
37
38
|
module.exports = __toCommonJS(change_proof_exports);
|
|
38
39
|
|
|
39
40
|
// src/profile.ts
|
|
40
|
-
var
|
|
41
|
-
"passed",
|
|
42
|
-
"product_regression",
|
|
43
|
-
"proof_insufficient",
|
|
44
|
-
"environment_blocked",
|
|
45
|
-
"configuration_error",
|
|
46
|
-
"needs_human_review"
|
|
47
|
-
];
|
|
41
|
+
var import_profile = require("@riddledc/riddle-proof-core/profile");
|
|
48
42
|
|
|
49
43
|
// src/receipts.ts
|
|
50
|
-
var
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return value.trim();
|
|
61
|
-
}
|
|
62
|
-
function normalizedSourceIdentity(value) {
|
|
63
|
-
if (!isRecord(value)) return {};
|
|
64
|
-
return {
|
|
65
|
-
git_revision: typeof value.git_revision === "string" && value.git_revision.trim() ? value.git_revision.trim() : void 0,
|
|
66
|
-
repository: typeof value.repository === "string" && value.repository.trim() ? value.repository.trim() : void 0,
|
|
67
|
-
dirty: typeof value.dirty === "boolean" ? value.dirty : void 0,
|
|
68
|
-
label: typeof value.label === "string" && value.label.trim() ? value.label.trim() : void 0
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
function parseRiddlePreviewReceipt(value) {
|
|
72
|
-
if (!isRecord(value)) throw new Error("Preview receipt must be an object.");
|
|
73
|
-
if (value.version !== RIDDLE_PREVIEW_RECEIPT_VERSION) {
|
|
74
|
-
throw new Error(`Unsupported Preview receipt version ${String(value.version || "missing")}.`);
|
|
75
|
-
}
|
|
76
|
-
if (!isRecord(value.source)) throw new Error("Preview receipt source must be an object.");
|
|
77
|
-
const expiresAt = requiredString(value, "expires_at", "preview receipt");
|
|
78
|
-
const publishedAt = requiredString(value, "published_at", "preview receipt");
|
|
79
|
-
const contentDigest = requiredString(value, "content_digest", "preview receipt");
|
|
80
|
-
if (!contentDigest.startsWith("sha256:") || contentDigest.length <= "sha256:".length) {
|
|
81
|
-
throw new Error("preview receipt.content_digest must be a sha256 digest.");
|
|
82
|
-
}
|
|
83
|
-
if (!Number.isFinite(Date.parse(expiresAt)) || !Number.isFinite(Date.parse(publishedAt))) {
|
|
84
|
-
throw new Error("Preview receipt timestamps must be valid ISO date strings.");
|
|
85
|
-
}
|
|
86
|
-
return {
|
|
87
|
-
version: RIDDLE_PREVIEW_RECEIPT_VERSION,
|
|
88
|
-
preview_id: requiredString(value, "preview_id", "preview receipt"),
|
|
89
|
-
url: requiredString(value, "url", "preview receipt"),
|
|
90
|
-
expires_at: expiresAt,
|
|
91
|
-
content_digest: contentDigest,
|
|
92
|
-
source: normalizedSourceIdentity(value.source),
|
|
93
|
-
published_at: publishedAt
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
function comparableArtifactName(value) {
|
|
97
|
-
return (value || "").split(/[/?#]/).pop()?.toLowerCase().replace(/\.(png|jpe?g|gif|webp|avif|svg)$/u, "").replace(/[^a-z0-9_-]+/gu, "-").replace(/^-+|-+$/g, "") || "";
|
|
98
|
-
}
|
|
99
|
-
function artifactMatchesLabel(artifact, label) {
|
|
100
|
-
const expected = comparableArtifactName(label);
|
|
101
|
-
if (!expected) return false;
|
|
102
|
-
return [artifact.name, artifact.url, artifact.path].map(comparableArtifactName).some((name) => name === expected || name.endsWith(`-${expected}`));
|
|
103
|
-
}
|
|
104
|
-
function artifactLooksLikeScreenshot(ref) {
|
|
105
|
-
const text = [ref.name, ref.url, ref.path, ref.kind, ref.content_type].filter(Boolean).join(" ").toLowerCase();
|
|
106
|
-
return /screenshot|\bimage\b/.test(text) || /\.(png|jpe?g|gif|webp|avif|svg)(\?|#|$)/.test(text);
|
|
107
|
-
}
|
|
108
|
-
function finalScreenshotLabels(result) {
|
|
109
|
-
const explicit = result.artifacts.canonical_screenshots || [];
|
|
110
|
-
if (explicit.length) return explicit;
|
|
111
|
-
const fromEvidence = (result.evidence?.viewports || []).map((viewport) => viewport.screenshot_label).filter((label) => typeof label === "string" && Boolean(label.trim()));
|
|
112
|
-
if (fromEvidence.length) return fromEvidence;
|
|
113
|
-
return (result.artifacts.screenshots || []).slice(0, 1);
|
|
114
|
-
}
|
|
115
|
-
function setupScreenshotLabels(result) {
|
|
116
|
-
const explicit = result.artifacts.setup_screenshots || [];
|
|
117
|
-
if (explicit.length) return explicit;
|
|
118
|
-
return (result.evidence?.viewports || []).flatMap(
|
|
119
|
-
(viewport) => (viewport.setup_action_results || []).filter((action) => action.action === "screenshot" && action.ok !== false && typeof action.screenshot_label === "string").map((action) => String(action.screenshot_label))
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
function observationArtifactFromRef(ref, canonicalLabels, setupLabels) {
|
|
123
|
-
const base = {
|
|
124
|
-
name: ref.name,
|
|
125
|
-
role: ref.role || "artifact",
|
|
126
|
-
url: ref.url,
|
|
127
|
-
path: ref.path,
|
|
128
|
-
kind: ref.kind,
|
|
129
|
-
content_type: ref.content_type,
|
|
130
|
-
source: ref.source
|
|
131
|
-
};
|
|
132
|
-
if (!artifactLooksLikeScreenshot(ref)) return base;
|
|
133
|
-
if (canonicalLabels.some((label) => artifactMatchesLabel(base, label))) {
|
|
134
|
-
return { ...base, role: "canonical_screenshot" };
|
|
135
|
-
}
|
|
136
|
-
if (setupLabels.some((label) => artifactMatchesLabel(base, label))) {
|
|
137
|
-
return { ...base, role: "setup_screenshot" };
|
|
138
|
-
}
|
|
139
|
-
return { ...base, role: "diagnostic" };
|
|
140
|
-
}
|
|
141
|
-
function profileObservationArtifacts(result) {
|
|
142
|
-
const canonicalLabels = finalScreenshotLabels(result);
|
|
143
|
-
const setupLabels = setupScreenshotLabels(result);
|
|
144
|
-
const artifacts = [];
|
|
145
|
-
const seen = /* @__PURE__ */ new Set();
|
|
146
|
-
const add = (artifact) => {
|
|
147
|
-
const key = artifact.url || artifact.path || `${artifact.role}:${artifact.name}`;
|
|
148
|
-
if (!artifact.name || seen.has(key)) return;
|
|
149
|
-
seen.add(key);
|
|
150
|
-
artifacts.push(artifact);
|
|
151
|
-
};
|
|
152
|
-
for (const ref of result.artifacts.riddle_artifacts || []) {
|
|
153
|
-
add(observationArtifactFromRef(ref, canonicalLabels, setupLabels));
|
|
154
|
-
}
|
|
155
|
-
for (const label of canonicalLabels) {
|
|
156
|
-
if (!artifacts.some((artifact) => artifactMatchesLabel(artifact, label))) {
|
|
157
|
-
add({ name: label, path: label, role: "canonical_screenshot", kind: "image" });
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
for (const label of setupLabels) {
|
|
161
|
-
if (!artifacts.some((artifact) => artifactMatchesLabel(artifact, label))) {
|
|
162
|
-
add({ name: label, path: label, role: "setup_screenshot", kind: "image" });
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
for (const label of result.artifacts.screenshots || []) {
|
|
166
|
-
if (!artifacts.some((artifact) => artifactMatchesLabel(artifact, label))) {
|
|
167
|
-
add({ name: label, path: label, role: "diagnostic", kind: "image" });
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
return artifacts;
|
|
171
|
-
}
|
|
172
|
-
function mergeObservationArtifacts(profileArtifacts, suppliedArtifacts) {
|
|
173
|
-
const artifacts = [...profileArtifacts];
|
|
174
|
-
for (const supplied of suppliedArtifacts) {
|
|
175
|
-
const suppliedNames = [supplied.name, supplied.url, supplied.path].map(comparableArtifactName).filter(Boolean);
|
|
176
|
-
const existingIndex = artifacts.findIndex((artifact) => {
|
|
177
|
-
if (supplied.url && artifact.url === supplied.url) return true;
|
|
178
|
-
if (supplied.path && artifact.path === supplied.path) return true;
|
|
179
|
-
return [artifact.name, artifact.url, artifact.path].map(comparableArtifactName).some((name) => name && suppliedNames.includes(name));
|
|
180
|
-
});
|
|
181
|
-
if (existingIndex < 0) {
|
|
182
|
-
artifacts.push(supplied);
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
const existing = artifacts[existingIndex];
|
|
186
|
-
const role = supplied.role === "canonical_screenshot" || supplied.role === "setup_screenshot" ? supplied.role : existing.role === "canonical_screenshot" || existing.role === "setup_screenshot" ? existing.role : supplied.role === "artifact" ? existing.role : supplied.role;
|
|
187
|
-
artifacts[existingIndex] = {
|
|
188
|
-
...existing,
|
|
189
|
-
...supplied,
|
|
190
|
-
role
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
return artifacts;
|
|
194
|
-
}
|
|
195
|
-
function defaultObservationId(role, capturedAt) {
|
|
196
|
-
return `obs_${role}_${capturedAt.replace(/[^0-9]/g, "").slice(0, 17) || "unknown"}`;
|
|
197
|
-
}
|
|
198
|
-
function profileCheckCounts(result) {
|
|
199
|
-
const counts = { total: result.checks.length, passed: 0, failed: 0, skipped: 0, needs_human_review: 0 };
|
|
200
|
-
for (const check of result.checks) {
|
|
201
|
-
if (check.status === "passed") counts.passed += 1;
|
|
202
|
-
if (check.status === "failed") counts.failed += 1;
|
|
203
|
-
if (check.status === "skipped") counts.skipped += 1;
|
|
204
|
-
if (check.status === "needs_human_review") counts.needs_human_review += 1;
|
|
205
|
-
}
|
|
206
|
-
return counts;
|
|
207
|
-
}
|
|
208
|
-
function createRiddleProofObservationReceipt(input) {
|
|
209
|
-
const capturedAt = input.captured_at || input.profile_result?.captured_at || (/* @__PURE__ */ new Date()).toISOString();
|
|
210
|
-
const profileArtifacts = input.profile_result ? profileObservationArtifacts(input.profile_result) : [];
|
|
211
|
-
const requestedCanonical = input.canonical_screenshot ? { ...input.canonical_screenshot, role: "canonical_screenshot" } : void 0;
|
|
212
|
-
const artifacts = mergeObservationArtifacts(
|
|
213
|
-
profileArtifacts,
|
|
214
|
-
[...input.artifacts || [], ...requestedCanonical ? [requestedCanonical] : []]
|
|
215
|
-
);
|
|
216
|
-
const canonicalScreenshot = requestedCanonical ? artifacts.find((artifact) => artifact.role === "canonical_screenshot" && artifactMatchesLabel(artifact, requestedCanonical.name)) || requestedCanonical : artifacts.find((artifact) => artifact.role === "canonical_screenshot");
|
|
217
|
-
const target = input.target.kind === "preview" && input.target.preview ? { ...input.target, preview: parseRiddlePreviewReceipt(input.target.preview) } : input.target;
|
|
218
|
-
return {
|
|
219
|
-
version: RIDDLE_PROOF_OBSERVATION_RECEIPT_VERSION,
|
|
220
|
-
observation_id: input.observation_id || defaultObservationId(input.comparison_role, capturedAt),
|
|
221
|
-
comparison_role: input.comparison_role,
|
|
222
|
-
executor: input.executor,
|
|
223
|
-
target,
|
|
224
|
-
source: normalizedSourceIdentity(input.source || input.target.preview?.source),
|
|
225
|
-
captured_at: capturedAt,
|
|
226
|
-
artifacts,
|
|
227
|
-
canonical_screenshot: canonicalScreenshot,
|
|
228
|
-
profile_summary: input.profile_result ? {
|
|
229
|
-
profile_name: input.profile_result.profile_name,
|
|
230
|
-
status: input.profile_result.status,
|
|
231
|
-
summary: input.profile_result.summary,
|
|
232
|
-
route: input.profile_result.route,
|
|
233
|
-
checks: profileCheckCounts(input.profile_result)
|
|
234
|
-
} : void 0,
|
|
235
|
-
proof: input.profile_result ? {
|
|
236
|
-
profile_name: input.profile_result.profile_name,
|
|
237
|
-
result: input.profile_result
|
|
238
|
-
} : void 0,
|
|
239
|
-
publication: input.publication,
|
|
240
|
-
execution: input.execution,
|
|
241
|
-
metadata: input.metadata
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
function parseRiddleProofObservationReceipt(value) {
|
|
245
|
-
if (!isRecord(value)) throw new Error("Observation receipt must be an object.");
|
|
246
|
-
if (value.version !== RIDDLE_PROOF_OBSERVATION_RECEIPT_VERSION) {
|
|
247
|
-
throw new Error(`Unsupported Observation receipt version ${String(value.version || "missing")}.`);
|
|
248
|
-
}
|
|
249
|
-
if (!isRecord(value.executor)) throw new Error("Observation receipt executor must be an object.");
|
|
250
|
-
if (!isRecord(value.target)) throw new Error("Observation receipt target must be an object.");
|
|
251
|
-
if (!isRecord(value.source)) throw new Error("Observation receipt source must be an object.");
|
|
252
|
-
requiredString(value, "observation_id", "observation receipt");
|
|
253
|
-
requiredString(value, "captured_at", "observation receipt");
|
|
254
|
-
const executorKind = requiredString(value.executor, "kind", "observation receipt executor");
|
|
255
|
-
if (!"local_playwright,riddle_hosted,browser_api,other".split(",").includes(executorKind)) {
|
|
256
|
-
throw new Error(`Unsupported observation executor kind ${executorKind}.`);
|
|
257
|
-
}
|
|
258
|
-
if (value.executor.runner !== void 0) {
|
|
259
|
-
requiredString(value.executor, "runner", "observation receipt executor");
|
|
260
|
-
}
|
|
261
|
-
const role = requiredString(value, "comparison_role", "observation receipt");
|
|
262
|
-
if (!["before", "after", "standalone"].includes(role)) {
|
|
263
|
-
throw new Error(`Unsupported observation comparison role ${role}.`);
|
|
264
|
-
}
|
|
265
|
-
const targetKind = requiredString(value.target, "kind", "observation receipt target");
|
|
266
|
-
if (targetKind !== "url" && targetKind !== "preview") {
|
|
267
|
-
throw new Error(`Unsupported observation target kind ${targetKind}.`);
|
|
268
|
-
}
|
|
269
|
-
requiredString(value.target, "url", "observation receipt target");
|
|
270
|
-
if (targetKind === "preview") {
|
|
271
|
-
if (value.target.preview === void 0) {
|
|
272
|
-
throw new Error("Preview Observation target must include its Preview receipt.");
|
|
273
|
-
}
|
|
274
|
-
parseRiddlePreviewReceipt(value.target.preview);
|
|
275
|
-
}
|
|
276
|
-
if (!Array.isArray(value.artifacts)) throw new Error("Observation receipt artifacts must be an array.");
|
|
277
|
-
const artifactRoles = /* @__PURE__ */ new Set(["canonical_screenshot", "setup_screenshot", "data", "diagnostic", "artifact"]);
|
|
278
|
-
const artifacts = value.artifacts.map((artifact, index) => {
|
|
279
|
-
if (!isRecord(artifact)) throw new Error(`Observation receipt artifact ${index} must be an object.`);
|
|
280
|
-
requiredString(artifact, "name", `observation receipt artifact ${index}`);
|
|
281
|
-
const artifactRole = requiredString(artifact, "role", `observation receipt artifact ${index}`);
|
|
282
|
-
if (!artifactRoles.has(artifactRole)) {
|
|
283
|
-
throw new Error(`Unsupported observation artifact role ${artifactRole}.`);
|
|
284
|
-
}
|
|
285
|
-
return artifact;
|
|
286
|
-
});
|
|
287
|
-
if (value.canonical_screenshot !== void 0) {
|
|
288
|
-
if (!isRecord(value.canonical_screenshot) || value.canonical_screenshot.role !== "canonical_screenshot") {
|
|
289
|
-
throw new Error("Observation canonical_screenshot must have the canonical_screenshot role.");
|
|
290
|
-
}
|
|
291
|
-
const canonical = value.canonical_screenshot;
|
|
292
|
-
const included = artifacts.some((artifact) => artifact.role === "canonical_screenshot" && artifact.name === canonical.name && artifact.url === canonical.url && artifact.path === canonical.path);
|
|
293
|
-
if (!included) {
|
|
294
|
-
throw new Error("Observation canonical_screenshot must reference an artifact in the receipt.");
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
return value;
|
|
298
|
-
}
|
|
44
|
+
var receipts_exports = {};
|
|
45
|
+
__export(receipts_exports, {
|
|
46
|
+
RIDDLE_PREVIEW_RECEIPT_VERSION: () => import_receipts.RIDDLE_PREVIEW_RECEIPT_VERSION,
|
|
47
|
+
RIDDLE_PROOF_OBSERVATION_RECEIPT_VERSION: () => import_receipts.RIDDLE_PROOF_OBSERVATION_RECEIPT_VERSION,
|
|
48
|
+
createRiddleProofObservationReceipt: () => import_receipts.createRiddleProofObservationReceipt,
|
|
49
|
+
parseRiddlePreviewReceipt: () => import_receipts.parseRiddlePreviewReceipt,
|
|
50
|
+
parseRiddleProofObservationReceipt: () => import_receipts.parseRiddleProofObservationReceipt
|
|
51
|
+
});
|
|
52
|
+
__reExport(receipts_exports, require("@riddledc/riddle-proof-core/receipts"));
|
|
53
|
+
var import_receipts = require("@riddledc/riddle-proof-core/receipts");
|
|
299
54
|
|
|
300
55
|
// src/change-proof.ts
|
|
301
56
|
var RIDDLE_PROOF_CHANGE_CONTRACT_VERSION = "riddle-proof.change-contract.v1";
|
|
@@ -639,7 +394,7 @@ function changeReceiptVerdict(status) {
|
|
|
639
394
|
if (status === "proof_insufficient") return "proof_insufficient";
|
|
640
395
|
return "not_mergeable";
|
|
641
396
|
}
|
|
642
|
-
function
|
|
397
|
+
function profileCheckCounts(result) {
|
|
643
398
|
const counts = {
|
|
644
399
|
total: result.checks.length,
|
|
645
400
|
passed: 0,
|
|
@@ -712,7 +467,7 @@ function observationExecutor(result) {
|
|
|
712
467
|
function observationForReceiptSide(side, result, source, sourceIdentity) {
|
|
713
468
|
if (!result) throw new Error(`${side}_result or ${side}_observation is required.`);
|
|
714
469
|
if (!source) throw new Error(`${side}_source or ${side}_observation is required.`);
|
|
715
|
-
return createRiddleProofObservationReceipt({
|
|
470
|
+
return (0, import_receipts.createRiddleProofObservationReceipt)({
|
|
716
471
|
comparison_role: side,
|
|
717
472
|
executor: observationExecutor(result),
|
|
718
473
|
target: { kind: "url", url: source },
|
|
@@ -723,8 +478,8 @@ function observationForReceiptSide(side, result, source, sourceIdentity) {
|
|
|
723
478
|
});
|
|
724
479
|
}
|
|
725
480
|
function createRiddleProofChangeReceipt(input) {
|
|
726
|
-
const before = input.before_observation ? parseRiddleProofObservationReceipt(input.before_observation) : observationForReceiptSide("before", input.before_result, input.before_source, input.before_source_identity);
|
|
727
|
-
const after = input.after_observation ? parseRiddleProofObservationReceipt(input.after_observation) : observationForReceiptSide("after", input.after_result, input.after_source, input.after_source_identity);
|
|
481
|
+
const before = input.before_observation ? (0, import_receipts.parseRiddleProofObservationReceipt)(input.before_observation) : observationForReceiptSide("before", input.before_result, input.before_source, input.before_source_identity);
|
|
482
|
+
const after = input.after_observation ? (0, import_receipts.parseRiddleProofObservationReceipt)(input.after_observation) : observationForReceiptSide("after", input.after_result, input.after_source, input.after_source_identity);
|
|
728
483
|
const verdict = changeReceiptVerdict(input.result.status);
|
|
729
484
|
const shippingAuthorization = input.shipping_authorization || noShippingAuthorization();
|
|
730
485
|
assertShippingAuthorizationConsistent(shippingAuthorization, "Change receipt");
|
|
@@ -754,7 +509,7 @@ function createRiddleProofChangeReceipt(input) {
|
|
|
754
509
|
metadata: input.result.metadata
|
|
755
510
|
};
|
|
756
511
|
}
|
|
757
|
-
function
|
|
512
|
+
function isRecord(value) {
|
|
758
513
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
759
514
|
}
|
|
760
515
|
function migratedObservationFromLegacySide(side, legacy) {
|
|
@@ -831,7 +586,7 @@ function migrateRiddleProofChangeReceipt(legacy) {
|
|
|
831
586
|
};
|
|
832
587
|
}
|
|
833
588
|
function parseRiddleProofChangeReceipt(value) {
|
|
834
|
-
if (!
|
|
589
|
+
if (!isRecord(value)) throw new Error("Change receipt must be an object.");
|
|
835
590
|
if (value.version === RIDDLE_PROOF_CHANGE_RECEIPT_V1_VERSION) {
|
|
836
591
|
return migrateRiddleProofChangeReceipt(value);
|
|
837
592
|
}
|
|
@@ -839,11 +594,11 @@ function parseRiddleProofChangeReceipt(value) {
|
|
|
839
594
|
throw new Error(`Unsupported Change receipt version ${String(value.version || "missing")}.`);
|
|
840
595
|
}
|
|
841
596
|
const receipt = value;
|
|
842
|
-
if (!RIDDLE_PROOF_PROFILE_STATUSES.includes(receipt.status)) {
|
|
597
|
+
if (!import_profile.RIDDLE_PROOF_PROFILE_STATUSES.includes(receipt.status)) {
|
|
843
598
|
throw new Error(`Unsupported Change receipt status ${String(receipt.status || "missing")}.`);
|
|
844
599
|
}
|
|
845
|
-
parseRiddleProofObservationReceipt(receipt.before);
|
|
846
|
-
parseRiddleProofObservationReceipt(receipt.after);
|
|
600
|
+
(0, import_receipts.parseRiddleProofObservationReceipt)(receipt.before);
|
|
601
|
+
(0, import_receipts.parseRiddleProofObservationReceipt)(receipt.after);
|
|
847
602
|
if (receipt.before.comparison_role !== "before" || receipt.after.comparison_role !== "after") {
|
|
848
603
|
throw new Error("Change receipt observations must preserve their before and after comparison roles.");
|
|
849
604
|
}
|
|
@@ -875,8 +630,8 @@ function createRiddleProofHandoffReceipt(changeReceipt, options = {}) {
|
|
|
875
630
|
};
|
|
876
631
|
}
|
|
877
632
|
function parseRiddleProofHandoffReceipt(value) {
|
|
878
|
-
if (!
|
|
879
|
-
throw new Error(`Unsupported Handoff receipt version ${String(
|
|
633
|
+
if (!isRecord(value) || value.version !== RIDDLE_PROOF_HANDOFF_RECEIPT_VERSION) {
|
|
634
|
+
throw new Error(`Unsupported Handoff receipt version ${String(isRecord(value) ? value.version || "missing" : "missing")}.`);
|
|
880
635
|
}
|
|
881
636
|
const receipt = value;
|
|
882
637
|
if (!Number.isFinite(Date.parse(receipt.created_at))) {
|
|
@@ -931,7 +686,7 @@ function receiptSideView(side, observation) {
|
|
|
931
686
|
summary: summary?.summary || observation.proof?.result.summary || "No profile summary recorded.",
|
|
932
687
|
route: summary?.route,
|
|
933
688
|
captured_at: observation.captured_at,
|
|
934
|
-
checks: summary?.checks || (observation.proof ?
|
|
689
|
+
checks: summary?.checks || (observation.proof ? profileCheckCounts(observation.proof.result) : {
|
|
935
690
|
total: 0,
|
|
936
691
|
passed: 0,
|
|
937
692
|
failed: 0,
|
package/dist/change-proof.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RiddleProofProfileResult, RiddleProofProfileStatus, RiddleProofProfileCheckResult } from '
|
|
2
|
-
import { RiddleProofObservationReceipt, RiddleProofSourceIdentity, RiddleProofObservationArtifact } from '
|
|
1
|
+
import { RiddleProofProfileResult, RiddleProofProfileStatus, RiddleProofProfileCheckResult } from '@riddledc/riddle-proof-core/profile';
|
|
2
|
+
import { RiddleProofObservationReceipt, RiddleProofSourceIdentity, RiddleProofObservationArtifact } from '@riddledc/riddle-proof-core/receipts';
|
|
3
3
|
import { JsonValue } from './types.cjs';
|
|
4
4
|
import './public-state.cjs';
|
|
5
5
|
|
package/dist/change-proof.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RiddleProofProfileResult, RiddleProofProfileStatus, RiddleProofProfileCheckResult } from '
|
|
2
|
-
import { RiddleProofObservationReceipt, RiddleProofSourceIdentity, RiddleProofObservationArtifact } from '
|
|
1
|
+
import { RiddleProofProfileResult, RiddleProofProfileStatus, RiddleProofProfileCheckResult } from '@riddledc/riddle-proof-core/profile';
|
|
2
|
+
import { RiddleProofObservationReceipt, RiddleProofSourceIdentity, RiddleProofObservationArtifact } from '@riddledc/riddle-proof-core/receipts';
|
|
3
3
|
import { JsonValue } from './types.js';
|
|
4
4
|
import './public-state.js';
|
|
5
5
|
|
package/dist/change-proof.js
CHANGED
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
parseRiddleProofHandoffReceipt,
|
|
13
13
|
riddleProofChangeReceiptHtml,
|
|
14
14
|
riddleProofChangeReceiptMarkdown
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-NR2XQXIC.js";
|
|
16
|
+
import "./chunk-KF6F2RMQ.js";
|
|
17
|
+
import "./chunk-OHDNCXRM.js";
|
|
18
18
|
import "./chunk-MLKGABMK.js";
|
|
19
19
|
export {
|
|
20
20
|
RIDDLE_PROOF_CHANGE_CONTRACT_VERSION,
|
|
@@ -0,0 +1,67 @@
|
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/checked-meaning.ts
|
|
22
|
+
var checked_meaning_exports = {};
|
|
23
|
+
__export(checked_meaning_exports, {
|
|
24
|
+
RIDDLE_PROOF_CHECKED_MEANING_ASSURANCE: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_ASSURANCE,
|
|
25
|
+
RIDDLE_PROOF_CHECKED_MEANING_CLOSURE_VERSION: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_CLOSURE_VERSION,
|
|
26
|
+
RIDDLE_PROOF_CHECKED_MEANING_MATERIALIZED_RULE_DIGEST_DOMAIN: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_MATERIALIZED_RULE_DIGEST_DOMAIN,
|
|
27
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_AGE_MS: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_MAX_AGE_MS,
|
|
28
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_CONSUMPTION_WINDOW_MS: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_MAX_CONSUMPTION_WINDOW_MS,
|
|
29
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_DEFINITION_BYTES: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_MAX_DEFINITION_BYTES,
|
|
30
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_PARAMETERS: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_MAX_PARAMETERS,
|
|
31
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_PREMISES: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_MAX_PREMISES,
|
|
32
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_RULES: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_MAX_RULES,
|
|
33
|
+
RIDDLE_PROOF_CHECKED_MEANING_RULE_DIGEST_DOMAIN: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_RULE_DIGEST_DOMAIN,
|
|
34
|
+
RIDDLE_PROOF_CHECKED_MEANING_RULE_ENGINE: () => import_checked_meaning.RIDDLE_PROOF_CHECKED_MEANING_RULE_ENGINE,
|
|
35
|
+
assessRiddleProofCheckedMeaningClosure: () => import_checked_meaning.assessRiddleProofCheckedMeaningClosure,
|
|
36
|
+
composeRiddleProofCheckedMeaningClosures: () => import_checked_meaning.composeRiddleProofCheckedMeaningClosures,
|
|
37
|
+
createRiddleProofCheckedMeaningAtomicClosure: () => import_checked_meaning.createRiddleProofCheckedMeaningAtomicClosure,
|
|
38
|
+
createRiddleProofCheckedMeaningRule: () => import_checked_meaning.createRiddleProofCheckedMeaningRule,
|
|
39
|
+
matchRiddleProofCheckedMeaningClosure: () => import_checked_meaning.matchRiddleProofCheckedMeaningClosure,
|
|
40
|
+
replayRiddleProofCheckedMeaningClosure: () => import_checked_meaning.replayRiddleProofCheckedMeaningClosure,
|
|
41
|
+
validateRiddleProofCheckedMeaningClosure: () => import_checked_meaning.validateRiddleProofCheckedMeaningClosure
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(checked_meaning_exports);
|
|
44
|
+
__reExport(checked_meaning_exports, require("@riddledc/riddle-proof-core/checked-meaning"), module.exports);
|
|
45
|
+
var import_checked_meaning = require("@riddledc/riddle-proof-core/checked-meaning");
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
RIDDLE_PROOF_CHECKED_MEANING_ASSURANCE,
|
|
49
|
+
RIDDLE_PROOF_CHECKED_MEANING_CLOSURE_VERSION,
|
|
50
|
+
RIDDLE_PROOF_CHECKED_MEANING_MATERIALIZED_RULE_DIGEST_DOMAIN,
|
|
51
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_AGE_MS,
|
|
52
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_CONSUMPTION_WINDOW_MS,
|
|
53
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_DEFINITION_BYTES,
|
|
54
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_PARAMETERS,
|
|
55
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_PREMISES,
|
|
56
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_RULES,
|
|
57
|
+
RIDDLE_PROOF_CHECKED_MEANING_RULE_DIGEST_DOMAIN,
|
|
58
|
+
RIDDLE_PROOF_CHECKED_MEANING_RULE_ENGINE,
|
|
59
|
+
assessRiddleProofCheckedMeaningClosure,
|
|
60
|
+
composeRiddleProofCheckedMeaningClosures,
|
|
61
|
+
createRiddleProofCheckedMeaningAtomicClosure,
|
|
62
|
+
createRiddleProofCheckedMeaningRule,
|
|
63
|
+
matchRiddleProofCheckedMeaningClosure,
|
|
64
|
+
replayRiddleProofCheckedMeaningClosure,
|
|
65
|
+
validateRiddleProofCheckedMeaningClosure,
|
|
66
|
+
...require("@riddledc/riddle-proof-core/checked-meaning")
|
|
67
|
+
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from '@riddledc/riddle-proof-core/checked-meaning';
|
|
2
|
+
export { RIDDLE_PROOF_CHECKED_MEANING_ASSURANCE, RIDDLE_PROOF_CHECKED_MEANING_CLOSURE_VERSION, RIDDLE_PROOF_CHECKED_MEANING_MATERIALIZED_RULE_DIGEST_DOMAIN, RIDDLE_PROOF_CHECKED_MEANING_MAX_AGE_MS, RIDDLE_PROOF_CHECKED_MEANING_MAX_CONSUMPTION_WINDOW_MS, RIDDLE_PROOF_CHECKED_MEANING_MAX_DEFINITION_BYTES, RIDDLE_PROOF_CHECKED_MEANING_MAX_PARAMETERS, RIDDLE_PROOF_CHECKED_MEANING_MAX_PREMISES, RIDDLE_PROOF_CHECKED_MEANING_MAX_RULES, RIDDLE_PROOF_CHECKED_MEANING_RULE_DIGEST_DOMAIN, RIDDLE_PROOF_CHECKED_MEANING_RULE_ENGINE, assessRiddleProofCheckedMeaningClosure, composeRiddleProofCheckedMeaningClosures, createRiddleProofCheckedMeaningAtomicClosure, createRiddleProofCheckedMeaningRule, matchRiddleProofCheckedMeaningClosure, replayRiddleProofCheckedMeaningClosure, validateRiddleProofCheckedMeaningClosure } from '@riddledc/riddle-proof-core/checked-meaning';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from '@riddledc/riddle-proof-core/checked-meaning';
|
|
2
|
+
export { RIDDLE_PROOF_CHECKED_MEANING_ASSURANCE, RIDDLE_PROOF_CHECKED_MEANING_CLOSURE_VERSION, RIDDLE_PROOF_CHECKED_MEANING_MATERIALIZED_RULE_DIGEST_DOMAIN, RIDDLE_PROOF_CHECKED_MEANING_MAX_AGE_MS, RIDDLE_PROOF_CHECKED_MEANING_MAX_CONSUMPTION_WINDOW_MS, RIDDLE_PROOF_CHECKED_MEANING_MAX_DEFINITION_BYTES, RIDDLE_PROOF_CHECKED_MEANING_MAX_PARAMETERS, RIDDLE_PROOF_CHECKED_MEANING_MAX_PREMISES, RIDDLE_PROOF_CHECKED_MEANING_MAX_RULES, RIDDLE_PROOF_CHECKED_MEANING_RULE_DIGEST_DOMAIN, RIDDLE_PROOF_CHECKED_MEANING_RULE_ENGINE, assessRiddleProofCheckedMeaningClosure, composeRiddleProofCheckedMeaningClosures, createRiddleProofCheckedMeaningAtomicClosure, createRiddleProofCheckedMeaningRule, matchRiddleProofCheckedMeaningClosure, replayRiddleProofCheckedMeaningClosure, validateRiddleProofCheckedMeaningClosure } from '@riddledc/riddle-proof-core/checked-meaning';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import {
|
|
2
|
+
RIDDLE_PROOF_CHECKED_MEANING_ASSURANCE,
|
|
3
|
+
RIDDLE_PROOF_CHECKED_MEANING_CLOSURE_VERSION,
|
|
4
|
+
RIDDLE_PROOF_CHECKED_MEANING_MATERIALIZED_RULE_DIGEST_DOMAIN,
|
|
5
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_AGE_MS,
|
|
6
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_CONSUMPTION_WINDOW_MS,
|
|
7
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_DEFINITION_BYTES,
|
|
8
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_PARAMETERS,
|
|
9
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_PREMISES,
|
|
10
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_RULES,
|
|
11
|
+
RIDDLE_PROOF_CHECKED_MEANING_RULE_DIGEST_DOMAIN,
|
|
12
|
+
RIDDLE_PROOF_CHECKED_MEANING_RULE_ENGINE,
|
|
13
|
+
assessRiddleProofCheckedMeaningClosure,
|
|
14
|
+
composeRiddleProofCheckedMeaningClosures,
|
|
15
|
+
createRiddleProofCheckedMeaningAtomicClosure,
|
|
16
|
+
createRiddleProofCheckedMeaningRule,
|
|
17
|
+
matchRiddleProofCheckedMeaningClosure,
|
|
18
|
+
replayRiddleProofCheckedMeaningClosure,
|
|
19
|
+
validateRiddleProofCheckedMeaningClosure
|
|
20
|
+
} from "./chunk-ODLGSEP2.js";
|
|
21
|
+
import "./chunk-MLKGABMK.js";
|
|
22
|
+
export {
|
|
23
|
+
RIDDLE_PROOF_CHECKED_MEANING_ASSURANCE,
|
|
24
|
+
RIDDLE_PROOF_CHECKED_MEANING_CLOSURE_VERSION,
|
|
25
|
+
RIDDLE_PROOF_CHECKED_MEANING_MATERIALIZED_RULE_DIGEST_DOMAIN,
|
|
26
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_AGE_MS,
|
|
27
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_CONSUMPTION_WINDOW_MS,
|
|
28
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_DEFINITION_BYTES,
|
|
29
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_PARAMETERS,
|
|
30
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_PREMISES,
|
|
31
|
+
RIDDLE_PROOF_CHECKED_MEANING_MAX_RULES,
|
|
32
|
+
RIDDLE_PROOF_CHECKED_MEANING_RULE_DIGEST_DOMAIN,
|
|
33
|
+
RIDDLE_PROOF_CHECKED_MEANING_RULE_ENGINE,
|
|
34
|
+
assessRiddleProofCheckedMeaningClosure,
|
|
35
|
+
composeRiddleProofCheckedMeaningClosures,
|
|
36
|
+
createRiddleProofCheckedMeaningAtomicClosure,
|
|
37
|
+
createRiddleProofCheckedMeaningRule,
|
|
38
|
+
matchRiddleProofCheckedMeaningClosure,
|
|
39
|
+
replayRiddleProofCheckedMeaningClosure,
|
|
40
|
+
validateRiddleProofCheckedMeaningClosure
|
|
41
|
+
};
|
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
|
+
RIDDLE_BALANCE_ENDPOINT_PATH,
|
|
2
3
|
RIDDLE_UNSUBMITTED_WAKE_HINT,
|
|
3
4
|
createRiddleApiClient,
|
|
4
5
|
isTerminalRiddleJobStatus,
|
|
5
6
|
parseRiddleViewport
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KB7FYRBG.js";
|
|
8
|
+
import {
|
|
9
|
+
suggestRiddleProofProfileChecks
|
|
10
|
+
} from "./chunk-7W6ZJPHJ.js";
|
|
7
11
|
import {
|
|
8
12
|
RIDDLE_PROOF_PR_COMMENT_MARKER,
|
|
9
13
|
buildRiddleProofPrCommentMarkdown,
|
|
10
14
|
summarizeRiddleProofPrComment
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
suggestRiddleProofProfileChecks
|
|
14
|
-
} from "./chunk-FW7CKARF.js";
|
|
15
|
+
} from "./chunk-BVYM4WJ5.js";
|
|
15
16
|
import {
|
|
16
17
|
assessRiddleProofChange,
|
|
17
18
|
createRiddleProofChangeReceipt,
|
|
18
19
|
createRiddleProofHandoffReceipt,
|
|
19
20
|
riddleProofChangeReceiptHtml,
|
|
20
21
|
riddleProofChangeReceiptMarkdown
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import {
|
|
23
|
-
createRiddleProofObservationReceipt,
|
|
24
|
-
parseRiddlePreviewReceipt,
|
|
25
|
-
parseRiddleProofObservationReceipt
|
|
26
|
-
} from "./chunk-MEVVL4TI.js";
|
|
22
|
+
} from "./chunk-NR2XQXIC.js";
|
|
27
23
|
import {
|
|
28
24
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|
|
29
25
|
applyRiddleProofProfileArtifactCompleteness,
|
|
@@ -41,7 +37,12 @@ import {
|
|
|
41
37
|
profileStatusExitCode,
|
|
42
38
|
resolveRiddleProofProfileTargetUrl,
|
|
43
39
|
resolveRiddleProofProfileTimeoutSec
|
|
44
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-KF6F2RMQ.js";
|
|
41
|
+
import {
|
|
42
|
+
createRiddleProofObservationReceipt,
|
|
43
|
+
parseRiddlePreviewReceipt,
|
|
44
|
+
parseRiddleProofObservationReceipt
|
|
45
|
+
} from "./chunk-OHDNCXRM.js";
|
|
45
46
|
import {
|
|
46
47
|
createCodexExecAgentAdapter,
|
|
47
48
|
runCodexExecAgentDoctor
|
|
@@ -50,7 +51,7 @@ import {
|
|
|
50
51
|
createDisabledRiddleProofAgentAdapter,
|
|
51
52
|
readRiddleProofRunStatus,
|
|
52
53
|
runRiddleProofEngineHarness
|
|
53
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-BID7CKMM.js";
|
|
54
55
|
import {
|
|
55
56
|
createCheckpointResponseTemplate
|
|
56
57
|
} from "./chunk-DYE3URAQ.js";
|
|
@@ -593,7 +594,7 @@ async function hostedRiddleSuiteEnvironmentBlocker(cases, options) {
|
|
|
593
594
|
error: message,
|
|
594
595
|
environment_blocker: {
|
|
595
596
|
source: "riddle_api",
|
|
596
|
-
endpoint:
|
|
597
|
+
endpoint: RIDDLE_BALANCE_ENDPOINT_PATH,
|
|
597
598
|
reason: "balance_preflight_failed",
|
|
598
599
|
balance_preflight: true,
|
|
599
600
|
job_count: cases.length,
|
|
@@ -613,7 +614,7 @@ async function hostedRiddleSuiteEnvironmentBlocker(cases, options) {
|
|
|
613
614
|
error: `Riddle hosted regression balance preflight failed: ${availableSeconds}s available for ${cases.length} serial hosted job(s), minimum ${requiredSeconds}s required.`,
|
|
614
615
|
environment_blocker: {
|
|
615
616
|
source: "riddle_api",
|
|
616
|
-
endpoint:
|
|
617
|
+
endpoint: RIDDLE_BALANCE_ENDPOINT_PATH,
|
|
617
618
|
reason: "insufficient_balance",
|
|
618
619
|
error: "Insufficient available balance",
|
|
619
620
|
balance_preflight: true,
|
|
@@ -4228,7 +4229,7 @@ async function recoverProfileResultFromRiddleArtifacts(profile, input) {
|
|
|
4228
4229
|
for (let attempt = 0; attempt < attempts; attempt += 1) {
|
|
4229
4230
|
let artifactPayload;
|
|
4230
4231
|
try {
|
|
4231
|
-
artifactPayload = await input.client.
|
|
4232
|
+
artifactPayload = await input.client.getJobArtifacts(input.jobId);
|
|
4232
4233
|
} catch {
|
|
4233
4234
|
artifactPayload = {};
|
|
4234
4235
|
}
|
|
@@ -4672,7 +4673,7 @@ async function preflightRiddleProfileBalanceForCli(profile, options, input) {
|
|
|
4672
4673
|
error,
|
|
4673
4674
|
environmentBlocker: {
|
|
4674
4675
|
source: "riddle_api",
|
|
4675
|
-
endpoint:
|
|
4676
|
+
endpoint: RIDDLE_BALANCE_ENDPOINT_PATH,
|
|
4676
4677
|
reason: "balance_preflight_failed",
|
|
4677
4678
|
balance_preflight: true,
|
|
4678
4679
|
...riddleApiErrorBlockerMetadata(error),
|
|
@@ -4694,7 +4695,7 @@ async function preflightRiddleProfileBalanceForCli(profile, options, input) {
|
|
|
4694
4695
|
error: `Riddle balance preflight failed: ${availableSeconds}s available for ${jobCount} intended hosted job(s), minimum ${requiredSeconds}s required.`,
|
|
4695
4696
|
environmentBlocker: {
|
|
4696
4697
|
source: "riddle_api",
|
|
4697
|
-
endpoint:
|
|
4698
|
+
endpoint: RIDDLE_BALANCE_ENDPOINT_PATH,
|
|
4698
4699
|
reason: "insufficient_balance",
|
|
4699
4700
|
error: "Insufficient available balance",
|
|
4700
4701
|
balance_preflight: true,
|
|
@@ -4900,7 +4901,7 @@ async function recoverProfileForCli(profile, options) {
|
|
|
4900
4901
|
const client = createRiddleApiClient(riddleClientConfig(options));
|
|
4901
4902
|
let artifactPayload;
|
|
4902
4903
|
try {
|
|
4903
|
-
artifactPayload = await client.
|
|
4904
|
+
artifactPayload = await client.getJobArtifacts(jobId);
|
|
4904
4905
|
} catch (error) {
|
|
4905
4906
|
return createRiddleProofProfileEnvironmentBlockedResult({
|
|
4906
4907
|
profile,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// src/rule-trust-root.ts
|
|
2
|
+
import {
|
|
3
|
+
RIDDLE_PROOF_RULE_TRUST_ROOT_DIGEST_DOMAIN,
|
|
4
|
+
RIDDLE_PROOF_RULE_TRUST_ROOT_VERSION,
|
|
5
|
+
createRiddleProofRuleTrustRoot,
|
|
6
|
+
resolveRiddleProofRuleTrustRoot
|
|
7
|
+
} from "@riddledc/riddle-proof-core/rule-trust-root";
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
RIDDLE_PROOF_RULE_TRUST_ROOT_DIGEST_DOMAIN,
|
|
11
|
+
RIDDLE_PROOF_RULE_TRUST_ROOT_VERSION,
|
|
12
|
+
createRiddleProofRuleTrustRoot,
|
|
13
|
+
resolveRiddleProofRuleTrustRoot
|
|
14
|
+
};
|