* Reads a candidate's file contents and extracts full SessionInfo. * Returns null if the session should be filtered out (sidechain, no summary).
(c: Candidate)
| 202 | * Returns null if the session should be filtered out (sidechain, no summary). |
| 203 | */ |
| 204 | async function readCandidate(c: Candidate): Promise<SessionInfo | null> { |
| 205 | const lite = await readSessionLite(c.filePath) |
| 206 | if (!lite) return null |
| 207 | |
| 208 | const info = parseSessionInfoFromLite(c.sessionId, lite, c.projectPath) |
| 209 | if (!info) return null |
| 210 | |
| 211 | // Prefer stat-pass mtime for sort-key consistency; fall back to |
| 212 | // lite.mtime when doStat=false (c.mtime is 0 placeholder). |
| 213 | if (c.mtime) info.lastModified = c.mtime |
| 214 | |
| 215 | return info |
| 216 | } |
| 217 | |
| 218 | // --------------------------------------------------------------------------- |
| 219 | // Sort + limit — batch-read candidates in sorted order until `limit` |
nothing calls this directly
no test coverage detected