@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.
- package/dist/advanced/engine-harness.cjs +101 -31
- package/dist/advanced/engine-harness.js +1 -1
- package/dist/advanced/index.cjs +101 -31
- package/dist/advanced/index.d.cts +2 -2
- package/dist/advanced/index.d.ts +2 -2
- package/dist/advanced/index.js +2 -2
- package/dist/advanced/proof-run-core.d.cts +1 -1
- package/dist/advanced/proof-run-core.d.ts +1 -1
- package/dist/advanced/proof-run-engine.cjs +101 -31
- package/dist/advanced/proof-run-engine.d.cts +2 -2
- package/dist/advanced/proof-run-engine.d.ts +2 -2
- package/dist/advanced/proof-run-engine.js +1 -1
- package/dist/{chunk-SZUC4MDN.js → chunk-EGZT3EVL.js} +1 -1
- package/dist/{chunk-JBY2SU5U.js → chunk-WJZYRUNV.js} +101 -31
- package/dist/cli/index.js +2 -2
- package/dist/cli.cjs +101 -31
- package/dist/cli.js +2 -2
- package/dist/engine-harness.cjs +101 -31
- package/dist/engine-harness.js +1 -1
- package/dist/index.cjs +101 -31
- package/dist/index.js +1 -1
- package/dist/{proof-run-core-CrpYH-qH.d.ts → proof-run-core-C8FDUhle.d.cts} +1 -1
- package/dist/{proof-run-core-CrpYH-qH.d.cts → proof-run-core-C8FDUhle.d.ts} +1 -1
- package/dist/proof-run-core.d.cts +1 -1
- package/dist/proof-run-core.d.ts +1 -1
- package/dist/{proof-run-engine-h9C1lC0w.d.ts → proof-run-engine-By7oLsF-.d.ts} +4 -4
- package/dist/{proof-run-engine-C6vYAZd8.d.cts → proof-run-engine-D80hVFMf.d.cts} +4 -4
- package/dist/proof-run-engine.cjs +101 -31
- package/dist/proof-run-engine.d.cts +2 -2
- package/dist/proof-run-engine.d.ts +2 -2
- package/dist/proof-run-engine.js +1 -1
- package/package.json +1 -1
- package/runtime/lib/verify.py +179 -11
- package/runtime/tests/recon_verify_smoke.py +142 -0
- package/runtime/tests/trust_boundary_regression.py +6 -0
- /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
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
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
|
-
|
|
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
|
@@ -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: "
|
|
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: "
|
|
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-
|
|
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';
|
package/dist/proof-run-core.d.ts
CHANGED
|
@@ -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-
|
|
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-
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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-
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
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
|
-
|
|
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-
|
|
2
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-
|
|
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-
|
|
2
|
-
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-
|
|
1
|
+
import './proof-run-core-C8FDUhle.js';
|
|
2
|
+
export { R as RiddleProofEngine, c as createRiddleProofEngine, e as executeWorkflow } from './proof-run-engine-By7oLsF-.js';
|
package/dist/proof-run-engine.js
CHANGED