letitloop 0.2.0__py3-none-any.whl
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.
- letitloop-0.2.0.dist-info/METADATA +232 -0
- letitloop-0.2.0.dist-info/RECORD +175 -0
- letitloop-0.2.0.dist-info/WHEEL +5 -0
- letitloop-0.2.0.dist-info/entry_points.txt +4 -0
- letitloop-0.2.0.dist-info/licenses/LICENSE +21 -0
- letitloop-0.2.0.dist-info/top_level.txt +1 -0
- orchestrator/SKILL.md +292 -0
- orchestrator/__init__.py +151 -0
- orchestrator/anti_ouroboros.py +78 -0
- orchestrator/approval.py +139 -0
- orchestrator/ast_node_splicer.py +130 -0
- orchestrator/ast_splicer.py +94 -0
- orchestrator/audit.py +88 -0
- orchestrator/budget.py +195 -0
- orchestrator/checkpoint.py +248 -0
- orchestrator/cli.py +1971 -0
- orchestrator/codebase_introspector.py +66 -0
- orchestrator/component_slicer.py +185 -0
- orchestrator/config.py +152 -0
- orchestrator/contract.py +404 -0
- orchestrator/dag_validator.py +172 -0
- orchestrator/elasticity_governor.py +80 -0
- orchestrator/env_doctor.py +166 -0
- orchestrator/errors.py +211 -0
- orchestrator/events.py +120 -0
- orchestrator/evidence.py +203 -0
- orchestrator/exceptions.py +37 -0
- orchestrator/experimental/arena_arbiter.py +260 -0
- orchestrator/experimental/fuzz_engine.py +206 -0
- orchestrator/experimental/mutation_tester.py +382 -0
- orchestrator/failure.py +226 -0
- orchestrator/fast_sandbox.py +126 -0
- orchestrator/feasibility_gate.py +115 -0
- orchestrator/feedback.py +302 -0
- orchestrator/fixtures/__init__.py +0 -0
- orchestrator/fixtures/example_contract.json +50 -0
- orchestrator/fixtures/generated/evidence-cli-run-test-step-1.json +47 -0
- orchestrator/fixtures/generated/evidence-cli-run-test-step-2.json +47 -0
- orchestrator/fixtures/generated/evidence-inject-test-a.json +47 -0
- orchestrator/fixtures/generated/evidence-inject-test-b.json +47 -0
- orchestrator/fixtures/generated/evidence-inject-test-c.json +47 -0
- orchestrator/fixtures/generated/evidence-json-test-a.json +47 -0
- orchestrator/fixtures/generated/evidence-json-test-b.json +47 -0
- orchestrator/fixtures/generated/fail-report-fail-task-1.json +47 -0
- orchestrator/fixtures/generated/fail-report-json-task-1.json +47 -0
- orchestrator/fixtures/generated/fail-report-success-task-1.json +47 -0
- orchestrator/fixtures/generated/fuzz-engine-design.json +63 -0
- orchestrator/fixtures/generated/fuzz-engine-impl.json +62 -0
- orchestrator/fixtures/generated/fuzz-engine-tests.json +62 -0
- orchestrator/fixtures/generated/fuzz-engine-verify.json +62 -0
- orchestrator/fixtures/generated/goal-orch-step-1.json +63 -0
- orchestrator/fixtures/generated/goal-orch-step-2.json +62 -0
- orchestrator/fixtures/generated/goal-orch-step-3.json +62 -0
- orchestrator/fixtures/generated/goal-orch-step-4.json +62 -0
- orchestrator/fixtures/generated/goal-orch-step-5.json +62 -0
- orchestrator/fixtures/generated/goal-orch-step-6.json +63 -0
- orchestrator/fixtures/generated/implement-a-thread-safe-token-bucket-rat-task-1.json +53 -0
- orchestrator/fixtures/generated/orchestrator-checkpoint-rollback-3.json +63 -0
- orchestrator/fixtures/generated/orchestrator-checkpoint-rollback.json +62 -0
- orchestrator/fixtures/generated/orchestrator-live-telemetry-2.json +62 -0
- orchestrator/fixtures/generated/orchestrator-live-telemetry.json +62 -0
- orchestrator/fixtures/generated/orchestrator-spec-synthesis-1.json +62 -0
- orchestrator/fixtures/generated/orchestrator-spec-synthesis.json +62 -0
- orchestrator/fixtures/generated/orchestrator-test-verification-4.json +62 -0
- orchestrator/fixtures/generated/orchestrator-test-verification.json +62 -0
- orchestrator/fixtures/generated/perf-step-1.json +61 -0
- orchestrator/fixtures/generated/perf-step-2.json +62 -0
- orchestrator/fixtures/generated/perf-step-3.json +62 -0
- orchestrator/fixtures/generated/perf-step-4.json +62 -0
- orchestrator/fixtures/generated/perf-step-5.json +63 -0
- orchestrator/fixtures/generated/phase2-proof-two-step-step-1.json +47 -0
- orchestrator/fixtures/generated/phase2-proof-two-step-step-2.json +47 -0
- orchestrator/fixtures/generated/planner-spec-synthesis-impl.json +59 -0
- orchestrator/fixtures/generated/self-evolution-ast-formatter.json +69 -0
- orchestrator/fixtures/generated/self-evolution-checkpoint-rollback.json +70 -0
- orchestrator/fixtures/generated/self-evolution-spec-synthesis.json +70 -0
- orchestrator/fixtures/generated/self-evolution-step-1.json +70 -0
- orchestrator/fixtures/generated/self-evolution-step-2.json +70 -0
- orchestrator/fixtures/generated/self-evolution-step-3.json +70 -0
- orchestrator/fixtures/generated/self-evolution-step-4.json +70 -0
- orchestrator/fixtures/generated/self-evolution-step-5.json +65 -0
- orchestrator/fixtures/generated/self-evolution-telemetry.json +70 -0
- orchestrator/fixtures/generated/self-evolution-tests.json +71 -0
- orchestrator/fixtures/generated/spec-telemetry-research-design.json +64 -0
- orchestrator/fixtures/generated/spec-telemetry-step-1.json +62 -0
- orchestrator/fixtures/generated/spec-telemetry-step-2.json +62 -0
- orchestrator/fixtures/generated/spec-telemetry-step-3.json +62 -0
- orchestrator/fixtures/generated/spec-telemetry-step-4.json +62 -0
- orchestrator/fixtures/generated/spec-telemetry-step-5.json +62 -0
- orchestrator/fixtures/generated/spec-telemetry-verification.json +58 -0
- orchestrator/fixtures/generated/token-bucket-impl.json +69 -0
- orchestrator/fixtures/generated/token-bucket-step-1.json +70 -0
- orchestrator/fixtures/generated/token-bucket-step-2.json +70 -0
- orchestrator/fixtures/generated/token-bucket-step-3.json +60 -0
- orchestrator/fixtures/generated/token-bucket-tests.json +70 -0
- orchestrator/fixtures/generated/token-bucket-verify.json +61 -0
- orchestrator/fixtures/generated/trace-ux-tests-step-1.json +64 -0
- orchestrator/fixtures/generated/trace-ux-tests-step-2.json +64 -0
- orchestrator/fixtures/generated/trace-ux-tests-step-3.json +62 -0
- orchestrator/fixtures/generated/tui-live-telemetry-impl.json +59 -0
- orchestrator/fixtures/phase1_proof_escalation_contract.json +41 -0
- orchestrator/fixtures/phase1_proof_happy_path_contract.json +83 -0
- orchestrator/fixtures/phase1_proof_qc_contract.json +41 -0
- orchestrator/fixtures/phase1_proof_repair_contract.json +41 -0
- orchestrator/fixtures/phase2_proof_two_step_goal.json +15 -0
- orchestrator/fixtures/run_proofs.py +299 -0
- orchestrator/fixtures/test_normalizer.py +16 -0
- orchestrator/generator.py +239 -0
- orchestrator/goal.py +245 -0
- orchestrator/handoff.py +86 -0
- orchestrator/hybrid_worker.py +840 -0
- orchestrator/impossibility.py +162 -0
- orchestrator/limits.py +60 -0
- orchestrator/live_evolution_engine.py +247 -0
- orchestrator/llm.py +291 -0
- orchestrator/local_tool_calling.py +285 -0
- orchestrator/lock.py +404 -0
- orchestrator/mcp_client.py +571 -0
- orchestrator/mcp_server.py +344 -0
- orchestrator/memory_bridge.py +182 -0
- orchestrator/metrics.py +159 -0
- orchestrator/micro_epoch.py +42 -0
- orchestrator/models.py +350 -0
- orchestrator/parsing.py +237 -0
- orchestrator/patch_applier.py +154 -0
- orchestrator/plan_preview.py +138 -0
- orchestrator/plan_quality.py +357 -0
- orchestrator/planner.py +532 -0
- orchestrator/preferences.py +115 -0
- orchestrator/preflight.py +141 -0
- orchestrator/process_guard.py +357 -0
- orchestrator/prometheus_exporter.py +207 -0
- orchestrator/prompts.py +275 -0
- orchestrator/proposal_ledger.py +194 -0
- orchestrator/provenance.py +263 -0
- orchestrator/provider_scheduler.py +394 -0
- orchestrator/qc/__init__.py +153 -0
- orchestrator/qc/aggregator.py +330 -0
- orchestrator/qc/parsing.py +287 -0
- orchestrator/qc/personas.py +242 -0
- orchestrator/qc/runner.py +569 -0
- orchestrator/qc_overrule.py +87 -0
- orchestrator/qc_review.py +282 -0
- orchestrator/quality_lenses.py +314 -0
- orchestrator/quality_plan.py +449 -0
- orchestrator/quality_plane.py +103 -0
- orchestrator/reconcile.py +191 -0
- orchestrator/replanner.py +433 -0
- orchestrator/research.py +176 -0
- orchestrator/review_artifact.py +672 -0
- orchestrator/safety.py +271 -0
- orchestrator/schemas.py +230 -0
- orchestrator/scope.py +466 -0
- orchestrator/sensory_radar.py +79 -0
- orchestrator/skill_installer.py +140 -0
- orchestrator/sse_server.py +160 -0
- orchestrator/state.py +871 -0
- orchestrator/subprocess_helper.py +131 -0
- orchestrator/supervisor/__init__.py +184 -0
- orchestrator/supervisor/_shared.py +164 -0
- orchestrator/supervisor/cleanup.py +185 -0
- orchestrator/supervisor/core.py +1680 -0
- orchestrator/supervisor/recovery.py +367 -0
- orchestrator/supervisor/reporting.py +251 -0
- orchestrator/surgical_extractor.py +119 -0
- orchestrator/telemetry.py +61 -0
- orchestrator/templates.py +268 -0
- orchestrator/token_gate.py +245 -0
- orchestrator/tui.py +649 -0
- orchestrator/verifier.py +1103 -0
- orchestrator/webhooks.py +168 -0
- orchestrator/worker.py +469 -0
- orchestrator/worker_adapters.py +815 -0
- orchestrator/worker_pool.py +121 -0
- orchestrator/worktree.py +364 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
"""Checkpoint persist/recovery for durable plan execution."""
|
|
2
|
+
|
|
3
|
+
import glob
|
|
4
|
+
import json
|
|
5
|
+
import os
|
|
6
|
+
import time
|
|
7
|
+
from datetime import datetime, timezone
|
|
8
|
+
from typing import Any, Dict, List, Optional
|
|
9
|
+
|
|
10
|
+
CHECKPOINT_PREFIX = "checkpoint_"
|
|
11
|
+
CHECKPOINT_SUFFIX = ".json"
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _checkpoint_path(run_dir: str, iteration: int) -> str:
|
|
15
|
+
return os.path.join(run_dir, f"{CHECKPOINT_PREFIX}{iteration:04d}{CHECKPOINT_SUFFIX}")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def _checkpoints_dir(run_dir: str) -> str:
|
|
19
|
+
return os.path.join(run_dir, "checkpoints")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def save_checkpoint(
|
|
23
|
+
run_dir: str,
|
|
24
|
+
iteration: int,
|
|
25
|
+
plan_contracts: List[Dict[str, Any]],
|
|
26
|
+
results: Dict[str, Dict[str, Any]],
|
|
27
|
+
graph_statuses: Dict[str, str],
|
|
28
|
+
evidence_store: Dict[str, List[str]],
|
|
29
|
+
goal_status: str = "",
|
|
30
|
+
total_contracts: int = 0,
|
|
31
|
+
max_checkpoints: int = 5,
|
|
32
|
+
) -> str:
|
|
33
|
+
"""Save execution checkpoint. Prunes old checkpoints beyond max_checkpoints."""
|
|
34
|
+
cp_dir = _checkpoints_dir(run_dir)
|
|
35
|
+
os.makedirs(cp_dir, exist_ok=True)
|
|
36
|
+
|
|
37
|
+
payload = {
|
|
38
|
+
"timestamp": datetime.now(timezone.utc).isoformat(),
|
|
39
|
+
"iteration": iteration,
|
|
40
|
+
"goal_status": goal_status,
|
|
41
|
+
"total_contracts": total_contracts,
|
|
42
|
+
"plan_contracts": plan_contracts,
|
|
43
|
+
"results": results,
|
|
44
|
+
"graph_statuses": graph_statuses,
|
|
45
|
+
"evidence_store": evidence_store,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
path = os.path.join(cp_dir, f"{CHECKPOINT_PREFIX}{iteration:04d}{CHECKPOINT_SUFFIX}")
|
|
49
|
+
tmp = path + ".tmp"
|
|
50
|
+
with open(tmp, "w", encoding="utf-8") as f:
|
|
51
|
+
json.dump(payload, f, indent=2, ensure_ascii=False)
|
|
52
|
+
os.replace(tmp, path)
|
|
53
|
+
|
|
54
|
+
_prune_checkpoints(cp_dir, max_checkpoints)
|
|
55
|
+
return path
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def load_checkpoint(run_dir: str) -> Optional[Dict[str, Any]]:
|
|
59
|
+
"""Load the most recent checkpoint from a run directory."""
|
|
60
|
+
cp_dir = _checkpoints_dir(run_dir)
|
|
61
|
+
path = _latest_checkpoint_path(cp_dir)
|
|
62
|
+
if not path:
|
|
63
|
+
return None
|
|
64
|
+
with open(path, "r", encoding="utf-8") as f:
|
|
65
|
+
return json.load(f)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _latest_checkpoint_path(cp_dir: str) -> Optional[str]:
|
|
69
|
+
"""Find the most recent checkpoint file by iteration number."""
|
|
70
|
+
if not os.path.isdir(cp_dir):
|
|
71
|
+
return None
|
|
72
|
+
pattern = os.path.join(cp_dir, f"{CHECKPOINT_PREFIX}*{CHECKPOINT_SUFFIX}")
|
|
73
|
+
files = glob.glob(pattern)
|
|
74
|
+
if not files:
|
|
75
|
+
return None
|
|
76
|
+
|
|
77
|
+
def _iter_num(path: str) -> int:
|
|
78
|
+
base = os.path.basename(path)
|
|
79
|
+
num_part = base[len(CHECKPOINT_PREFIX) : -len(CHECKPOINT_SUFFIX)]
|
|
80
|
+
try:
|
|
81
|
+
return int(num_part)
|
|
82
|
+
except ValueError:
|
|
83
|
+
return 0
|
|
84
|
+
|
|
85
|
+
files.sort(key=_iter_num, reverse=True)
|
|
86
|
+
return files[0]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def _prune_checkpoints(cp_dir: str, max_checkpoints: int) -> None:
|
|
90
|
+
"""Remove oldest checkpoints beyond the retention limit."""
|
|
91
|
+
if not os.path.isdir(cp_dir):
|
|
92
|
+
return
|
|
93
|
+
pattern = os.path.join(cp_dir, f"{CHECKPOINT_PREFIX}*{CHECKPOINT_SUFFIX}")
|
|
94
|
+
files = glob.glob(pattern)
|
|
95
|
+
if len(files) <= max_checkpoints:
|
|
96
|
+
return
|
|
97
|
+
|
|
98
|
+
def _iter_num(path: str) -> int:
|
|
99
|
+
base = os.path.basename(path)
|
|
100
|
+
num_part = base[len(CHECKPOINT_PREFIX) : -len(CHECKPOINT_SUFFIX)]
|
|
101
|
+
try:
|
|
102
|
+
return int(num_part)
|
|
103
|
+
except ValueError:
|
|
104
|
+
return 0
|
|
105
|
+
|
|
106
|
+
files.sort(key=_iter_num)
|
|
107
|
+
if max_checkpoints > 0:
|
|
108
|
+
remove = files[:-max_checkpoints]
|
|
109
|
+
else:
|
|
110
|
+
remove = files[:-1] if files else []
|
|
111
|
+
for f in remove:
|
|
112
|
+
try:
|
|
113
|
+
os.remove(f)
|
|
114
|
+
except OSError:
|
|
115
|
+
pass
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def list_checkpoints(run_dir: str) -> List[Dict[str, Any]]:
|
|
119
|
+
"""List all checkpoints with metadata (no full payload)."""
|
|
120
|
+
cp_dir = _checkpoints_dir(run_dir)
|
|
121
|
+
if not os.path.isdir(cp_dir):
|
|
122
|
+
return []
|
|
123
|
+
pattern = os.path.join(cp_dir, f"{CHECKPOINT_PREFIX}*{CHECKPOINT_SUFFIX}")
|
|
124
|
+
files = glob.glob(pattern)
|
|
125
|
+
entries = []
|
|
126
|
+
for f in sorted(files):
|
|
127
|
+
try:
|
|
128
|
+
with open(f, "r", encoding="utf-8") as fh:
|
|
129
|
+
data = json.load(fh)
|
|
130
|
+
entries.append(
|
|
131
|
+
{
|
|
132
|
+
"path": f,
|
|
133
|
+
"iteration": data.get("iteration", 0),
|
|
134
|
+
"timestamp": data.get("timestamp", ""),
|
|
135
|
+
"goal_status": data.get("goal_status", ""),
|
|
136
|
+
"total_contracts": data.get("total_contracts", 0),
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
except (json.JSONDecodeError, OSError):
|
|
140
|
+
pass
|
|
141
|
+
return entries
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def recover_from_checkpoint(run_dir: str) -> Dict[str, Any]:
|
|
145
|
+
"""Load checkpoint and return a recovery dict with plan/status to restore.
|
|
146
|
+
|
|
147
|
+
Returns:
|
|
148
|
+
{
|
|
149
|
+
"recovered": True/False,
|
|
150
|
+
"plan_contracts": [...],
|
|
151
|
+
"results": {...},
|
|
152
|
+
"graph_statuses": {...},
|
|
153
|
+
"evidence_store": {...},
|
|
154
|
+
"goal_status": "...",
|
|
155
|
+
"iteration": N,
|
|
156
|
+
}
|
|
157
|
+
"""
|
|
158
|
+
cp = load_checkpoint(run_dir)
|
|
159
|
+
if cp is None:
|
|
160
|
+
return {"recovered": False}
|
|
161
|
+
return {
|
|
162
|
+
"recovered": True,
|
|
163
|
+
"plan_contracts": cp.get("plan_contracts", []),
|
|
164
|
+
"results": cp.get("results", {}),
|
|
165
|
+
"graph_statuses": cp.get("graph_statuses", {}),
|
|
166
|
+
"evidence_store": cp.get("evidence_store", {}),
|
|
167
|
+
"goal_status": cp.get("goal_status", ""),
|
|
168
|
+
"iteration": cp.get("iteration", 0),
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
def clear_checkpoints(run_dir: str) -> int:
|
|
173
|
+
"""Remove all checkpoints. Returns count removed."""
|
|
174
|
+
cp_dir = _checkpoints_dir(run_dir)
|
|
175
|
+
if not os.path.isdir(cp_dir):
|
|
176
|
+
return 0
|
|
177
|
+
pattern = os.path.join(cp_dir, f"{CHECKPOINT_PREFIX}*{CHECKPOINT_SUFFIX}")
|
|
178
|
+
files = glob.glob(pattern)
|
|
179
|
+
for f in files:
|
|
180
|
+
try:
|
|
181
|
+
os.remove(f)
|
|
182
|
+
except OSError:
|
|
183
|
+
pass
|
|
184
|
+
return len(files)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
def apply_checkpoint(
|
|
188
|
+
run_dir: str,
|
|
189
|
+
workspace_root: str = "",
|
|
190
|
+
) -> Dict[str, Any]:
|
|
191
|
+
"""Apply the latest checkpoint by rehydrating plan.json and task state files.
|
|
192
|
+
|
|
193
|
+
Returns the recovery summary dict or raises FileNotFoundError if no checkpoint.
|
|
194
|
+
"""
|
|
195
|
+
recovery = recover_from_checkpoint(run_dir)
|
|
196
|
+
if not recovery.get("recovered"):
|
|
197
|
+
raise FileNotFoundError("No valid checkpoint found to apply")
|
|
198
|
+
|
|
199
|
+
plan_contracts = recovery.get("plan_contracts", [])
|
|
200
|
+
if plan_contracts:
|
|
201
|
+
plan_file = os.path.join(run_dir, "plan.json")
|
|
202
|
+
plan_data = {
|
|
203
|
+
"goal_id": os.path.basename(run_dir),
|
|
204
|
+
"contracts": plan_contracts,
|
|
205
|
+
"created_at": datetime.now(timezone.utc).isoformat(),
|
|
206
|
+
}
|
|
207
|
+
with open(plan_file, "w", encoding="utf-8") as f:
|
|
208
|
+
json.dump(plan_data, f, indent=2, ensure_ascii=False)
|
|
209
|
+
|
|
210
|
+
graph_statuses = recovery.get("graph_statuses", {})
|
|
211
|
+
from .exceptions import IllegalTransitionError, StateError
|
|
212
|
+
from .state import WAL_FILENAME, create_initial_state, load_state, save_state
|
|
213
|
+
|
|
214
|
+
for task_id, status in graph_statuses.items():
|
|
215
|
+
task_dir = os.path.join(run_dir, task_id)
|
|
216
|
+
os.makedirs(task_dir, exist_ok=True)
|
|
217
|
+
state_file = os.path.join(task_dir, "state.json")
|
|
218
|
+
|
|
219
|
+
# Quarantine a corrupt/unreplayable WAL so the rehydrated snapshot
|
|
220
|
+
# becomes the consistent source of truth again. Without this, a
|
|
221
|
+
# poisoned journal keeps every subsequent load_state fail-closed
|
|
222
|
+
# forever and the checkpoint apply is effectively useless.
|
|
223
|
+
wal_file = os.path.join(task_dir, WAL_FILENAME)
|
|
224
|
+
if os.path.isfile(wal_file):
|
|
225
|
+
try:
|
|
226
|
+
load_state(state_file, journal_dir=task_dir)
|
|
227
|
+
except Exception:
|
|
228
|
+
try:
|
|
229
|
+
os.replace(wal_file, f"{wal_file}.corrupt-{int(time.time())}")
|
|
230
|
+
except OSError:
|
|
231
|
+
pass
|
|
232
|
+
|
|
233
|
+
if os.path.isfile(state_file):
|
|
234
|
+
try:
|
|
235
|
+
state = load_state(state_file, journal_dir=task_dir)
|
|
236
|
+
except (StateError, json.JSONDecodeError, OSError, ValueError):
|
|
237
|
+
state = create_initial_state(task_id, journal_dir=task_dir)
|
|
238
|
+
else:
|
|
239
|
+
state = create_initial_state(task_id, journal_dir=task_dir)
|
|
240
|
+
|
|
241
|
+
if state.status != status:
|
|
242
|
+
try:
|
|
243
|
+
state.transition(status, reason="rehydrated from checkpoint")
|
|
244
|
+
except (IllegalTransitionError, StateError):
|
|
245
|
+
state.status = status
|
|
246
|
+
save_state(state, state_file)
|
|
247
|
+
|
|
248
|
+
return recovery
|