Move Persona scheduler state to CultCache

This commit is contained in:
Meta Vens 2026-07-16 00:27:01 +01:00
commit 567f0e0226
14 changed files with 213 additions and 37 deletions

View file

@ -45,7 +45,7 @@ const swarmCultMeshRudpEndpoint = String(
const storageRoot = resolveConfigPath(env.STORAGE_ROOT, defaultStorageRoot);
const statusDir = resolve(storageRoot, "status");
const heartbeatStatePath = resolveConfigPath(
env.REPO_FACE_HEARTBEAT_STATE_PATH,
schedulerDebugProjectionPath(env.REPO_FACE_HEARTBEAT_STATE_PATH),
resolve(statusDir, "repo-face-heartbeats.json"),
);
const orchestratorPath = resolve(statusDir, "gamecult-orchestrator.json");
@ -2936,6 +2936,13 @@ async function readDotEnv(path) {
return values;
}
function schedulerDebugProjectionPath(value) {
if (!value) return value;
const resolved = resolve(value);
if (resolved.toLowerCase().endsWith(".cc")) return `${resolved.slice(0, -3)}.json`;
return resolved;
}
function resolveConfigPath(value, fallback) {
const raw = typeof value === "string" && value.trim() ? value.trim() : fallback;
return resolve(repoRoot, raw);