@riddledc/riddle-proof 0.5.44 → 0.5.46

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.
Files changed (45) hide show
  1. package/README.md +17 -0
  2. package/dist/checkpoint.cjs +366 -0
  3. package/dist/checkpoint.d.cts +44 -1
  4. package/dist/checkpoint.d.ts +44 -1
  5. package/dist/checkpoint.js +8 -2
  6. package/dist/{chunk-W7VTDN4T.js → chunk-DUFDZJOF.js} +1 -0
  7. package/dist/{chunk-7S7O3NKF.js → chunk-JTNMEH57.js} +6 -1
  8. package/dist/{chunk-MRSYJMF4.js → chunk-L26NTZOU.js} +2 -2
  9. package/dist/chunk-NOBFZDZG.js +754 -0
  10. package/dist/chunk-PLSGW2GI.js +161 -0
  11. package/dist/chunk-R6SCWJCI.js +656 -0
  12. package/dist/{chunk-MJD37CLH.js → chunk-X3AQ2WUM.js} +201 -18
  13. package/dist/cli.cjs +6129 -0
  14. package/dist/cli.d.cts +1 -0
  15. package/dist/cli.d.ts +1 -0
  16. package/dist/cli.js +160 -0
  17. package/dist/codex-exec-agent.cjs +790 -0
  18. package/dist/codex-exec-agent.d.cts +91 -0
  19. package/dist/codex-exec-agent.d.ts +91 -0
  20. package/dist/codex-exec-agent.js +10 -0
  21. package/dist/engine-harness.cjs +1013 -323
  22. package/dist/engine-harness.js +5 -4
  23. package/dist/index.cjs +1702 -247
  24. package/dist/index.d.cts +4 -2
  25. package/dist/index.d.ts +4 -2
  26. package/dist/index.js +37 -17
  27. package/dist/openclaw.js +4 -2
  28. package/dist/proof-run-engine.d.cts +3 -3
  29. package/dist/proof-run-engine.d.ts +3 -3
  30. package/dist/result.cjs +1 -0
  31. package/dist/result.js +1 -1
  32. package/dist/run-card.cjs +212 -0
  33. package/dist/run-card.d.cts +10 -0
  34. package/dist/run-card.d.ts +10 -0
  35. package/dist/run-card.js +10 -0
  36. package/dist/runner.cjs +2 -0
  37. package/dist/runner.js +5 -3
  38. package/dist/state.cjs +174 -5
  39. package/dist/state.d.cts +2 -1
  40. package/dist/state.d.ts +2 -1
  41. package/dist/state.js +4 -2
  42. package/dist/types.d.cts +64 -2
  43. package/dist/types.d.ts +64 -2
  44. package/package.json +15 -2
  45. package/dist/chunk-RI25RGQP.js +0 -293
package/dist/index.d.cts CHANGED
@@ -1,9 +1,11 @@
1
- export { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofCheckpointArtifact, RiddleProofCheckpointPacket, RiddleProofCheckpointResponse, RiddleProofCheckpointRole, RiddleProofCheckpointRoutingHint, RiddleProofCheckpointSummary, RiddleProofCheckpointVisibility, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofPrLifecycleState, RiddleProofPrLifecycleStatus, RiddleProofProofContract, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatePaths, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, RiddleProofVisualSession, RiddleProofVisualSessionFingerprintBasis, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter } from './types.cjs';
1
+ export { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofCheckpointArtifact, RiddleProofCheckpointPacket, RiddleProofCheckpointResponse, RiddleProofCheckpointRole, RiddleProofCheckpointRoutingHint, RiddleProofCheckpointSummary, RiddleProofCheckpointVisibility, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofPrLifecycleState, RiddleProofPrLifecycleStatus, RiddleProofProofContract, RiddleProofRunCard, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatePaths, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, RiddleProofVisualSession, RiddleProofVisualSessionFingerprintBasis, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter } from './types.cjs';
2
2
  export { TerminalMetadataInput, applyTerminalMetadata, compactRecord, createRunResult, isSuccessfulStatus, isTerminalStatus, nonEmptyString, normalizeTerminalMetadata, recordValue } from './result.cjs';
3
3
  export { CreateRunStateInput, RIDDLE_PROOF_RUN_STATE_VERSION, RunEventInput, appendRunEvent, appendStageHeartbeat, applyPrLifecycleState, createRunState, createRunStatusSnapshot, normalizeIntegrationContext, normalizePrLifecycleState, normalizeRunParams, setRunStatus } from './state.cjs';
