@riddledc/riddle-proof 0.7.67 → 0.7.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -468,8 +468,11 @@ from weak proof and environment blockers:
468
468
  `--output` writes `profile-result.json`, `summary.md`, and local copies of the
469
469
  structured `proof.json`, `console.json`, and `dom-summary.json` when they are
470
470
  available. Riddle screenshot URLs remain referenced in the result's artifact
471
- list. The profile/result schema is runner-agnostic; Riddle is the first hosted
472
- adapter.
471
+ list. When setup actions or network mocks are present, `summary.md` includes
472
+ compact setup and network mock sections so reviewers can see action counts,
473
+ setup screenshots, hit counts, required hits, max-hit caps, and failed mocks
474
+ without opening the full JSON artifact. The profile/result schema is
475
+ runner-agnostic; Riddle is the first hosted adapter.
473
476
 
474
477
  ## Runner Harness
475
478
 
package/dist/cli.cjs CHANGED
@@ -11194,6 +11194,10 @@ function profileResultMarkdown(result) {
11194
11194
  if (setupSummaryLines.length) {
11195
11195
  lines.push("", "## Setup Summary", "", ...setupSummaryLines);
11196
11196
  }
11197
+ const networkMockSummaryLines = profileNetworkMockSummaryMarkdown(result);
11198
+ if (networkMockSummaryLines.length) {
11199
+ lines.push("", "## Network Mocks", "", ...networkMockSummaryLines);
11200
+ }
11197
11201
  if (result.artifacts.riddle_artifacts?.length) {
11198
11202
  lines.push("", "## Riddle Artifacts", "");
11199
11203
  for (const artifact of result.artifacts.riddle_artifacts.slice(0, 40)) {
@@ -11243,6 +11247,41 @@ function profileSetupSummaryMarkdown(result) {
11243
11247
  if (viewports.length > 8) lines.push(`- ${viewports.length - 8} additional viewport(s) omitted from setup summary.`);
11244
11248
  return lines;
11245
11249
  }
11250
+ function cliRecordNumber(value, key) {
11251
+ return cliFiniteNumber(value[key]);
11252
+ }
11253
+ function profileNetworkMockSummaryMarkdown(result) {
11254
+ const networkCheck = result.checks.find((check) => check.type === "network_mocks_succeeded");
11255
+ const evidence = cliRecord(networkCheck?.evidence);
11256
+ if (!evidence) return [];
11257
+ const hitsByLabel = cliRecord(evidence.hits_by_label) || {};
11258
+ const requiredHitsByLabel = cliRecord(evidence.required_hits_by_label) || {};
11259
+ const maxHitsByLabel = cliRecord(evidence.max_hits_by_label) || {};
11260
+ const labels = Array.from(/* @__PURE__ */ new Set([
11261
+ ...Object.keys(hitsByLabel),
11262
+ ...Object.keys(requiredHitsByLabel),
11263
+ ...Object.keys(maxHitsByLabel)
11264
+ ])).sort();
11265
+ const mockCount = cliFiniteNumber(evidence.mock_count);
11266
+ const requiredCount = cliFiniteNumber(evidence.required_count);
11267
+ const hitCount = cliFiniteNumber(evidence.hit_count);
11268
+ const failed = Array.isArray(evidence.failed) ? evidence.failed : [];
11269
+ if (!labels.length && mockCount === void 0 && hitCount === void 0 && !failed.length) return [];
11270
+ const lines = [
11271
+ `- mocks: ${mockCount === void 0 ? labels.length : mockCount}; total hits: ${hitCount === void 0 ? "unknown" : hitCount}${requiredCount === void 0 ? "" : `; required mocks: ${requiredCount}`}`,
11272
+ `- failed mocks: ${failed.length}`
11273
+ ];
11274
+ for (const label of labels.slice(0, 16)) {
11275
+ const parts = [`hits ${cliRecordNumber(hitsByLabel, label) ?? 0}`];
11276
+ const requiredHits = cliRecordNumber(requiredHitsByLabel, label);
11277
+ const maxHits = cliRecordNumber(maxHitsByLabel, label);
11278
+ if (requiredHits !== void 0) parts.push(`required ${requiredHits}`);
11279
+ if (maxHits !== void 0) parts.push(`max ${maxHits}`);
11280
+ lines.push(`- ${label}: ${parts.join(", ")}`);
11281
+ }
11282
+ if (labels.length > 16) lines.push(`- ${labels.length - 16} additional network mock label(s) omitted from summary.`);
11283
+ return lines;
11284
+ }
11246
11285
  function writeProfileOutput(outputDir, result) {
11247
11286
  if (!outputDir) return;
11248
11287
  (0, import_node_fs6.mkdirSync)(outputDir, { recursive: true });
package/dist/cli.js CHANGED
@@ -316,6 +316,10 @@ function profileResultMarkdown(result) {
316
316
  if (setupSummaryLines.length) {
317
317
  lines.push("", "## Setup Summary", "", ...setupSummaryLines);
318
318
  }
319
+ const networkMockSummaryLines = profileNetworkMockSummaryMarkdown(result);
320
+ if (networkMockSummaryLines.length) {
321
+ lines.push("", "## Network Mocks", "", ...networkMockSummaryLines);
322
+ }
319
323
  if (result.artifacts.riddle_artifacts?.length) {
320
324
  lines.push("", "## Riddle Artifacts", "");
321
325
  for (const artifact of result.artifacts.riddle_artifacts.slice(0, 40)) {
@@ -365,6 +369,41 @@ function profileSetupSummaryMarkdown(result) {
365
369
  if (viewports.length > 8) lines.push(`- ${viewports.length - 8} additional viewport(s) omitted from setup summary.`);
366
370
  return lines;
367
371
  }
372
+ function cliRecordNumber(value, key) {
373
+ return cliFiniteNumber(value[key]);
374
+ }
375
+ function profileNetworkMockSummaryMarkdown(result) {
376
+ const networkCheck = result.checks.find((check) => check.type === "network_mocks_succeeded");
377
+ const evidence = cliRecord(networkCheck?.evidence);
378
+ if (!evidence) return [];
379
+ const hitsByLabel = cliRecord(evidence.hits_by_label) || {};
380
+ const requiredHitsByLabel = cliRecord(evidence.required_hits_by_label) || {};
381
+ const maxHitsByLabel = cliRecord(evidence.max_hits_by_label) || {};
382
+ const labels = Array.from(/* @__PURE__ */ new Set([
383
+ ...Object.keys(hitsByLabel),
384
+ ...Object.keys(requiredHitsByLabel),
385
+ ...Object.keys(maxHitsByLabel)
386
+ ])).sort();
387
+ const mockCount = cliFiniteNumber(evidence.mock_count);
388
+ const requiredCount = cliFiniteNumber(evidence.required_count);
389
+ const hitCount = cliFiniteNumber(evidence.hit_count);
390
+ const failed = Array.isArray(evidence.failed) ? evidence.failed : [];
391
+ if (!labels.length && mockCount === void 0 && hitCount === void 0 && !failed.length) return [];
392
+ const lines = [
393
+ `- mocks: ${mockCount === void 0 ? labels.length : mockCount}; total hits: ${hitCount === void 0 ? "unknown" : hitCount}${requiredCount === void 0 ? "" : `; required mocks: ${requiredCount}`}`,
394
+ `- failed mocks: ${failed.length}`
395
+ ];
396
+ for (const label of labels.slice(0, 16)) {
397
+ const parts = [`hits ${cliRecordNumber(hitsByLabel, label) ?? 0}`];
398
+ const requiredHits = cliRecordNumber(requiredHitsByLabel, label);
399
+ const maxHits = cliRecordNumber(maxHitsByLabel, label);
400
+ if (requiredHits !== void 0) parts.push(`required ${requiredHits}`);
401
+ if (maxHits !== void 0) parts.push(`max ${maxHits}`);
402
+ lines.push(`- ${label}: ${parts.join(", ")}`);
403
+ }
404
+ if (labels.length > 16) lines.push(`- ${labels.length - 16} additional network mock label(s) omitted from summary.`);
405
+ return lines;
406
+ }
368
407
  function writeProfileOutput(outputDir, result) {
369
408
  if (!outputDir) return;
370
409
  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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
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: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "run";
662
+ action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.7.67",
3
+ "version": "0.7.68",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",