@riddledc/riddle-proof 0.8.67 → 0.8.69
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-VSP4K5LR.js → chunk-AF3KFD4A.js} +10 -5
- package/dist/{chunk-RZ3GXSXQ.js → chunk-DTFSHRV5.js} +76 -7
- package/dist/cli/index.js +2 -2
- package/dist/cli.cjs +85 -11
- package/dist/cli.js +2 -2
- package/dist/index.cjs +76 -7
- package/dist/index.js +1 -1
- package/dist/pr-comment.cjs +76 -7
- package/dist/pr-comment.js +1 -1
- package/examples/story-matrices/README.md +13 -0
- package/examples/story-matrices/riddle-proof-ux-coverage.csv +17 -0
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
RIDDLE_PROOF_PR_COMMENT_MARKER,
|
|
9
9
|
buildRiddleProofPrCommentMarkdown,
|
|
10
10
|
summarizeRiddleProofPrComment
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-DTFSHRV5.js";
|
|
12
12
|
import {
|
|
13
13
|
suggestRiddleProofProfileChecks
|
|
14
14
|
} from "./chunk-5Y4V2IXI.js";
|
|
@@ -4713,12 +4713,17 @@ async function main() {
|
|
|
4713
4713
|
}
|
|
4714
4714
|
if (command === "pr-comment") {
|
|
4715
4715
|
const proofDir = optionString(options, "proofDir") || optionString(options, "outputDir") || positional[1];
|
|
4716
|
-
const
|
|
4717
|
-
const
|
|
4716
|
+
const explicitRunResponsePath = optionString(options, "runResponse");
|
|
4717
|
+
const explicitResultJsonPath = optionString(options, "resultJson");
|
|
4718
|
+
const runResponsePath = explicitRunResponsePath || defaultProofDirJsonPath(proofDir, "riddle-run-response.json");
|
|
4719
|
+
const resultJsonPaths = explicitResultJsonPath ? [explicitResultJsonPath] : [
|
|
4720
|
+
defaultProofDirJsonPath(proofDir, "result.json"),
|
|
4721
|
+
defaultProofDirJsonPath(proofDir, "profile-result.json")
|
|
4722
|
+
];
|
|
4718
4723
|
const runResponse = readJsonFileIfExists(runResponsePath);
|
|
4719
|
-
const result = readJsonFileIfExists(
|
|
4724
|
+
const result = resultJsonPaths.map((candidate) => readJsonFileIfExists(candidate)).find(Boolean);
|
|
4720
4725
|
if (!runResponse && !result) {
|
|
4721
|
-
throw new Error("pr-comment requires --proof-dir with riddle-run-response.json
|
|
4726
|
+
throw new Error("pr-comment requires --proof-dir with riddle-run-response.json, result.json, or profile-result.json, or explicit --run-response/--result-json.");
|
|
4722
4727
|
}
|
|
4723
4728
|
const body = buildRiddleProofPrCommentMarkdown({
|
|
4724
4729
|
title: optionString(options, "title"),
|
|
@@ -59,6 +59,36 @@ function collectArtifacts(runResponse) {
|
|
|
59
59
|
}
|
|
60
60
|
return artifacts;
|
|
61
61
|
}
|
|
62
|
+
function collectProfileArtifacts(result) {
|
|
63
|
+
const resultArtifacts = asRecord(result.artifacts);
|
|
64
|
+
const artifacts = [];
|
|
65
|
+
const seen = /* @__PURE__ */ new Set();
|
|
66
|
+
for (const [index, item] of asArray(resultArtifacts.riddle_artifacts).entries()) {
|
|
67
|
+
const artifact = asRecord(item);
|
|
68
|
+
const url = stringValue(artifact.url);
|
|
69
|
+
if (!url || seen.has(url)) continue;
|
|
70
|
+
seen.add(url);
|
|
71
|
+
const fallbackName = stringValue(artifact.kind) || `artifact-${index + 1}`;
|
|
72
|
+
const name = artifactDisplayName(artifact.name, fallbackName);
|
|
73
|
+
artifacts.push({
|
|
74
|
+
name,
|
|
75
|
+
url,
|
|
76
|
+
kind: artifactKind(name, url),
|
|
77
|
+
size_bytes: numberValue(artifact.size_bytes) ?? numberValue(artifact.size)
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
return artifacts;
|
|
81
|
+
}
|
|
82
|
+
function mergeArtifacts(...artifactLists) {
|
|
83
|
+
const artifacts = [];
|
|
84
|
+
const seen = /* @__PURE__ */ new Set();
|
|
85
|
+
for (const artifact of artifactLists.flat()) {
|
|
86
|
+
if (seen.has(artifact.url)) continue;
|
|
87
|
+
seen.add(artifact.url);
|
|
88
|
+
artifacts.push(artifact);
|
|
89
|
+
}
|
|
90
|
+
return artifacts;
|
|
91
|
+
}
|
|
62
92
|
function pageSummaries(result) {
|
|
63
93
|
const pages = [];
|
|
64
94
|
for (const page of asArray(result.pages)) {
|
|
@@ -75,6 +105,35 @@ function pageSummaries(result) {
|
|
|
75
105
|
}
|
|
76
106
|
return pages;
|
|
77
107
|
}
|
|
108
|
+
function profileCheckCounts(result) {
|
|
109
|
+
const checks = asArray(result.checks);
|
|
110
|
+
if (checks.length) {
|
|
111
|
+
let passed2 = 0;
|
|
112
|
+
let failed2 = 0;
|
|
113
|
+
for (const item of checks) {
|
|
114
|
+
const status = stringValue(asRecord(item).status);
|
|
115
|
+
if (status === "passed") passed2 += 1;
|
|
116
|
+
if (status === "failed") failed2 += 1;
|
|
117
|
+
}
|
|
118
|
+
return { passed: passed2, failed: failed2 };
|
|
119
|
+
}
|
|
120
|
+
const checkCounts = asRecord(result.check_counts);
|
|
121
|
+
const passed = numberValue(checkCounts.passed);
|
|
122
|
+
const failed = numberValue(checkCounts.failed);
|
|
123
|
+
if (typeof passed === "number" || typeof failed === "number") {
|
|
124
|
+
return { passed: passed ?? 0, failed: failed ?? 0 };
|
|
125
|
+
}
|
|
126
|
+
return void 0;
|
|
127
|
+
}
|
|
128
|
+
function profilePageSummaries(result, counts) {
|
|
129
|
+
if (!counts) return [];
|
|
130
|
+
const route = asRecord(result.route);
|
|
131
|
+
return [{
|
|
132
|
+
route: firstStringValue(route.observed, route.expected_path, route.requested, result.profile_name) || "profile",
|
|
133
|
+
passed: counts.passed,
|
|
134
|
+
failed: counts.failed
|
|
135
|
+
}];
|
|
136
|
+
}
|
|
78
137
|
function summarizeExplicitChecks(value) {
|
|
79
138
|
let passed = 0;
|
|
80
139
|
let failed = 0;
|
|
@@ -126,18 +185,28 @@ function checkpointSummaryFrom(...values) {
|
|
|
126
185
|
};
|
|
127
186
|
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
128
187
|
}
|
|
188
|
+
function isProfileResult(result) {
|
|
189
|
+
const version = stringValue(result.version);
|
|
190
|
+
return version === "riddle-proof.profile-result.v1" || version === "riddle-proof.profile-compact-result.v1";
|
|
191
|
+
}
|
|
129
192
|
function summarizeRiddleProofPrComment(input) {
|
|
130
193
|
const runResponse = asRecord(input.runResponse);
|
|
131
194
|
const result = asRecord(input.result);
|
|
132
195
|
const proofResult = asRecord(runResponse.proofResult);
|
|
196
|
+
const profileResult = isProfileResult(result);
|
|
197
|
+
const profileRiddle = asRecord(result.riddle);
|
|
133
198
|
const preview = asRecord(runResponse.preview);
|
|
134
199
|
const resultRunCard = asRecord(result.run_card);
|
|
135
200
|
const stopCondition = asRecord(resultRunCard.stop_condition);
|
|
136
201
|
const resultDetails = asRecord(result.details);
|
|
137
202
|
const resultRaw = asRecord(result.raw);
|
|
138
203
|
const rawDetails = asRecord(resultRaw.details);
|
|
139
|
-
const
|
|
140
|
-
const
|
|
204
|
+
const profileChecks = profileResult ? profileCheckCounts(result) : void 0;
|
|
205
|
+
const artifacts = mergeArtifacts(
|
|
206
|
+
collectArtifacts(runResponse),
|
|
207
|
+
profileResult ? collectProfileArtifacts(result) : []
|
|
208
|
+
);
|
|
209
|
+
const pages = profileResult ? profilePageSummaries(result, profileChecks) : pageSummaries(result);
|
|
141
210
|
const checkSource = { ...result };
|
|
142
211
|
delete checkSource.ok;
|
|
143
212
|
const nestedChecks = summarizeExplicitChecks(checkSource);
|
|
@@ -160,10 +229,10 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
160
229
|
);
|
|
161
230
|
return {
|
|
162
231
|
ok,
|
|
163
|
-
status:
|
|
232
|
+
status: firstStringValue(proofResult.status, profileRiddle.status),
|
|
164
233
|
result_status: publicState.status,
|
|
165
|
-
job_id:
|
|
166
|
-
duration_ms: numberValue(proofResult.duration_ms),
|
|
234
|
+
job_id: firstStringValue(proofResult.job_id, profileRiddle.job_id),
|
|
235
|
+
duration_ms: numberValue(proofResult.duration_ms) ?? numberValue(profileRiddle.elapsed_ms),
|
|
167
236
|
proof_url: stringValue(runResponse.proofUrl),
|
|
168
237
|
preview_id: stringValue(preview.id),
|
|
169
238
|
preview_url: stringValue(preview.preview_url) || stringValue(preview.url),
|
|
@@ -178,8 +247,8 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
178
247
|
merge_recommendation: mergeRecommendation,
|
|
179
248
|
checkpoint_summary: checkpointSummary,
|
|
180
249
|
public_state: publicState,
|
|
181
|
-
passed_checks: nestedChecks.passed,
|
|
182
|
-
failed_checks: nestedChecks.failed,
|
|
250
|
+
passed_checks: profileChecks?.passed ?? nestedChecks.passed,
|
|
251
|
+
failed_checks: profileChecks?.failed ?? nestedChecks.failed,
|
|
183
252
|
pages,
|
|
184
253
|
artifacts,
|
|
185
254
|
primary_image: selectPrimaryImage(artifacts)
|
package/dist/cli/index.js
CHANGED
package/dist/cli.cjs
CHANGED
|
@@ -18034,6 +18034,36 @@ function collectArtifacts(runResponse) {
|
|
|
18034
18034
|
}
|
|
18035
18035
|
return artifacts;
|
|
18036
18036
|
}
|
|
18037
|
+
function collectProfileArtifacts(result) {
|
|
18038
|
+
const resultArtifacts = asRecord2(result.artifacts);
|
|
18039
|
+
const artifacts = [];
|
|
18040
|
+
const seen = /* @__PURE__ */ new Set();
|
|
18041
|
+
for (const [index, item] of asArray(resultArtifacts.riddle_artifacts).entries()) {
|
|
18042
|
+
const artifact = asRecord2(item);
|
|
18043
|
+
const url = stringValue4(artifact.url);
|
|
18044
|
+
if (!url || seen.has(url)) continue;
|
|
18045
|
+
seen.add(url);
|
|
18046
|
+
const fallbackName = stringValue4(artifact.kind) || `artifact-${index + 1}`;
|
|
18047
|
+
const name = artifactDisplayName(artifact.name, fallbackName);
|
|
18048
|
+
artifacts.push({
|
|
18049
|
+
name,
|
|
18050
|
+
url,
|
|
18051
|
+
kind: artifactKind(name, url),
|
|
18052
|
+
size_bytes: numberValue3(artifact.size_bytes) ?? numberValue3(artifact.size)
|
|
18053
|
+
});
|
|
18054
|
+
}
|
|
18055
|
+
return artifacts;
|
|
18056
|
+
}
|
|
18057
|
+
function mergeArtifacts(...artifactLists) {
|
|
18058
|
+
const artifacts = [];
|
|
18059
|
+
const seen = /* @__PURE__ */ new Set();
|
|
18060
|
+
for (const artifact of artifactLists.flat()) {
|
|
18061
|
+
if (seen.has(artifact.url)) continue;
|
|
18062
|
+
seen.add(artifact.url);
|
|
18063
|
+
artifacts.push(artifact);
|
|
18064
|
+
}
|
|
18065
|
+
return artifacts;
|
|
18066
|
+
}
|
|
18037
18067
|
function pageSummaries(result) {
|
|
18038
18068
|
const pages = [];
|
|
18039
18069
|
for (const page of asArray(result.pages)) {
|
|
@@ -18050,6 +18080,35 @@ function pageSummaries(result) {
|
|
|
18050
18080
|
}
|
|
18051
18081
|
return pages;
|
|
18052
18082
|
}
|
|
18083
|
+
function profileCheckCounts(result) {
|
|
18084
|
+
const checks = asArray(result.checks);
|
|
18085
|
+
if (checks.length) {
|
|
18086
|
+
let passed2 = 0;
|
|
18087
|
+
let failed2 = 0;
|
|
18088
|
+
for (const item of checks) {
|
|
18089
|
+
const status = stringValue4(asRecord2(item).status);
|
|
18090
|
+
if (status === "passed") passed2 += 1;
|
|
18091
|
+
if (status === "failed") failed2 += 1;
|
|
18092
|
+
}
|
|
18093
|
+
return { passed: passed2, failed: failed2 };
|
|
18094
|
+
}
|
|
18095
|
+
const checkCounts = asRecord2(result.check_counts);
|
|
18096
|
+
const passed = numberValue3(checkCounts.passed);
|
|
18097
|
+
const failed = numberValue3(checkCounts.failed);
|
|
18098
|
+
if (typeof passed === "number" || typeof failed === "number") {
|
|
18099
|
+
return { passed: passed ?? 0, failed: failed ?? 0 };
|
|
18100
|
+
}
|
|
18101
|
+
return void 0;
|
|
18102
|
+
}
|
|
18103
|
+
function profilePageSummaries(result, counts) {
|
|
18104
|
+
if (!counts) return [];
|
|
18105
|
+
const route = asRecord2(result.route);
|
|
18106
|
+
return [{
|
|
18107
|
+
route: firstStringValue2(route.observed, route.expected_path, route.requested, result.profile_name) || "profile",
|
|
18108
|
+
passed: counts.passed,
|
|
18109
|
+
failed: counts.failed
|
|
18110
|
+
}];
|
|
18111
|
+
}
|
|
18053
18112
|
function summarizeExplicitChecks(value) {
|
|
18054
18113
|
let passed = 0;
|
|
18055
18114
|
let failed = 0;
|
|
@@ -18101,18 +18160,28 @@ function checkpointSummaryFrom2(...values) {
|
|
|
18101
18160
|
};
|
|
18102
18161
|
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
18103
18162
|
}
|
|
18163
|
+
function isProfileResult(result) {
|
|
18164
|
+
const version = stringValue4(result.version);
|
|
18165
|
+
return version === "riddle-proof.profile-result.v1" || version === "riddle-proof.profile-compact-result.v1";
|
|
18166
|
+
}
|
|
18104
18167
|
function summarizeRiddleProofPrComment(input) {
|
|
18105
18168
|
const runResponse = asRecord2(input.runResponse);
|
|
18106
18169
|
const result = asRecord2(input.result);
|
|
18107
18170
|
const proofResult = asRecord2(runResponse.proofResult);
|
|
18171
|
+
const profileResult = isProfileResult(result);
|
|
18172
|
+
const profileRiddle = asRecord2(result.riddle);
|
|
18108
18173
|
const preview = asRecord2(runResponse.preview);
|
|
18109
18174
|
const resultRunCard = asRecord2(result.run_card);
|
|
18110
18175
|
const stopCondition = asRecord2(resultRunCard.stop_condition);
|
|
18111
18176
|
const resultDetails = asRecord2(result.details);
|
|
18112
18177
|
const resultRaw = asRecord2(result.raw);
|
|
18113
18178
|
const rawDetails = asRecord2(resultRaw.details);
|
|
18114
|
-
const
|
|
18115
|
-
const
|
|
18179
|
+
const profileChecks = profileResult ? profileCheckCounts(result) : void 0;
|
|
18180
|
+
const artifacts = mergeArtifacts(
|
|
18181
|
+
collectArtifacts(runResponse),
|
|
18182
|
+
profileResult ? collectProfileArtifacts(result) : []
|
|
18183
|
+
);
|
|
18184
|
+
const pages = profileResult ? profilePageSummaries(result, profileChecks) : pageSummaries(result);
|
|
18116
18185
|
const checkSource = { ...result };
|
|
18117
18186
|
delete checkSource.ok;
|
|
18118
18187
|
const nestedChecks = summarizeExplicitChecks(checkSource);
|
|
@@ -18135,10 +18204,10 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
18135
18204
|
);
|
|
18136
18205
|
return {
|
|
18137
18206
|
ok,
|
|
18138
|
-
status:
|
|
18207
|
+
status: firstStringValue2(proofResult.status, profileRiddle.status),
|
|
18139
18208
|
result_status: publicState.status,
|
|
18140
|
-
job_id:
|
|
18141
|
-
duration_ms: numberValue3(proofResult.duration_ms),
|
|
18209
|
+
job_id: firstStringValue2(proofResult.job_id, profileRiddle.job_id),
|
|
18210
|
+
duration_ms: numberValue3(proofResult.duration_ms) ?? numberValue3(profileRiddle.elapsed_ms),
|
|
18142
18211
|
proof_url: stringValue4(runResponse.proofUrl),
|
|
18143
18212
|
preview_id: stringValue4(preview.id),
|
|
18144
18213
|
preview_url: stringValue4(preview.preview_url) || stringValue4(preview.url),
|
|
@@ -18153,8 +18222,8 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
18153
18222
|
merge_recommendation: mergeRecommendation,
|
|
18154
18223
|
checkpoint_summary: checkpointSummary,
|
|
18155
18224
|
public_state: publicState,
|
|
18156
|
-
passed_checks: nestedChecks.passed,
|
|
18157
|
-
failed_checks: nestedChecks.failed,
|
|
18225
|
+
passed_checks: profileChecks?.passed ?? nestedChecks.passed,
|
|
18226
|
+
failed_checks: profileChecks?.failed ?? nestedChecks.failed,
|
|
18158
18227
|
pages,
|
|
18159
18228
|
artifacts,
|
|
18160
18229
|
primary_image: selectPrimaryImage(artifacts)
|
|
@@ -23125,12 +23194,17 @@ async function main() {
|
|
|
23125
23194
|
}
|
|
23126
23195
|
if (command === "pr-comment") {
|
|
23127
23196
|
const proofDir = optionString(options, "proofDir") || optionString(options, "outputDir") || positional[1];
|
|
23128
|
-
const
|
|
23129
|
-
const
|
|
23197
|
+
const explicitRunResponsePath = optionString(options, "runResponse");
|
|
23198
|
+
const explicitResultJsonPath = optionString(options, "resultJson");
|
|
23199
|
+
const runResponsePath = explicitRunResponsePath || defaultProofDirJsonPath(proofDir, "riddle-run-response.json");
|
|
23200
|
+
const resultJsonPaths = explicitResultJsonPath ? [explicitResultJsonPath] : [
|
|
23201
|
+
defaultProofDirJsonPath(proofDir, "result.json"),
|
|
23202
|
+
defaultProofDirJsonPath(proofDir, "profile-result.json")
|
|
23203
|
+
];
|
|
23130
23204
|
const runResponse = readJsonFileIfExists(runResponsePath);
|
|
23131
|
-
const result = readJsonFileIfExists(
|
|
23205
|
+
const result = resultJsonPaths.map((candidate) => readJsonFileIfExists(candidate)).find(Boolean);
|
|
23132
23206
|
if (!runResponse && !result) {
|
|
23133
|
-
throw new Error("pr-comment requires --proof-dir with riddle-run-response.json
|
|
23207
|
+
throw new Error("pr-comment requires --proof-dir with riddle-run-response.json, result.json, or profile-result.json, or explicit --run-response/--result-json.");
|
|
23134
23208
|
}
|
|
23135
23209
|
const body = buildRiddleProofPrCommentMarkdown({
|
|
23136
23210
|
title: optionString(options, "title"),
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./chunk-
|
|
2
|
+
import "./chunk-AF3KFD4A.js";
|
|
3
3
|
import "./chunk-B2DP2LET.js";
|
|
4
|
-
import "./chunk-
|
|
4
|
+
import "./chunk-DTFSHRV5.js";
|
|
5
5
|
import "./chunk-5Y4V2IXI.js";
|
|
6
6
|
import "./chunk-EX7TO4I5.js";
|
|
7
7
|
import "./chunk-P4BHU5NM.js";
|
package/dist/index.cjs
CHANGED
|
@@ -20501,6 +20501,36 @@ function collectArtifacts(runResponse) {
|
|
|
20501
20501
|
}
|
|
20502
20502
|
return artifacts;
|
|
20503
20503
|
}
|
|
20504
|
+
function collectProfileArtifacts(result) {
|
|
20505
|
+
const resultArtifacts = asRecord2(result.artifacts);
|
|
20506
|
+
const artifacts = [];
|
|
20507
|
+
const seen = /* @__PURE__ */ new Set();
|
|
20508
|
+
for (const [index, item] of asArray(resultArtifacts.riddle_artifacts).entries()) {
|
|
20509
|
+
const artifact = asRecord2(item);
|
|
20510
|
+
const url = stringValue7(artifact.url);
|
|
20511
|
+
if (!url || seen.has(url)) continue;
|
|
20512
|
+
seen.add(url);
|
|
20513
|
+
const fallbackName = stringValue7(artifact.kind) || `artifact-${index + 1}`;
|
|
20514
|
+
const name = artifactDisplayName(artifact.name, fallbackName);
|
|
20515
|
+
artifacts.push({
|
|
20516
|
+
name,
|
|
20517
|
+
url,
|
|
20518
|
+
kind: artifactKind(name, url),
|
|
20519
|
+
size_bytes: numberValue5(artifact.size_bytes) ?? numberValue5(artifact.size)
|
|
20520
|
+
});
|
|
20521
|
+
}
|
|
20522
|
+
return artifacts;
|
|
20523
|
+
}
|
|
20524
|
+
function mergeArtifacts(...artifactLists) {
|
|
20525
|
+
const artifacts = [];
|
|
20526
|
+
const seen = /* @__PURE__ */ new Set();
|
|
20527
|
+
for (const artifact of artifactLists.flat()) {
|
|
20528
|
+
if (seen.has(artifact.url)) continue;
|
|
20529
|
+
seen.add(artifact.url);
|
|
20530
|
+
artifacts.push(artifact);
|
|
20531
|
+
}
|
|
20532
|
+
return artifacts;
|
|
20533
|
+
}
|
|
20504
20534
|
function pageSummaries(result) {
|
|
20505
20535
|
const pages = [];
|
|
20506
20536
|
for (const page of asArray(result.pages)) {
|
|
@@ -20517,6 +20547,35 @@ function pageSummaries(result) {
|
|
|
20517
20547
|
}
|
|
20518
20548
|
return pages;
|
|
20519
20549
|
}
|
|
20550
|
+
function profileCheckCounts(result) {
|
|
20551
|
+
const checks = asArray(result.checks);
|
|
20552
|
+
if (checks.length) {
|
|
20553
|
+
let passed2 = 0;
|
|
20554
|
+
let failed2 = 0;
|
|
20555
|
+
for (const item of checks) {
|
|
20556
|
+
const status = stringValue7(asRecord2(item).status);
|
|
20557
|
+
if (status === "passed") passed2 += 1;
|
|
20558
|
+
if (status === "failed") failed2 += 1;
|
|
20559
|
+
}
|
|
20560
|
+
return { passed: passed2, failed: failed2 };
|
|
20561
|
+
}
|
|
20562
|
+
const checkCounts = asRecord2(result.check_counts);
|
|
20563
|
+
const passed = numberValue5(checkCounts.passed);
|
|
20564
|
+
const failed = numberValue5(checkCounts.failed);
|
|
20565
|
+
if (typeof passed === "number" || typeof failed === "number") {
|
|
20566
|
+
return { passed: passed ?? 0, failed: failed ?? 0 };
|
|
20567
|
+
}
|
|
20568
|
+
return void 0;
|
|
20569
|
+
}
|
|
20570
|
+
function profilePageSummaries(result, counts) {
|
|
20571
|
+
if (!counts) return [];
|
|
20572
|
+
const route = asRecord2(result.route);
|
|
20573
|
+
return [{
|
|
20574
|
+
route: firstStringValue2(route.observed, route.expected_path, route.requested, result.profile_name) || "profile",
|
|
20575
|
+
passed: counts.passed,
|
|
20576
|
+
failed: counts.failed
|
|
20577
|
+
}];
|
|
20578
|
+
}
|
|
20520
20579
|
function summarizeExplicitChecks(value) {
|
|
20521
20580
|
let passed = 0;
|
|
20522
20581
|
let failed = 0;
|
|
@@ -20568,18 +20627,28 @@ function checkpointSummaryFrom2(...values) {
|
|
|
20568
20627
|
};
|
|
20569
20628
|
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
20570
20629
|
}
|
|
20630
|
+
function isProfileResult(result) {
|
|
20631
|
+
const version = stringValue7(result.version);
|
|
20632
|
+
return version === "riddle-proof.profile-result.v1" || version === "riddle-proof.profile-compact-result.v1";
|
|
20633
|
+
}
|
|
20571
20634
|
function summarizeRiddleProofPrComment(input) {
|
|
20572
20635
|
const runResponse = asRecord2(input.runResponse);
|
|
20573
20636
|
const result = asRecord2(input.result);
|
|
20574
20637
|
const proofResult = asRecord2(runResponse.proofResult);
|
|
20638
|
+
const profileResult = isProfileResult(result);
|
|
20639
|
+
const profileRiddle = asRecord2(result.riddle);
|
|
20575
20640
|
const preview = asRecord2(runResponse.preview);
|
|
20576
20641
|
const resultRunCard = asRecord2(result.run_card);
|
|
20577
20642
|
const stopCondition = asRecord2(resultRunCard.stop_condition);
|
|
20578
20643
|
const resultDetails = asRecord2(result.details);
|
|
20579
20644
|
const resultRaw = asRecord2(result.raw);
|
|
20580
20645
|
const rawDetails = asRecord2(resultRaw.details);
|
|
20581
|
-
const
|
|
20582
|
-
const
|
|
20646
|
+
const profileChecks = profileResult ? profileCheckCounts(result) : void 0;
|
|
20647
|
+
const artifacts = mergeArtifacts(
|
|
20648
|
+
collectArtifacts(runResponse),
|
|
20649
|
+
profileResult ? collectProfileArtifacts(result) : []
|
|
20650
|
+
);
|
|
20651
|
+
const pages = profileResult ? profilePageSummaries(result, profileChecks) : pageSummaries(result);
|
|
20583
20652
|
const checkSource = { ...result };
|
|
20584
20653
|
delete checkSource.ok;
|
|
20585
20654
|
const nestedChecks = summarizeExplicitChecks(checkSource);
|
|
@@ -20602,10 +20671,10 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
20602
20671
|
);
|
|
20603
20672
|
return {
|
|
20604
20673
|
ok,
|
|
20605
|
-
status:
|
|
20674
|
+
status: firstStringValue2(proofResult.status, profileRiddle.status),
|
|
20606
20675
|
result_status: publicState.status,
|
|
20607
|
-
job_id:
|
|
20608
|
-
duration_ms: numberValue5(proofResult.duration_ms),
|
|
20676
|
+
job_id: firstStringValue2(proofResult.job_id, profileRiddle.job_id),
|
|
20677
|
+
duration_ms: numberValue5(proofResult.duration_ms) ?? numberValue5(profileRiddle.elapsed_ms),
|
|
20609
20678
|
proof_url: stringValue7(runResponse.proofUrl),
|
|
20610
20679
|
preview_id: stringValue7(preview.id),
|
|
20611
20680
|
preview_url: stringValue7(preview.preview_url) || stringValue7(preview.url),
|
|
@@ -20620,8 +20689,8 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
20620
20689
|
merge_recommendation: mergeRecommendation,
|
|
20621
20690
|
checkpoint_summary: checkpointSummary,
|
|
20622
20691
|
public_state: publicState,
|
|
20623
|
-
passed_checks: nestedChecks.passed,
|
|
20624
|
-
failed_checks: nestedChecks.failed,
|
|
20692
|
+
passed_checks: profileChecks?.passed ?? nestedChecks.passed,
|
|
20693
|
+
failed_checks: profileChecks?.failed ?? nestedChecks.failed,
|
|
20625
20694
|
pages,
|
|
20626
20695
|
artifacts,
|
|
20627
20696
|
primary_image: selectPrimaryImage(artifacts)
|
package/dist/index.js
CHANGED
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
RIDDLE_PROOF_PR_COMMENT_MARKER,
|
|
61
61
|
buildRiddleProofPrCommentMarkdown,
|
|
62
62
|
summarizeRiddleProofPrComment
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-DTFSHRV5.js";
|
|
64
64
|
import {
|
|
65
65
|
RIDDLE_PROOF_PROFILE_SUGGESTIONS_VERSION,
|
|
66
66
|
suggestRiddleProofProfileChecks
|
package/dist/pr-comment.cjs
CHANGED
|
@@ -242,6 +242,36 @@ function collectArtifacts(runResponse) {
|
|
|
242
242
|
}
|
|
243
243
|
return artifacts;
|
|
244
244
|
}
|
|
245
|
+
function collectProfileArtifacts(result) {
|
|
246
|
+
const resultArtifacts = asRecord2(result.artifacts);
|
|
247
|
+
const artifacts = [];
|
|
248
|
+
const seen = /* @__PURE__ */ new Set();
|
|
249
|
+
for (const [index, item] of asArray(resultArtifacts.riddle_artifacts).entries()) {
|
|
250
|
+
const artifact = asRecord2(item);
|
|
251
|
+
const url = stringValue2(artifact.url);
|
|
252
|
+
if (!url || seen.has(url)) continue;
|
|
253
|
+
seen.add(url);
|
|
254
|
+
const fallbackName = stringValue2(artifact.kind) || `artifact-${index + 1}`;
|
|
255
|
+
const name = artifactDisplayName(artifact.name, fallbackName);
|
|
256
|
+
artifacts.push({
|
|
257
|
+
name,
|
|
258
|
+
url,
|
|
259
|
+
kind: artifactKind(name, url),
|
|
260
|
+
size_bytes: numberValue2(artifact.size_bytes) ?? numberValue2(artifact.size)
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
return artifacts;
|
|
264
|
+
}
|
|
265
|
+
function mergeArtifacts(...artifactLists) {
|
|
266
|
+
const artifacts = [];
|
|
267
|
+
const seen = /* @__PURE__ */ new Set();
|
|
268
|
+
for (const artifact of artifactLists.flat()) {
|
|
269
|
+
if (seen.has(artifact.url)) continue;
|
|
270
|
+
seen.add(artifact.url);
|
|
271
|
+
artifacts.push(artifact);
|
|
272
|
+
}
|
|
273
|
+
return artifacts;
|
|
274
|
+
}
|
|
245
275
|
function pageSummaries(result) {
|
|
246
276
|
const pages = [];
|
|
247
277
|
for (const page of asArray(result.pages)) {
|
|
@@ -258,6 +288,35 @@ function pageSummaries(result) {
|
|
|
258
288
|
}
|
|
259
289
|
return pages;
|
|
260
290
|
}
|
|
291
|
+
function profileCheckCounts(result) {
|
|
292
|
+
const checks = asArray(result.checks);
|
|
293
|
+
if (checks.length) {
|
|
294
|
+
let passed2 = 0;
|
|
295
|
+
let failed2 = 0;
|
|
296
|
+
for (const item of checks) {
|
|
297
|
+
const status = stringValue2(asRecord2(item).status);
|
|
298
|
+
if (status === "passed") passed2 += 1;
|
|
299
|
+
if (status === "failed") failed2 += 1;
|
|
300
|
+
}
|
|
301
|
+
return { passed: passed2, failed: failed2 };
|
|
302
|
+
}
|
|
303
|
+
const checkCounts = asRecord2(result.check_counts);
|
|
304
|
+
const passed = numberValue2(checkCounts.passed);
|
|
305
|
+
const failed = numberValue2(checkCounts.failed);
|
|
306
|
+
if (typeof passed === "number" || typeof failed === "number") {
|
|
307
|
+
return { passed: passed ?? 0, failed: failed ?? 0 };
|
|
308
|
+
}
|
|
309
|
+
return void 0;
|
|
310
|
+
}
|
|
311
|
+
function profilePageSummaries(result, counts) {
|
|
312
|
+
if (!counts) return [];
|
|
313
|
+
const route = asRecord2(result.route);
|
|
314
|
+
return [{
|
|
315
|
+
route: firstStringValue2(route.observed, route.expected_path, route.requested, result.profile_name) || "profile",
|
|
316
|
+
passed: counts.passed,
|
|
317
|
+
failed: counts.failed
|
|
318
|
+
}];
|
|
319
|
+
}
|
|
261
320
|
function summarizeExplicitChecks(value) {
|
|
262
321
|
let passed = 0;
|
|
263
322
|
let failed = 0;
|
|
@@ -309,18 +368,28 @@ function checkpointSummaryFrom2(...values) {
|
|
|
309
368
|
};
|
|
310
369
|
return Object.values(summary).some((value) => typeof value !== "undefined") ? summary : void 0;
|
|
311
370
|
}
|
|
371
|
+
function isProfileResult(result) {
|
|
372
|
+
const version = stringValue2(result.version);
|
|
373
|
+
return version === "riddle-proof.profile-result.v1" || version === "riddle-proof.profile-compact-result.v1";
|
|
374
|
+
}
|
|
312
375
|
function summarizeRiddleProofPrComment(input) {
|
|
313
376
|
const runResponse = asRecord2(input.runResponse);
|
|
314
377
|
const result = asRecord2(input.result);
|
|
315
378
|
const proofResult = asRecord2(runResponse.proofResult);
|
|
379
|
+
const profileResult = isProfileResult(result);
|
|
380
|
+
const profileRiddle = asRecord2(result.riddle);
|
|
316
381
|
const preview = asRecord2(runResponse.preview);
|
|
317
382
|
const resultRunCard = asRecord2(result.run_card);
|
|
318
383
|
const stopCondition = asRecord2(resultRunCard.stop_condition);
|
|
319
384
|
const resultDetails = asRecord2(result.details);
|
|
320
385
|
const resultRaw = asRecord2(result.raw);
|
|
321
386
|
const rawDetails = asRecord2(resultRaw.details);
|
|
322
|
-
const
|
|
323
|
-
const
|
|
387
|
+
const profileChecks = profileResult ? profileCheckCounts(result) : void 0;
|
|
388
|
+
const artifacts = mergeArtifacts(
|
|
389
|
+
collectArtifacts(runResponse),
|
|
390
|
+
profileResult ? collectProfileArtifacts(result) : []
|
|
391
|
+
);
|
|
392
|
+
const pages = profileResult ? profilePageSummaries(result, profileChecks) : pageSummaries(result);
|
|
324
393
|
const checkSource = { ...result };
|
|
325
394
|
delete checkSource.ok;
|
|
326
395
|
const nestedChecks = summarizeExplicitChecks(checkSource);
|
|
@@ -343,10 +412,10 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
343
412
|
);
|
|
344
413
|
return {
|
|
345
414
|
ok,
|
|
346
|
-
status:
|
|
415
|
+
status: firstStringValue2(proofResult.status, profileRiddle.status),
|
|
347
416
|
result_status: publicState.status,
|
|
348
|
-
job_id:
|
|
349
|
-
duration_ms: numberValue2(proofResult.duration_ms),
|
|
417
|
+
job_id: firstStringValue2(proofResult.job_id, profileRiddle.job_id),
|
|
418
|
+
duration_ms: numberValue2(proofResult.duration_ms) ?? numberValue2(profileRiddle.elapsed_ms),
|
|
350
419
|
proof_url: stringValue2(runResponse.proofUrl),
|
|
351
420
|
preview_id: stringValue2(preview.id),
|
|
352
421
|
preview_url: stringValue2(preview.preview_url) || stringValue2(preview.url),
|
|
@@ -361,8 +430,8 @@ function summarizeRiddleProofPrComment(input) {
|
|
|
361
430
|
merge_recommendation: mergeRecommendation,
|
|
362
431
|
checkpoint_summary: checkpointSummary,
|
|
363
432
|
public_state: publicState,
|
|
364
|
-
passed_checks: nestedChecks.passed,
|
|
365
|
-
failed_checks: nestedChecks.failed,
|
|
433
|
+
passed_checks: profileChecks?.passed ?? nestedChecks.passed,
|
|
434
|
+
failed_checks: profileChecks?.failed ?? nestedChecks.failed,
|
|
366
435
|
pages,
|
|
367
436
|
artifacts,
|
|
368
437
|
primary_image: selectPrimaryImage(artifacts)
|
package/dist/pr-comment.js
CHANGED
|
@@ -4,6 +4,11 @@
|
|
|
4
4
|
It is meant to keep broad user-story sweeps evidence-backed and reviewable
|
|
5
5
|
without turning them into unbounded scaffolding.
|
|
6
6
|
|
|
7
|
+
`riddle-proof-ux-coverage.csv` is the spreadsheet view of the same loop. Open it
|
|
8
|
+
in a spreadsheet editor when you want the "status bar" view: surface, user story,
|
|
9
|
+
expected behavior, runner, required evidence, last result, finding, next action,
|
|
10
|
+
and priority.
|
|
11
|
+
|
|
7
12
|
Each story names:
|
|
8
13
|
|
|
9
14
|
- the Riddle Proof surface under test
|
|
@@ -15,3 +20,11 @@ Each story names:
|
|
|
15
20
|
|
|
16
21
|
Use one batch at a time, save outputs under `artifacts/riddle-proof/<story-id>/`,
|
|
17
22
|
fix only high-signal failures, and rerun the same batch before expanding scope.
|
|
23
|
+
|
|
24
|
+
Use the CSV to choose the next batch:
|
|
25
|
+
|
|
26
|
+
- `passed`, `product_regression_expected`, and `found_fixed` rows need receipts
|
|
27
|
+
in `artifact_or_pr`.
|
|
28
|
+
- `ready_to_run` rows are good next targets for live dogfood passes.
|
|
29
|
+
- `needs_product_hook` rows point to product surfaces that need an import, shared
|
|
30
|
+
contract, or manual proof-view smoke before they can become recurring.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
area,user_story_id,user_story,expected_behavior,surface,runner,evidence_required,last_result,last_run,artifact_or_pr,finding,next_action,priority,failure_class
|
|
2
|
+
"Authoring","rp-story-profile-suggest-drafts-not-verdicts","As a proof author, I can ask for suggested checks without accidentally treating the suggestion as proof.","Output is a draft profile only; it contains no passed, product_regression, or proof_insufficient verdict.","profile-suggest","local-cli","Generated profile; absence of proof verdict; saved stdout or draft path","passed","2026-06-21","docs/riddle-proof-story-matrix-runs/2026-06-21-initial-batch.md","Authoring boundary held: suggestions stayed drafts.","Promote after one more route-specific use against a real product change.","P2","doc_or_ux_gap"
|
|
3
|
+
"Local core","rp-story-local-core-trust-boundary","As a framework maintainer, I can validate core trust-boundary behavior without hosted infrastructure.","Local core regression pack passes route, query/hash, thrown-error, missing-selector, and no-diff cases.","regression-pack local core","local-core","regression-pack-result.json; required cases present; forbidden terminal markers absent","passed","2026-06-21","docs/riddle-proof-story-matrix-runs/2026-06-21-initial-batch.md","Core contracts are covered by a repeatable local suite.","Keep recurring and run before hosted batches.","P1","contract_gap"
|
|
4
|
+
"Hosted run","rp-story-hosted-happy-path-produces-artifacts","As a maintainer, I can run a hosted profile against a live route and receive evidence-backed artifacts.","Hosted run-profile returns passed and writes profile-result, summary, proof JSON, console, DOM summary, and screenshots.","run-profile hosted runner","hosted-riddle","profile-result.json; proof.json; screenshot; riddle.job_id","passed","2026-06-21","job_366d440b","Hosted happy path passed with 5/5 checks and artifact links.","Keep recurring; reuse as known-good packet for reporting and recovery checks.","P1","product_regression"
|
|
5
|
+
"Hosted negative control","rp-story-hosted-negative-control-stays-regression","As a maintainer, I can run a deliberate missing-selector profile and see product_regression instead of a false pass.","Negative control returns product_regression with failed-check evidence and artifacts.","run-profile hosted runner","hosted-riddle","profile-result.json; failed check; summary.md; console.json","product_regression_expected","2026-06-21","job_9f446230","Negative control stayed red: 1 passed / 1 failed.","Keep recurring next to hosted happy path.","P1","contract_gap"
|
|
6
|
+
"Cold start","rp-story-cold-start-does-not-duplicate-too-soon","As a hosted runner user, I can submit work while workers are scaled to zero without the client declaring the job stale too early.","Client waits through accepted worker cold-start latency and reports worker-wake progress.","hosted worker cold start","hosted-riddle","progress output; profile-result.json; queue/pre-submission timing","passed","2026-06-21","job_366d440b","Cold start waited about 165 seconds and completed without duplicate retry.","Run occasionally after infra changes; do not wait an hour for every batch.","P2","environment_blocked"
|
|
7
|
+
"Reporting","rp-story-pr-comment-renders-only-evidence-backed-status","As a reviewer, I can get a PR comment whose status, checks, screenshot, and links reflect the saved proof packet.","PR comment reads profile-result.json, uses profile check statuses, and links hosted artifacts.","pr-comment","local-cli","pr-comment-body.md; profile-result.json; screenshot/artifact links","found_fixed","2026-06-21","PR #947","Found real bug: profile packets were rejected or miscounted as 4 passed / 12 failed.","Keep recurring; replay against happy-path and negative-control packets.","P0","contract_gap"
|
|
8
|
+
"Artifact promotion","rp-story-profile-body-assertions-derive-from-real-artifact","As a profile promoter, I can derive body assertions from a real artifact before making a public claim.","Body assertion command emits present fragments and exits nonzero for missing required fragments.","profile-body-assertions","local-cli","body assertion output; nonzero missing-required case","passed","2026-06-21","docs/riddle-proof-story-matrix-runs/2026-06-21-initial-batch.md","Positive and missing-required cases behaved as a real gate.","Use when promoting public proof/profile claims.","P2","proof_insufficient"
|
|
9
|
+
"Artifact publication","rp-story-http-preflight-catches-publication-mismatch","As a publisher, I can preflight public artifact URLs before spending hosted browser time.","Preflight checks status, content type, bytes, required body fragments, forbidden body text, and JSON assertions.","profile-http-status-preflight","local-cli","preflight JSON; failed missing-fragment negative control","passed","2026-06-21","https://cdn.riddledc.com/scripts/job_366d440b/proof.json.json","Live CDN artifact passed positive checks; missing fragment failed clearly.","Keep as the cheap gate before broad hosted runs.","P1","product_regression"
|
|
10
|
+
"Recovery","rp-story-run-profile-recover-preserves-artifacts","As a user whose local process was interrupted, I can recover a hosted job and still get the proof artifacts and summary.","Recover preserves the original job id and writes profile-result, summary, proof JSON, console, DOM summary, and screenshot references.","run-profile recover","hosted-riddle","recovered profile-result.json; summary.md; proof.json; preserved job id","passed","2026-06-21","job_366d440b","Recovery reconstructed the hosted happy-path packet from the old job id.","Keep as recurring for interrupted-run confidence.","P2","environment_blocked"
|
|
11
|
+
"Package install","rp-ux-published-bin-resolves","As a new user, I can invoke the published package binary from a clean temporary directory.","npm exec resolves riddle-proof-loop and prints CLI help when npm is on PATH.","published package bin","npm-exec","npm exec output; package version","passed","2026-06-21","@riddledc/riddle-proof@0.8.68","Earlier command-not-found was local PATH, not a package bin defect.","Repeat after package metadata or bin changes.","P2","configuration_error"
|
|
12
|
+
"Local browser","rp-ux-local-playwright-runner-smoke","As a user avoiding hosted infra, I can run the local Playwright runner and receive the same profile-result contract shape.","riddle-proof-playwright writes profile-result.json, proof.json, console.json, dom-summary.json, summary.md, and artifact-manifest.json.","@riddledc/riddle-proof-runner-playwright","local-playwright","profile-result.json; artifact-manifest.json; screenshot or DOM evidence","passed","2026-06-21","docs/riddle-proof-story-matrix-runs/2026-06-21-ux-coverage-batch.md","Live local Playwright smoke passed against riddledc.com/proof with 5/5 checks.","Keep as local-vs-hosted parity smoke; rerun after runner package changes.","P1","configuration_error"
|
|
13
|
+
"Viewport matrices","rp-story-viewport-aggregate-does-not-hide-child-failure","As a maintainer running viewport matrices, I can aggregate child runs without losing the failing viewport.","Aggregate returns the worst child verdict, lists child outputs, and separates summed poll time from max child latency.","run-profile aggregate","local-cli","child profile-result files; aggregate profile-result.json; summary.md","product_regression_expected","2026-06-21","docs/riddle-proof-story-matrix-runs/2026-06-21-ux-coverage-batch.md","Aggregate preserved the phone child product_regression via split_viewport_children.","Keep as a recurring negative-control aggregate using one passing child and one failing child.","P1","contract_gap"
|
|
14
|
+
"Formal contract","rp-story-formal-kernel-matches-runtime-contract","As a framework maintainer, I can prove the status/result contract that runtime tests depend on.","Lean kernel builds and runtime conformance tests mirror the formal contract cases.","formal/riddle-proof-kernel","lean-kernel","lake build; formal-conformance test log","passed","2026-06-21","PR #947 CI formal-kernel","Formal layer stayed in contract-hardening path, not runtime evidence collection.","Keep recurring when status semantics change.","P2","contract_gap"
|
|
15
|
+
"Hosted proof view","rp-story-hosted-proof-view-uses-contract","As a hosted proof viewer, I see contract-derived status, artifacts, and missing-evidence explanations rather than raw backend fields.","Hosted proof renderer uses the same consumer-surface contract as PR comments and summaries.","hosted proof renderer","manual-review","manual review note; screenshot; passed and negative-control packets","needs_product_hook","","","Still not proven end-to-end through the hosted proof view UI.","Inspect renderer imports and run passed plus negative-control view smoke.","P1","contract_gap"
|
|
16
|
+
"Agent summary","rp-ux-agent-summary-uses-contract","As an agent consuming Riddle Proof output, I see the same evidence-backed status language as reviewers.","Agent-facing summaries use shared public-state/consumer-surface contract and avoid raw-field overclaiming.","agent-facing summary","manual-review","summary text; contract import or documented gap; negative-control packet","needs_product_hook","","","Still not proven outside PR comments.","Find agent summary renderer and wire or verify shared contract usage.","P1","contract_gap"
|
|
17
|
+
"Release and publish","rp-ux-release-publish-flow","As a package maintainer, I can merge a fix, get a version PR, and publish the package without manual status fakery.","Changeset release PR validates, merges, and trusted npm publish updates latest.","changesets release","github-actions","release PR; Release workflow; npm view latest","passed","2026-06-21","@riddledc/riddle-proof@0.8.68","Release path worked for the reporting fix and published with provenance.","Keep GitHub Action noise low and use this as release smoke.","P2","environment_blocked"
|