4
- export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION, authorPacketPayloadFromCheckpointResponse, buildAuthorCheckpointPacket, checkpointResponseIdentity, checkpointSummaryFromState, isDuplicateCheckpointResponse, normalizeCheckpointResponse, proofContractFromAuthorCheckpointResponse, statePathsForRunState } from './checkpoint.cjs';
4
+ export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION, authorPacketPayloadFromCheckpointResponse, buildAuthorCheckpointPacket, buildCheckpointPacketForEngineResult, buildProofAssessmentCheckpointPacket, buildStageCheckpointPacket, checkpointResponseIdentity, checkpointSummaryFromState, isDuplicateCheckpointResponse, normalizeCheckpointResponse, proofContractFromAuthorCheckpointResponse, statePathsForRunState } from './checkpoint.cjs';
5
+ export { RIDDLE_PROOF_RUN_CARD_VERSION, createRiddleProofRunCard } from './run-card.cjs';
5
6
  export { RiddleProofRunnerAdapters, RunRiddleProofInput, runRiddleProof } from './runner.cjs';
6
7
  export { RiddleProofAgentAdapter, RiddleProofAgentPayload, RiddleProofCheckpointMode, RiddleProofEngine, RiddleProofEngineHarnessConfig, RiddleProofEngineHarnessContext, RiddleProofEngineResult, RiddleProofShipMode, RiddleProofWorkflowParams, RunRiddleProofEngineHarnessInput, createDisabledRiddleProofAgentAdapter, readRiddleProofRunStatus, runRiddleProofEngineHarness } from './engine-harness.cjs';
8
+ export { CodexExecAgentConfig, CodexJsonRequest, CodexJsonResult, CodexJsonRunner, createCodexExecAgentAdapter, createCodexExecJsonRunner, runCodexExecAgentDoctor } from './codex-exec-agent.cjs';
7
9
  export { CreateCaptureDiagnosticInput, DEFAULT_DIAGNOSTIC_ARRAY_LIMIT, DEFAULT_DIAGNOSTIC_HISTORY_LIMIT, DEFAULT_DIAGNOSTIC_STRING_LIMIT, RIDDLE_PROOF_CAPTURE_DIAGNOSTIC_VERSION, RiddleProofArtifactSummary, RiddleProofCaptureArtifactSummary, RiddleProofCaptureDiagnostic, RiddleProofDiagnosticRedactionOptions, appendCaptureDiagnostic, createCaptureDiagnostic, redactForProofDiagnostics, summarizeCaptureArtifacts } from './diagnostics.cjs';
8
10
  export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.cjs';
9
11
  export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.cjs';
package/dist/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
- export { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofCheckpointArtifact, RiddleProofCheckpointPacket, RiddleProofCheckpointResponse, RiddleProofCheckpointRole, RiddleProofCheckpointRoutingHint, RiddleProofCheckpointSummary, RiddleProofCheckpointVisibility, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofPrLifecycleState, RiddleProofPrLifecycleStatus, RiddleProofProofContract, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatePaths, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, RiddleProofVisualSession, RiddleProofVisualSessionFingerprintBasis, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter } from './types.js';
1
+ export { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofCheckpointArtifact, RiddleProofCheckpointPacket, RiddleProofCheckpointResponse, RiddleProofCheckpointRole, RiddleProofCheckpointRoutingHint, RiddleProofCheckpointSummary, RiddleProofCheckpointVisibility, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofPrLifecycleState, RiddleProofPrLifecycleStatus, RiddleProofProofContract, RiddleProofRunCard, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatePaths, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, RiddleProofVisualSession, RiddleProofVisualSessionFingerprintBasis, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter } from './types.js';
2
2
  export { TerminalMetadataInput, applyTerminalMetadata, compactRecord, createRunResult, isSuccessfulStatus, isTerminalStatus, nonEmptyString, normalizeTerminalMetadata, recordValue } from './result.js';
3
3
  export { CreateRunStateInput, RIDDLE_PROOF_RUN_STATE_VERSION, RunEventInput, appendRunEvent, appendStageHeartbeat, applyPrLifecycleState, createRunState, createRunStatusSnapshot, normalizeIntegrationContext, normalizePrLifecycleState, normalizeRunParams, setRunStatus } from './state.js';
