@riddledc/riddle-proof 0.5.46 → 0.5.48
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/README.md +6 -1
- package/dist/{chunk-X3AQ2WUM.js → chunk-2RS4PBYK.js} +82 -16
- package/dist/chunk-JFQXAJH2.js +0 -0
- package/dist/{chunk-JTNMEH57.js → chunk-JOXTKWX6.js} +1 -1
- package/dist/{chunk-L26NTZOU.js → chunk-N3ZNBRIG.js} +1 -1
- package/dist/cli.cjs +117 -27
- package/dist/cli.js +19 -13
- package/dist/engine-harness.cjs +105 -20
- package/dist/engine-harness.js +2 -2
- package/dist/index.cjs +111 -20
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -16
- package/dist/local-agent.cjs +792 -0
- package/dist/local-agent.d.cts +3 -0
- package/dist/local-agent.d.ts +3 -0
- package/dist/local-agent.js +11 -0
- package/dist/openclaw.js +1 -1
- package/dist/proof-run-engine.cjs +23 -4
- package/dist/proof-run-engine.js +23 -4
- package/dist/runner.js +2 -2
- package/dist/state.cjs +1 -1
- package/dist/state.js +1 -1
- package/package.json +7 -2
package/dist/engine-harness.cjs
CHANGED
|
@@ -1747,9 +1747,27 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
|
|
|
1747
1747
|
}
|
|
1748
1748
|
return "inspect the ship gate details, repair the missing invariant, then resume the run";
|
|
1749
1749
|
};
|
|
1750
|
+
const shipGateRecoveryStage = (shipGate) => {
|
|
1751
|
+
const reasons = shipGate.reasons || [];
|
|
1752
|
+
if (reasons.some((reason) => reason.includes("before_cdn") || reason.includes("prod_cdn") || reason.includes("prod_url"))) {
|
|
1753
|
+
return "recon";
|
|
1754
|
+
}
|
|
1755
|
+
if (reasons.some((reason) => reason.includes("implementation"))) {
|
|
1756
|
+
return "implement";
|
|
1757
|
+
}
|
|
1758
|
+
if (reasons.some((reason) => reason.includes("after_cdn") || reason.includes("verify_status") || reason.includes("visual_delta"))) {
|
|
1759
|
+
return "verify";
|
|
1760
|
+
}
|
|
1761
|
+
if (reasons.some((reason) => reason.includes("proof_assessment"))) {
|
|
1762
|
+
return "verify";
|
|
1763
|
+
}
|
|
1764
|
+
return "verify";
|
|
1765
|
+
};
|
|
1750
1766
|
const shipGateBlocked = (state, executed, details = {}) => {
|
|
1751
1767
|
const shipGate = validateShipGate(state);
|
|
1752
1768
|
const nextAction = primaryShipGateNextAction(shipGate);
|
|
1769
|
+
const recoveryStage = shipGateRecoveryStage(shipGate);
|
|
1770
|
+
const advanceOptions = Array.from(/* @__PURE__ */ new Set([recoveryStage, "verify", "author", "implement", "recon", "ship"]));
|
|
1753
1771
|
return checkpoint(
|
|
1754
1772
|
"verify",
|
|
1755
1773
|
"ship_gate_blocked",
|
|
@@ -1757,12 +1775,13 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
|
|
|
1757
1775
|
{
|
|
1758
1776
|
ok: false,
|
|
1759
1777
|
nextActions: ["inspect_ship_gate", "advance_run_to_verify", "supply_proof_assessment_json", "return_to_recon_if_baseline_is_missing"],
|
|
1760
|
-
advanceOptions
|
|
1761
|
-
recommendedAdvanceStage:
|
|
1762
|
-
continueWithStage:
|
|
1778
|
+
advanceOptions,
|
|
1779
|
+
recommendedAdvanceStage: recoveryStage,
|
|
1780
|
+
continueWithStage: recoveryStage,
|
|
1763
1781
|
blocking: true,
|
|
1764
|
-
details: { ...details, shipGate, next_action: nextAction, executed },
|
|
1782
|
+
details: { ...details, shipGate, next_action: nextAction, recovery_stage: recoveryStage, executed },
|
|
1765
1783
|
nextAction,
|
|
1784
|
+
recoveryStage,
|
|
1766
1785
|
shipGate,
|
|
1767
1786
|
verifyStatus: state?.verify_status || null,
|
|
1768
1787
|
mergeRecommendation: state?.merge_recommendation || null,
|
|
@@ -3935,7 +3954,7 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
|
3935
3954
|
checkpoint_summary: state.checkpoint_summary,
|
|
3936
3955
|
state_paths: state.state_paths,
|
|
3937
3956
|
proof_contract: state.proof_contract,
|
|
3938
|
-
run_card: createRiddleProofRunCard(state, { at }),
|
|
3957
|
+
run_card: state.run_card || createRiddleProofRunCard(state, { at }),
|
|
3939
3958
|
latest_event: latestEvent
|
|
3940
3959
|
});
|
|
3941
3960
|
}
|
|
@@ -4184,6 +4203,20 @@ function checkpointContinueStage2(result) {
|
|
|
4184
4203
|
const resume = recordValue(result.checkpointContract?.resume);
|
|
4185
4204
|
return nonEmptyString(resume?.continue_with_stage);
|
|
4186
4205
|
}
|
|
4206
|
+
function checkpointRecommendedStage(result) {
|
|
4207
|
+
const resumeStage = checkpointContinueStage2(result);
|
|
4208
|
+
if (resumeStage) return resumeStage;
|
|
4209
|
+
return nonEmptyString(result.checkpointContract?.recommended_advance_stage) || nonEmptyString(result.decisionRequest?.continue_with_stage) || nonEmptyString(result.decisionRequest?.recommended_advance_stage) || nonEmptyString(recordValue(result.decisionRequest)?.continueWithStage) || nonEmptyString(recordValue(result.decisionRequest)?.recommendedAdvanceStage);
|
|
4210
|
+
}
|
|
4211
|
+
function stageCheckpointContinuation(result) {
|
|
4212
|
+
const stage = checkpointRecommendedStage(result);
|
|
4213
|
+
if (!stage) return null;
|
|
4214
|
+
return {
|
|
4215
|
+
action: "run",
|
|
4216
|
+
state_path: String(result.state_path || ""),
|
|
4217
|
+
advance_stage: stage
|
|
4218
|
+
};
|
|
4219
|
+
}
|
|
4187
4220
|
function recommendedContinuation(result) {
|
|
4188
4221
|
const continueStage = checkpointContinueStage2(result);
|
|
4189
4222
|
if (!continueStage) return null;
|
|
@@ -4226,6 +4259,18 @@ function defaultStageForProofCheckpointDecision(decision) {
|
|
|
4226
4259
|
if (decision === "needs_richer_proof") return "author";
|
|
4227
4260
|
return null;
|
|
4228
4261
|
}
|
|
4262
|
+
function checkpointContractFromPacket(packet) {
|
|
4263
|
+
return recordValue(packet.evidence_excerpt?.checkpoint_contract) || recordValue(recordValue(packet.state_excerpt?.stage_decision_request)?.checkpoint_contract) || null;
|
|
4264
|
+
}
|
|
4265
|
+
function stageFromCheckpointResponse(response, packet) {
|
|
4266
|
+
if (response.decision === "needs_recon") return "recon";
|
|
4267
|
+
if (response.decision === "needs_implementation") return "implement";
|
|
4268
|
+
const payload = recordValue(response.payload) || {};
|
|
4269
|
+
const contract = checkpointContractFromPacket(packet);
|
|
4270
|
+
const resume = recordValue(contract?.resume);
|
|
4271
|
+
const stage = response.continue_with_stage || nonEmptyString(payload.continue_with_stage) || nonEmptyString(payload.recommended_stage) || nonEmptyString(resume?.continue_with_stage) || (response.decision === "retry_stage" ? packet.stage : "");
|
|
4272
|
+
return stage ? stage : null;
|
|
4273
|
+
}
|
|
4229
4274
|
function proofAssessmentPayloadFromCheckpointResponse(response) {
|
|
4230
4275
|
if (![
|
|
4231
4276
|
"ready_to_ship",
|
|
@@ -4328,6 +4373,13 @@ function visualDeltaEvidenceRecoveryAssessment(state, payload, blocker) {
|
|
|
4328
4373
|
blockers: [...blockers, blocker]
|
|
4329
4374
|
};
|
|
4330
4375
|
}
|
|
4376
|
+
function isRecoverableStageCheckpoint(checkpoint) {
|
|
4377
|
+
return [
|
|
4378
|
+
"ship_gate_blocked",
|
|
4379
|
+
"verify_required",
|
|
4380
|
+
"verify_supervisor_judgment_required"
|
|
4381
|
+
].includes(checkpoint);
|
|
4382
|
+
}
|
|
4331
4383
|
function contextFor(request, state, result) {
|
|
4332
4384
|
return {
|
|
4333
4385
|
request,
|
|
@@ -4674,6 +4726,18 @@ function checkpointResponseContinuation(state, value) {
|
|
|
4674
4726
|
};
|
|
4675
4727
|
}
|
|
4676
4728
|
}
|
|
4729
|
+
if (response.decision === "continue_stage" || response.decision === "retry_stage" || response.decision === "needs_implementation") {
|
|
4730
|
+
const stage = stageFromCheckpointResponse(response, packet);
|
|
4731
|
+
if (stage) {
|
|
4732
|
+
appendCheckpointResponse(state, response);
|
|
4733
|
+
return {
|
|
4734
|
+
next: {
|
|
4735
|
+
...base,
|
|
4736
|
+
advance_stage: stage
|
|
4737
|
+
}
|
|
4738
|
+
};
|
|
4739
|
+
}
|
|
4740
|
+
}
|
|
4677
4741
|
appendCheckpointResponse(state, response, { clear_packet: false });
|
|
4678
4742
|
return {
|
|
4679
4743
|
blocker: {
|
|
@@ -4796,18 +4860,23 @@ async function handleImplementation(request, state, result, agent) {
|
|
|
4796
4860
|
adapter_details: implementation.details || null
|
|
4797
4861
|
})
|
|
4798
4862
|
});
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4863
|
+
recordEvent(state, {
|
|
4864
|
+
kind: "agent.implementation.retry_requested",
|
|
4865
|
+
checkpoint: result.checkpoint || null,
|
|
4866
|
+
stage: "implement",
|
|
4867
|
+
summary: "Implementation adapter left no detectable diff; retrying the implement checkpoint inside the bounded loop.",
|
|
4868
|
+
details: compactRecord({
|
|
4869
|
+
worktree_path: workdir || null,
|
|
4802
4870
|
checkpoint: result.checkpoint || null,
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4871
|
+
next_stage: "implement"
|
|
4872
|
+
})
|
|
4873
|
+
});
|
|
4874
|
+
return {
|
|
4875
|
+
next: {
|
|
4876
|
+
action: "run",
|
|
4877
|
+
state_path: String(result.state_path || ""),
|
|
4878
|
+
advance_stage: "implement",
|
|
4879
|
+
implementation_notes: implementation.implementationNotes || implementation.summary || "Implementation adapter returned without a detectable git diff; retry the implement checkpoint."
|
|
4811
4880
|
}
|
|
4812
4881
|
};
|
|
4813
4882
|
}
|
|
@@ -4843,16 +4912,32 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
4843
4912
|
terminal: terminalResult(state, "completed", result, result.summary || "Riddle Proof engine completed.")
|
|
4844
4913
|
};
|
|
4845
4914
|
}
|
|
4915
|
+
if (isRecoverableStageCheckpoint(checkpoint) && !input.dry_run && !request.dry_run) {
|
|
4916
|
+
if (input.checkpoint_mode === "yield") {
|
|
4917
|
+
return { terminal: checkpointAwaitingResult(state, result, input.checkpoint_visibility) };
|
|
4918
|
+
}
|
|
4919
|
+
const next = stageCheckpointContinuation(result);
|
|
4920
|
+
if (next) {
|
|
4921
|
+
recordEvent(state, {
|
|
4922
|
+
kind: "checkpoint.recovery_continuation",
|
|
4923
|
+
checkpoint,
|
|
4924
|
+
stage: stageFromCheckpoint2(result),
|
|
4925
|
+
summary: `Routing recoverable checkpoint ${checkpoint} back to ${next.advance_stage}.`,
|
|
4926
|
+
details: {
|
|
4927
|
+
next,
|
|
4928
|
+
checkpointContract: result.checkpointContract || null
|
|
4929
|
+
}
|
|
4930
|
+
});
|
|
4931
|
+
return { next };
|
|
4932
|
+
}
|
|
4933
|
+
}
|
|
4846
4934
|
const failureBlocker = engineFailureBlocker(result, checkpoint);
|
|
4847
4935
|
if (failureBlocker) {
|
|
4848
4936
|
return { blocker: failureBlocker };
|
|
4849
4937
|
}
|
|
4850
4938
|
if ([
|
|
4851
4939
|
"recon_human_escalation",
|
|
4852
|
-
"verify_human_escalation"
|
|
4853
|
-
"ship_gate_blocked",
|
|
4854
|
-
"verify_required",
|
|
4855
|
-
"verify_supervisor_judgment_required"
|
|
4940
|
+
"verify_human_escalation"
|
|
4856
4941
|
].includes(checkpoint) && result.ok === false) {
|
|
4857
4942
|
return {
|
|
4858
4943
|
blocker: {
|
package/dist/engine-harness.js
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
createDisabledRiddleProofAgentAdapter,
|
|
3
3
|
readRiddleProofRunStatus,
|
|
4
4
|
runRiddleProofEngineHarness
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2RS4PBYK.js";
|
|
6
6
|
import "./chunk-4ASMX4R6.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-JOXTKWX6.js";
|
|
8
8
|
import "./chunk-PLSGW2GI.js";
|
|
9
9
|
import "./chunk-R6SCWJCI.js";
|
|
10
10
|
import "./chunk-DUFDZJOF.js";
|
package/dist/index.cjs
CHANGED
|
@@ -1747,9 +1747,27 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
|
|
|
1747
1747
|
}
|
|
1748
1748
|
return "inspect the ship gate details, repair the missing invariant, then resume the run";
|
|
1749
1749
|
};
|
|
1750
|
+
const shipGateRecoveryStage = (shipGate) => {
|
|
1751
|
+
const reasons = shipGate.reasons || [];
|
|
1752
|
+
if (reasons.some((reason) => reason.includes("before_cdn") || reason.includes("prod_cdn") || reason.includes("prod_url"))) {
|
|
1753
|
+
return "recon";
|
|
1754
|
+
}
|
|
1755
|
+
if (reasons.some((reason) => reason.includes("implementation"))) {
|
|
1756
|
+
return "implement";
|
|
1757
|
+
}
|
|
1758
|
+
if (reasons.some((reason) => reason.includes("after_cdn") || reason.includes("verify_status") || reason.includes("visual_delta"))) {
|
|
1759
|
+
return "verify";
|
|
1760
|
+
}
|
|
1761
|
+
if (reasons.some((reason) => reason.includes("proof_assessment"))) {
|
|
1762
|
+
return "verify";
|
|
1763
|
+
}
|
|
1764
|
+
return "verify";
|
|
1765
|
+
};
|
|
1750
1766
|
const shipGateBlocked = (state, executed, details = {}) => {
|
|
1751
1767
|
const shipGate = validateShipGate(state);
|
|
1752
1768
|
const nextAction = primaryShipGateNextAction(shipGate);
|
|
1769
|
+
const recoveryStage = shipGateRecoveryStage(shipGate);
|
|
1770
|
+
const advanceOptions = Array.from(/* @__PURE__ */ new Set([recoveryStage, "verify", "author", "implement", "recon", "ship"]));
|
|
1753
1771
|
return checkpoint(
|
|
1754
1772
|
"verify",
|
|
1755
1773
|
"ship_gate_blocked",
|
|
@@ -1757,12 +1775,13 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
|
|
|
1757
1775
|
{
|
|
1758
1776
|
ok: false,
|
|
1759
1777
|
nextActions: ["inspect_ship_gate", "advance_run_to_verify", "supply_proof_assessment_json", "return_to_recon_if_baseline_is_missing"],
|
|
1760
|
-
advanceOptions
|
|
1761
|
-
recommendedAdvanceStage:
|
|
1762
|
-
continueWithStage:
|
|
1778
|
+
advanceOptions,
|
|
1779
|
+
recommendedAdvanceStage: recoveryStage,
|
|
1780
|
+
continueWithStage: recoveryStage,
|
|
1763
1781
|
blocking: true,
|
|
1764
|
-
details: { ...details, shipGate, next_action: nextAction, executed },
|
|
1782
|
+
details: { ...details, shipGate, next_action: nextAction, recovery_stage: recoveryStage, executed },
|
|
1765
1783
|
nextAction,
|
|
1784
|
+
recoveryStage,
|
|
1766
1785
|
shipGate,
|
|
1767
1786
|
verifyStatus: state?.verify_status || null,
|
|
1768
1787
|
mergeRecommendation: state?.merge_recommendation || null,
|
|
@@ -2785,6 +2804,8 @@ __export(index_exports, {
|
|
|
2785
2804
|
createCodexExecAgentAdapter: () => createCodexExecAgentAdapter,
|
|
2786
2805
|
createCodexExecJsonRunner: () => createCodexExecJsonRunner,
|
|
2787
2806
|
createDisabledRiddleProofAgentAdapter: () => createDisabledRiddleProofAgentAdapter,
|
|
2807
|
+
createLocalAgentAdapter: () => createCodexExecAgentAdapter,
|
|
2808
|
+
createLocalAgentJsonRunner: () => createCodexExecJsonRunner,
|
|
2788
2809
|
createRiddleProofRunCard: () => createRiddleProofRunCard,
|
|
2789
2810
|
createRunResult: () => createRunResult,
|
|
2790
2811
|
createRunState: () => createRunState,
|
|
@@ -2806,6 +2827,7 @@ __export(index_exports, {
|
|
|
2806
2827
|
recordValue: () => recordValue,
|
|
2807
2828
|
redactForProofDiagnostics: () => redactForProofDiagnostics,
|
|
2808
2829
|
runCodexExecAgentDoctor: () => runCodexExecAgentDoctor,
|
|
2830
|
+
runLocalAgentDoctor: () => runCodexExecAgentDoctor,
|
|
2809
2831
|
runRiddleProof: () => runRiddleProof,
|
|
2810
2832
|
runRiddleProofEngineHarness: () => runRiddleProofEngineHarness,
|
|
2811
2833
|
setRunStatus: () => setRunStatus,
|
|
@@ -4018,7 +4040,7 @@ function createRunStatusSnapshot(state, at = timestamp2()) {
|
|
|
4018
4040
|
checkpoint_summary: state.checkpoint_summary,
|
|
4019
4041
|
state_paths: state.state_paths,
|
|
4020
4042
|
proof_contract: state.proof_contract,
|
|
4021
|
-
run_card: createRiddleProofRunCard(state, { at }),
|
|
4043
|
+
run_card: state.run_card || createRiddleProofRunCard(state, { at }),
|
|
4022
4044
|
latest_event: latestEvent
|
|
4023
4045
|
});
|
|
4024
4046
|
}
|
|
@@ -4770,6 +4792,20 @@ function checkpointContinueStage2(result) {
|
|
|
4770
4792
|
const resume = recordValue(result.checkpointContract?.resume);
|
|
4771
4793
|
return nonEmptyString(resume?.continue_with_stage);
|
|
4772
4794
|
}
|
|
4795
|
+
function checkpointRecommendedStage(result) {
|
|
4796
|
+
const resumeStage = checkpointContinueStage2(result);
|
|
4797
|
+
if (resumeStage) return resumeStage;
|
|
4798
|
+
return nonEmptyString(result.checkpointContract?.recommended_advance_stage) || nonEmptyString(result.decisionRequest?.continue_with_stage) || nonEmptyString(result.decisionRequest?.recommended_advance_stage) || nonEmptyString(recordValue(result.decisionRequest)?.continueWithStage) || nonEmptyString(recordValue(result.decisionRequest)?.recommendedAdvanceStage);
|
|
4799
|
+
}
|
|
4800
|
+
function stageCheckpointContinuation(result) {
|
|
4801
|
+
const stage = checkpointRecommendedStage(result);
|
|
4802
|
+
if (!stage) return null;
|
|
4803
|
+
return {
|
|
4804
|
+
action: "run",
|
|
4805
|
+
state_path: String(result.state_path || ""),
|
|
4806
|
+
advance_stage: stage
|
|
4807
|
+
};
|
|
4808
|
+
}
|
|
4773
4809
|
function recommendedContinuation(result) {
|
|
4774
4810
|
const continueStage = checkpointContinueStage2(result);
|
|
4775
4811
|
if (!continueStage) return null;
|
|
@@ -4812,6 +4848,18 @@ function defaultStageForProofCheckpointDecision(decision) {
|
|
|
4812
4848
|
if (decision === "needs_richer_proof") return "author";
|
|
4813
4849
|
return null;
|
|
4814
4850
|
}
|
|
4851
|
+
function checkpointContractFromPacket(packet) {
|
|
4852
|
+
return recordValue(packet.evidence_excerpt?.checkpoint_contract) || recordValue(recordValue(packet.state_excerpt?.stage_decision_request)?.checkpoint_contract) || null;
|
|
4853
|
+
}
|
|
4854
|
+
function stageFromCheckpointResponse(response, packet) {
|
|
4855
|
+
if (response.decision === "needs_recon") return "recon";
|
|
4856
|
+
if (response.decision === "needs_implementation") return "implement";
|
|
4857
|
+
const payload = recordValue(response.payload) || {};
|
|
4858
|
+
const contract = checkpointContractFromPacket(packet);
|
|
4859
|
+
const resume = recordValue(contract?.resume);
|
|
4860
|
+
const stage = response.continue_with_stage || nonEmptyString(payload.continue_with_stage) || nonEmptyString(payload.recommended_stage) || nonEmptyString(resume?.continue_with_stage) || (response.decision === "retry_stage" ? packet.stage : "");
|
|
4861
|
+
return stage ? stage : null;
|
|
4862
|
+
}
|
|
4815
4863
|
function proofAssessmentPayloadFromCheckpointResponse(response) {
|
|
4816
4864
|
if (![
|
|
4817
4865
|
"ready_to_ship",
|
|
@@ -4914,6 +4962,13 @@ function visualDeltaEvidenceRecoveryAssessment(state, payload, blocker) {
|
|
|
4914
4962
|
blockers: [...blockers, blocker]
|
|
4915
4963
|
};
|
|
4916
4964
|
}
|
|
4965
|
+
function isRecoverableStageCheckpoint(checkpoint) {
|
|
4966
|
+
return [
|
|
4967
|
+
"ship_gate_blocked",
|
|
4968
|
+
"verify_required",
|
|
4969
|
+
"verify_supervisor_judgment_required"
|
|
4970
|
+
].includes(checkpoint);
|
|
4971
|
+
}
|
|
4917
4972
|
function contextFor(request, state, result) {
|
|
4918
4973
|
return {
|
|
4919
4974
|
request,
|
|
@@ -5260,6 +5315,18 @@ function checkpointResponseContinuation(state, value) {
|
|
|
5260
5315
|
};
|
|
5261
5316
|
}
|
|
5262
5317
|
}
|
|
5318
|
+
if (response.decision === "continue_stage" || response.decision === "retry_stage" || response.decision === "needs_implementation") {
|
|
5319
|
+
const stage = stageFromCheckpointResponse(response, packet);
|
|
5320
|
+
if (stage) {
|
|
5321
|
+
appendCheckpointResponse(state, response);
|
|
5322
|
+
return {
|
|
5323
|
+
next: {
|
|
5324
|
+
...base,
|
|
5325
|
+
advance_stage: stage
|
|
5326
|
+
}
|
|
5327
|
+
};
|
|
5328
|
+
}
|
|
5329
|
+
}
|
|
5263
5330
|
appendCheckpointResponse(state, response, { clear_packet: false });
|
|
5264
5331
|
return {
|
|
5265
5332
|
blocker: {
|
|
@@ -5382,18 +5449,23 @@ async function handleImplementation(request, state, result, agent) {
|
|
|
5382
5449
|
adapter_details: implementation.details || null
|
|
5383
5450
|
})
|
|
5384
5451
|
});
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5452
|
+
recordEvent(state, {
|
|
5453
|
+
kind: "agent.implementation.retry_requested",
|
|
5454
|
+
checkpoint: result.checkpoint || null,
|
|
5455
|
+
stage: "implement",
|
|
5456
|
+
summary: "Implementation adapter left no detectable diff; retrying the implement checkpoint inside the bounded loop.",
|
|
5457
|
+
details: compactRecord({
|
|
5458
|
+
worktree_path: workdir || null,
|
|
5388
5459
|
checkpoint: result.checkpoint || null,
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5460
|
+
next_stage: "implement"
|
|
5461
|
+
})
|
|
5462
|
+
});
|
|
5463
|
+
return {
|
|
5464
|
+
next: {
|
|
5465
|
+
action: "run",
|
|
5466
|
+
state_path: String(result.state_path || ""),
|
|
5467
|
+
advance_stage: "implement",
|
|
5468
|
+
implementation_notes: implementation.implementationNotes || implementation.summary || "Implementation adapter returned without a detectable git diff; retry the implement checkpoint."
|
|
5397
5469
|
}
|
|
5398
5470
|
};
|
|
5399
5471
|
}
|
|
@@ -5429,16 +5501,32 @@ async function routeCheckpoint(request, state, result, agent, input) {
|
|
|
5429
5501
|
terminal: terminalResult(state, "completed", result, result.summary || "Riddle Proof engine completed.")
|
|
5430
5502
|
};
|
|
5431
5503
|
}
|
|
5504
|
+
if (isRecoverableStageCheckpoint(checkpoint) && !input.dry_run && !request.dry_run) {
|
|
5505
|
+
if (input.checkpoint_mode === "yield") {
|
|
5506
|
+
return { terminal: checkpointAwaitingResult(state, result, input.checkpoint_visibility) };
|
|
5507
|
+
}
|
|
5508
|
+
const next = stageCheckpointContinuation(result);
|
|
5509
|
+
if (next) {
|
|
5510
|
+
recordEvent(state, {
|
|
5511
|
+
kind: "checkpoint.recovery_continuation",
|
|
5512
|
+
checkpoint,
|
|
5513
|
+
stage: stageFromCheckpoint2(result),
|
|
5514
|
+
summary: `Routing recoverable checkpoint ${checkpoint} back to ${next.advance_stage}.`,
|
|
5515
|
+
details: {
|
|
5516
|
+
next,
|
|
5517
|
+
checkpointContract: result.checkpointContract || null
|
|
5518
|
+
}
|
|
5519
|
+
});
|
|
5520
|
+
return { next };
|
|
5521
|
+
}
|
|
5522
|
+
}
|
|
5432
5523
|
const failureBlocker = engineFailureBlocker(result, checkpoint);
|
|
5433
5524
|
if (failureBlocker) {
|
|
5434
5525
|
return { blocker: failureBlocker };
|
|
5435
5526
|
}
|
|
5436
5527
|
if ([
|
|
5437
5528
|
"recon_human_escalation",
|
|
5438
|
-
"verify_human_escalation"
|
|
5439
|
-
"ship_gate_blocked",
|
|
5440
|
-
"verify_required",
|
|
5441
|
-
"verify_supervisor_judgment_required"
|
|
5529
|
+
"verify_human_escalation"
|
|
5442
5530
|
].includes(checkpoint) && result.ok === false) {
|
|
5443
5531
|
return {
|
|
5444
5532
|
blocker: {
|
|
@@ -7215,6 +7303,8 @@ function parseJson(value) {
|
|
|
7215
7303
|
createCodexExecAgentAdapter,
|
|
7216
7304
|
createCodexExecJsonRunner,
|
|
7217
7305
|
createDisabledRiddleProofAgentAdapter,
|
|
7306
|
+
createLocalAgentAdapter,
|
|
7307
|
+
createLocalAgentJsonRunner,
|
|
7218
7308
|
createRiddleProofRunCard,
|
|
7219
7309
|
createRunResult,
|
|
7220
7310
|
createRunState,
|
|
@@ -7236,6 +7326,7 @@ function parseJson(value) {
|
|
|
7236
7326
|
recordValue,
|
|
7237
7327
|
redactForProofDiagnostics,
|
|
7238
7328
|
runCodexExecAgentDoctor,
|
|
7329
|
+
runLocalAgentDoctor,
|
|
7239
7330
|
runRiddleProof,
|
|
7240
7331
|
runRiddleProofEngineHarness,
|
|
7241
7332
|
setRunStatus,
|
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONS
|
|
|
5
5
|
export { RIDDLE_PROOF_RUN_CARD_VERSION, createRiddleProofRunCard } from './run-card.cjs';
|
|
6
6
|
export { RiddleProofRunnerAdapters, RunRiddleProofInput, runRiddleProof } from './runner.cjs';
|
|
7
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';
|
|
8
|
+
export { CodexExecAgentConfig, CodexJsonRequest, CodexJsonResult, CodexJsonRunner, CodexExecAgentConfig as LocalAgentConfig, CodexJsonRequest as LocalAgentJsonRequest, CodexJsonResult as LocalAgentJsonResult, CodexJsonRunner as LocalAgentJsonRunner, createCodexExecAgentAdapter, createCodexExecJsonRunner, createCodexExecAgentAdapter as createLocalAgentAdapter, createCodexExecJsonRunner as createLocalAgentJsonRunner, runCodexExecAgentDoctor, runCodexExecAgentDoctor as runLocalAgentDoctor } from './codex-exec-agent.cjs';
|
|
9
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';
|
|
10
10
|
export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.cjs';
|
|
11
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
|
@@ -5,7 +5,7 @@ export { RIDDLE_PROOF_CHECKPOINT_PACKET_VERSION, RIDDLE_PROOF_CHECKPOINT_RESPONS
|
|
|
5
5
|
export { RIDDLE_PROOF_RUN_CARD_VERSION, createRiddleProofRunCard } from './run-card.js';
|
|
6
6
|
export { RiddleProofRunnerAdapters, RunRiddleProofInput, runRiddleProof } from './runner.js';
|
|
7
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';
|
|
8
|
+
export { CodexExecAgentConfig, CodexJsonRequest, CodexJsonResult, CodexJsonRunner, CodexExecAgentConfig as LocalAgentConfig, CodexJsonRequest as LocalAgentJsonRequest, CodexJsonResult as LocalAgentJsonResult, CodexJsonRunner as LocalAgentJsonRunner, createCodexExecAgentAdapter, createCodexExecJsonRunner, createCodexExecAgentAdapter as createLocalAgentAdapter, createCodexExecJsonRunner as createLocalAgentJsonRunner, runCodexExecAgentDoctor, runCodexExecAgentDoctor as runLocalAgentDoctor } from './codex-exec-agent.js';
|
|
9
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';
|
|
10
10
|
export { BuildVisualProofSessionInput, RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION, RIDDLE_PROOF_VISUAL_SESSION_VERSION, VisualProofSessionMismatch, buildVisualProofSession, compareVisualProofSessionFingerprint, parseVisualProofSession, visualSessionFingerprint, visualSessionFingerprintBasis } from './proof-session.js';
|
|
11
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
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import "./chunk-6F4PWJZI.js";
|
|
2
|
+
import {
|
|
3
|
+
RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION,
|
|
4
|
+
RIDDLE_PROOF_PLAYABILITY_VERSION,
|
|
5
|
+
assessPlayabilityEvidence,
|
|
6
|
+
extractPlayabilityEvidence,
|
|
7
|
+
isRiddleProofPlayabilityMode
|
|
8
|
+
} from "./chunk-NSWT3VSV.js";
|
|
1
9
|
import {
|
|
2
10
|
RIDDLE_PROOF_VISUAL_SESSION_FINGERPRINT_VERSION,
|
|
3
11
|
RIDDLE_PROOF_VISUAL_SESSION_VERSION,
|
|
@@ -9,13 +17,7 @@ import {
|
|
|
9
17
|
} from "./chunk-ODORKNSO.js";
|
|
10
18
|
import {
|
|
11
19
|
runRiddleProof
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-6F4PWJZI.js";
|
|
14
|
-
import {
|
|
15
|
-
createCodexExecAgentAdapter,
|
|
16
|
-
createCodexExecJsonRunner,
|
|
17
|
-
runCodexExecAgentDoctor
|
|
18
|
-
} from "./chunk-NOBFZDZG.js";
|
|
20
|
+
} from "./chunk-N3ZNBRIG.js";
|
|
19
21
|
import {
|
|
20
22
|
DEFAULT_DIAGNOSTIC_ARRAY_LIMIT,
|
|
21
23
|
DEFAULT_DIAGNOSTIC_HISTORY_LIMIT,
|
|
@@ -30,8 +32,14 @@ import {
|
|
|
30
32
|
createDisabledRiddleProofAgentAdapter,
|
|
31
33
|
readRiddleProofRunStatus,
|
|
32
34
|
runRiddleProofEngineHarness
|
|
33
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-2RS4PBYK.js";
|
|
34
36
|
import "./chunk-4ASMX4R6.js";
|
|
37
|
+
import "./chunk-JFQXAJH2.js";
|
|
38
|
+
import {
|
|
39
|
+
createCodexExecAgentAdapter,
|
|
40
|
+
createCodexExecJsonRunner,
|
|
41
|
+
runCodexExecAgentDoctor
|
|
42
|
+
} from "./chunk-NOBFZDZG.js";
|
|
35
43
|
import {
|
|
36
44
|
RIDDLE_PROOF_RUN_STATE_VERSION,
|
|
37
45
|
appendRunEvent,
|
|
@@ -43,7 +51,7 @@ import {
|
|
|
43
51
|
normalizePrLifecycleState,
|
|
44
52
|
normalizeRunParams,
|
|
45
53
|
setRunStatus
|
|
46
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-JOXTKWX6.js";
|
|
47
55
|
import {
|
|
48
56
|
RIDDLE_PROOF_RUN_CARD_VERSION,
|
|
49
57
|
createRiddleProofRunCard
|
|
@@ -73,13 +81,6 @@ import {
|
|
|
73
81
|
normalizeTerminalMetadata,
|
|
74
82
|
recordValue
|
|
75
83
|
} from "./chunk-DUFDZJOF.js";
|
|
76
|
-
import {
|
|
77
|
-
RIDDLE_PROOF_PLAYABILITY_ASSESSMENT_VERSION,
|
|
78
|
-
RIDDLE_PROOF_PLAYABILITY_VERSION,
|
|
79
|
-
assessPlayabilityEvidence,
|
|
80
|
-
extractPlayabilityEvidence,
|
|
81
|
-
isRiddleProofPlayabilityMode
|
|
82
|
-
} from "./chunk-NSWT3VSV.js";
|
|
83
84
|
export {
|
|
84
85
|
DEFAULT_DIAGNOSTIC_ARRAY_LIMIT,
|
|
85
86
|
DEFAULT_DIAGNOSTIC_HISTORY_LIMIT,
|
|
@@ -113,6 +114,8 @@ export {
|
|
|
113
114
|
createCodexExecAgentAdapter,
|
|
114
115
|
createCodexExecJsonRunner,
|
|
115
116
|
createDisabledRiddleProofAgentAdapter,
|
|
117
|
+
createCodexExecAgentAdapter as createLocalAgentAdapter,
|
|
118
|
+
createCodexExecJsonRunner as createLocalAgentJsonRunner,
|
|
116
119
|
createRiddleProofRunCard,
|
|
117
120
|
createRunResult,
|
|
118
121
|
createRunState,
|
|
@@ -134,6 +137,7 @@ export {
|
|
|
134
137
|
recordValue,
|
|
135
138
|
redactForProofDiagnostics,
|
|
136
139
|
runCodexExecAgentDoctor,
|
|
140
|
+
runCodexExecAgentDoctor as runLocalAgentDoctor,
|
|
137
141
|
runRiddleProof,
|
|
138
142
|
runRiddleProofEngineHarness,
|
|
139
143
|
setRunStatus,
|