@riddledc/riddle-proof 0.7.142 → 0.7.143

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
@@ -14651,6 +14651,10 @@ function profileResultMarkdown(result) {
14651
14651
  if (environmentBlockerLines.length) {
14652
14652
  lines.push("", "## Environment Blocker", "", ...environmentBlockerLines);
14653
14653
  }
14654
+ const riddleJobLines = profileRiddleJobMarkdown(result);
14655
+ if (riddleJobLines.length) {
14656
+ lines.push("", "## Riddle Job", "", ...riddleJobLines);
14657
+ }
14654
14658
  if (result.artifacts.riddle_artifacts?.length) {
14655
14659
  lines.push("", "## Riddle Artifacts", "");
14656
14660
  for (const artifact of result.artifacts.riddle_artifacts.slice(0, 40)) {
@@ -14660,6 +14664,34 @@ function profileResultMarkdown(result) {
14660
14664
  return `${lines.join("\n")}
14661
14665
  `;
14662
14666
  }
14667
+ function profileRiddleJobMarkdown(result) {
14668
+ const riddle = cliRecord(result.riddle);
14669
+ if (!riddle) return [];
14670
+ const jobId = cliString(riddle.job_id);
14671
+ const status = cliString(riddle.status);
14672
+ const terminal = typeof riddle.terminal === "boolean" ? riddle.terminal : void 0;
14673
+ const queueElapsedMs = cliFiniteNumber(riddle.queue_elapsed_ms);
14674
+ const elapsedMs3 = cliFiniteNumber(riddle.elapsed_ms);
14675
+ const attempt = cliFiniteNumber(riddle.attempt);
14676
+ const attempts = cliFiniteNumber(riddle.attempts);
14677
+ const submittedAt = cliString(riddle.submitted_at);
14678
+ const completedAt = cliString(riddle.completed_at);
14679
+ const parts = [
14680
+ jobId ? `job ${markdownInlineCode(jobId)}` : "",
14681
+ status ? `status ${markdownInlineCode(status)}` : "",
14682
+ terminal === void 0 ? "" : `terminal ${terminal ? "true" : "false"}`
14683
+ ].filter(Boolean);
14684
+ const lines = parts.length ? [`- ${parts.join(", ")}`] : [];
14685
+ if (queueElapsedMs !== void 0 || elapsedMs3 !== void 0 || attempt !== void 0 || attempts !== void 0) {
14686
+ lines.push(
14687
+ `- poll: queue ${formatPollDuration(queueElapsedMs)}, elapsed ${formatPollDuration(elapsedMs3)}${attempt === void 0 ? "" : `, attempt ${attempt}${attempts === void 0 ? "" : `/${attempts}`}`}`
14688
+ );
14689
+ }
14690
+ if (submittedAt || completedAt) {
14691
+ lines.push(`- timing:${submittedAt ? ` submitted ${markdownInlineCode(submittedAt)}` : ""}${completedAt ? ` completed ${markdownInlineCode(completedAt)}` : ""}`);
14692
+ }
14693
+ return lines;
14694
+ }
14663
14695
  function markdownInlineCode(value, maxLength = 80) {
14664
14696
  const normalized = value.replace(/\s+/g, " ").trim();
14665
14697
  const clipped = normalized.length > maxLength ? `${normalized.slice(0, Math.max(0, maxLength - 3))}...` : normalized;
@@ -15203,13 +15235,22 @@ async function profileResultFromRiddleArtifacts(profile, artifacts, fallbackInpu
15203
15235
  return void 0;
15204
15236
  }
15205
15237
  function withRiddleMetadata(result, input) {
15238
+ const poll = input.poll;
15206
15239
  return {
15207
15240
  ...result,
15208
15241
  riddle: {
15209
15242
  ...result.riddle || {},
15210
15243
  job_id: input.job_id || result.riddle?.job_id,
15211
15244
  status: input.status ?? result.riddle?.status,
15212
- terminal: input.terminal ?? result.riddle?.terminal
15245
+ terminal: input.terminal ?? result.riddle?.terminal,
15246
+ created_at: poll?.created_at ?? result.riddle?.created_at,
15247
+ submitted_at: poll?.submitted_at ?? result.riddle?.submitted_at,
15248
+ completed_at: poll?.completed_at ?? result.riddle?.completed_at,
15249
+ queue_elapsed_ms: poll?.queue_elapsed_ms ?? result.riddle?.queue_elapsed_ms,
15250
+ elapsed_ms: poll?.elapsed_ms ?? result.riddle?.elapsed_ms,
15251
+ attempt: poll?.attempt ?? result.riddle?.attempt,
15252
+ attempts: poll?.attempts ?? result.riddle?.attempts,
15253
+ timed_out: poll?.timed_out ?? result.riddle?.timed_out
15213
15254
  },
15214
15255
  artifacts: {
15215
15256
  ...result.artifacts,
@@ -15217,6 +15258,21 @@ function withRiddleMetadata(result, input) {
15217
15258
  }
15218
15259
  };
15219
15260
  }
15261
+ function riddleMetadataFromPoll(jobId, poll) {
15262
+ return {
15263
+ job_id: jobId,
15264
+ status: poll.status,
15265
+ terminal: poll.terminal,
15266
+ created_at: poll.poll?.created_at,
15267
+ submitted_at: poll.poll?.submitted_at,
15268
+ completed_at: poll.poll?.completed_at,
15269
+ queue_elapsed_ms: poll.poll?.queue_elapsed_ms,
15270
+ elapsed_ms: poll.poll?.elapsed_ms,
15271
+ attempt: poll.poll?.attempt,
15272
+ attempts: poll.poll?.attempts,
15273
+ timed_out: poll.poll?.timed_out
15274
+ };
15275
+ }
15220
15276
  async function runProfileForCli(profile, options) {
15221
15277
  const runner = optionString(options, "runner") || "riddle";
15222
15278
  if (runner !== "riddle") {
@@ -15261,7 +15317,7 @@ async function runProfileForCli(profile, options) {
15261
15317
  profile,
15262
15318
  runner,
15263
15319
  error: `Riddle job ${jobId} ended with status ${poll.status || "unknown"}.`,
15264
- riddle: { job_id: jobId, status: poll.status, terminal: poll.terminal },
15320
+ riddle: riddleMetadataFromPoll(jobId, poll),
15265
15321
  artifacts
15266
15322
  });
15267
15323
  }
@@ -15270,7 +15326,7 @@ async function runProfileForCli(profile, options) {
15270
15326
  return createRiddleProofProfileInsufficientResult({
15271
15327
  profile,
15272
15328
  runner,
15273
- riddle: { job_id: jobId, status: poll.status, terminal: poll.terminal },
15329
+ riddle: riddleMetadataFromPoll(jobId, poll),
15274
15330
  artifacts
15275
15331
  });
15276
15332
  }
@@ -15278,6 +15334,7 @@ async function runProfileForCli(profile, options) {
15278
15334
  job_id: jobId,
15279
15335
  status: poll.status,
15280
15336
  terminal: poll.terminal,
15337
+ poll: poll.poll,
15281
15338
  artifacts
15282
15339
  });
15283
15340
  }
package/dist/cli.js CHANGED
@@ -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;
@@ -950,13 +982,22 @@ async function profileResultFromRiddleArtifacts(profile, artifacts, fallbackInpu
950
982
  return void 0;
951
983
  }
952
984
  function withRiddleMetadata(result, input) {
985
+ const poll = input.poll;
953
986
  return {
954
987
  ...result,
955
988
  riddle: {
956
989
  ...result.riddle || {},
957
990
  job_id: input.job_id || result.riddle?.job_id,
958
991
  status: input.status ?? result.riddle?.status,
959
- terminal: input.terminal ?? result.riddle?.terminal
992
+ terminal: input.terminal ?? result.riddle?.terminal,
993
+ created_at: poll?.created_at ?? result.riddle?.created_at,
994
+ submitted_at: poll?.submitted_at ?? result.riddle?.submitted_at,
995
+ completed_at: poll?.completed_at ?? result.riddle?.completed_at,
996
+ queue_elapsed_ms: poll?.queue_elapsed_ms ?? result.riddle?.queue_elapsed_ms,
997
+ elapsed_ms: poll?.elapsed_ms ?? result.riddle?.elapsed_ms,
998
+ attempt: poll?.attempt ?? result.riddle?.attempt,
999
+ attempts: poll?.attempts ?? result.riddle?.attempts,
1000
+ timed_out: poll?.timed_out ?? result.riddle?.timed_out
960
1001
  },
961
1002
  artifacts: {
962
1003
  ...result.artifacts,
@@ -964,6 +1005,21 @@ function withRiddleMetadata(result, input) {
964
1005
  }
965
1006
  };
966
1007
  }
1008
+ function riddleMetadataFromPoll(jobId, poll) {
1009
+ return {
1010
+ job_id: jobId,
1011
+ status: poll.status,
1012
+ terminal: poll.terminal,
1013
+ created_at: poll.poll?.created_at,
1014
+ submitted_at: poll.poll?.submitted_at,
1015
+ completed_at: poll.poll?.completed_at,
1016
+ queue_elapsed_ms: poll.poll?.queue_elapsed_ms,
1017
+ elapsed_ms: poll.poll?.elapsed_ms,
1018
+ attempt: poll.poll?.attempt,
1019
+ attempts: poll.poll?.attempts,
1020
+ timed_out: poll.poll?.timed_out
1021
+ };
1022
+ }
967
1023
  async function runProfileForCli(profile, options) {
968
1024
  const runner = optionString(options, "runner") || "riddle";
969
1025
  if (runner !== "riddle") {
@@ -1008,7 +1064,7 @@ async function runProfileForCli(profile, options) {
1008
1064
  profile,
1009
1065
  runner,
1010
1066
  error: `Riddle job ${jobId} ended with status ${poll.status || "unknown"}.`,
1011
- riddle: { job_id: jobId, status: poll.status, terminal: poll.terminal },
1067
+ riddle: riddleMetadataFromPoll(jobId, poll),
1012
1068
  artifacts
1013
1069
  });
1014
1070
  }
@@ -1017,7 +1073,7 @@ async function runProfileForCli(profile, options) {
1017
1073
  return createRiddleProofProfileInsufficientResult({
1018
1074
  profile,
1019
1075
  runner,
1020
- riddle: { job_id: jobId, status: poll.status, terminal: poll.terminal },
1076
+ riddle: riddleMetadataFromPoll(jobId, poll),
1021
1077
  artifacts
1022
1078
  });
1023
1079
  }
@@ -1025,6 +1081,7 @@ async function runProfileForCli(profile, options) {
1025
1081
  job_id: jobId,
1026
1082
  status: poll.status,
1027
1083
  terminal: poll.terminal,
1084
+ poll: poll.poll,
1028
1085
  artifacts
1029
1086
  });
1030
1087
  }
@@ -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;
@@ -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.142",
3
+ "version": "0.7.143",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",