@riddledc/riddle-proof 0.7.73 → 0.7.74

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 CHANGED
@@ -11252,7 +11252,7 @@ function profileResultMarkdown(result) {
11252
11252
  ""
11253
11253
  ];
11254
11254
  for (const check of result.checks) {
11255
- lines.push(`- ${check.status}: ${check.label || check.type}`);
11255
+ lines.push(`- ${check.status}: ${profileCheckMarkdownLabel(check)}`);
11256
11256
  if (check.message) lines.push(` ${check.message}`);
11257
11257
  }
11258
11258
  const setupSummaryLines = profileSetupSummaryMarkdown(result);
@@ -11276,6 +11276,76 @@ function profileResultMarkdown(result) {
11276
11276
  return `${lines.join("\n")}
11277
11277
  `;
11278
11278
  }
11279
+ function markdownInlineCode(value, maxLength = 80) {
11280
+ const normalized = value.replace(/\s+/g, " ").trim();
11281
+ const clipped = normalized.length > maxLength ? `${normalized.slice(0, Math.max(0, maxLength - 3))}...` : normalized;
11282
+ return `\`${clipped.replace(/`/g, "'")}\``;
11283
+ }
11284
+ function profileCheckTextTarget(evidence) {
11285
+ const text = cliString(evidence.text);
11286
+ if (text) return markdownInlineCode(text);
11287
+ const pattern = cliString(evidence.pattern);
11288
+ return pattern ? `pattern ${markdownInlineCode(pattern)}` : void 0;
11289
+ }
11290
+ function profileCheckMarkdownTarget(check) {
11291
+ const evidence = cliRecord(check.evidence);
11292
+ if (!evidence) return void 0;
11293
+ const selector = cliString(evidence.selector);
11294
+ if (check.type === "route_loaded") {
11295
+ const expectedPath = cliString(evidence.expected_path);
11296
+ return expectedPath ? markdownInlineCode(expectedPath) : void 0;
11297
+ }
11298
+ if (check.type === "selector_visible" || check.type === "selector_absent") {
11299
+ return selector ? markdownInlineCode(selector) : void 0;
11300
+ }
11301
+ if (check.type === "selector_count_at_least") {
11302
+ const minCount = cliFiniteNumber(evidence.min_count);
11303
+ return selector && minCount !== void 0 ? `${markdownInlineCode(selector)} >= ${minCount}` : void 0;
11304
+ }
11305
+ if (check.type === "selector_count_equals" || check.type === "selector_count_equal" || check.type === "selector_count_eq") {
11306
+ const expectedCount = cliFiniteNumber(evidence.expected_count);
11307
+ return selector && expectedCount !== void 0 ? `${markdownInlineCode(selector)} = ${expectedCount}` : void 0;
11308
+ }
11309
+ if (check.type === "selector_text_order") {
11310
+ return selector ? `${markdownInlineCode(selector)} text order` : void 0;
11311
+ }
11312
+ if (check.type === "text_visible" || check.type === "text_absent") {
11313
+ return profileCheckTextTarget(evidence);
11314
+ }
11315
+ if (check.type === "frame_text_visible") {
11316
+ const textTarget = profileCheckTextTarget(evidence);
11317
+ if (selector && textTarget) return `${markdownInlineCode(selector)} contains ${textTarget}`;
11318
+ return selector ? markdownInlineCode(selector) : textTarget;
11319
+ }
11320
+ if (check.type === "frame_url_equals") {
11321
+ const expectedUrl = cliString(evidence.expected_url);
11322
+ if (selector && expectedUrl) return `${markdownInlineCode(selector)} = ${markdownInlineCode(expectedUrl)}`;
11323
+ return selector ? markdownInlineCode(selector) : expectedUrl ? markdownInlineCode(expectedUrl) : void 0;
11324
+ }
11325
+ if (check.type === "frame_url_matches") {
11326
+ const pattern = cliString(evidence.pattern);
11327
+ if (selector && pattern) return `${markdownInlineCode(selector)} matches ${markdownInlineCode(pattern)}`;
11328
+ return selector ? markdownInlineCode(selector) : pattern ? `pattern ${markdownInlineCode(pattern)}` : void 0;
11329
+ }
11330
+ if (check.type === "frame_no_horizontal_overflow") {
11331
+ const maxOverflow = cliFiniteNumber(evidence.max_overflow_px);
11332
+ if (selector && maxOverflow !== void 0) return `${markdownInlineCode(selector)} <= ${maxOverflow}px`;
11333
+ return selector ? markdownInlineCode(selector) : maxOverflow !== void 0 ? `<= ${maxOverflow}px` : void 0;
11334
+ }
11335
+ if (check.type === "no_horizontal_overflow" || check.type === "no_mobile_horizontal_overflow") {
11336
+ const maxOverflow = cliFiniteNumber(evidence.max_overflow_px);
11337
+ return maxOverflow !== void 0 ? `<= ${maxOverflow}px` : void 0;
11338
+ }
11339
+ if (check.type === "no_fatal_console_errors") {
11340
+ return "0 unallowed fatal errors";
11341
+ }
11342
+ return void 0;
11343
+ }
11344
+ function profileCheckMarkdownLabel(check) {
11345
+ const label = check.label || check.type;
11346
+ const target = profileCheckMarkdownTarget(check);
11347
+ return target ? `${label} (${target})` : label;
11348
+ }
11279
11349
  function cliRecord(value) {
11280
11350
  return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
11281
11351
  }
