@riddledc/riddle-proof 0.2.0 → 0.4.0

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/types.d.cts CHANGED
@@ -6,7 +6,8 @@ type JsonObject = {
6
6
  type RiddleProofStatus = "running" | "blocked" | "failed" | "ready_to_ship" | "shipped" | "completed";
7
7
  type RiddleProofVerificationMode = "proof" | "visual" | "interaction" | "render" | "data" | "json" | "audio" | "log" | "logs" | "metric" | "metrics" | (string & {});
8
8
  type RiddleProofDecision = "ready_to_ship" | "needs_richer_proof" | "revise_capture" | "needs_recon" | "needs_implementation" | (string & {});
9
- type RiddleProofStage = "setup" | "recon" | "author" | "implement" | "prove" | "verify" | "ship" | "notify" | (string & {});
9
+ type RiddleProofStage = "preflight" | "setup" | "recon" | "author" | "implement" | "prove" | "verify" | "ship" | "notify" | (string & {});
10
+ type RiddleProofArtifactRole = "baseline" | "after_proof" | "incidental" | "diagnostic" | (string & {});
10
11
  interface RiddleProofRunParams {
11
12
  repo?: string;
12
13
  branch?: string;
@@ -34,6 +35,11 @@ interface RiddleProofRunParams {
34
35
  color_scheme?: "dark" | "light" | (string & {});
35
36
  wait_for_selector?: string;
36
37
  ship_mode?: "none" | "ship";
38
+ engine_state_path?: string;
39
+ harness_state_path?: string;
40
+ max_iterations?: number;
41
+ auto_approve?: boolean;
42
+ dry_run?: boolean;
37
43
  integration_context?: IntegrationContext;
38
44
  }
39
45
  interface IntegrationContext {
@@ -60,7 +66,12 @@ interface RiddleProofEvent {
60
66
  }
61
67
  interface RiddleProofRunState {
62
68
  version: "riddle-proof.run-state.v1";
69
+ run_id?: string;
63
70
  state_path?: string;
71
+ worktree_path?: string;
72
+ branch?: string;
73
+ current_stage?: RiddleProofStage | null;
74
+ stage_started_at?: string | null;
64
75
  status: RiddleProofStatus;
65
76
  ok?: boolean;
66
77
  created_at: string;
@@ -80,7 +91,11 @@ interface RiddleProofRunState {
80
91
  interface RiddleProofRunResult {
81
92
  ok: boolean;
82
93
  status: RiddleProofStatus;
94
+ run_id?: string;
83
95
  state_path?: string | null;
96
+ worktree_path?: string | null;
97
+ branch?: string | null;
98
+ current_stage?: RiddleProofStage | null;
84
99
  iterations?: number;
85
100
  last_checkpoint?: string | null;
86
101
  last_summary?: string | null;
@@ -95,6 +110,21 @@ interface RiddleProofRunResult {
95
110
  evidence_bundle?: RiddleProofEvidenceBundle;
96
111
  raw?: Record<string, unknown>;
97
112
  }
113
+ interface RiddleProofRunStatusSnapshot {
114
+ run_id: string;
115
+ status: RiddleProofStatus;
116
+ current_stage?: RiddleProofStage | null;
117
+ state_path?: string | null;
118
+ worktree_path?: string | null;
119
+ branch?: string | null;
120
+ iterations: number;
121
+ last_checkpoint?: string | null;
122
+ updated_at: string;
123
+ elapsed_ms?: number;
124
+ stage_elapsed_ms?: number;
125
+ blocker?: RiddleProofBlocker;
126
+ latest_event?: RiddleProofEvent;
127
+ }
98
128
  interface RiddleProofEvidenceBundle {
99
129
  verification_mode: RiddleProofVerificationMode;
100
130
  baselines?: EvidenceReference[];
@@ -108,6 +138,7 @@ interface RiddleProofEvidenceBundle {
108
138
  }
109
139
  interface EvidenceReference {
110
140
  kind: "before" | "prod" | "after" | "comparison" | (string & {});
141
+ role?: RiddleProofArtifactRole;
111
142
  url?: string;
112
143
  path?: string;
113
144
  observed_path?: string;
@@ -117,6 +148,7 @@ interface EvidenceReference {
117
148
  interface EvidenceArtifact {
118
149
  name: string;
119
150
  kind?: "screenshot" | "json" | "log" | "metric" | "audio" | "video" | (string & {});
151
+ role?: RiddleProofArtifactRole;
120
152
  url?: string;
121
153
  path?: string;
122
154
  content_type?: string;
@@ -132,6 +164,20 @@ interface RiddleProofAssessment {
132
164
  reasons?: string[];
133
165
  source?: "supervising_agent" | "supervisor" | "human" | (string & {});
134
166
  }
167
+ interface PreflightAdapterInput {
168
+ request: RiddleProofRunParams;
169
+ state: RiddleProofRunState;
170
+ }
171
+ interface PreflightAdapterResult {
172
+ ok: boolean;
173
+ warnings?: string[];
174
+ degraded_capabilities?: string[];
175
+ blockers?: string[];
176
+ raw?: Record<string, unknown>;
177
+ }
178
+ interface PreflightAdapter {
179
+ preflight(input: PreflightAdapterInput): Promise<PreflightAdapterResult>;
180
+ }
135
181
  interface SetupAdapterInput {
136
182
  request: RiddleProofRunParams;
137
183
  state: RiddleProofRunState;
@@ -139,6 +185,9 @@ interface SetupAdapterInput {
139
185
  interface SetupAdapterResult {
140
186
  ok: boolean;
141
187
  workdir?: string;
188
+ worktree_path?: string;
189
+ branch?: string;
190
+ cleanup_policy?: "reuse" | "delete_on_success" | "delete_on_finish" | "leave_for_debug" | (string & {});
142
191
  evidence_context?: RiddleProofEvidenceBundle;
143
192
  blockers?: string[];
144
193
  raw?: Record<string, unknown>;
@@ -204,4 +253,4 @@ interface RiddleProofTerminalMetadata {
204
253
  finalized?: boolean;
205
254
  }
206
255
 
207
- export type { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofAssessment, RiddleProofBlocker, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofStage, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter };
256
+ export type { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter };
package/dist/types.d.ts CHANGED
@@ -6,7 +6,8 @@ type JsonObject = {
6
6
  type RiddleProofStatus = "running" | "blocked" | "failed" | "ready_to_ship" | "shipped" | "completed";
7
7
  type RiddleProofVerificationMode = "proof" | "visual" | "interaction" | "render" | "data" | "json" | "audio" | "log" | "logs" | "metric" | "metrics" | (string & {});
8
8
  type RiddleProofDecision = "ready_to_ship" | "needs_richer_proof" | "revise_capture" | "needs_recon" | "needs_implementation" | (string & {});
9
- type RiddleProofStage = "setup" | "recon" | "author" | "implement" | "prove" | "verify" | "ship" | "notify" | (string & {});
9
+ type RiddleProofStage = "preflight" | "setup" | "recon" | "author" | "implement" | "prove" | "verify" | "ship" | "notify" | (string & {});
10
+ type RiddleProofArtifactRole = "baseline" | "after_proof" | "incidental" | "diagnostic" | (string & {});
10
11
  interface RiddleProofRunParams {
11
12
  repo?: string;
12
13
  branch?: string;
@@ -34,6 +35,11 @@ interface RiddleProofRunParams {
34
35
  color_scheme?: "dark" | "light" | (string & {});
35
36
  wait_for_selector?: string;
36
37
  ship_mode?: "none" | "ship";
38
+ engine_state_path?: string;
39
+ harness_state_path?: string;
40
+ max_iterations?: number;
41
+ auto_approve?: boolean;
42
+ dry_run?: boolean;
37
43
  integration_context?: IntegrationContext;
38
44
  }
39
45
  interface IntegrationContext {
@@ -60,7 +66,12 @@ interface RiddleProofEvent {
60
66
  }
61
67
  interface RiddleProofRunState {
62
68
  version: "riddle-proof.run-state.v1";
69
+ run_id?: string;
63
70
  state_path?: string;
71
+ worktree_path?: string;
72
+ branch?: string;
73
+ current_stage?: RiddleProofStage | null;
74
+ stage_started_at?: string | null;
64
75
  status: RiddleProofStatus;
65
76
  ok?: boolean;
66
77
  created_at: string;
@@ -80,7 +91,11 @@ interface RiddleProofRunState {
80
91
  interface RiddleProofRunResult {
81
92
  ok: boolean;
82
93
  status: RiddleProofStatus;
94
+ run_id?: string;
83
95
  state_path?: string | null;
96
+ worktree_path?: string | null;
97
+ branch?: string | null;
98
+ current_stage?: RiddleProofStage | null;
84
99
  iterations?: number;
85
100
  last_checkpoint?: string | null;
86
101
  last_summary?: string | null;
@@ -95,6 +110,21 @@ interface RiddleProofRunResult {
95
110
  evidence_bundle?: RiddleProofEvidenceBundle;
96
111
  raw?: Record<string, unknown>;
97
112
  }
113
+ interface RiddleProofRunStatusSnapshot {
114
+ run_id: string;
115
+ status: RiddleProofStatus;
116
+ current_stage?: RiddleProofStage | null;
117
+ state_path?: string | null;
118
+ worktree_path?: string | null;
119
+ branch?: string | null;
120
+ iterations: number;
121
+ last_checkpoint?: string | null;
122
+ updated_at: string;
123
+ elapsed_ms?: number;
124
+ stage_elapsed_ms?: number;
125
+ blocker?: RiddleProofBlocker;
126
+ latest_event?: RiddleProofEvent;
127
+ }
98
128
  interface RiddleProofEvidenceBundle {
99
129
  verification_mode: RiddleProofVerificationMode;
100
130
  baselines?: EvidenceReference[];
@@ -108,6 +138,7 @@ interface RiddleProofEvidenceBundle {
108
138
  }
109
139
  interface EvidenceReference {
110
140
  kind: "before" | "prod" | "after" | "comparison" | (string & {});
141
+ role?: RiddleProofArtifactRole;
111
142
  url?: string;
112
143
  path?: string;
113
144
  observed_path?: string;
@@ -117,6 +148,7 @@ interface EvidenceReference {
117
148
  interface EvidenceArtifact {
118
149
  name: string;
119
150
  kind?: "screenshot" | "json" | "log" | "metric" | "audio" | "video" | (string & {});
151
+ role?: RiddleProofArtifactRole;
120
152
  url?: string;
121
153
  path?: string;
122
154
  content_type?: string;
@@ -132,6 +164,20 @@ interface RiddleProofAssessment {
132
164
  reasons?: string[];
133
165
  source?: "supervising_agent" | "supervisor" | "human" | (string & {});
134
166
  }
167
+ interface PreflightAdapterInput {
168
+ request: RiddleProofRunParams;
169
+ state: RiddleProofRunState;
170
+ }
171
+ interface PreflightAdapterResult {
172
+ ok: boolean;
173
+ warnings?: string[];
174
+ degraded_capabilities?: string[];
175
+ blockers?: string[];
176
+ raw?: Record<string, unknown>;
177
+ }
178
+ interface PreflightAdapter {
179
+ preflight(input: PreflightAdapterInput): Promise<PreflightAdapterResult>;
180
+ }
135
181
  interface SetupAdapterInput {
136
182
  request: RiddleProofRunParams;
137
183
  state: RiddleProofRunState;
@@ -139,6 +185,9 @@ interface SetupAdapterInput {
139
185
  interface SetupAdapterResult {
140
186
  ok: boolean;
141
187
  workdir?: string;
188
+ worktree_path?: string;
189
+ branch?: string;
190
+ cleanup_policy?: "reuse" | "delete_on_success" | "delete_on_finish" | "leave_for_debug" | (string & {});
142
191
  evidence_context?: RiddleProofEvidenceBundle;
143
192
  blockers?: string[];
144
193
  raw?: Record<string, unknown>;
@@ -204,4 +253,4 @@ interface RiddleProofTerminalMetadata {
204
253
  finalized?: boolean;
205
254
  }
206
255
 
207
- export type { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofAssessment, RiddleProofBlocker, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofStage, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter };
256
+ export type { EvidenceArtifact, EvidenceReference, ImplementationAdapter, ImplementationAdapterInput, ImplementationAdapterResult, IntegrationContext, JsonObject, JsonPrimitive, JsonValue, JudgeAdapter, NotificationAdapter, PreflightAdapter, PreflightAdapterInput, PreflightAdapterResult, ProofAdapter, ProofAdapterInput, ProofAdapterResult, RiddleProofArtifactRole, RiddleProofAssessment, RiddleProofBlocker, RiddleProofDecision, RiddleProofEvent, RiddleProofEvidenceBundle, RiddleProofRunParams, RiddleProofRunResult, RiddleProofRunState, RiddleProofRunStatusSnapshot, RiddleProofStage, RiddleProofStatus, RiddleProofTerminalMetadata, RiddleProofVerificationMode, SetupAdapter, SetupAdapterInput, SetupAdapterResult, ShipAdapter };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",
@@ -39,6 +39,11 @@
39
39
  "import": "./dist/runner.js",
40
40
  "require": "./dist/runner.cjs"
41
41
  },
42
+ "./engine-harness": {
43
+ "types": "./dist/engine-harness.d.ts",
44
+ "import": "./dist/engine-harness.js",
45
+ "require": "./dist/engine-harness.cjs"
46
+ },
42
47
  "./openclaw": {
43
48
  "types": "./dist/openclaw.d.ts",
44
49
  "import": "./dist/openclaw.js",
@@ -60,7 +65,7 @@
60
65
  "typescript": "^5.4.5"
61
66
  },
62
67
  "scripts": {
63
- "build": "tsup src/index.ts src/types.ts src/result.ts src/state.ts src/runner.ts src/openclaw.ts --format cjs,esm --dts --out-dir dist --clean",
68
+ "build": "tsup src/index.ts src/types.ts src/result.ts src/state.ts src/runner.ts src/engine-harness.ts src/openclaw.ts --format cjs,esm --dts --out-dir dist --clean",
64
69
  "clean": "rm -rf dist",
65
70
  "lint": "echo 'lint: (not configured)'",
66
71
  "test": "npm run build && node test.js"