@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.
@@ -0,0 +1,3 @@
1
+ export { CodexExecAgentConfig as LocalAgentConfig, CodexJsonRequest as LocalAgentJsonRequest, CodexJsonResult as LocalAgentJsonResult, CodexJsonRunner as LocalAgentJsonRunner, createCodexExecAgentAdapter as createLocalAgentAdapter, createCodexExecJsonRunner as createLocalAgentJsonRunner, runCodexExecAgentDoctor as runLocalAgentDoctor } from './codex-exec-agent.cjs';
2
+ import './engine-harness.cjs';
3
+ import './types.cjs';
@@ -0,0 +1,3 @@
1
+ export { CodexExecAgentConfig as LocalAgentConfig, CodexJsonRequest as LocalAgentJsonRequest, CodexJsonResult as LocalAgentJsonResult, CodexJsonRunner as LocalAgentJsonRunner, createCodexExecAgentAdapter as createLocalAgentAdapter, createCodexExecJsonRunner as createLocalAgentJsonRunner, runCodexExecAgentDoctor as runLocalAgentDoctor } from './codex-exec-agent.js';
2
+ import './engine-harness.js';
3
+ import './types.js';
@@ -0,0 +1,11 @@
1
+ import "./chunk-JFQXAJH2.js";
2
+ import {
3
+ createCodexExecAgentAdapter,
4
+ createCodexExecJsonRunner,
5
+ runCodexExecAgentDoctor
6
+ } from "./chunk-NOBFZDZG.js";
7
+ export {
8
+ createCodexExecAgentAdapter as createLocalAgentAdapter,
9
+ createCodexExecJsonRunner as createLocalAgentJsonRunner,
10
+ runCodexExecAgentDoctor as runLocalAgentDoctor
11
+ };
package/dist/openclaw.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  normalizeIntegrationContext,
3
3
  normalizeRunParams
4
- } from "./chunk-JTNMEH57.js";
4
+ } from "./chunk-JOXTKWX6.js";
5
5
  import "./chunk-PLSGW2GI.js";
6
6
  import "./chunk-R6SCWJCI.js";
7
7
  import {
@@ -1745,9 +1745,27 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
1745
1745
  }
1746
1746
  return "inspect the ship gate details, repair the missing invariant, then resume the run";
1747
1747
  };