package/dist/cli.js CHANGED
@@ -316,7 +316,7 @@ function profileResultMarkdown(result) {
316
316
  ""
317
317
  ];
318
318
  for (const check of result.checks) {
319
- lines.push(`- ${check.status}: ${check.label || check.type}`);
319
+ lines.push(`- ${check.status}: ${profileCheckMarkdownLabel(check)}`);
320
320
  if (check.message) lines.push(` ${check.message}`);
321
321
  }
322
322
  const setupSummaryLines = profileSetupSummaryMarkdown(result);
@@ -340,6 +340,76 @@ function profileResultMarkdown(result) {
340
340
  return `${lines.join("\n")}
341
341
  `;
342
342
  }
343
+ function markdownInlineCode(value, maxLength = 80) {
344
+ const normalized = value.replace(/\s+/g, " ").trim();
345
+ const clipped = normalized.length > maxLength ? `${normalized.slice(0, Math.max(0, maxLength - 3))}...` : normalized;
346
+ return `\`${clipped.replace(/`/g, "'")}\``;
347
+ }
348
+ function profileCheckTextTarget(evidence) {
349
+ const text = cliString(evidence.text);
350
+ if (text) return markdownInlineCode(text);
351
+ const pattern = cliString(evidence.pattern);
352
+ return pattern ? `pattern ${markdownInlineCode(pattern)}` : void 0;
353
+ }
354
+ function profileCheckMarkdownTarget(check) {
355
+ const evidence = cliRecord(check.evidence);
356
+ if (!evidence) return void 0;
357
+ const selector = cliString(evidence.selector);
358
+ if (check.type === "route_loaded") {
359
+ const expectedPath = cliString(evidence.expected_path);
360
+ return expectedPath ? markdownInlineCode(expectedPath) : void 0;
361
+ }
362
+ if (check.type === "selector_visible" || check.type === "selector_absent") {
363
+ return selector ? markdownInlineCode(selector) : void 0;
364
+ }
365
+ if (check.type === "selector_count_at_least") {
366
+ const minCount = cliFiniteNumber(evidence.min_count);
367
+ return selector && minCount !== void 0 ? `${markdownInlineCode(selector)} >= ${minCount}` : void 0;
368
+ }
369
+ if (check.type === "selector_count_equals" || check.type === "selector_count_equal" || check.type === "selector_count_eq") {
370
+ const expectedCount = cliFiniteNumber(evidence.expected_count);
371
+ return selector && expectedCount !== void 0 ? `${markdownInlineCode(selector)} = ${expectedCount}` : void 0;
372
+ }
373
+ if (check.type === "selector_text_order") {
374
+ return selector ? `${markdownInlineCode(selector)} text order` : void 0;
375
+ }
376
+ if (check.type === "text_visible" || check.type === "text_absent") {
377
+ return profileCheckTextTarget(evidence);
378
+ }
379
+ if (check.type === "frame_text_visible") {
380
+ const textTarget = profileCheckTextTarget(evidence);
381
+ if (selector && textTarget) return `${markdownInlineCode(selector)} contains ${textTarget}`;
382
+ return selector ? markdownInlineCode(selector) : textTarget;
383
+ }
384
+ if (check.type === "frame_url_equals") {
385
+ const expectedUrl = cliString(evidence.expected_url);
386
+ if (selector && expectedUrl) return `${markdownInlineCode(selector)} = ${markdownInlineCode(expectedUrl)}`;
387
+ return selector ? markdownInlineCode(selector) : expectedUrl ? markdownInlineCode(expectedUrl) : void 0;
388
+ }
389
+ if (check.type === "frame_url_matches") {
390
+ const pattern = cliString(evidence.pattern);
391
+ if (selector && pattern) return `${markdownInlineCode(selector)} matches ${markdownInlineCode(pattern)}`;
392
+ return selector ? markdownInlineCode(selector) : pattern ? `pattern ${markdownInlineCode(pattern)}` : void 0;
393
+ }
394
+ if (check.type === "frame_no_horizontal_overflow") {
395
+ const maxOverflow = cliFiniteNumber(evidence.max_overflow_px);
396
+ if (selector && maxOverflow !== void 0) return `${markdownInlineCode(selector)} <= ${maxOverflow}px`;
397
+ return selector ? markdownInlineCode(selector) : maxOverflow !== void 0 ? `<= ${maxOverflow}px` : void 0;
398
+ }
399
+ if (check.type === "no_horizontal_overflow" || check.type === "no_mobile_horizontal_overflow") {
400
+ const maxOverflow = cliFiniteNumber(evidence.max_overflow_px);
401
+ return maxOverflow !== void 0 ? `<= ${maxOverflow}px` : void 0;
402
+ }
403
+ if (check.type === "no_fatal_console_errors") {
404
+ return "0 unallowed fatal errors";
405
+ }
406
+ return void 0;
407
+ }
408
+ function profileCheckMarkdownLabel(check) {
409
+ const label = check.label || check.type;
410
+ const target = profileCheckMarkdownTarget(check);
411
+ return target ? `${label} (${target})` : label;
412
+ }
343
413
  function cliRecord(value) {
344
414
  return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
345
415
  }
@@ -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.73",
3
+ "version": "0.7.74",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",