@riddledc/riddle-proof 0.7.142 → 0.7.144
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-66RDQVFI.js → chunk-LFFTWXLB.js} +40 -2
- package/dist/cli.cjs +127 -5
- package/dist/cli.js +88 -4
- package/dist/index.cjs +40 -2
- package/dist/index.js +1 -1
- package/dist/profile.cjs +40 -2
- package/dist/profile.d.cts +8 -0
- package/dist/profile.d.ts +8 -0
- package/dist/profile.js +1 -1
- package/package.json +1 -1
|
@@ -2044,6 +2044,20 @@ function summarizeRouteInventory(viewport, inventory) {
|
|
|
2044
2044
|
failure_count: failures.length
|
|
2045
2045
|
};
|
|
2046
2046
|
}
|
|
2047
|
+
function routeInventoryExpectedRouteSummaries(value, fallback) {
|
|
2048
|
+
const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
|
|
2049
|
+
return rawRoutes.map((route) => {
|
|
2050
|
+
if (typeof route === "string") {
|
|
2051
|
+
const path2 = route.trim();
|
|
2052
|
+
return path2 ? { path: path2 } : void 0;
|
|
2053
|
+
}
|
|
2054
|
+
if (!isRecord(route)) return void 0;
|
|
2055
|
+
const path = stringValue(route.path);
|
|
2056
|
+
if (!path) return void 0;
|
|
2057
|
+
const name = stringValue(route.name);
|
|
2058
|
+
return name ? { name, path } : { path };
|
|
2059
|
+
}).filter((route) => Boolean(route));
|
|
2060
|
+
}
|
|
2047
2061
|
function matchText(sample, check) {
|
|
2048
2062
|
if (check.pattern) {
|
|
2049
2063
|
try {
|
|
@@ -2645,7 +2659,10 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
2645
2659
|
type: check.type,
|
|
2646
2660
|
label: checkLabel(check),
|
|
2647
2661
|
status: "failed",
|
|
2648
|
-
evidence: {
|
|
2662
|
+
evidence: {
|
|
2663
|
+
expected_count: check.expected_routes?.length || 0,
|
|
2664
|
+
expected_routes: routeInventoryExpectedRouteSummaries(void 0, check.expected_routes)
|
|
2665
|
+
},
|
|
2649
2666
|
message: "No route inventory evidence was captured."
|
|
2650
2667
|
};
|
|
2651
2668
|
}
|
|
@@ -2658,12 +2675,14 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
2658
2675
|
const sourceUniqueLinkCount = numberValue(first?.source_unique_link_count) ?? numberValue(first?.home_unique_game_link_count) ?? null;
|
|
2659
2676
|
const duplicateSourceLinks = Array.isArray(first?.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
|
|
2660
2677
|
const duplicateSourceLinkCount = numberValue(first?.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
|
|
2678
|
+
const expectedRoutes = routeInventoryExpectedRouteSummaries(first?.expected_routes, check.expected_routes);
|
|
2661
2679
|
return {
|
|
2662
2680
|
type: check.type,
|
|
2663
2681
|
label: checkLabel(check),
|
|
2664
2682
|
status: failures.length ? "failed" : "passed",
|
|
2665
2683
|
evidence: {
|
|
2666
2684
|
expected_count: check.expected_routes?.length || 0,
|
|
2685
|
+
expected_routes: expectedRoutes,
|
|
2667
2686
|
source_link_count: sourceLinkCount,
|
|
2668
2687
|
source_unique_link_count: sourceUniqueLinkCount,
|
|
2669
2688
|
duplicate_source_link_count: duplicateSourceLinkCount,
|
|
@@ -3670,6 +3689,20 @@ function summarizeRouteInventory(viewport, inventory) {
|
|
|
3670
3689
|
failure_count: failures.length,
|
|
3671
3690
|
};
|
|
3672
3691
|
}
|
|
3692
|
+
function routeInventoryExpectedRouteSummaries(value, fallback) {
|
|
3693
|
+
const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
|
|
3694
|
+
return rawRoutes.map((route) => {
|
|
3695
|
+
if (typeof route === "string") {
|
|
3696
|
+
const path = route.trim();
|
|
3697
|
+
return path ? { path } : null;
|
|
3698
|
+
}
|
|
3699
|
+
if (!route || typeof route !== "object" || Array.isArray(route)) return null;
|
|
3700
|
+
const path = typeof route.path === "string" && route.path.trim() ? route.path.trim() : "";
|
|
3701
|
+
if (!path) return null;
|
|
3702
|
+
const name = typeof route.name === "string" && route.name.trim() ? route.name.trim() : "";
|
|
3703
|
+
return name ? { name, path } : { path };
|
|
3704
|
+
}).filter(Boolean);
|
|
3705
|
+
}
|
|
3673
3706
|
function numberValue(value) {
|
|
3674
3707
|
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
3675
3708
|
}
|
|
@@ -4497,7 +4530,10 @@ function assessProfile(profile, evidence) {
|
|
|
4497
4530
|
type: check.type,
|
|
4498
4531
|
label: check.label || check.type,
|
|
4499
4532
|
status: "failed",
|
|
4500
|
-
evidence: {
|
|
4533
|
+
evidence: {
|
|
4534
|
+
expected_count: (check.expected_routes || []).length,
|
|
4535
|
+
expected_routes: routeInventoryExpectedRouteSummaries(undefined, check.expected_routes),
|
|
4536
|
+
},
|
|
4501
4537
|
message: "No route inventory evidence was captured.",
|
|
4502
4538
|
});
|
|
4503
4539
|
continue;
|
|
@@ -4516,12 +4552,14 @@ function assessProfile(profile, evidence) {
|
|
|
4516
4552
|
const sourceUniqueLinkCount = typeof first.source_unique_link_count === "number" ? first.source_unique_link_count : typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : null;
|
|
4517
4553
|
const duplicateSourceLinks = Array.isArray(first.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
|
|
4518
4554
|
const duplicateSourceLinkCount = typeof first.duplicate_source_link_count === "number" ? first.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
|
|
4555
|
+
const expectedRoutes = routeInventoryExpectedRouteSummaries(first.expected_routes, check.expected_routes);
|
|
4519
4556
|
checks.push({
|
|
4520
4557
|
type: check.type,
|
|
4521
4558
|
label: check.label || check.type,
|
|
4522
4559
|
status: failures.length ? "failed" : "passed",
|
|
4523
4560
|
evidence: {
|
|
4524
4561
|
expected_count: (check.expected_routes || []).length,
|
|
4562
|
+
expected_routes: expectedRoutes,
|
|
4525
4563
|
source_link_count: sourceLinkCount,
|
|
4526
4564
|
source_unique_link_count: sourceUniqueLinkCount,
|
|
4527
4565
|
duplicate_source_link_count: duplicateSourceLinkCount,
|
package/dist/cli.cjs
CHANGED
|
@@ -8981,6 +8981,20 @@ function summarizeRouteInventory(viewport, inventory) {
|
|
|
8981
8981
|
failure_count: failures.length
|
|
8982
8982
|
};
|
|
8983
8983
|
}
|
|
8984
|
+
function routeInventoryExpectedRouteSummaries(value, fallback) {
|
|
8985
|
+
const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
|
|
8986
|
+
return rawRoutes.map((route) => {
|
|
8987
|
+
if (typeof route === "string") {
|
|
8988
|
+
const path8 = route.trim();
|
|
8989
|
+
return path8 ? { path: path8 } : void 0;
|
|
8990
|
+
}
|
|
8991
|
+
if (!isRecord(route)) return void 0;
|
|
8992
|
+
const path7 = stringValue2(route.path);
|
|
8993
|
+
if (!path7) return void 0;
|
|
8994
|
+
const name = stringValue2(route.name);
|
|
8995
|
+
return name ? { name, path: path7 } : { path: path7 };
|
|
8996
|
+
}).filter((route) => Boolean(route));
|
|
8997
|
+
}
|
|
8984
8998
|
function matchText(sample, check) {
|
|
8985
8999
|
if (check.pattern) {
|
|
8986
9000
|
try {
|
|
@@ -9582,7 +9596,10 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
9582
9596
|
type: check.type,
|
|
9583
9597
|
label: checkLabel(check),
|
|
9584
9598
|
status: "failed",
|
|
9585
|
-
evidence: {
|
|
9599
|
+
evidence: {
|
|
9600
|
+
expected_count: check.expected_routes?.length || 0,
|
|
9601
|
+
expected_routes: routeInventoryExpectedRouteSummaries(void 0, check.expected_routes)
|
|
9602
|
+
},
|
|
9586
9603
|
message: "No route inventory evidence was captured."
|
|
9587
9604
|
};
|
|
9588
9605
|
}
|
|
@@ -9595,12 +9612,14 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
9595
9612
|
const sourceUniqueLinkCount = numberValue(first?.source_unique_link_count) ?? numberValue(first?.home_unique_game_link_count) ?? null;
|
|
9596
9613
|
const duplicateSourceLinks = Array.isArray(first?.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path7) => String(path7)) : [];
|
|
9597
9614
|
const duplicateSourceLinkCount = numberValue(first?.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
|
|
9615
|
+
const expectedRoutes = routeInventoryExpectedRouteSummaries(first?.expected_routes, check.expected_routes);
|
|
9598
9616
|
return {
|
|
9599
9617
|
type: check.type,
|
|
9600
9618
|
label: checkLabel(check),
|
|
9601
9619
|
status: failures.length ? "failed" : "passed",
|
|
9602
9620
|
evidence: {
|
|
9603
9621
|
expected_count: check.expected_routes?.length || 0,
|
|
9622
|
+
expected_routes: expectedRoutes,
|
|
9604
9623
|
source_link_count: sourceLinkCount,
|
|
9605
9624
|
source_unique_link_count: sourceUniqueLinkCount,
|
|
9606
9625
|
duplicate_source_link_count: duplicateSourceLinkCount,
|
|
@@ -10591,6 +10610,20 @@ function summarizeRouteInventory(viewport, inventory) {
|
|
|
10591
10610
|
failure_count: failures.length,
|
|
10592
10611
|
};
|
|
10593
10612
|
}
|
|
10613
|
+
function routeInventoryExpectedRouteSummaries(value, fallback) {
|
|
10614
|
+
const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
|
|
10615
|
+
return rawRoutes.map((route) => {
|
|
10616
|
+
if (typeof route === "string") {
|
|
10617
|
+
const path = route.trim();
|
|
10618
|
+
return path ? { path } : null;
|
|
10619
|
+
}
|
|
10620
|
+
if (!route || typeof route !== "object" || Array.isArray(route)) return null;
|
|
10621
|
+
const path = typeof route.path === "string" && route.path.trim() ? route.path.trim() : "";
|
|
10622
|
+
if (!path) return null;
|
|
10623
|
+
const name = typeof route.name === "string" && route.name.trim() ? route.name.trim() : "";
|
|
10624
|
+
return name ? { name, path } : { path };
|
|
10625
|
+
}).filter(Boolean);
|
|
10626
|
+
}
|
|
10594
10627
|
function numberValue(value) {
|
|
10595
10628
|
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
10596
10629
|
}
|
|
@@ -11418,7 +11451,10 @@ function assessProfile(profile, evidence) {
|
|
|
11418
11451
|
type: check.type,
|
|
11419
11452
|
label: check.label || check.type,
|
|
11420
11453
|
status: "failed",
|
|
11421
|
-
evidence: {
|
|
11454
|
+
evidence: {
|
|
11455
|
+
expected_count: (check.expected_routes || []).length,
|
|
11456
|
+
expected_routes: routeInventoryExpectedRouteSummaries(undefined, check.expected_routes),
|
|
11457
|
+
},
|
|
11422
11458
|
message: "No route inventory evidence was captured.",
|
|
11423
11459
|
});
|
|
11424
11460
|
continue;
|
|
@@ -11437,12 +11473,14 @@ function assessProfile(profile, evidence) {
|
|
|
11437
11473
|
const sourceUniqueLinkCount = typeof first.source_unique_link_count === "number" ? first.source_unique_link_count : typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : null;
|
|
11438
11474
|
const duplicateSourceLinks = Array.isArray(first.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
|
|
11439
11475
|
const duplicateSourceLinkCount = typeof first.duplicate_source_link_count === "number" ? first.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
|
|
11476
|
+
const expectedRoutes = routeInventoryExpectedRouteSummaries(first.expected_routes, check.expected_routes);
|
|
11440
11477
|
checks.push({
|
|
11441
11478
|
type: check.type,
|
|
11442
11479
|
label: check.label || check.type,
|
|
11443
11480
|
status: failures.length ? "failed" : "passed",
|
|
11444
11481
|
evidence: {
|
|
11445
11482
|
expected_count: (check.expected_routes || []).length,
|
|
11483
|
+
expected_routes: expectedRoutes,
|
|
11446
11484
|
source_link_count: sourceLinkCount,
|
|
11447
11485
|
source_unique_link_count: sourceUniqueLinkCount,
|
|
11448
11486
|
duplicate_source_link_count: duplicateSourceLinkCount,
|
|
@@ -14651,6 +14689,10 @@ function profileResultMarkdown(result) {
|
|
|
14651
14689
|
if (environmentBlockerLines.length) {
|
|
14652
14690
|
lines.push("", "## Environment Blocker", "", ...environmentBlockerLines);
|
|
14653
14691
|
}
|
|
14692
|
+
const riddleJobLines = profileRiddleJobMarkdown(result);
|
|
14693
|
+
if (riddleJobLines.length) {
|
|
14694
|
+
lines.push("", "## Riddle Job", "", ...riddleJobLines);
|
|
14695
|
+
}
|
|
14654
14696
|
if (result.artifacts.riddle_artifacts?.length) {
|
|
14655
14697
|
lines.push("", "## Riddle Artifacts", "");
|
|
14656
14698
|
for (const artifact of result.artifacts.riddle_artifacts.slice(0, 40)) {
|
|
@@ -14660,6 +14702,34 @@ function profileResultMarkdown(result) {
|
|
|
14660
14702
|
return `${lines.join("\n")}
|
|
14661
14703
|
`;
|
|
14662
14704
|
}
|
|
14705
|
+
function profileRiddleJobMarkdown(result) {
|
|
14706
|
+
const riddle = cliRecord(result.riddle);
|
|
14707
|
+
if (!riddle) return [];
|
|
14708
|
+
const jobId = cliString(riddle.job_id);
|
|
14709
|
+
const status = cliString(riddle.status);
|
|
14710
|
+
const terminal = typeof riddle.terminal === "boolean" ? riddle.terminal : void 0;
|
|
14711
|
+
const queueElapsedMs = cliFiniteNumber(riddle.queue_elapsed_ms);
|
|
14712
|
+
const elapsedMs3 = cliFiniteNumber(riddle.elapsed_ms);
|
|
14713
|
+
const attempt = cliFiniteNumber(riddle.attempt);
|
|
14714
|
+
const attempts = cliFiniteNumber(riddle.attempts);
|
|
14715
|
+
const submittedAt = cliString(riddle.submitted_at);
|
|
14716
|
+
const completedAt = cliString(riddle.completed_at);
|
|
14717
|
+
const parts = [
|
|
14718
|
+
jobId ? `job ${markdownInlineCode(jobId)}` : "",
|
|
14719
|
+
status ? `status ${markdownInlineCode(status)}` : "",
|
|
14720
|
+
terminal === void 0 ? "" : `terminal ${terminal ? "true" : "false"}`
|
|
14721
|
+
].filter(Boolean);
|
|
14722
|
+
const lines = parts.length ? [`- ${parts.join(", ")}`] : [];
|
|
14723
|
+
if (queueElapsedMs !== void 0 || elapsedMs3 !== void 0 || attempt !== void 0 || attempts !== void 0) {
|
|
14724
|
+
lines.push(
|
|
14725
|
+
`- poll: queue ${formatPollDuration(queueElapsedMs)}, elapsed ${formatPollDuration(elapsedMs3)}${attempt === void 0 ? "" : `, attempt ${attempt}${attempts === void 0 ? "" : `/${attempts}`}`}`
|
|
14726
|
+
);
|
|
14727
|
+
}
|
|
14728
|
+
if (submittedAt || completedAt) {
|
|
14729
|
+
lines.push(`- timing:${submittedAt ? ` submitted ${markdownInlineCode(submittedAt)}` : ""}${completedAt ? ` completed ${markdownInlineCode(completedAt)}` : ""}`);
|
|
14730
|
+
}
|
|
14731
|
+
return lines;
|
|
14732
|
+
}
|
|
14663
14733
|
function markdownInlineCode(value, maxLength = 80) {
|
|
14664
14734
|
const normalized = value.replace(/\s+/g, " ").trim();
|
|
14665
14735
|
const clipped = normalized.length > maxLength ? `${normalized.slice(0, Math.max(0, maxLength - 3))}...` : normalized;
|
|
@@ -14788,6 +14858,29 @@ function cliValueLabel(value) {
|
|
|
14788
14858
|
function cliStringArray(value) {
|
|
14789
14859
|
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && Boolean(entry.trim())) : [];
|
|
14790
14860
|
}
|
|
14861
|
+
function cliRouteInventoryRoutes(value) {
|
|
14862
|
+
if (!Array.isArray(value)) return [];
|
|
14863
|
+
return value.map((entry) => {
|
|
14864
|
+
if (typeof entry === "string") {
|
|
14865
|
+
const pathValue2 = entry.trim();
|
|
14866
|
+
return pathValue2 ? { path: pathValue2 } : void 0;
|
|
14867
|
+
}
|
|
14868
|
+
const route = cliRecord(entry);
|
|
14869
|
+
if (!route) return void 0;
|
|
14870
|
+
const pathValue = cliString(route.path);
|
|
14871
|
+
if (!pathValue) return void 0;
|
|
14872
|
+
const nameValue = cliString(route.name);
|
|
14873
|
+
return nameValue ? { name: nameValue, path: pathValue } : { path: pathValue };
|
|
14874
|
+
}).filter((route) => Boolean(route));
|
|
14875
|
+
}
|
|
14876
|
+
function cliRouteInventoryRouteLabel(route) {
|
|
14877
|
+
return route.name && route.name !== route.path ? `${route.name} (${route.path})` : route.path;
|
|
14878
|
+
}
|
|
14879
|
+
function cliRouteInventoryRouteList(routes) {
|
|
14880
|
+
const visible = routes.slice(0, 12).map(cliRouteInventoryRouteLabel);
|
|
14881
|
+
const omitted = routes.length > 12 ? `; ${routes.length - 12} more` : "";
|
|
14882
|
+
return `${visible.join("; ")}${omitted}`;
|
|
14883
|
+
}
|
|
14791
14884
|
function profileEnvironmentBlockerMarkdown(result) {
|
|
14792
14885
|
const blocker = cliRecord(result.environment_blocker);
|
|
14793
14886
|
if (!blocker) return [];
|
|
@@ -15031,6 +15124,10 @@ function profileRouteInventorySummaryMarkdown(result) {
|
|
|
15031
15124
|
const duplicateText = duplicateLinks.length ? `: ${duplicateLinks.slice(0, 8).join(", ")}${duplicateLinks.length > 8 ? `, ${duplicateLinks.length - 8} more` : ""}` : "";
|
|
15032
15125
|
lines.push(`- ${label} duplicate source links: ${duplicateCount}${evidence.duplicates_allowed === true ? " allowed" : ""}${duplicateText}`);
|
|
15033
15126
|
}
|
|
15127
|
+
const expectedRoutes = cliRouteInventoryRoutes(evidence.expected_routes);
|
|
15128
|
+
if (expectedRoutes.length) {
|
|
15129
|
+
lines.push(`- ${label} expected routes: ${cliRouteInventoryRouteList(expectedRoutes)}`);
|
|
15130
|
+
}
|
|
15034
15131
|
for (const viewport of viewports.slice(0, 8)) {
|
|
15035
15132
|
const viewportName = cliString(viewport.viewport) || cliString(viewport.name) || "viewport";
|
|
15036
15133
|
const viewportSourceLinkCount = cliFiniteNumber(viewport.source_link_count);
|
|
@@ -15203,13 +15300,22 @@ async function profileResultFromRiddleArtifacts(profile, artifacts, fallbackInpu
|
|
|
15203
15300
|
return void 0;
|
|
15204
15301
|
}
|
|
15205
15302
|
function withRiddleMetadata(result, input) {
|
|
15303
|
+
const poll = input.poll;
|
|
15206
15304
|
return {
|
|
15207
15305
|
...result,
|
|
15208
15306
|
riddle: {
|
|
15209
15307
|
...result.riddle || {},
|
|
15210
15308
|
job_id: input.job_id || result.riddle?.job_id,
|
|
15211
15309
|
status: input.status ?? result.riddle?.status,
|
|
15212
|
-
terminal: input.terminal ?? result.riddle?.terminal
|
|
15310
|
+
terminal: input.terminal ?? result.riddle?.terminal,
|
|
15311
|
+
created_at: poll?.created_at ?? result.riddle?.created_at,
|
|
15312
|
+
submitted_at: poll?.submitted_at ?? result.riddle?.submitted_at,
|
|
15313
|
+
completed_at: poll?.completed_at ?? result.riddle?.completed_at,
|
|
15314
|
+
queue_elapsed_ms: poll?.queue_elapsed_ms ?? result.riddle?.queue_elapsed_ms,
|
|
15315
|
+
elapsed_ms: poll?.elapsed_ms ?? result.riddle?.elapsed_ms,
|
|
15316
|
+
attempt: poll?.attempt ?? result.riddle?.attempt,
|
|
15317
|
+
attempts: poll?.attempts ?? result.riddle?.attempts,
|
|
15318
|
+
timed_out: poll?.timed_out ?? result.riddle?.timed_out
|
|
15213
15319
|
},
|
|
15214
15320
|
artifacts: {
|
|
15215
15321
|
...result.artifacts,
|
|
@@ -15217,6 +15323,21 @@ function withRiddleMetadata(result, input) {
|
|
|
15217
15323
|
}
|
|
15218
15324
|
};
|
|
15219
15325
|
}
|
|
15326
|
+
function riddleMetadataFromPoll(jobId, poll) {
|
|
15327
|
+
return {
|
|
15328
|
+
job_id: jobId,
|
|
15329
|
+
status: poll.status,
|
|
15330
|
+
terminal: poll.terminal,
|
|
15331
|
+
created_at: poll.poll?.created_at,
|
|
15332
|
+
submitted_at: poll.poll?.submitted_at,
|
|
15333
|
+
completed_at: poll.poll?.completed_at,
|
|
15334
|
+
queue_elapsed_ms: poll.poll?.queue_elapsed_ms,
|
|
15335
|
+
elapsed_ms: poll.poll?.elapsed_ms,
|
|
15336
|
+
attempt: poll.poll?.attempt,
|
|
15337
|
+
attempts: poll.poll?.attempts,
|
|
15338
|
+
timed_out: poll.poll?.timed_out
|
|
15339
|
+
};
|
|
15340
|
+
}
|
|
15220
15341
|
async function runProfileForCli(profile, options) {
|
|
15221
15342
|
const runner = optionString(options, "runner") || "riddle";
|
|
15222
15343
|
if (runner !== "riddle") {
|
|
@@ -15261,7 +15382,7 @@ async function runProfileForCli(profile, options) {
|
|
|
15261
15382
|
profile,
|
|
15262
15383
|
runner,
|
|
15263
15384
|
error: `Riddle job ${jobId} ended with status ${poll.status || "unknown"}.`,
|
|
15264
|
-
riddle:
|
|
15385
|
+
riddle: riddleMetadataFromPoll(jobId, poll),
|
|
15265
15386
|
artifacts
|
|
15266
15387
|
});
|
|
15267
15388
|
}
|
|
@@ -15270,7 +15391,7 @@ async function runProfileForCli(profile, options) {
|
|
|
15270
15391
|
return createRiddleProofProfileInsufficientResult({
|
|
15271
15392
|
profile,
|
|
15272
15393
|
runner,
|
|
15273
|
-
riddle:
|
|
15394
|
+
riddle: riddleMetadataFromPoll(jobId, poll),
|
|
15274
15395
|
artifacts
|
|
15275
15396
|
});
|
|
15276
15397
|
}
|
|
@@ -15278,6 +15399,7 @@ async function runProfileForCli(profile, options) {
|
|
|
15278
15399
|
job_id: jobId,
|
|
15279
15400
|
status: poll.status,
|
|
15280
15401
|
terminal: poll.terminal,
|
|
15402
|
+
poll: poll.poll,
|
|
15281
15403
|
artifacts
|
|
15282
15404
|
});
|
|
15283
15405
|
}
|
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
profileStatusExitCode,
|
|
13
13
|
resolveRiddleProofProfileTargetUrl,
|
|
14
14
|
resolveRiddleProofProfileTimeoutSec
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LFFTWXLB.js";
|
|
16
16
|
import {
|
|
17
17
|
createRiddleApiClient,
|
|
18
18
|
parseRiddleViewport
|
|
@@ -398,6 +398,10 @@ function profileResultMarkdown(result) {
|
|
|
398
398
|
if (environmentBlockerLines.length) {
|
|
399
399
|
lines.push("", "## Environment Blocker", "", ...environmentBlockerLines);
|
|
400
400
|
}
|
|
401
|
+
const riddleJobLines = profileRiddleJobMarkdown(result);
|
|
402
|
+
if (riddleJobLines.length) {
|
|
403
|
+
lines.push("", "## Riddle Job", "", ...riddleJobLines);
|
|
404
|
+
}
|
|
401
405
|
if (result.artifacts.riddle_artifacts?.length) {
|
|
402
406
|
lines.push("", "## Riddle Artifacts", "");
|
|
403
407
|
for (const artifact of result.artifacts.riddle_artifacts.slice(0, 40)) {
|
|
@@ -407,6 +411,34 @@ function profileResultMarkdown(result) {
|
|
|
407
411
|
return `${lines.join("\n")}
|
|
408
412
|
`;
|
|
409
413
|
}
|
|
414
|
+
function profileRiddleJobMarkdown(result) {
|
|
415
|
+
const riddle = cliRecord(result.riddle);
|
|
416
|
+
if (!riddle) return [];
|
|
417
|
+
const jobId = cliString(riddle.job_id);
|
|
418
|
+
const status = cliString(riddle.status);
|
|
419
|
+
const terminal = typeof riddle.terminal === "boolean" ? riddle.terminal : void 0;
|
|
420
|
+
const queueElapsedMs = cliFiniteNumber(riddle.queue_elapsed_ms);
|
|
421
|
+
const elapsedMs = cliFiniteNumber(riddle.elapsed_ms);
|
|
422
|
+
const attempt = cliFiniteNumber(riddle.attempt);
|
|
423
|
+
const attempts = cliFiniteNumber(riddle.attempts);
|
|
424
|
+
const submittedAt = cliString(riddle.submitted_at);
|
|
425
|
+
const completedAt = cliString(riddle.completed_at);
|
|
426
|
+
const parts = [
|
|
427
|
+
jobId ? `job ${markdownInlineCode(jobId)}` : "",
|
|
428
|
+
status ? `status ${markdownInlineCode(status)}` : "",
|
|
429
|
+
terminal === void 0 ? "" : `terminal ${terminal ? "true" : "false"}`
|
|
430
|
+
].filter(Boolean);
|
|
431
|
+
const lines = parts.length ? [`- ${parts.join(", ")}`] : [];
|
|
432
|
+
if (queueElapsedMs !== void 0 || elapsedMs !== void 0 || attempt !== void 0 || attempts !== void 0) {
|
|
433
|
+
lines.push(
|
|
434
|
+
`- poll: queue ${formatPollDuration(queueElapsedMs)}, elapsed ${formatPollDuration(elapsedMs)}${attempt === void 0 ? "" : `, attempt ${attempt}${attempts === void 0 ? "" : `/${attempts}`}`}`
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
if (submittedAt || completedAt) {
|
|
438
|
+
lines.push(`- timing:${submittedAt ? ` submitted ${markdownInlineCode(submittedAt)}` : ""}${completedAt ? ` completed ${markdownInlineCode(completedAt)}` : ""}`);
|
|
439
|
+
}
|
|
440
|
+
return lines;
|
|
441
|
+
}
|
|
410
442
|
function markdownInlineCode(value, maxLength = 80) {
|
|
411
443
|
const normalized = value.replace(/\s+/g, " ").trim();
|
|
412
444
|
const clipped = normalized.length > maxLength ? `${normalized.slice(0, Math.max(0, maxLength - 3))}...` : normalized;
|
|
@@ -535,6 +567,29 @@ function cliValueLabel(value) {
|
|
|
535
567
|
function cliStringArray(value) {
|
|
536
568
|
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && Boolean(entry.trim())) : [];
|
|
537
569
|
}
|
|
570
|
+
function cliRouteInventoryRoutes(value) {
|
|
571
|
+
if (!Array.isArray(value)) return [];
|
|
572
|
+
return value.map((entry) => {
|
|
573
|
+
if (typeof entry === "string") {
|
|
574
|
+
const pathValue2 = entry.trim();
|
|
575
|
+
return pathValue2 ? { path: pathValue2 } : void 0;
|
|
576
|
+
}
|
|
577
|
+
const route = cliRecord(entry);
|
|
578
|
+
if (!route) return void 0;
|
|
579
|
+
const pathValue = cliString(route.path);
|
|
580
|
+
if (!pathValue) return void 0;
|
|
581
|
+
const nameValue = cliString(route.name);
|
|
582
|
+
return nameValue ? { name: nameValue, path: pathValue } : { path: pathValue };
|
|
583
|
+
}).filter((route) => Boolean(route));
|
|
584
|
+
}
|
|
585
|
+
function cliRouteInventoryRouteLabel(route) {
|
|
586
|
+
return route.name && route.name !== route.path ? `${route.name} (${route.path})` : route.path;
|
|
587
|
+
}
|
|
588
|
+
function cliRouteInventoryRouteList(routes) {
|
|
589
|
+
const visible = routes.slice(0, 12).map(cliRouteInventoryRouteLabel);
|
|
590
|
+
const omitted = routes.length > 12 ? `; ${routes.length - 12} more` : "";
|
|
591
|
+
return `${visible.join("; ")}${omitted}`;
|
|
592
|
+
}
|
|
538
593
|
function profileEnvironmentBlockerMarkdown(result) {
|
|
539
594
|
const blocker = cliRecord(result.environment_blocker);
|
|
540
595
|
if (!blocker) return [];
|
|
@@ -778,6 +833,10 @@ function profileRouteInventorySummaryMarkdown(result) {
|
|
|
778
833
|
const duplicateText = duplicateLinks.length ? `: ${duplicateLinks.slice(0, 8).join(", ")}${duplicateLinks.length > 8 ? `, ${duplicateLinks.length - 8} more` : ""}` : "";
|
|
779
834
|
lines.push(`- ${label} duplicate source links: ${duplicateCount}${evidence.duplicates_allowed === true ? " allowed" : ""}${duplicateText}`);
|
|
780
835
|
}
|
|
836
|
+
const expectedRoutes = cliRouteInventoryRoutes(evidence.expected_routes);
|
|
837
|
+
if (expectedRoutes.length) {
|
|
838
|
+
lines.push(`- ${label} expected routes: ${cliRouteInventoryRouteList(expectedRoutes)}`);
|
|
839
|
+
}
|
|
781
840
|
for (const viewport of viewports.slice(0, 8)) {
|
|
782
841
|
const viewportName = cliString(viewport.viewport) || cliString(viewport.name) || "viewport";
|
|
783
842
|
const viewportSourceLinkCount = cliFiniteNumber(viewport.source_link_count);
|
|
@@ -950,13 +1009,22 @@ async function profileResultFromRiddleArtifacts(profile, artifacts, fallbackInpu
|
|
|
950
1009
|
return void 0;
|
|
951
1010
|
}
|
|
952
1011
|
function withRiddleMetadata(result, input) {
|
|
1012
|
+
const poll = input.poll;
|
|
953
1013
|
return {
|
|
954
1014
|
...result,
|
|
955
1015
|
riddle: {
|
|
956
1016
|
...result.riddle || {},
|
|
957
1017
|
job_id: input.job_id || result.riddle?.job_id,
|
|
958
1018
|
status: input.status ?? result.riddle?.status,
|
|
959
|
-
terminal: input.terminal ?? result.riddle?.terminal
|
|
1019
|
+
terminal: input.terminal ?? result.riddle?.terminal,
|
|
1020
|
+
created_at: poll?.created_at ?? result.riddle?.created_at,
|
|
1021
|
+
submitted_at: poll?.submitted_at ?? result.riddle?.submitted_at,
|
|
1022
|
+
completed_at: poll?.completed_at ?? result.riddle?.completed_at,
|
|
1023
|
+
queue_elapsed_ms: poll?.queue_elapsed_ms ?? result.riddle?.queue_elapsed_ms,
|
|
1024
|
+
elapsed_ms: poll?.elapsed_ms ?? result.riddle?.elapsed_ms,
|
|
1025
|
+
attempt: poll?.attempt ?? result.riddle?.attempt,
|
|
1026
|
+
attempts: poll?.attempts ?? result.riddle?.attempts,
|
|
1027
|
+
timed_out: poll?.timed_out ?? result.riddle?.timed_out
|
|
960
1028
|
},
|
|
961
1029
|
artifacts: {
|
|
962
1030
|
...result.artifacts,
|
|
@@ -964,6 +1032,21 @@ function withRiddleMetadata(result, input) {
|
|
|
964
1032
|
}
|
|
965
1033
|
};
|
|
966
1034
|
}
|
|
1035
|
+
function riddleMetadataFromPoll(jobId, poll) {
|
|
1036
|
+
return {
|
|
1037
|
+
job_id: jobId,
|
|
1038
|
+
status: poll.status,
|
|
1039
|
+
terminal: poll.terminal,
|
|
1040
|
+
created_at: poll.poll?.created_at,
|
|
1041
|
+
submitted_at: poll.poll?.submitted_at,
|
|
1042
|
+
completed_at: poll.poll?.completed_at,
|
|
1043
|
+
queue_elapsed_ms: poll.poll?.queue_elapsed_ms,
|
|
1044
|
+
elapsed_ms: poll.poll?.elapsed_ms,
|
|
1045
|
+
attempt: poll.poll?.attempt,
|
|
1046
|
+
attempts: poll.poll?.attempts,
|
|
1047
|
+
timed_out: poll.poll?.timed_out
|
|
1048
|
+
};
|
|
1049
|
+
}
|
|
967
1050
|
async function runProfileForCli(profile, options) {
|
|
968
1051
|
const runner = optionString(options, "runner") || "riddle";
|
|
969
1052
|
if (runner !== "riddle") {
|
|
@@ -1008,7 +1091,7 @@ async function runProfileForCli(profile, options) {
|
|
|
1008
1091
|
profile,
|
|
1009
1092
|
runner,
|
|
1010
1093
|
error: `Riddle job ${jobId} ended with status ${poll.status || "unknown"}.`,
|
|
1011
|
-
riddle:
|
|
1094
|
+
riddle: riddleMetadataFromPoll(jobId, poll),
|
|
1012
1095
|
artifacts
|
|
1013
1096
|
});
|
|
1014
1097
|
}
|
|
@@ -1017,7 +1100,7 @@ async function runProfileForCli(profile, options) {
|
|
|
1017
1100
|
return createRiddleProofProfileInsufficientResult({
|
|
1018
1101
|
profile,
|
|
1019
1102
|
runner,
|
|
1020
|
-
riddle:
|
|
1103
|
+
riddle: riddleMetadataFromPoll(jobId, poll),
|
|
1021
1104
|
artifacts
|
|
1022
1105
|
});
|
|
1023
1106
|
}
|
|
@@ -1025,6 +1108,7 @@ async function runProfileForCli(profile, options) {
|
|
|
1025
1108
|
job_id: jobId,
|
|
1026
1109
|
status: poll.status,
|
|
1027
1110
|
terminal: poll.terminal,
|
|
1111
|
+
poll: poll.poll,
|
|
1028
1112
|
artifacts
|
|
1029
1113
|
});
|
|
1030
1114
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -10777,6 +10777,20 @@ function summarizeRouteInventory(viewport, inventory) {
|
|
|
10777
10777
|
failure_count: failures.length
|
|
10778
10778
|
};
|
|
10779
10779
|
}
|
|
10780
|
+
function routeInventoryExpectedRouteSummaries(value, fallback) {
|
|
10781
|
+
const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
|
|
10782
|
+
return rawRoutes.map((route) => {
|
|
10783
|
+
if (typeof route === "string") {
|
|
10784
|
+
const path7 = route.trim();
|
|
10785
|
+
return path7 ? { path: path7 } : void 0;
|
|
10786
|
+
}
|
|
10787
|
+
if (!isRecord2(route)) return void 0;
|
|
10788
|
+
const path6 = stringValue5(route.path);
|
|
10789
|
+
if (!path6) return void 0;
|
|
10790
|
+
const name = stringValue5(route.name);
|
|
10791
|
+
return name ? { name, path: path6 } : { path: path6 };
|
|
10792
|
+
}).filter((route) => Boolean(route));
|
|
10793
|
+
}
|
|
10780
10794
|
function matchText(sample, check) {
|
|
10781
10795
|
if (check.pattern) {
|
|
10782
10796
|
try {
|
|
@@ -11378,7 +11392,10 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
11378
11392
|
type: check.type,
|
|
11379
11393
|
label: checkLabel(check),
|
|
11380
11394
|
status: "failed",
|
|
11381
|
-
evidence: {
|
|
11395
|
+
evidence: {
|
|
11396
|
+
expected_count: check.expected_routes?.length || 0,
|
|
11397
|
+
expected_routes: routeInventoryExpectedRouteSummaries(void 0, check.expected_routes)
|
|
11398
|
+
},
|
|
11382
11399
|
message: "No route inventory evidence was captured."
|
|
11383
11400
|
};
|
|
11384
11401
|
}
|
|
@@ -11391,12 +11408,14 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
11391
11408
|
const sourceUniqueLinkCount = numberValue3(first?.source_unique_link_count) ?? numberValue3(first?.home_unique_game_link_count) ?? null;
|
|
11392
11409
|
const duplicateSourceLinks = Array.isArray(first?.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path6) => String(path6)) : [];
|
|
11393
11410
|
const duplicateSourceLinkCount = numberValue3(first?.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
|
|
11411
|
+
const expectedRoutes = routeInventoryExpectedRouteSummaries(first?.expected_routes, check.expected_routes);
|
|
11394
11412
|
return {
|
|
11395
11413
|
type: check.type,
|
|
11396
11414
|
label: checkLabel(check),
|
|
11397
11415
|
status: failures.length ? "failed" : "passed",
|
|
11398
11416
|
evidence: {
|
|
11399
11417
|
expected_count: check.expected_routes?.length || 0,
|
|
11418
|
+
expected_routes: expectedRoutes,
|
|
11400
11419
|
source_link_count: sourceLinkCount,
|
|
11401
11420
|
source_unique_link_count: sourceUniqueLinkCount,
|
|
11402
11421
|
duplicate_source_link_count: duplicateSourceLinkCount,
|
|
@@ -12403,6 +12422,20 @@ function summarizeRouteInventory(viewport, inventory) {
|
|
|
12403
12422
|
failure_count: failures.length,
|
|
12404
12423
|
};
|
|
12405
12424
|
}
|
|
12425
|
+
function routeInventoryExpectedRouteSummaries(value, fallback) {
|
|
12426
|
+
const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
|
|
12427
|
+
return rawRoutes.map((route) => {
|
|
12428
|
+
if (typeof route === "string") {
|
|
12429
|
+
const path = route.trim();
|
|
12430
|
+
return path ? { path } : null;
|
|
12431
|
+
}
|
|
12432
|
+
if (!route || typeof route !== "object" || Array.isArray(route)) return null;
|
|
12433
|
+
const path = typeof route.path === "string" && route.path.trim() ? route.path.trim() : "";
|
|
12434
|
+
if (!path) return null;
|
|
12435
|
+
const name = typeof route.name === "string" && route.name.trim() ? route.name.trim() : "";
|
|
12436
|
+
return name ? { name, path } : { path };
|
|
12437
|
+
}).filter(Boolean);
|
|
12438
|
+
}
|
|
12406
12439
|
function numberValue(value) {
|
|
12407
12440
|
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
12408
12441
|
}
|
|
@@ -13230,7 +13263,10 @@ function assessProfile(profile, evidence) {
|
|
|
13230
13263
|
type: check.type,
|
|
13231
13264
|
label: check.label || check.type,
|
|
13232
13265
|
status: "failed",
|
|
13233
|
-
evidence: {
|
|
13266
|
+
evidence: {
|
|
13267
|
+
expected_count: (check.expected_routes || []).length,
|
|
13268
|
+
expected_routes: routeInventoryExpectedRouteSummaries(undefined, check.expected_routes),
|
|
13269
|
+
},
|
|
13234
13270
|
message: "No route inventory evidence was captured.",
|
|
13235
13271
|
});
|
|
13236
13272
|
continue;
|
|
@@ -13249,12 +13285,14 @@ function assessProfile(profile, evidence) {
|
|
|
13249
13285
|
const sourceUniqueLinkCount = typeof first.source_unique_link_count === "number" ? first.source_unique_link_count : typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : null;
|
|
13250
13286
|
const duplicateSourceLinks = Array.isArray(first.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
|
|
13251
13287
|
const duplicateSourceLinkCount = typeof first.duplicate_source_link_count === "number" ? first.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
|
|
13288
|
+
const expectedRoutes = routeInventoryExpectedRouteSummaries(first.expected_routes, check.expected_routes);
|
|
13252
13289
|
checks.push({
|
|
13253
13290
|
type: check.type,
|
|
13254
13291
|
label: check.label || check.type,
|
|
13255
13292
|
status: failures.length ? "failed" : "passed",
|
|
13256
13293
|
evidence: {
|
|
13257
13294
|
expected_count: (check.expected_routes || []).length,
|
|
13295
|
+
expected_routes: expectedRoutes,
|
|
13258
13296
|
source_link_count: sourceLinkCount,
|
|
13259
13297
|
source_unique_link_count: sourceUniqueLinkCount,
|
|
13260
13298
|
duplicate_source_link_count: duplicateSourceLinkCount,
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
resolveRiddleProofProfileTimeoutSec,
|
|
63
63
|
slugifyRiddleProofProfileName,
|
|
64
64
|
summarizeRiddleProofProfileResult
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-LFFTWXLB.js";
|
|
66
66
|
import {
|
|
67
67
|
DEFAULT_RIDDLE_API_BASE_URL,
|
|
68
68
|
DEFAULT_RIDDLE_API_KEY_FILE,
|
package/dist/profile.cjs
CHANGED
|
@@ -2091,6 +2091,20 @@ function summarizeRouteInventory(viewport, inventory) {
|
|
|
2091
2091
|
failure_count: failures.length
|
|
2092
2092
|
};
|
|
2093
2093
|
}
|
|
2094
|
+
function routeInventoryExpectedRouteSummaries(value, fallback) {
|
|
2095
|
+
const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
|
|
2096
|
+
return rawRoutes.map((route) => {
|
|
2097
|
+
if (typeof route === "string") {
|
|
2098
|
+
const path2 = route.trim();
|
|
2099
|
+
return path2 ? { path: path2 } : void 0;
|
|
2100
|
+
}
|
|
2101
|
+
if (!isRecord(route)) return void 0;
|
|
2102
|
+
const path = stringValue(route.path);
|
|
2103
|
+
if (!path) return void 0;
|
|
2104
|
+
const name = stringValue(route.name);
|
|
2105
|
+
return name ? { name, path } : { path };
|
|
2106
|
+
}).filter((route) => Boolean(route));
|
|
2107
|
+
}
|
|
2094
2108
|
function matchText(sample, check) {
|
|
2095
2109
|
if (check.pattern) {
|
|
2096
2110
|
try {
|
|
@@ -2692,7 +2706,10 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
2692
2706
|
type: check.type,
|
|
2693
2707
|
label: checkLabel(check),
|
|
2694
2708
|
status: "failed",
|
|
2695
|
-
evidence: {
|
|
2709
|
+
evidence: {
|
|
2710
|
+
expected_count: check.expected_routes?.length || 0,
|
|
2711
|
+
expected_routes: routeInventoryExpectedRouteSummaries(void 0, check.expected_routes)
|
|
2712
|
+
},
|
|
2696
2713
|
message: "No route inventory evidence was captured."
|
|
2697
2714
|
};
|
|
2698
2715
|
}
|
|
@@ -2705,12 +2722,14 @@ function assessCheckFromEvidence(check, evidence) {
|
|
|
2705
2722
|
const sourceUniqueLinkCount = numberValue(first?.source_unique_link_count) ?? numberValue(first?.home_unique_game_link_count) ?? null;
|
|
2706
2723
|
const duplicateSourceLinks = Array.isArray(first?.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
|
|
2707
2724
|
const duplicateSourceLinkCount = numberValue(first?.duplicate_source_link_count) ?? (sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null);
|
|
2725
|
+
const expectedRoutes = routeInventoryExpectedRouteSummaries(first?.expected_routes, check.expected_routes);
|
|
2708
2726
|
return {
|
|
2709
2727
|
type: check.type,
|
|
2710
2728
|
label: checkLabel(check),
|
|
2711
2729
|
status: failures.length ? "failed" : "passed",
|
|
2712
2730
|
evidence: {
|
|
2713
2731
|
expected_count: check.expected_routes?.length || 0,
|
|
2732
|
+
expected_routes: expectedRoutes,
|
|
2714
2733
|
source_link_count: sourceLinkCount,
|
|
2715
2734
|
source_unique_link_count: sourceUniqueLinkCount,
|
|
2716
2735
|
duplicate_source_link_count: duplicateSourceLinkCount,
|
|
@@ -3717,6 +3736,20 @@ function summarizeRouteInventory(viewport, inventory) {
|
|
|
3717
3736
|
failure_count: failures.length,
|
|
3718
3737
|
};
|
|
3719
3738
|
}
|
|
3739
|
+
function routeInventoryExpectedRouteSummaries(value, fallback) {
|
|
3740
|
+
const rawRoutes = Array.isArray(value) ? value : Array.isArray(fallback) ? fallback : [];
|
|
3741
|
+
return rawRoutes.map((route) => {
|
|
3742
|
+
if (typeof route === "string") {
|
|
3743
|
+
const path = route.trim();
|
|
3744
|
+
return path ? { path } : null;
|
|
3745
|
+
}
|
|
3746
|
+
if (!route || typeof route !== "object" || Array.isArray(route)) return null;
|
|
3747
|
+
const path = typeof route.path === "string" && route.path.trim() ? route.path.trim() : "";
|
|
3748
|
+
if (!path) return null;
|
|
3749
|
+
const name = typeof route.name === "string" && route.name.trim() ? route.name.trim() : "";
|
|
3750
|
+
return name ? { name, path } : { path };
|
|
3751
|
+
}).filter(Boolean);
|
|
3752
|
+
}
|
|
3720
3753
|
function numberValue(value) {
|
|
3721
3754
|
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
3722
3755
|
}
|
|
@@ -4544,7 +4577,10 @@ function assessProfile(profile, evidence) {
|
|
|
4544
4577
|
type: check.type,
|
|
4545
4578
|
label: check.label || check.type,
|
|
4546
4579
|
status: "failed",
|
|
4547
|
-
evidence: {
|
|
4580
|
+
evidence: {
|
|
4581
|
+
expected_count: (check.expected_routes || []).length,
|
|
4582
|
+
expected_routes: routeInventoryExpectedRouteSummaries(undefined, check.expected_routes),
|
|
4583
|
+
},
|
|
4548
4584
|
message: "No route inventory evidence was captured.",
|
|
4549
4585
|
});
|
|
4550
4586
|
continue;
|
|
@@ -4563,12 +4599,14 @@ function assessProfile(profile, evidence) {
|
|
|
4563
4599
|
const sourceUniqueLinkCount = typeof first.source_unique_link_count === "number" ? first.source_unique_link_count : typeof first.home_unique_game_link_count === "number" ? first.home_unique_game_link_count : null;
|
|
4564
4600
|
const duplicateSourceLinks = Array.isArray(first.duplicate_source_link_paths) ? first.duplicate_source_link_paths.map((path) => String(path)) : [];
|
|
4565
4601
|
const duplicateSourceLinkCount = typeof first.duplicate_source_link_count === "number" ? first.duplicate_source_link_count : sourceLinkCount !== null && sourceUniqueLinkCount !== null ? Math.max(0, sourceLinkCount - sourceUniqueLinkCount) : null;
|
|
4602
|
+
const expectedRoutes = routeInventoryExpectedRouteSummaries(first.expected_routes, check.expected_routes);
|
|
4566
4603
|
checks.push({
|
|
4567
4604
|
type: check.type,
|
|
4568
4605
|
label: check.label || check.type,
|
|
4569
4606
|
status: failures.length ? "failed" : "passed",
|
|
4570
4607
|
evidence: {
|
|
4571
4608
|
expected_count: (check.expected_routes || []).length,
|
|
4609
|
+
expected_routes: expectedRoutes,
|
|
4572
4610
|
source_link_count: sourceLinkCount,
|
|
4573
4611
|
source_unique_link_count: sourceUniqueLinkCount,
|
|
4574
4612
|
duplicate_source_link_count: duplicateSourceLinkCount,
|
package/dist/profile.d.cts
CHANGED
|
@@ -379,6 +379,14 @@ interface RiddleProofProfileResult {
|
|
|
379
379
|
job_id?: string;
|
|
380
380
|
status?: string | null;
|
|
381
381
|
terminal?: boolean;
|
|
382
|
+
created_at?: string | null;
|
|
383
|
+
submitted_at?: string | null;
|
|
384
|
+
completed_at?: string | null;
|
|
385
|
+
queue_elapsed_ms?: number | null;
|
|
386
|
+
elapsed_ms?: number;
|
|
387
|
+
attempt?: number;
|
|
388
|
+
attempts?: number;
|
|
389
|
+
timed_out?: boolean;
|
|
382
390
|
};
|
|
383
391
|
environment_blocker?: Record<string, JsonValue>;
|
|
384
392
|
error?: string;
|
package/dist/profile.d.ts
CHANGED
|
@@ -379,6 +379,14 @@ interface RiddleProofProfileResult {
|
|
|
379
379
|
job_id?: string;
|
|
380
380
|
status?: string | null;
|
|
381
381
|
terminal?: boolean;
|
|
382
|
+
created_at?: string | null;
|
|
383
|
+
submitted_at?: string | null;
|
|
384
|
+
completed_at?: string | null;
|
|
385
|
+
queue_elapsed_ms?: number | null;
|
|
386
|
+
elapsed_ms?: number;
|
|
387
|
+
attempt?: number;
|
|
388
|
+
attempts?: number;
|
|
389
|
+
timed_out?: boolean;
|
|
382
390
|
};
|
|
383
391
|
environment_blocker?: Record<string, JsonValue>;
|
|
384
392
|
error?: string;
|
package/dist/profile.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
resolveRiddleProofProfileTimeoutSec,
|
|
24
24
|
slugifyRiddleProofProfileName,
|
|
25
25
|
summarizeRiddleProofProfileResult
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-LFFTWXLB.js";
|
|
27
27
|
export {
|
|
28
28
|
RIDDLE_PROOF_PROFILE_CHECK_TYPES,
|
|
29
29
|
RIDDLE_PROOF_PROFILE_EVIDENCE_VERSION,
|