@riddledc/riddle-proof 0.8.12 → 0.8.14

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 (36) hide show
  1. package/dist/advanced/engine-harness.cjs +101 -31
  2. package/dist/advanced/engine-harness.js +1 -1
  3. package/dist/advanced/index.cjs +101 -31
  4. package/dist/advanced/index.d.cts +2 -2
  5. package/dist/advanced/index.d.ts +2 -2
  6. package/dist/advanced/index.js +2 -2
  7. package/dist/advanced/proof-run-core.d.cts +1 -1
  8. package/dist/advanced/proof-run-core.d.ts +1 -1
  9. package/dist/advanced/proof-run-engine.cjs +101 -31
  10. package/dist/advanced/proof-run-engine.d.cts +2 -2
  11. package/dist/advanced/proof-run-engine.d.ts +2 -2
  12. package/dist/advanced/proof-run-engine.js +1 -1
  13. package/dist/{chunk-SZUC4MDN.js → chunk-EGZT3EVL.js} +1 -1
  14. package/dist/{chunk-JBY2SU5U.js → chunk-WJZYRUNV.js} +101 -31
  15. package/dist/cli/index.js +2 -2
  16. package/dist/cli.cjs +101 -31
  17. package/dist/cli.js +2 -2
  18. package/dist/engine-harness.cjs +101 -31
  19. package/dist/engine-harness.js +1 -1
  20. package/dist/index.cjs +101 -31
  21. package/dist/index.js +1 -1
  22. package/dist/{proof-run-core-CrpYH-qH.d.ts → proof-run-core-C8FDUhle.d.cts} +1 -1
  23. package/dist/{proof-run-core-CrpYH-qH.d.cts → proof-run-core-C8FDUhle.d.ts} +1 -1
  24. package/dist/proof-run-core.d.cts +1 -1
  25. package/dist/proof-run-core.d.ts +1 -1
  26. package/dist/{proof-run-engine-h9C1lC0w.d.ts → proof-run-engine-By7oLsF-.d.ts} +4 -4
  27. package/dist/{proof-run-engine-C6vYAZd8.d.cts → proof-run-engine-D80hVFMf.d.cts} +4 -4
  28. package/dist/proof-run-engine.cjs +101 -31
  29. package/dist/proof-run-engine.d.cts +2 -2
  30. package/dist/proof-run-engine.d.ts +2 -2
  31. package/dist/proof-run-engine.js +1 -1
  32. package/package.json +1 -1
  33. package/runtime/lib/verify.py +179 -11
  34. package/runtime/tests/recon_verify_smoke.py +142 -0
  35. package/runtime/tests/trust_boundary_regression.py +6 -0
  36. /package/dist/{chunk-RTLA6CPP.js → chunk-YFRPFV4U.js} +0 -0
