MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / supervisor_tmp_path

Function supervisor_tmp_path

src/mcp/mcp.c:10479–10489  ·  view source on GitHub ↗

Resolve a per-supervisor-run temp path /logs/.supervisor- * (falls back to the CWD if the cache dir is unresolvable). Used for the crash- * attribution marker and the quarantine list during the recovery re-run. */

Source from the content-addressed store, hash-verified

10477 * (falls back to the CWD if the cache dir is unresolvable). Used for the crash-
10478 * attribution marker and the quarantine list during the recovery re-run. */
10479static void supervisor_tmp_path(char *out, size_t out_sz, const char *suffix) {
10480 const char *cdir = cbm_resolve_cache_dir();
10481 if (cdir && cdir[0]) {
10482 char logdir[CBM_SZ_1K];
10483 snprintf(logdir, sizeof(logdir), "%s/logs", cdir);
10484 cbm_mkdir_p_ex(logdir, 0755, CBM_MKDIR_FOLLOW_OWNED);
10485 snprintf(out, out_sz, "%s/.supervisor-%d%s", logdir, (int)getpid(), suffix);
10486 } else {
10487 snprintf(out, out_sz, ".supervisor-%d%s", (int)getpid(), suffix);
10488 }
10489}
10490
10491/* Parse the worker's marker JOURNAL ("S <rel>" / "D <rel>" lines, one event
10492 * per line — see cbm_index_mark_start/done) into the crash/hang SUSPECT set:

Callers 1

index_run_supervisedFunction · 0.85

Calls 2

cbm_resolve_cache_dirFunction · 0.85
cbm_mkdir_p_exFunction · 0.85

Tested by

no test coverage detected