(sourceId: string, env?: NodeJS.ProcessEnv)
| 261 | * shim on PATH). |
| 262 | */ |
| 263 | export 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 | } |
no test coverage detected