MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / resolve_store_db_path

Function resolve_store_db_path

eval/run_real_model.py:262–283  ·  view source on GitHub ↗
(tracedecay_bin, fixture, env)

Source from the content-addressed store, hash-verified

260
261
262def resolve_store_db_path(tracedecay_bin, fixture, env):
263 result = run(
264 [tracedecay_bin, "status", "--runtime", "--json"],
265 cwd=fixture,
266 env=env,
267 timeout=120,
268 check=False,
269 )
270 if result.returncode != 0:
271 sys.exit(
272 "failed to resolve TraceDecay store path with status --runtime --json\n"
273 f"{result.stdout}"
274 )
275 try:
276 payload = json.loads(result.stdout)
277 except json.JSONDecodeError as exc:
278 sys.exit(f"invalid status --runtime --json output while resolving store path: {exc}")
279
280 db_path = payload.get("database", {}).get("db_path") or payload.get("db_path")
281 if not db_path:
282 sys.exit("status --runtime --json did not report database.db_path")
283 return Path(db_path)
284
285
286def build_fixture(scenario, tracedecay_bin, env):

Callers 1

build_fixtureFunction · 0.85

Calls 1

runFunction · 0.70

Tested by

no test coverage detected