1748
+ const shipGateRecoveryStage = (shipGate) => {
1749
+ const reasons = shipGate.reasons || [];
1750
+ if (reasons.some((reason) => reason.includes("before_cdn") || reason.includes("prod_cdn") || reason.includes("prod_url"))) {
1751
+ return "recon";
1752
+ }
1753
+ if (reasons.some((reason) => reason.includes("implementation"))) {
1754
+ return "implement";
1755
+ }
1756
+ if (reasons.some((reason) => reason.includes("after_cdn") || reason.includes("verify_status") || reason.includes("visual_delta"))) {
1757
+ return "verify";
1758
+ }
1759
+ if (reasons.some((reason) => reason.includes("proof_assessment"))) {
1760
+ return "verify";
1761
+ }
1762
+ return "verify";
1763
+ };
1748
1764
  const shipGateBlocked = (state, executed, details = {}) => {
1749
1765
  const shipGate = validateShipGate(state);
1750
1766
  const nextAction = primaryShipGateNextAction(shipGate);
1767
+ const recoveryStage = shipGateRecoveryStage(shipGate);
1768
+ const advanceOptions = Array.from(/* @__PURE__ */ new Set([recoveryStage, "verify", "author", "implement", "recon", "ship"]));
1751
1769
  return checkpoint(
1752
1770
  "verify",
1753
1771
  "ship_gate_blocked",
@@ -1755,12 +1773,13 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
1755
1773
  {
1756
1774
  ok: false,
1757
1775
  nextActions: ["inspect_ship_gate", "advance_run_to_verify", "supply_proof_assessment_json", "return_to_recon_if_baseline_is_missing"],
1758
- advanceOptions: ["verify", "author", "implement", "recon"],
1759
- recommendedAdvanceStage: "verify",
1760
- continueWithStage: "verify",
1776
+ advanceOptions,
1777
+ recommendedAdvanceStage: recoveryStage,
1778
+ continueWithStage: recoveryStage,
1761
1779
  blocking: true,
1762
- details: { ...details, shipGate, next_action: nextAction, executed },
1780
+ details: { ...details, shipGate, next_action: nextAction, recovery_stage: recoveryStage, executed },
1763
1781
  nextAction,
1782
+ recoveryStage,
1764
1783
  shipGate,
1765
1784
  verifyStatus: state?.verify_status || null,
1766
1785
  mergeRecommendation: state?.merge_recommendation || null,
@@ -781,9 +781,27 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
781
781
  }
782
782
  return "inspect the ship gate details, repair the missing invariant, then resume the run";
783
783
  };
784
+ const shipGateRecoveryStage = (shipGate) => {
785
+ const reasons = shipGate.reasons || [];
786
+ if (reasons.some((reason) => reason.includes("before_cdn") || reason.includes("prod_cdn") || reason.includes("prod_url"))) {
787
+ return "recon";
788
+ }
789
+ if (reasons.some((reason) => reason.includes("implementation"))) {
790
+ return "implement";
791
+ }
792
+ if (reasons.some((reason) => reason.includes("after_cdn") || reason.includes("verify_status") || reason.includes("visual_delta"))) {
793
+ return "verify";
794
+ }
795
+ if (reasons.some((reason) => reason.includes("proof_assessment"))) {
796
+ return "verify";
797
+ }
798
+ return "verify";
799
+ };
784
800
  const shipGateBlocked = (state, executed, details = {}) => {
785
801
  const shipGate = validateShipGate(state);
786
802
  const nextAction = primaryShipGateNextAction(shipGate);
803
+ const recoveryStage = shipGateRecoveryStage(shipGate);
804
+ const advanceOptions = Array.from(/* @__PURE__ */ new Set([recoveryStage, "verify", "author", "implement", "recon", "ship"]));
787
805
  return checkpoint(
788
806
  "verify",
789
807
  "ship_gate_blocked",
@@ -791,12 +809,13 @@ async function executeWorkflow(params, pluginConfig, resolvedConfig) {
791
809
  {
792
810
  ok: false,
793
811
  nextActions: ["inspect_ship_gate", "advance_run_to_verify", "supply_proof_assessment_json", "return_to_recon_if_baseline_is_missing"],
794
- advanceOptions: ["verify", "author", "implement", "recon"],
795
- recommendedAdvanceStage: "verify",
796
- continueWithStage: "verify",
812
+ advanceOptions,
813
+ recommendedAdvanceStage: recoveryStage,
814
+ continueWithStage: recoveryStage,
797
815
  blocking: true,
798
- details: { ...details, shipGate, next_action: nextAction, executed },
816
+ details: { ...details, shipGate, next_action: nextAction, recovery_stage: recoveryStage, executed },
799
817
  nextAction,
818
+ recoveryStage,
800
819
  shipGate,
801
820
  verifyStatus: state?.verify_status || null,
802
821
  mergeRecommendation: state?.merge_recommendation || null,
package/dist/runner.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  runRiddleProof
3
- } from "./chunk-L26NTZOU.js";
4
- import "./chunk-JTNMEH57.js";
3
+ } from "./chunk-N3ZNBRIG.js";
4
+ import "./chunk-JOXTKWX6.js";
5
5
  import "./chunk-PLSGW2GI.js";
6
6
  import "./chunk-R6SCWJCI.js";
7
7
  import "./chunk-DUFDZJOF.js";
package/dist/state.cjs CHANGED
@@ -419,7 +419,7 @@ function createRunStatusSnapshot(state, at = timestamp()) {
419
419
  checkpoint_summary: state.checkpoint_summary,
420
420
  state_paths: state.state_paths,
421
421
  proof_contract: state.proof_contract,
422
- run_card: createRiddleProofRunCard(state, { at }),
422
+ run_card: state.run_card || createRiddleProofRunCard(state, { at }),
423
423
  latest_event: latestEvent
424
424
  });
425
425
  }
package/dist/state.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  normalizePrLifecycleState,
10
10
  normalizeRunParams,
11
11
  setRunStatus
12
- } from "./chunk-JTNMEH57.js";
12
+ } from "./chunk-JOXTKWX6.js";
13
13
  import "./chunk-PLSGW2GI.js";
14
14
  import "./chunk-R6SCWJCI.js";
15
15
  import "./chunk-DUFDZJOF.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riddledc/riddle-proof",
3
- "version": "0.5.46",
3
+ "version": "0.5.48",
4
4
  "description": "Reusable Riddle Proof contracts and helpers for evidence-backed agent changes.",
5
5
  "license": "MIT",
6
6
  "author": "RiddleDC",
@@ -59,6 +59,11 @@
59
59
  "import": "./dist/codex-exec-agent.js",
60
60
  "require": "./dist/codex-exec-agent.cjs"
61
61
  },
62
+ "./local-agent": {
63
+ "types": "./dist/local-agent.d.ts",
64
+ "import": "./dist/local-agent.js",
65
+ "require": "./dist/local-agent.cjs"
66
+ },
62
67
  "./diagnostics": {
63
68
  "types": "./dist/diagnostics.d.ts",
64
69
  "import": "./dist/diagnostics.js",
@@ -110,7 +115,7 @@
110
115
  "typescript": "^5.4.5"
111
116
  },
112
117
  "scripts": {
113
- "build": "tsup src/index.ts src/types.ts src/result.ts src/state.ts src/checkpoint.ts src/run-card.ts src/runner.ts src/engine-harness.ts src/codex-exec-agent.ts src/cli.ts src/diagnostics.ts src/proof-session.ts src/playability.ts src/openclaw.ts src/proof-run-core.ts src/proof-run-engine.ts --format cjs,esm --dts --out-dir dist --clean",
118
+ "build": "tsup src/index.ts src/types.ts src/result.ts src/state.ts src/checkpoint.ts src/run-card.ts src/runner.ts src/engine-harness.ts src/codex-exec-agent.ts src/local-agent.ts src/cli.ts src/diagnostics.ts src/proof-session.ts src/playability.ts src/openclaw.ts src/proof-run-core.ts src/proof-run-engine.ts --format cjs,esm --dts --out-dir dist --clean",
114
119
  "clean": "rm -rf dist",
115
120
  "lint": "echo 'lint: (not configured)'",
116
121
  "test": "npm run build && node test.js && node proof-run.test.js"