@riddledc/riddle-proof 0.7.71 → 0.7.72
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/cli.cjs +47 -0
- package/dist/cli.js +47 -0
- package/dist/proof-run-engine.d.cts +3 -3
- package/dist/proof-run-engine.d.ts +3 -3
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -11256,6 +11256,10 @@ function profileResultMarkdown(result) {
|
|
|
11256
11256
|
if (networkMockSummaryLines.length) {
|
|
11257
11257
|
lines.push("", "## Network Mocks", "", ...networkMockSummaryLines);
|
|
11258
11258
|
}
|
|
11259
|
+
const routeInventorySummaryLines = profileRouteInventorySummaryMarkdown(result);
|
|
11260
|
+
if (routeInventorySummaryLines.length) {
|
|
11261
|
+
lines.push("", "## Route Inventory", "", ...routeInventorySummaryLines);
|
|
11262
|
+
}
|
|
11259
11263
|
if (result.artifacts.riddle_artifacts?.length) {
|
|
11260
11264
|
lines.push("", "## Riddle Artifacts", "");
|
|
11261
11265
|
for (const artifact of result.artifacts.riddle_artifacts.slice(0, 40)) {
|
|
@@ -11274,6 +11278,9 @@ function cliFiniteNumber(value) {
|
|
|
11274
11278
|
function cliString(value) {
|
|
11275
11279
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
11276
11280
|
}
|
|
11281
|
+
function cliStringArray(value) {
|
|
11282
|
+
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && Boolean(entry.trim())) : [];
|
|
11283
|
+
}
|
|
11277
11284
|
function profileSetupSummaryMarkdown(result) {
|
|
11278
11285
|
const setupCheck = result.checks.find((check) => check.type === "setup_actions_succeeded");
|
|
11279
11286
|
const setupSummary = cliRecord(setupCheck?.evidence?.setup_summary);
|
|
@@ -11355,6 +11362,46 @@ function profileNetworkMockSummaryMarkdown(result) {
|
|
|
11355
11362
|
if (labels.length > 16) lines.push(`- ${labels.length - 16} additional network mock label(s) omitted from summary.`);
|
|
11356
11363
|
return lines;
|
|
11357
11364
|
}
|
|
11365
|
+
function profileRouteInventorySummaryMarkdown(result) {
|
|
11366
|
+
const routeInventoryChecks = result.checks.filter((check) => check.type === "route_inventory");
|
|
11367
|
+
const lines = [];
|
|
11368
|
+
for (const check of routeInventoryChecks) {
|
|
11369
|
+
const evidence = cliRecord(check.evidence);
|
|
11370
|
+
if (!evidence) continue;
|
|
11371
|
+
const label = check.label || check.type;
|
|
11372
|
+
const expectedCount = cliFiniteNumber(evidence.expected_count);
|
|
11373
|
+
const sourceLinkCount = cliFiniteNumber(evidence.source_link_count);
|
|
11374
|
+
const sourceUniqueLinkCount = cliFiniteNumber(evidence.source_unique_link_count);
|
|
11375
|
+
const directRouteCount = cliFiniteNumber(evidence.direct_route_count);
|
|
11376
|
+
const clickthroughCount = cliFiniteNumber(evidence.clickthrough_count);
|
|
11377
|
+
const topLevelFailures = Array.isArray(evidence.failures) ? evidence.failures.length : void 0;
|
|
11378
|
+
const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
|
|
11379
|
+
const viewportFailureTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.failure_count) || 0), 0);
|
|
11380
|
+
const failureCount = topLevelFailures === void 0 ? viewportFailureTotal : topLevelFailures;
|
|
11381
|
+
lines.push(
|
|
11382
|
+
`- ${label}: expected ${expectedCount ?? "unknown"}, source links ${sourceLinkCount ?? "unknown"}${sourceUniqueLinkCount === void 0 ? "" : ` (${sourceUniqueLinkCount} unique)`}, direct ${directRouteCount ?? "unknown"}, clickthrough ${clickthroughCount ?? "unknown"}, failures ${failureCount}`
|
|
11383
|
+
);
|
|
11384
|
+
const duplicateCount = cliFiniteNumber(evidence.duplicate_source_link_count) || 0;
|
|
11385
|
+
const duplicateLinks = cliStringArray(evidence.duplicate_source_links);
|
|
11386
|
+
if (duplicateCount || duplicateLinks.length) {
|
|
11387
|
+
const duplicateText = duplicateLinks.length ? `: ${duplicateLinks.slice(0, 8).join(", ")}${duplicateLinks.length > 8 ? `, ${duplicateLinks.length - 8} more` : ""}` : "";
|
|
11388
|
+
lines.push(`- ${label} duplicate source links: ${duplicateCount}${evidence.duplicates_allowed === true ? " allowed" : ""}${duplicateText}`);
|
|
11389
|
+
}
|
|
11390
|
+
for (const viewport of viewports.slice(0, 8)) {
|
|
11391
|
+
const viewportName = cliString(viewport.viewport) || cliString(viewport.name) || "viewport";
|
|
11392
|
+
const viewportSourceLinkCount = cliFiniteNumber(viewport.source_link_count);
|
|
11393
|
+
const viewportSourceUniqueLinkCount = cliFiniteNumber(viewport.source_unique_link_count);
|
|
11394
|
+
const viewportDirectRouteCount = cliFiniteNumber(viewport.direct_route_count);
|
|
11395
|
+
const viewportClickthroughCount = cliFiniteNumber(viewport.clickthrough_count);
|
|
11396
|
+
const viewportFailureCount = cliFiniteNumber(viewport.failure_count) || 0;
|
|
11397
|
+
lines.push(
|
|
11398
|
+
`- ${label} ${viewportName}: source ${viewportSourceLinkCount ?? "unknown"}${viewportSourceUniqueLinkCount === void 0 ? "" : ` (${viewportSourceUniqueLinkCount} unique)`}, direct ${viewportDirectRouteCount ?? "unknown"}, clickthrough ${viewportClickthroughCount ?? "unknown"}, failures ${viewportFailureCount}`
|
|
11399
|
+
);
|
|
11400
|
+
}
|
|
11401
|
+
if (viewports.length > 8) lines.push(`- ${label}: ${viewports.length - 8} additional viewport(s) omitted from route inventory summary.`);
|
|
11402
|
+
}
|
|
11403
|
+
return lines;
|
|
11404
|
+
}
|
|
11358
11405
|
function writeProfileOutput(outputDir, result) {
|
|
11359
11406
|
if (!outputDir) return;
|
|
11360
11407
|
(0, import_node_fs6.mkdirSync)(outputDir, { recursive: true });
|
package/dist/cli.js
CHANGED
|
@@ -320,6 +320,10 @@ function profileResultMarkdown(result) {
|
|
|
320
320
|
if (networkMockSummaryLines.length) {
|
|
321
321
|
lines.push("", "## Network Mocks", "", ...networkMockSummaryLines);
|
|
322
322
|
}
|
|
323
|
+
const routeInventorySummaryLines = profileRouteInventorySummaryMarkdown(result);
|
|
324
|
+
if (routeInventorySummaryLines.length) {
|
|
325
|
+
lines.push("", "## Route Inventory", "", ...routeInventorySummaryLines);
|
|
326
|
+
}
|
|
323
327
|
if (result.artifacts.riddle_artifacts?.length) {
|
|
324
328
|
lines.push("", "## Riddle Artifacts", "");
|
|
325
329
|
for (const artifact of result.artifacts.riddle_artifacts.slice(0, 40)) {
|
|
@@ -338,6 +342,9 @@ function cliFiniteNumber(value) {
|
|
|
338
342
|
function cliString(value) {
|
|
339
343
|
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
340
344
|
}
|
|
345
|
+
function cliStringArray(value) {
|
|
346
|
+
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string" && Boolean(entry.trim())) : [];
|
|
347
|
+
}
|
|
341
348
|
function profileSetupSummaryMarkdown(result) {
|
|
342
349
|
const setupCheck = result.checks.find((check) => check.type === "setup_actions_succeeded");
|
|
343
350
|
const setupSummary = cliRecord(setupCheck?.evidence?.setup_summary);
|
|
@@ -419,6 +426,46 @@ function profileNetworkMockSummaryMarkdown(result) {
|
|
|
419
426
|
if (labels.length > 16) lines.push(`- ${labels.length - 16} additional network mock label(s) omitted from summary.`);
|
|
420
427
|
return lines;
|
|
421
428
|
}
|
|
429
|
+
function profileRouteInventorySummaryMarkdown(result) {
|
|
430
|
+
const routeInventoryChecks = result.checks.filter((check) => check.type === "route_inventory");
|
|
431
|
+
const lines = [];
|
|
432
|
+
for (const check of routeInventoryChecks) {
|
|
433
|
+
const evidence = cliRecord(check.evidence);
|
|
434
|
+
if (!evidence) continue;
|
|
435
|
+
const label = check.label || check.type;
|
|
436
|
+
const expectedCount = cliFiniteNumber(evidence.expected_count);
|
|
437
|
+
const sourceLinkCount = cliFiniteNumber(evidence.source_link_count);
|
|
438
|
+
const sourceUniqueLinkCount = cliFiniteNumber(evidence.source_unique_link_count);
|
|
439
|
+
const directRouteCount = cliFiniteNumber(evidence.direct_route_count);
|
|
440
|
+
const clickthroughCount = cliFiniteNumber(evidence.clickthrough_count);
|
|
441
|
+
const topLevelFailures = Array.isArray(evidence.failures) ? evidence.failures.length : void 0;
|
|
442
|
+
const viewports = Array.isArray(evidence.viewports) ? evidence.viewports.map(cliRecord).filter((viewport) => Boolean(viewport)) : [];
|
|
443
|
+
const viewportFailureTotal = viewports.reduce((sum, viewport) => sum + (cliFiniteNumber(viewport.failure_count) || 0), 0);
|
|
444
|
+
const failureCount = topLevelFailures === void 0 ? viewportFailureTotal : topLevelFailures;
|
|
445
|
+
lines.push(
|
|
446
|
+
`- ${label}: expected ${expectedCount ?? "unknown"}, source links ${sourceLinkCount ?? "unknown"}${sourceUniqueLinkCount === void 0 ? "" : ` (${sourceUniqueLinkCount} unique)`}, direct ${directRouteCount ?? "unknown"}, clickthrough ${clickthroughCount ?? "unknown"}, failures ${failureCount}`
|
|
447
|
+
);
|
|
448
|
+
const duplicateCount = cliFiniteNumber(evidence.duplicate_source_link_count) || 0;
|
|
449
|
+
const duplicateLinks = cliStringArray(evidence.duplicate_source_links);
|
|
450
|
+
if (duplicateCount || duplicateLinks.length) {
|
|
451
|
+
const duplicateText = duplicateLinks.length ? `: ${duplicateLinks.slice(0, 8).join(", ")}${duplicateLinks.length > 8 ? `, ${duplicateLinks.length - 8} more` : ""}` : "";
|
|
452
|
+
lines.push(`- ${label} duplicate source links: ${duplicateCount}${evidence.duplicates_allowed === true ? " allowed" : ""}${duplicateText}`);
|
|
453
|
+
}
|
|
454
|
+
for (const viewport of viewports.slice(0, 8)) {
|
|
455
|
+
const viewportName = cliString(viewport.viewport) || cliString(viewport.name) || "viewport";
|
|
456
|
+
const viewportSourceLinkCount = cliFiniteNumber(viewport.source_link_count);
|
|
457
|
+
const viewportSourceUniqueLinkCount = cliFiniteNumber(viewport.source_unique_link_count);
|
|
458
|
+
const viewportDirectRouteCount = cliFiniteNumber(viewport.direct_route_count);
|
|
459
|
+
const viewportClickthroughCount = cliFiniteNumber(viewport.clickthrough_count);
|
|
460
|
+
const viewportFailureCount = cliFiniteNumber(viewport.failure_count) || 0;
|
|
461
|
+
lines.push(
|
|
462
|
+
`- ${label} ${viewportName}: source ${viewportSourceLinkCount ?? "unknown"}${viewportSourceUniqueLinkCount === void 0 ? "" : ` (${viewportSourceUniqueLinkCount} unique)`}, direct ${viewportDirectRouteCount ?? "unknown"}, clickthrough ${viewportClickthroughCount ?? "unknown"}, failures ${viewportFailureCount}`
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
if (viewports.length > 8) lines.push(`- ${label}: ${viewports.length - 8} additional viewport(s) omitted from route inventory summary.`);
|
|
466
|
+
}
|
|
467
|
+
return lines;
|
|
468
|
+
}
|
|
422
469
|
function writeProfileOutput(outputDir, result) {
|
|
423
470
|
if (!outputDir) return;
|
|
424
471
|
mkdirSync(outputDir, { recursive: true });
|
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|
|
@@ -292,7 +292,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
292
292
|
blocking?: boolean;
|
|
293
293
|
details?: Record<string, unknown>;
|
|
294
294
|
ok: boolean;
|
|
295
|
-
action: "
|
|
295
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
296
296
|
state_path: string;
|
|
297
297
|
stage: any;
|
|
298
298
|
summary: string;
|
|
@@ -382,7 +382,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
382
382
|
continueWithStage?: WorkflowStage | null;
|
|
383
383
|
blocking?: boolean;
|
|
384
384
|
details?: Record<string, unknown>;
|
|
385
|
-
action: "
|
|
385
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
386
386
|
state_path: string;
|
|
387
387
|
stage: any;
|
|
388
388
|
checkpoint: string;
|
|
@@ -659,7 +659,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
|
|
|
659
659
|
error?: undefined;
|
|
660
660
|
} | {
|
|
661
661
|
ok: boolean;
|
|
662
|
-
action: "
|
|
662
|
+
action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
|
|
663
663
|
state_path: string;
|
|
664
664
|
stage: any;
|
|
665
665
|
summary: string;
|