()
| 87 | } |
| 88 | |
| 89 | function buildRuns() { |
| 90 | const paths = getObserverPaths(); |
| 91 | const cycle = readJsonSafe(paths.cycleProgressPath, null); |
| 92 | const solidify = readJsonSafe(paths.solidifyStatePath, null); |
| 93 | const events = readJsonl(paths.eventsPath).map(redactValue); |
| 94 | const assetCalls = readJsonl(paths.assetCallLogPath).map(redactValue); |
| 95 | const pipelineEvents = readPipelineEvents(); |
| 96 | const runs = new Map(); |
| 97 | |
| 98 | addCycleRun(runs, cycle, solidify); |
| 99 | for (const event of events) mergeRun(runs, summaryFromEvent(event)); |
| 100 | for (const call of assetCalls) mergeRun(runs, summaryFromAssetCall(call)); |
| 101 | for (const event of pipelineEvents) mergeRun(runs, summaryFromPipelineEvent(event)); |
| 102 | |
| 103 | const now = Date.now(); |
| 104 | return Array.from(runs.values()).map((run) => ({ |
| 105 | ...run, |
| 106 | status: maybeAbandon(run, now), |
| 107 | requiresConfirmation: Boolean(run.requiresConfirmation), |
| 108 | })); |
| 109 | } |
| 110 | |
| 111 | function maybeAbandon(run, now) { |
| 112 | if (run.status !== 'running' || run.finishedAt) return run.status; |
no test coverage detected