MCPcopy
hub / github.com/garrytan/gstack / cycleCompleted

Function cycleCompleted

lib/gbrain-sources.ts:263–276  ·  view source on GitHub ↗
(sourceId: string, env?: NodeJS.ProcessEnv)

Source from the content-addressed store, hash-verified

261 * shim on PATH).
262 */
263export function cycleCompleted(sourceId: string, env?: NodeJS.ProcessEnv): CycleStatus {
264 const report = execGbrainJson<DoctorReport>(["doctor", "--json", "--fast"], { baseEnv: env });
265 if (!report || !Array.isArray(report.checks)) return "unknown";
266
267 const check = report.checks.find((c) => c.name === "cycle_freshness");
268 if (!check) return "unknown";
269
270 if (check.status === "ok") return "completed";
271 if (check.status === "fail" || check.status === "warn") {
272 const msg = check.message || "";
273 return msg.includes(sourceId) ? "never" : "unknown";
274 }
275 return "unknown";
276}

Callers 2

mainFunction · 0.90

Calls 1

execGbrainJsonFunction · 0.90

Tested by

no test coverage detected