package/dist/index.cjs CHANGED
@@ -1139,6 +1139,12 @@ function snapshotFor(statePath) {
1139
1139
  function authorReady(state) {
1140
1140
  return state?.author_status === "ready" || state?.proof_plan_status === "ready";
1141
1141
  }
1142
+ function hasAuthoredProofPlan2(state = {}) {
1143
+ return Boolean((state?.proof_plan || "").trim()) && Boolean((state?.capture_script || "").trim());
1144
+ }
1145
+ function hasExplicitCaptureScript(state = {}) {
1146
+ return Boolean((state?.capture_script || "").trim());
1147
+ }
1142
1148
  function implementationReady(state) {
1143
1149
  return ["changes_detected", "completed"].includes(state?.implementation_status || "");
1144
1150
  }
@@ -1169,6 +1175,45 @@ function latestReconHasRequiredBaselines(state) {
1169
1175
  const baselines = latestReconCapturedBaselines(state);
1170
1176
  return requiredReconBaselineLabels(state).every((label) => Boolean((baselines?.[label]?.url || "").trim()));
1171
1177
  }
1178
+ function canAutoAcceptExplicitCaptureRecon(params, state) {
1179
+ const labels = requiredReconBaselineLabels(state);
1180
+ return Boolean(
1181
+ !implementationRequired(params, state) && hasExplicitCaptureScript(state) && ["needs_agent_decision", "needs_supervisor_judgment"].includes(state?.recon_status || "") && labels.length > 0 && latestReconHasRequiredBaselines(state)
1182
+ );
1183
+ }
1184
+ function applyExplicitCaptureReconAcceptance(state) {
1185
+ const baselines = promoteLatestReconBaselines(state);
1186
+ const labels = requiredReconBaselineLabels(state);
1187
+ const selected = latestReconAttempt(state) || {};
1188
+ state.recon_status = "ready_for_proof_plan";
1189
+ state.recon_results = state.recon_results || {};
1190
+ state.recon_results.status = "ready_for_proof_plan";
1191
+ state.recon_results.baselines = baselines;
1192
+ state.recon_assessment_request = {};
1193
+ state.recon_decision_request = {};
1194
+ state.recon_assessment = {
1195
+ decision: "ready_for_author",
1196
+ continue_with_stage: "author",
1197
+ source: "runner_auto_accept",
1198
+ summary: "Runner accepted recon automatically because this audit/no-diff run already supplied an explicit capture script, and the required baseline capture exists.",
1199
+ baseline_labels: labels
1200
+ };
1201
+ state.recon_assessment_source = "runner_auto_accept";
1202
+ state.recon_baseline_understanding = state.recon_baseline_understanding || {
1203
+ reference: state?.reference || state?.requested_reference || "before",
1204
+ target_route: selected?.plan?.target_path || state?.server_path || "/",
1205
+ proof_focus: state?.proof_plan || state?.change_request || "",
1206
+ stop_condition: "Verify must judge the authored capture evidence against the explicit proof packet."
1207
+ };
1208
+ if (hasAuthoredProofPlan2(state)) {
1209
+ state.author_status = "ready";
1210
+ state.proof_plan_status = "ready";
1211
+ } else {
1212
+ state.author_status = "needs_authoring";
1213
+ state.proof_plan_status = "needs_authoring";
1214
+ }
1215
+ return { baselines, labels };
1216
+ }
1172
1217
  function hasReconBaselineUnderstanding(state) {
1173
1218
  const understanding = state?.recon_assessment?.baseline_understanding || state?.recon_baseline_understanding || {};
1174
1219
  return Boolean(
@@ -2195,6 +2240,7 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
2195
2240
  state = readState(config.statePath);
2196
2241
  }
2197
2242
  }
2243
+ let reconAutoAcceptedExplicitCapture = false;
2198
2244
  if (!state?.recon_results || state?.stage === "setup" || state?.stage === "preflight" || ["needs_agent_decision", "needs_supervisor_judgment"].includes(state?.recon_status || "") || requestedStage === "recon") {
2199
2245
  const reconRes = runOne("recon");
2200
2246
  executed.push(executedStep(reconRes));
@@ -2207,40 +2253,64 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
2207
2253
  }
2208
2254
  state = readState(config.statePath);
2209
2255
  if (["needs_agent_decision", "needs_supervisor_judgment"].includes(state?.recon_status || "")) {
2210
- const reconAssessmentRequest = state?.recon_assessment_request || state?.recon_decision_request || null;
2211
- const summary = "Recon gathered route hints, candidate paths, baseline captures, and observations. The supervising agent should now judge whether the latest baseline is trustworthy, whether recon should retry/reframe, and whether recon is done.";
2212
- const reconDetails = {
2213
- executed,
2214
- latestAttempt: latestReconAttempt(state),
2215
- latestCapturedBaselines: latestReconCapturedBaselines(state),
2216
- reconAssessmentRequest
2217
- };
2218
- recordAttempt("recon", "checkpoint", summary, {
2256
+ if (canAutoAcceptExplicitCaptureRecon(params, state)) {
2257
+ const promoted = updateState(config.statePath, (currentState) => {
2258
+ applyExplicitCaptureReconAcceptance(currentState);
2259
+ });
2260
+ state = promoted;
2261
+ reconAutoAcceptedExplicitCapture = true;
2262
+ effectiveAdvanceStage = stageAfterAuthor(state, params);
2263
+ requestedStage = normalizeStageRequest(state, effectiveAdvanceStage);
2264
+ updateState(config.statePath, (currentState) => {
2265
+ currentState.last_requested_advance_stage = effectiveAdvanceStage;
2266
+ });
2267
+ recordAttempt("recon", "completed", "Recon baseline was captured and auto-accepted for an explicit audit/no-diff proof packet.", {
2268
+ autoApproved: true,
2269
+ checkpoint: "recon_auto_accept_explicit_capture",
2270
+ details: {
2271
+ executed,
2272
+ promotedBaselines: latestReconCapturedBaselines(state),
2273
+ baselineLabels: requiredReconBaselineLabels(state)
2274
+ }
2275
+ });
2276
+ } else {
2277
+ const reconAssessmentRequest = state?.recon_assessment_request || state?.recon_decision_request || null;
2278
+ const summary = "Recon gathered route hints, candidate paths, baseline captures, and observations. The supervising agent should now judge whether the latest baseline is trustworthy, whether recon should retry/reframe, and whether recon is done.";
2279
+ const reconDetails = {
2280
+ executed,
2281
+ latestAttempt: latestReconAttempt(state),
2282
+ latestCapturedBaselines: latestReconCapturedBaselines(state),
2283
+ reconAssessmentRequest
2284
+ };
2285
+ recordAttempt("recon", "checkpoint", summary, {
2286
+ autoApproved: reconRes.autoApproved || false,
2287
+ checkpoint: "recon_supervisor_judgment",
2288
+ details: reconDetails
2289
+ });
2290
+ return checkpoint(
2291
+ "recon",
2292
+ "recon_supervisor_judgment",
2293
+ summary,
2294
+ {
2295
+ nextActions: ["inspect_recon_packet", "supply_recon_assessment_json", "continue_internal_loop_with_checkpoint"],
2296
+ advanceOptions: ["recon", "author"],
2297
+ recommendedAdvanceStage: "recon",
2298
+ continueWithStage: "recon",
2299
+ blocking: false,
2300
+ details: reconDetails,
2301
+ reconAssessmentRequest,
2302
+ reconDecisionRequest: state?.recon_decision_request || null,
2303
+ executed
2304
+ }
2305
+ );
2306
+ }
2307
+ }
2308
+ if (!reconAutoAcceptedExplicitCapture) {
2309
+ recordAttempt("recon", "completed", "Recon completed and promoted an approved baseline context.", {
2219
2310
  autoApproved: reconRes.autoApproved || false,
2220
- checkpoint: "recon_supervisor_judgment",
2221
- details: reconDetails
2311
+ details: { executed }
2222
2312
  });
2223
- return checkpoint(
2224
- "recon",
2225
- "recon_supervisor_judgment",
2226
- summary,
2227
- {
2228
- nextActions: ["inspect_recon_packet", "supply_recon_assessment_json", "continue_internal_loop_with_checkpoint"],
2229
- advanceOptions: ["recon", "author"],
2230
- recommendedAdvanceStage: "recon",
2231
- continueWithStage: "recon",
2232
- blocking: false,
2233
- details: reconDetails,
2234
- reconAssessmentRequest,
2235
- reconDecisionRequest: state?.recon_decision_request || null,
2236
- executed
2237
- }
2238
- );
2239
2313
  }
2240
- recordAttempt("recon", "completed", "Recon completed and promoted an approved baseline context.", {
2241
- autoApproved: reconRes.autoApproved || false,
2242
- details: { executed }
2243
- });
2244
2314
  }
2245
2315
  state = readState(config.statePath);
2246
2316
  if (!authorReady(state) || effectiveAdvanceStage === "author") {
package/dist/index.js CHANGED
@@ -95,7 +95,7 @@ import {
95
95
  createDisabledRiddleProofAgentAdapter,
96
96
  readRiddleProofRunStatus,
97
97
  runRiddleProofEngineHarness
98
- } from "./chunk-RTLA6CPP.js";
98
+ } from "./chunk-YFRPFV4U.js";
99
99
  import {
100
100
  RIDDLE_PROOF_RUN_STATE_VERSION,
101
101
  appendRunEvent,
@@ -121,7 +121,7 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
121
121
  target_image_hash: string;
122
122
  viewport_matrix_json: string;
123
123
  deterministic_setup_json: string;
124
- reference: "prod" | "before" | "both";
124
+ reference: "before" | "prod" | "both";
125
125
  base_branch: string;
126
126
  before_ref: string;
127
127
  allow_static_preview_fallback: string;
@@ -121,7 +121,7 @@ declare function buildSetupArgs(params: WorkflowParams, config: ReturnType<typeo
121
121
  target_image_hash: string;
122
122
  viewport_matrix_json: string;
123
123
  deterministic_setup_json: string;
124
- reference: "prod" | "before" | "both";
124
+ reference: "before" | "prod" | "both";
125
125
  base_branch: string;
126
126
  before_ref: string;
127
127
  allow_static_preview_fallback: string;
@@ -1 +1 @@
1
- export { B as BUNDLED_RIDDLE_PROOF_DIR, C as CHECKPOINT_CONTRACT_VERSION, b as CheckpointInputContract, P as PluginConfig, R as RIDDLE_PROOF_DIR_CANDIDATES, S as ShipGateValidation, c as WORKFLOW_STAGE_ORDER, d as WorkflowAction, W as WorkflowParams, a as WorkflowStage, e as buildCheckpointContract, f as buildSetupArgs, g as checkpointContinueStage, h as clearStageDecisionRequest, i as ensureAction, j as ensureStageLoopState, k as invalidateVerifyEvidence, m as mergeStateFromParams, n as noImplementationModeFor, l as previewModeFromWorkflowMode, o as proofAssessmentHardBlockersForState, q as readState, s as recordStageAttempt, t as requiredBaselineLabelsForState, r as resolveConfig, u as resolveRiddleProofDir, v as setStageDecisionRequest, w as summarizeState, x as validateShipGate, y as visualDeltaForState, z as visualDeltaRequiredForState, A as visualDeltaShipGateReason, D as workflowFile, E as writeState } from './proof-run-core-CrpYH-qH.cjs';
1
+ export { B as BUNDLED_RIDDLE_PROOF_DIR, C as CHECKPOINT_CONTRACT_VERSION, b as CheckpointInputContract, P as PluginConfig, R as RIDDLE_PROOF_DIR_CANDIDATES, S as ShipGateValidation, c as WORKFLOW_STAGE_ORDER, d as WorkflowAction, W as WorkflowParams, a as WorkflowStage, e as buildCheckpointContract, f as buildSetupArgs, g as checkpointContinueStage, h as clearStageDecisionRequest, i as ensureAction, j as ensureStageLoopState, k as invalidateVerifyEvidence, m as mergeStateFromParams, n as noImplementationModeFor, l as previewModeFromWorkflowMode, o as proofAssessmentHardBlockersForState, q as readState, s as recordStageAttempt, t as requiredBaselineLabelsForState, r as resolveConfig, u as resolveRiddleProofDir, v as setStageDecisionRequest, w as summarizeState, x as validateShipGate, y as visualDeltaForState, z as visualDeltaRequiredForState, A as visualDeltaShipGateReason, D as workflowFile, E as writeState } from './proof-run-core-C8FDUhle.cjs';
@@ -1 +1 @@
1
- export { B as BUNDLED_RIDDLE_PROOF_DIR, C as CHECKPOINT_CONTRACT_VERSION, b as CheckpointInputContract, P as PluginConfig, R as RIDDLE_PROOF_DIR_CANDIDATES, S as ShipGateValidation, c as WORKFLOW_STAGE_ORDER, d as WorkflowAction, W as WorkflowParams, a as WorkflowStage, e as buildCheckpointContract, f as buildSetupArgs, g as checkpointContinueStage, h as clearStageDecisionRequest, i as ensureAction, j as ensureStageLoopState, k as invalidateVerifyEvidence, m as mergeStateFromParams, n as noImplementationModeFor, l as previewModeFromWorkflowMode, o as proofAssessmentHardBlockersForState, q as readState, s as recordStageAttempt, t as requiredBaselineLabelsForState, r as resolveConfig, u as resolveRiddleProofDir, v as setStageDecisionRequest, w as summarizeState, x as validateShipGate, y as visualDeltaForState, z as visualDeltaRequiredForState, A as visualDeltaShipGateReason, D as workflowFile, E as writeState } from './proof-run-core-CrpYH-qH.js';
1
+ export { B as BUNDLED_RIDDLE_PROOF_DIR, C as CHECKPOINT_CONTRACT_VERSION, b as CheckpointInputContract, P as PluginConfig, R as RIDDLE_PROOF_DIR_CANDIDATES, S as ShipGateValidation, c as WORKFLOW_STAGE_ORDER, d as WorkflowAction, W as WorkflowParams, a as WorkflowStage, e as buildCheckpointContract, f as buildSetupArgs, g as checkpointContinueStage, h as clearStageDecisionRequest, i as ensureAction, j as ensureStageLoopState, k as invalidateVerifyEvidence, m as mergeStateFromParams, n as noImplementationModeFor, l as previewModeFromWorkflowMode, o as proofAssessmentHardBlockersForState, q as readState, s as recordStageAttempt, t as requiredBaselineLabelsForState, r as resolveConfig, u as resolveRiddleProofDir, v as setStageDecisionRequest, w as summarizeState, x as validateShipGate, y as visualDeltaForState, z as visualDeltaRequiredForState, A as visualDeltaShipGateReason, D as workflowFile, E as writeState } from './proof-run-core-C8FDUhle.js';
@@ -1,4 +1,4 @@
1
- import { W as WorkflowParams, r as resolveConfig, P as PluginConfig, a as WorkflowStage } from './proof-run-core-CrpYH-qH.js';
1
+ import { W as WorkflowParams, r as resolveConfig, P as PluginConfig, a as WorkflowStage } from './proof-run-core-C8FDUhle.js';
2
2
 
3
3
  declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, resolvedConfig?: ReturnType<typeof resolveConfig>): Promise<{
4
4
  ok: boolean;
@@ -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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
295
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
385
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "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: "setup" | "recon" | "author" | "implement" | "verify" | "ship";
662
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -1,4 +1,4 @@
1
- import { W as WorkflowParams, r as resolveConfig, P as PluginConfig, a as WorkflowStage } from './proof-run-core-CrpYH-qH.cjs';
1
+ import { W as WorkflowParams, r as resolveConfig, P as PluginConfig, a as WorkflowStage } from './proof-run-core-C8FDUhle.cjs';
2
2
 
3
3
  declare function executeWorkflow(params: WorkflowParams, pluginConfig: any, resolvedConfig?: ReturnType<typeof resolveConfig>): Promise<{
4
4
  ok: boolean;
@@ -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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
295
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "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: "setup" | "recon" | "author" | "implement" | "verify" | "ship" | "run";
385
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup" | "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: "setup" | "recon" | "author" | "implement" | "verify" | "ship";
662
+ action: "author" | "recon" | "ship" | "implement" | "verify" | "setup";
663
663
  state_path: string;
664
664
  stage: any;
665
665
  summary: string;
@@ -1136,6 +1136,12 @@ function snapshotFor(statePath) {
1136
1136
  function authorReady(state) {
1137
1137
  return state?.author_status === "ready" || state?.proof_plan_status === "ready";
1138
1138
  }
1139
+ function hasAuthoredProofPlan2(state = {}) {
1140
+ return Boolean((state?.proof_plan || "").trim()) && Boolean((state?.capture_script || "").trim());
1141
+ }
1142
+ function hasExplicitCaptureScript(state = {}) {
1143
+ return Boolean((state?.capture_script || "").trim());
1144
+ }
1139
1145
  function implementationReady(state) {
1140
1146
  return ["changes_detected", "completed"].includes(state?.implementation_status || "");
1141
1147
  }
@@ -1166,6 +1172,45 @@ function latestReconHasRequiredBaselines(state) {
1166
1172
  const baselines = latestReconCapturedBaselines(state);
1167
1173
  return requiredReconBaselineLabels(state).every((label) => Boolean((baselines?.[label]?.url || "").trim()));
1168
1174
  }
1175
+ function canAutoAcceptExplicitCaptureRecon(params, state) {
1176
+ const labels = requiredReconBaselineLabels(state);
1177
+ return Boolean(
1178
+ !implementationRequired(params, state) && hasExplicitCaptureScript(state) && ["needs_agent_decision", "needs_supervisor_judgment"].includes(state?.recon_status || "") && labels.length > 0 && latestReconHasRequiredBaselines(state)
1179
+ );
1180
+ }
1181
+ function applyExplicitCaptureReconAcceptance(state) {
1182
+ const baselines = promoteLatestReconBaselines(state);
1183
+ const labels = requiredReconBaselineLabels(state);
1184
+ const selected = latestReconAttempt(state) || {};
1185
+ state.recon_status = "ready_for_proof_plan";
1186
+ state.recon_results = state.recon_results || {};
1187
+ state.recon_results.status = "ready_for_proof_plan";
1188
+ state.recon_results.baselines = baselines;
1189
+ state.recon_assessment_request = {};
1190
+ state.recon_decision_request = {};
1191
+ state.recon_assessment = {
1192
+ decision: "ready_for_author",
1193
+ continue_with_stage: "author",
1194
+ source: "runner_auto_accept",
1195
+ summary: "Runner accepted recon automatically because this audit/no-diff run already supplied an explicit capture script, and the required baseline capture exists.",
1196
+ baseline_labels: labels
1197
+ };
1198
+ state.recon_assessment_source = "runner_auto_accept";
1199
+ state.recon_baseline_understanding = state.recon_baseline_understanding || {
1200
+ reference: state?.reference || state?.requested_reference || "before",
1201
+ target_route: selected?.plan?.target_path || state?.server_path || "/",
1202
+ proof_focus: state?.proof_plan || state?.change_request || "",
1203
+ stop_condition: "Verify must judge the authored capture evidence against the explicit proof packet."
1204
+ };
1205
+ if (hasAuthoredProofPlan2(state)) {
1206
+ state.author_status = "ready";
1207
+ state.proof_plan_status = "ready";
1208
+ } else {
1209
+ state.author_status = "needs_authoring";
1210
+ state.proof_plan_status = "needs_authoring";
1211
+ }
1212
+ return { baselines, labels };
1213
+ }
1169
1214
  function hasReconBaselineUnderstanding(state) {
1170
1215
  const understanding = state?.recon_assessment?.baseline_understanding || state?.recon_baseline_understanding || {};
1171
1216
  return Boolean(
@@ -2193,6 +2238,7 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
2193
2238
  state = readState(config.statePath);
2194
2239
  }
2195
2240
  }
2241
+ let reconAutoAcceptedExplicitCapture = false;
2196
2242
  if (!state?.recon_results || state?.stage === "setup" || state?.stage === "preflight" || ["needs_agent_decision", "needs_supervisor_judgment"].includes(state?.recon_status || "") || requestedStage === "recon") {
2197
2243
  const reconRes = runOne("recon");
2198
2244
  executed.push(executedStep(reconRes));
@@ -2205,40 +2251,64 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
2205
2251
  }
2206
2252
  state = readState(config.statePath);
2207
2253
  if (["needs_agent_decision", "needs_supervisor_judgment"].includes(state?.recon_status || "")) {
2208
- const reconAssessmentRequest = state?.recon_assessment_request || state?.recon_decision_request || null;
2209
- const summary = "Recon gathered route hints, candidate paths, baseline captures, and observations. The supervising agent should now judge whether the latest baseline is trustworthy, whether recon should retry/reframe, and whether recon is done.";
2210
- const reconDetails = {
2211
- executed,
2212
- latestAttempt: latestReconAttempt(state),
2213
- latestCapturedBaselines: latestReconCapturedBaselines(state),
2214
- reconAssessmentRequest
2215
- };
2216
- recordAttempt("recon", "checkpoint", summary, {
2254
+ if (canAutoAcceptExplicitCaptureRecon(params, state)) {
2255
+ const promoted = updateState(config.statePath, (currentState) => {
2256
+ applyExplicitCaptureReconAcceptance(currentState);
2257
+ });
2258
+ state = promoted;
2259
+ reconAutoAcceptedExplicitCapture = true;
2260
+ effectiveAdvanceStage = stageAfterAuthor(state, params);
2261
+ requestedStage = normalizeStageRequest(state, effectiveAdvanceStage);
2262
+ updateState(config.statePath, (currentState) => {
2263
+ currentState.last_requested_advance_stage = effectiveAdvanceStage;
2264
+ });
2265
+ recordAttempt("recon", "completed", "Recon baseline was captured and auto-accepted for an explicit audit/no-diff proof packet.", {
2266
+ autoApproved: true,
2267
+ checkpoint: "recon_auto_accept_explicit_capture",
2268
+ details: {
2269
+ executed,
2270
+ promotedBaselines: latestReconCapturedBaselines(state),
2271
+ baselineLabels: requiredReconBaselineLabels(state)
2272
+ }
2273
+ });
2274
+ } else {
2275
+ const reconAssessmentRequest = state?.recon_assessment_request || state?.recon_decision_request || null;
2276
+ const summary = "Recon gathered route hints, candidate paths, baseline captures, and observations. The supervising agent should now judge whether the latest baseline is trustworthy, whether recon should retry/reframe, and whether recon is done.";
2277
+ const reconDetails = {
2278
+ executed,
2279
+ latestAttempt: latestReconAttempt(state),
2280
+ latestCapturedBaselines: latestReconCapturedBaselines(state),
2281
+ reconAssessmentRequest
2282
+ };
2283
+ recordAttempt("recon", "checkpoint", summary, {
2284
+ autoApproved: reconRes.autoApproved || false,
2285
+ checkpoint: "recon_supervisor_judgment",
2286
+ details: reconDetails
2287
+ });
2288
+ return checkpoint(
2289
+ "recon",
2290
+ "recon_supervisor_judgment",
2291
+ summary,
2292
+ {
2293
+ nextActions: ["inspect_recon_packet", "supply_recon_assessment_json", "continue_internal_loop_with_checkpoint"],
2294
+ advanceOptions: ["recon", "author"],
2295
+ recommendedAdvanceStage: "recon",
2296
+ continueWithStage: "recon",
2297
+ blocking: false,
2298
+ details: reconDetails,
2299
+ reconAssessmentRequest,
2300
+ reconDecisionRequest: state?.recon_decision_request || null,
2301
+ executed
2302
+ }
2303
+ );
2304
+ }
2305
+ }
2306
+ if (!reconAutoAcceptedExplicitCapture) {
2307
+ recordAttempt("recon", "completed", "Recon completed and promoted an approved baseline context.", {
2217
2308
  autoApproved: reconRes.autoApproved || false,
2218
- checkpoint: "recon_supervisor_judgment",
2219
- details: reconDetails
2309
+ details: { executed }
2220
2310
  });
2221
- return checkpoint(
2222
- "recon",
2223
- "recon_supervisor_judgment",
2224
- summary,
2225
- {
2226
- nextActions: ["inspect_recon_packet", "supply_recon_assessment_json", "continue_internal_loop_with_checkpoint"],
2227
- advanceOptions: ["recon", "author"],
2228
- recommendedAdvanceStage: "recon",
2229
- continueWithStage: "recon",
2230
- blocking: false,
2231
- details: reconDetails,
2232
- reconAssessmentRequest,
2233
- reconDecisionRequest: state?.recon_decision_request || null,
2234
- executed
2235
- }
2236
- );
2237
2311
  }
2238
- recordAttempt("recon", "completed", "Recon completed and promoted an approved baseline context.", {
2239
- autoApproved: reconRes.autoApproved || false,
2240
- details: { executed }
2241
- });
2242
2312
  }
2243
2313
  state = readState(config.statePath);
2244
2314
  if (!authorReady(state) || effectiveAdvanceStage === "author") {
@@ -1,2 +1,2 @@
1
- import './proof-run-core-CrpYH-qH.cjs';
2
- export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-C6vYAZd8.cjs';
1
+ import './proof-run-core-C8FDUhle.cjs';
2
+ export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-D80hVFMf.cjs';
@@ -1,2 +1,2 @@
1
- import './proof-run-core-CrpYH-qH.js';
2
- export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-h9C1lC0w.js';
1
+ import './proof-run-core-C8FDUhle.js';
2
+ export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-By7oLsF-.js';
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createRiddleProofEngine,
3
3
  executeWorkflow
4
- } from "./chunk-JBY2SU5U.js";
4
+ } from "./chunk-WJZYRUNV.js";
5
5
  import "./chunk-7GZY5PLT.js";
6
6
  import "./chunk-MLKGABMK.js";
7
7
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.8.12",
3
+ "version": "0.8.14",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",