4
- export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION, authorPacketPayloadFromCheckpointResponse, buildAuthorCheckpointPacket, checkpointResponseIdentity, checkpointSummaryFromState, isDuplicateCheckpointResponse, normalizeCheckpointResponse, proofContractFromAuthorCheckpointResponse, statePathsForRunState } from './checkpoint.js';
4
+ export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION, authorPacketPayloadFromCheckpointResponse, buildAuthorCheckpointPacket, buildCheckpointPacketForEngineResult, buildProofAssessmentCheckpointPacket, buildStageCheckpointPacket, checkpointResponseIdentity, checkpointSummaryFromState, isDuplicateCheckpointResponse, normalizeCheckpointResponse, proofContractFromAuthorCheckpointResponse, statePathsForRunState } from './checkpoint.js';
5
+ export { RIDDLE_PROOF_RUN_CARD_VERSION, createRiddleProofRunCard } from './run-card.js';
5
6
  export { RiddleProofRunnerAdapters, RunRiddleProofInput, runRiddleProof } from './runner.js';
6
7
  export { RiddleProofAgentAdapter, RiddleProofAgentPayload, RiddleProofCheckpointMode, RiddleProofEngine, RiddleProofEngineHarnessConfig, RiddleProofEngineHarnessContext, RiddleProofEngineResult, RiddleProofShipMode, RiddleProofWorkflowParams, RunRiddleProofEngineHarnessInput, createDisabledRiddleProofAgentAdapter, readRiddleProofRunStatus, runRiddleProofEngineHarness } from './engine-harness.js';
8
+ export { CodexExecAgentConfig, CodexJsonRequest, CodexJsonResult, CodexJsonRunner, createCodexExecAgentAdapter, createCodexExecJsonRunner, runCodexExecAgentDoctor } from './codex-exec-agent.js';
7
9
  export { CreateCaptureDiagnosticInput, DEFAULT_DIAGNOSTIC_ARRAY_LIMIT, DEFAULT_DIAGNOSTIC_HISTORY_LIMIT, DEFAULT_DIAGNOSTIC_STRING_LIMIT, RIDDLE_PROOF_CAPTURE_DIAGNOSTIC_VERSION, RiddleProofArtifactSummary, RiddleProofCaptureArtifactSummary, RiddleProofCaptureDiagnostic, RiddleProofDiagnosticRedactionOptions, appendCaptureDiagnostic, createCaptureDiagnostic, redactForProofDiagnostics, summarizeCaptureArtifacts } from './diagnostics.js';
8
10
  export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.js';
9
11
  export { AssessPlayabilityOptions, RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION, RIDDLE_PROOF_PLAYABILITY_VERSION, RiddleProofPlayabilityAssessment, RiddleProofPlayabilityEvidence, assessPlayabilityEvidence, extractPlayabilityEvidence, isRiddleProofPlayabilityMode } from './playability.js';
package/dist/index.js CHANGED
@@ -9,8 +9,13 @@ import {
9
9
  } from "./chunk-ODORKNSO.js";
10
10
  import {
11
11
  runRiddleProof
12
- } from "./chunk-MRSYJMF4.js";
12
+ } from "./chunk-L26NTZOU.js";
13
13
  import "./chunk-6F4PWJZI.js";
