* gbrain writes ~/.gbrain/import-checkpoint.json on every import run. If a * previous /sync-gbrain hit the timeout (SIGTERM = exit 143), the checkpoint * + its staging dir survive on disk. Detect both and let gbrain resume from * processedIndex+1 on the next run. If the staging dir is missing/emp
| 163 | * user sees we noticed. See #1611 + plan D1/C1. |
| 164 | */ |
| 165 | interface GbrainCheckpoint { |
| 166 | dir?: string; |
| 167 | totalFiles?: number; |
| 168 | processedIndex?: number; |
| 169 | completedFiles?: number; |
| 170 | timestamp?: string; |
| 171 | } |
| 172 | |
| 173 | export function readGbrainCheckpoint(): GbrainCheckpoint | null { |
| 174 | // Read HOME from env so tests can redirect via process.env.HOME = ... |
nothing calls this directly
no outgoing calls
no test coverage detected