14
+ import {
15
+ createCodexExecAgentAdapter,
16
+ createCodexExecJsonRunner,
17
+ runCodexExecAgentDoctor
18
+ } from "./chunk-NOBFZDZG.js";
14
19
  import {
15
20
  DEFAULT_DIAGNOSTIC_ARRAY_LIMIT,
16
21
  DEFAULT_DIAGNOSTIC_HISTORY_LIMIT,
@@ -25,19 +30,8 @@ import {
25
30
  createDisabledRiddleProofAgentAdapter,
26
31
  readRiddleProofRunStatus,
27
32
  runRiddleProofEngineHarness
28
- } from "./chunk-MJD37CLH.js";
29
- import {
30
- RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
31
- RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
32
- authorPacketPayloadFromCheckpointResponse,
33
- buildAuthorCheckpointPacket,
34
- checkpointResponseIdentity,
35
- checkpointSummaryFromState,
36
- isDuplicateCheckpointResponse,
37
- normalizeCheckpointResponse,
38
- proofContractFromAuthorCheckpointResponse,
39
- statePathsForRunState
40
- } from "./chunk-RI25RGQP.js";
33
+ } from "./chunk-X3AQ2WUM.js";
34
+ import "./chunk-4ASMX4R6.js";
41
35
  import {
42
36
  RIDDLE_PROOF_RUN_STATE_VERSION,
43
37
  appendRunEvent,
@@ -49,7 +43,26 @@ import {
49
43
  normalizePrLifecycleState,
50
44
  normalizeRunParams,
51
45
  setRunStatus
52
- } from "./chunk-7S7O3NKF.js";
46
+ } from "./chunk-JTNMEH57.js";
47
+ import {
48
+ RIDDLE_PROOF_RUN_CARD_VERSION,
49
+ createRiddleProofRunCard
50
+ } from "./chunk-PLSGW2GI.js";
51
+ import {
52
+ RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION,
53
+ RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
54
+ authorPacketPayloadFromCheckpointResponse,
55
+ buildAuthorCheckpointPacket,
56
+ buildCheckpointPacketForEngineResult,
57
+ buildProofAssessmentCheckpointPacket,
58
+ buildStageCheckpointPacket,
59
+ checkpointResponseIdentity,
60
+ checkpointSummaryFromState,
61
+ isDuplicateCheckpointResponse,
62
+ normalizeCheckpointResponse,
63
+ proofContractFromAuthorCheckpointResponse,
64
+ statePathsForRunState
65
+ } from "./chunk-R6SCWJCI.js";
53
66
  import {
54
67
  applyTerminalMetadata,
55
68
  compactRecord,
@@ -59,7 +72,7 @@ import {
59
72
  nonEmptyString,
60
73
  normalizeTerminalMetadata,
61
74
  recordValue
62
- } from "./chunk-W7VTDN4T.js";
75
+ } from "./chunk-DUFDZJOF.js";
63
76
  import {
64
77
  RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION,
65
78
  RIDDLE_PROOF_PLAYABILITY_VERSION,
@@ -67,7 +80,6 @@ import {
67
80
  extractPlayabilityEvidence,
68
81
  isRiddleProofPlayabilityMode
69
82
  } from "./chunk-NSWT3VSV.js";
70
- import "./chunk-4ASMX4R6.js";
71
83
  export {
72
84
  DEFAULT_DIAGNOSTIC_ARRAY_LIMIT,
73
85
  DEFAULT_DIAGNOSTIC_HISTORY_LIMIT,
@@ -77,6 +89,7 @@ export {
77
89
  RIDDLE_PROOF_CHECKPOINT_RESPONSE_VERSION,
78
90
  RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION,
79
91
  RIDDLE_PROOF_PLAYABILITY_VERSION,
92
+ RIDDLE_PROOF_RUN_CARD_VERSION,
80
93
  RIDDLE_PROOF_RUN_STATE_VERSION,
81
94
  RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
82
95
  RIDDLE_PROOF_VISUAL_SESSION_VERSION,
@@ -88,13 +101,19 @@ export {
88
101
  assessPlayabilityEvidence,
89
102
  authorPacketPayloadFromCheckpointResponse,
90
103
  buildAuthorCheckpointPacket,
104
+ buildCheckpointPacketForEngineResult,
105
+ buildProofAssessmentCheckpointPacket,
106
+ buildStageCheckpointPacket,
91
107
  buildVisualProofSession,
92
108
  checkpointResponseIdentity,
93
109
  checkpointSummaryFromState,
94
110
  compactRecord,
95
111
  compareVisualProofSessionFingerprint,
96
112
  createCaptureDiagnostic,
113
+ createCodexExecAgentAdapter,
114
+ createCodexExecJsonRunner,
97
115
  createDisabledRiddleProofAgentAdapter,
116
+ createRiddleProofRunCard,
98
117
  createRunResult,
99
118
  createRunState,
100
119
  createRunStatusSnapshot,
@@ -114,6 +133,7 @@ export {
114
133
  readRiddleProofRunStatus,
115
134
  recordValue,
116
135
  redactForProofDiagnostics,
136
+ runCodexExecAgentDoctor,
117
137
  runRiddleProof,
118
138
  runRiddleProofEngineHarness,
119
139
  setRunStatus,
package/dist/openclaw.js CHANGED
@@ -1,10 +1,12 @@
1
1
  import {
2
2
  normalizeIntegrationContext,
3
3
  normalizeRunParams
4
- } from "./chunk-7S7O3NKF.js";
4
+ } from "./chunk-JTNMEH57.js";
5
+ import "./chunk-PLSGW2GI.js";
6
+ import "./chunk-R6SCWJCI.js";
5
7
  import {
6
8
  compactRecord
7
- } from "./chunk-W7VTDN4T.js";
9
+ } from "./chunk-DUFDZJOF.js";
8
10
 
9
11
  // src/openclaw.ts
10
12
  function parseOpenClawAssertions(value) {
@@ -277,7 +277,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
277
277
  blocking?: boolean;
278
278
  details?: Record<string, unknown>;
279
279
  ok: boolean;
280
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
280
+ action: "run" | "ship" | "setup" | "recon" | "author" | "implement" | "verify";
281
281
  state_path: string;
282
282
  stage: any;
283
283
  summary: string;
@@ -362,7 +362,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
362
362
  continueWithStage?: WorkflowStage | null;
363
363
  blocking?: boolean;
364
364
  details?: Record<string, unknown>;
365
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
365
+ action: "run" | "ship" | "setup" | "recon" | "author" | "implement" | "verify";
366
366
  state_path: string;
367
367
  stage: any;
368
368
  checkpoint: string;
@@ -624,7 +624,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
624
624
  error?: undefined;
625
625
  } | {
626
626
  ok: boolean;
627
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
627
+ action: "run" | "ship" | "setup" | "recon" | "author" | "implement" | "verify";
628
628
  state_path: string;
629
629
  stage: any;
630
630
  summary: string;
@@ -277,7 +277,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
277
277
  blocking?: boolean;
278
278
  details?: Record<string, unknown>;
279
279
  ok: boolean;
280
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
280
+ action: "run" | "ship" | "setup" | "recon" | "author" | "implement" | "verify";
281
281
  state_path: string;
282
282
  stage: any;
283
283
  summary: string;
@@ -362,7 +362,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
362
362
  continueWithStage?: WorkflowStage | null;
363
363
  blocking?: boolean;
364
364
  details?: Record<string, unknown>;
365
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
365
+ action: "run" | "ship" | "setup" | "recon" | "author" | "implement" | "verify";
366
366
  state_path: string;
367
367
  stage: any;
368
368
  checkpoint: string;
@@ -624,7 +624,7 @@ declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, reso
624
624
  error?: undefined;
625
625
  } | {
626
626
  ok: boolean;
627
- action: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
627
+ action: "run" | "ship" | "setup" | "recon" | "author" | "implement" | "verify";
628
628
  state_path: string;
629
629
  stage: any;
630
630
  summary: string;
package/dist/result.cjs CHANGED
@@ -237,6 +237,7 @@ function createRunResult(input) {
237
237
  checkpoint_summary: state.checkpoint_summary,
238
238
  state_paths: state.state_paths,
239
239
  proof_contract: state.proof_contract,
240
+ run_card: state.run_card,
240
241
  proof_session: state.proof_session,
241
242
  evidence_bundle: input.evidence_bundle,
242
243
  raw: input.raw
package/dist/result.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  nonEmptyString,
8
8
  normalizeTerminalMetadata,
9
9
  recordValue
10
- } from "./chunk-W7VTDN4T.js";
10
+ } from "./chunk-DUFDZJOF.js";
11
11
  export {
12
12
  applyTerminalMetadata,
13
13
  compactRecord,
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/run-card.ts
31
+ var run_card_exports = {};
32
+ __export(run_card_exports, {
33
+ RIDDLE_PROOF_RUN_CARD_VERSION: () => RIDDLE_PROOF_RUN_CARD_VERSION,
34
+ createRiddleProofRunCard: () => createRiddleProofRunCard
35
+ });
36
+ module.exports = __toCommonJS(run_card_exports);
37
+
38
+ // src/result.ts
39
+ function isTerminalStatus(status) {
40
+ return status === "blocked" || status === "failed" || status === "ready_to_ship" || status === "shipped" || status === "completed";
41
+ }
42
+ function compactRecord(input) {
43
+ return Object.fromEntries(Object.entries(input).filter(([, value]) => value !== void 0 && value !== null && value !== ""));
44
+ }
45
+ function nonEmptyString(value) {
46
+ return typeof value === "string" && value.trim() ? value.trim() : void 0;
47
+ }
48
+ function recordValue(value) {
49
+ return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
50
+ }
51
+
52
+ // src/checkpoint.ts
53
+ var import_node_crypto = __toESM(require("crypto"), 1);
54
+ function statePathsForRunState(state, engineStatePath) {
55
+ return compactRecord({
56
+ wrapper_state_path: state.state_path || state.request.harness_state_path || null,
57
+ engine_state_path: engineStatePath || state.request.engine_state_path || null,
58
+ resume_state_path: engineStatePath || state.request.engine_state_path || null
59
+ });
60
+ }
61
+
62
+ // src/run-card.ts
63
+ var RIDDLE_PROOF_RUN_CARD_VERSION = "riddle-proof.run-card.v1";
64
+ function elapsedMs(start, end) {
65
+ const startMs = start ? Date.parse(start) : NaN;
66
+ const endMs = end ? Date.parse(end) : NaN;
67
+ if (!Number.isFinite(startMs) || !Number.isFinite(endMs)) return void 0;
68
+ return Math.max(0, endMs - startMs);
69
+ }
70
+ function jsonCloneRecord(value) {
71
+ const record = recordValue(value);
72
+ if (!record) return void 0;
73
+ try {
74
+ return JSON.parse(JSON.stringify(record));
75
+ } catch {
76
+ return { ...record };
77
+ }
78
+ }
79
+ function compactText(value, limit = 600) {
80
+ const text = nonEmptyString(value);
81
+ if (!text) return void 0;
82
+ return text.length <= limit ? text : `${text.slice(0, limit - 20).trimEnd()}...`;
83
+ }
84
+ function visualDeltaFrom(input) {
85
+ const fullState = input.fullRiddleState || {};
86
+ const bundle = recordValue(fullState.evidence_bundle);
87
+ const after = recordValue(bundle?.after);
88
+ const afterDelta = recordValue(after?.visual_delta);
89
+ if (afterDelta && Object.keys(afterDelta).length) return afterDelta;
90
+ const requestDelta = recordValue(recordValue(fullState.proof_assessment_request)?.visual_delta);
91
+ if (requestDelta && Object.keys(requestDelta).length) return requestDelta;
92
+ const packetDelta = recordValue(input.runState.checkpoint_packet?.evidence_excerpt?.visual_delta);
93
+ return packetDelta && Object.keys(packetDelta).length ? packetDelta : void 0;
94
+ }
95
+ function artifactsFrom(input) {
96
+ const packetArtifacts = input.runState.checkpoint_packet?.artifacts;
97
+ if (packetArtifacts?.length) return packetArtifacts.slice(0, 12);
98
+ const fullState = input.fullRiddleState || {};
99
+ const artifacts = [];
100
+ for (const role of ["before", "prod", "after"]) {
101
+ const url = nonEmptyString(fullState[`${role}_cdn`]) || nonEmptyString(input.runState[`${role}_artifact_url`]);
102
+ if (url) artifacts.push({ role, url, name: `${role}.png`, mime_type: "image/png" });
103
+ }
104
+ return artifacts.length ? artifacts : void 0;
105
+ }
106
+ function ownerFor(state) {
107
+ if (state.status === "awaiting_checkpoint") {
108
+ const role = nonEmptyString(state.checkpoint_packet?.routing_hint?.suggested_role);
109
+ return role || "supervising_agent";
110
+ }
111
+ if (state.status === "running") return "engine";
112
+ if (state.status === "blocked" || state.status === "failed") return "human_or_operator";
113
+ return "none";
114
+ }
115
+ function actionFor(state) {
116
+ if (state.status === "awaiting_checkpoint") return state.checkpoint_packet?.question || "Answer the pending checkpoint.";
117
+ if (state.status === "running") return "Continue the current Riddle Proof stage.";
118
+ if (state.status === "blocked" || state.status === "failed") return state.blocker?.message || "Inspect the blocker and decide whether a new run or infrastructure repair is needed.";
119
+ if (state.status === "ready_to_ship") return "Ship is held by policy; review PR/ship policy before advancing.";
120
+ return "No next action; run is terminal.";
121
+ }
122
+ function evidenceIssueCode(input) {
123
+ const packetIssue = nonEmptyString(input.runState.checkpoint_packet?.evidence_excerpt?.evidence_issue_code);
124
+ if (packetIssue) return packetIssue;
125
+ const assessmentIssue = nonEmptyString(recordValue(input.fullRiddleState?.proof_assessment)?.evidence_issue_code);
126
+ if (assessmentIssue) return assessmentIssue;
127
+ const delta = visualDeltaFrom(input);
128
+ const status = nonEmptyString(delta?.status);
129
+ if (status === "unmeasured") {
130
+ const reason = `${nonEmptyString(delta?.reason) || ""}
131
+ ${input.runState.blocker?.message || ""}`.toLowerCase();
132
+ return reason.includes("fetch") || reason.includes("allowlist") || reason.includes("registered domain") || reason.includes("high risk") || reason.includes("comparator") ? "comparator_fetch_blocked" : "visual_delta_unmeasured";
133
+ }
134
+ if (status === "measured" && delta?.passed === false) return "semantic_proof_failed";
135
+ return void 0;
136
+ }
137
+ function createRiddleProofRunCard(state, input = {}) {
138
+ const at = input.at || (/* @__PURE__ */ new Date()).toISOString();
139
+ const fullState = input.fullRiddleState || {};
140
+ const packet = state.checkpoint_packet;
141
+ const latestEvent = state.events[state.events.length - 1];
142
+ const bundle = recordValue(fullState.evidence_bundle);
143
+ const artifactContract = jsonCloneRecord(packet?.artifact_contract) || jsonCloneRecord(recordValue(fullState.proof_assessment_request)?.artifact_contract) || jsonCloneRecord(recordValue(bundle?.artifact_contract)) || jsonCloneRecord(state.proof_contract?.artifact_contract);
144
+ const required = jsonCloneRecord(recordValue(artifactContract)?.required);
145
+ const statePaths = input.state_paths || state.state_paths || statePathsForRunState(state);
146
+ const visualDelta = visualDeltaFrom({ fullRiddleState: fullState, runState: state });
147
+ const artifacts = artifactsFrom({ fullRiddleState: fullState, runState: state });
148
+ return {
149
+ version: RIDDLE_PROOF_RUN_CARD_VERSION,
150
+ run_id: state.run_id || "unknown",
151
+ status: state.status,
152
+ goal: compactRecord({
153
+ repo: state.request.repo || nonEmptyString(fullState.repo),
154
+ branch: state.request.branch || nonEmptyString(fullState.branch),
155
+ change_request: state.request.change_request || nonEmptyString(fullState.change_request),
156
+ verification_mode: state.request.verification_mode || nonEmptyString(fullState.verification_mode),
157
+ success_criteria: state.request.success_criteria
158
+ }),
159
+ durable_state: compactRecord({
160
+ ...statePaths,
161
+ worktree_path: state.worktree_path || nonEmptyString(fullState.after_worktree) || null,
162
+ branch: state.branch || nonEmptyString(fullState.branch) || null
163
+ }),
164
+ current_phase: compactRecord({
165
+ stage: state.current_stage ?? null,
166
+ checkpoint: state.last_checkpoint ?? packet?.checkpoint ?? null,
167
+ latest_event: latestEvent?.kind ?? null,
168
+ elapsed_ms: elapsedMs(state.created_at, at),
169
+ stage_elapsed_ms: elapsedMs(state.stage_started_at, at),
170
+ iterations: state.iterations
171
+ }),
172
+ owner_next_action: compactRecord({
173
+ owner: ownerFor(state),
174
+ action: actionFor(state),
175
+ checkpoint_kind: packet?.kind || null,
176
+ allowed_decisions: packet?.allowed_decisions,
177
+ retryable: state.status === "running" || state.status === "awaiting_checkpoint",
178
+ reason: state.blocker?.code || packet?.summary || latestEvent?.summary || null
179
+ }),
180
+ evidence_contract: compactRecord({
181
+ verification_mode: state.request.verification_mode || nonEmptyString(fullState.verification_mode),
182
+ required,
183
+ artifact_contract: artifactContract,
184
+ proof_plan: compactText(state.proof_contract?.proof_plan || fullState.proof_plan, 600),
185
+ stop_condition: compactText(state.proof_contract?.stop_condition, 400)
186
+ }),
187
+ latest_evidence: compactRecord({
188
+ before_url: nonEmptyString(fullState.before_cdn) || state.before_artifact_url || null,
189
+ prod_url: nonEmptyString(fullState.prod_cdn) || state.prod_artifact_url || null,
190
+ after_url: nonEmptyString(fullState.after_cdn) || state.after_artifact_url || null,
191
+ visual_delta: visualDelta || null,
192
+ evidence_issue_code: evidenceIssueCode({ fullRiddleState: fullState, runState: state }) || null,
193
+ proof_evidence_present: fullState.proof_evidence_present === true || Boolean(bundle?.proof_evidence || bundle?.proof_evidence_sample),
194
+ artifacts
195
+ }),
196
+ stop_condition: compactRecord({
197
+ status: state.status,
198
+ terminal: isTerminalStatus(state.status),
199
+ blocker_code: state.blocker?.code || null,
200
+ blocker_message: state.blocker?.message || null,
201
+ proof_decision: state.proof_decision,
202
+ merge_recommendation: state.merge_recommendation,
203
+ monitor_should_continue: !isTerminalStatus(state.status)
204
+ }),
205
+ updated_at: state.updated_at
206
+ };
207
+ }
208
+ // Annotate the CommonJS export names for ESM import in node:
209
+ 0 && (module.exports = {
210
+ RIDDLE_PROOF_RUN_CARD_VERSION,
211
+ createRiddleProofRunCard
212
+ });
@@ -0,0 +1,10 @@
1
+ import { RiddleProofRunState, RiddleProofStatePaths, RiddleProofRunCard } from './types.cjs';
2
+
3
+ declare const RIDDLE_PROOF_RUN_CARD_VERSION: "riddle-proof.run-card.v1";
4
+ declare function createRiddleProofRunCard(state: RiddleProofRunState, input?: {
5
+ fullRiddleState?: Record<string, unknown> | null;
6
+ state_paths?: RiddleProofStatePaths;
7
+ at?: string;
8
+ }): RiddleProofRunCard;
9
+
10
+ export { RIDDLE_PROOF_RUN_CARD_VERSION, createRiddleProofRunCard };
@@ -0,0 +1,10 @@
1
+ import { RiddleProofRunState, RiddleProofStatePaths, RiddleProofRunCard } from './types.js';
2
+
3
+ declare const RIDDLE_PROOF_RUN_CARD_VERSION: "riddle-proof.run-card.v1";
4
+ declare function createRiddleProofRunCard(state: RiddleProofRunState, input?: {
5
+ fullRiddleState?: Record<string, unknown> | null;
6
+ state_paths?: RiddleProofStatePaths;
7
+ at?: string;
8
+ }): RiddleProofRunCard;
9
+
10
+ export { RIDDLE_PROOF_RUN_CARD_VERSION, createRiddleProofRunCard };
@@ -0,0 +1,10 @@
1
+ import {
2
+ RIDDLE_PROOF_RUN_CARD_VERSION,
3
+ createRiddleProofRunCard
4
+ } from "./chunk-PLSGW2GI.js";
5
+ import "./chunk-R6SCWJCI.js";
6
+ import "./chunk-DUFDZJOF.js";
7
+ export {
8
+ RIDDLE_PROOF_RUN_CARD_VERSION,
9
+ createRiddleProofRunCard
10
+ };
package/dist/runner.cjs CHANGED
@@ -127,6 +127,7 @@ function createRunResult(input) {
127
127
  checkpoint_summary: state.checkpoint_summary,
128
128
  state_paths: state.state_paths,
129
129
  proof_contract: state.proof_contract,
130
+ run_card: state.run_card,
130
131
  proof_session: state.proof_session,
131
132
  evidence_bundle: input.evidence_bundle,
132
133
  raw: input.raw
@@ -229,6 +230,7 @@ function createRunState(input) {
229
230
  checkpoint_summary: input.checkpoint_summary,
230
231
  state_paths: input.state_paths,
231
232
  proof_contract: input.proof_contract,
233
+ run_card: input.run_card,
232
234
  checkpoint_history: input.checkpoint_history,
233
235
  events: input.events ? [...input.events] : []
234
236
  });
package/dist/runner.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "./chunk-MRSYJMF4.js";
4
- import "./chunk-7S7O3NKF.js";
5
- import "./chunk-W7VTDN4T.js";
3
+ } from "./chunk-L26NTZOU.js";
4
+ import "./chunk-JTNMEH57.js";
5
+ import "./chunk-PLSGW2GI.js";
6
+ import "./chunk-R6SCWJCI.js";
7
+ import "./chunk-DUFDZJOF.js";
6
8
  export {
7
9
  runRiddleProof
8
10
  };